mirror of
https://github.com/tiennm99/codeforces.git
synced 2026-10-15 02:16:44 +00:00
[Init] Solved solutions
This commit is contained in:
1 parent
51f667ac81
commit
20542601dd
131 files changed
+4148
No files matched your search
+37
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
|
||||
namespace problem_999A
|
||||
{
|
||||
class problem_999A
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
string[] input = Console.ReadLine().Split(' ');
|
||||
int n = Convert.ToInt32(input[0]);
|
||||
int k = Convert.ToInt32(input[1]);
|
||||
input = Console.ReadLine().Split(' ');
|
||||
int[] a = new int[n];
|
||||
int i;
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
a[i] = Convert.ToInt32(input[i]);
|
||||
}
|
||||
i = 0;
|
||||
int l = 0;
|
||||
while (i < n && a[i] <= k)
|
||||
{
|
||||
l++;
|
||||
i++;
|
||||
}
|
||||
i = n - 1;
|
||||
int r = 0;
|
||||
while (i >= 0 && a[i] <= k)
|
||||
{
|
||||
r++;
|
||||
i--;
|
||||
}
|
||||
int ouput = Math.Min(l + r, n);
|
||||
Console.WriteLine(ouput);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user