mirror of
https://github.com/tiennm99/codeforces.git
synced 2026-10-14 04:15:54 +00:00
[Init] Solved solutions
This commit is contained in:
1 parent
51f667ac81
commit
20542601dd
131 files changed
+4148
No files matched your search
+68
@@ -0,0 +1,68 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace _378B
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
int n = int.Parse(Console.ReadLine());
|
||||
int[] a1 = new int[n];
|
||||
int[] a2 = new int[n];
|
||||
int i, j;
|
||||
i = 0;
|
||||
while (i < n)
|
||||
{
|
||||
int[] ip = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
|
||||
a1[i] = ip[0];
|
||||
a2[i] = ip[1];
|
||||
i++;
|
||||
}
|
||||
i = n / 2;
|
||||
while (a1[i] < a2[n - 1 - i])
|
||||
{
|
||||
i++;
|
||||
if (i == n)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
j = 0;
|
||||
while (j < i)
|
||||
{
|
||||
Console.Write("1");
|
||||
j++;
|
||||
}
|
||||
while (j < n)
|
||||
{
|
||||
Console.Write("0");
|
||||
j++;
|
||||
}
|
||||
Console.WriteLine();
|
||||
i = n / 2;
|
||||
while (a2[i] < a1[n - 1 - i] && i < n)
|
||||
{
|
||||
i++;
|
||||
if (i == n)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
j = 0;
|
||||
while (j < i)
|
||||
{
|
||||
Console.Write("1");
|
||||
j++;
|
||||
}
|
||||
while (j < n)
|
||||
{
|
||||
Console.Write("0");
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user