#include <algorithm>
#include <iostream>
long long trios[1000005];
long long xis[1000005];
long long yis[1000005];
int subt4[1000005];
char answer[1000005];
using namespace std;
long long const mult = 1000007;//10^6 + 7
int main()
{
int n;
cin >> n;
if (n==3)
{
int a, b, c, d, e, f;
cin >> a >> d >> b >> e >> c >> f;
if (a==b and b==c)
{
if (d>e and e>f)
{
cout << "101";
}
else if (d<e and e<f)
{
cout << "101";
}
else if (e>d and d>f)
{
cout << "011";
}
else if (e<d and d<f)
{
cout << "011";
}
else if (d>f and f>e)
{
cout << "110";
}
else if (d<f and f<e)
{
cout << "110";
}
}
else if (d==e and e==f)
{
if (a>b and b>c)
{
cout << "101";
}
else if (a<b and b<c)
{
cout << "101";
}
else if (b>a and a>c)
{
cout << "011";
}
else if (b<a and a<c)
{
cout << "011";
}
else if (a>c and c>b)
{
cout << "110";
}
else if (a<c and c<b)
{
cout << "110";
}
}
else
{
cout << "111";
}
cout << '\n';
}
else if (n<=2)
{
if (n==2)
{
cout << "1";
}
cout << "1\n";
}
else
{
int four=1;
for (int i=0; i<n; i++)
{
cin >> xis[i] >> yis[i];
trios[i]=mult*mult*yis[i]+mult*xis[i]+i;
subt4[xis[i]]++;
if (subt4[xis[i]]>=3)
four=0;
}
if (four)
{
for (int i=0; i<n; i++)
{
answer[i]='1';
}
sort(trios, trios+n);
int sindex=0;
int eindex=0;
while (sindex<n)
{
while (trios[eindex]/(mult*mult) == trios[eindex+1]/(mult*mult))
{
eindex++;
}
for (int i=sindex+1; i<eindex; i++)
{
answer[trios[i]%mult] = '0';
}
sindex=eindex+1;
eindex=sindex+1-1;
}
cout << answer << '\n';
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
0 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
0 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Incorrect |
0 ms |
340 KB |
Unexpected end of file - token expected |
12 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
32 ms |
2484 KB |
Unexpected end of file - token expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
600 ms |
29612 KB |
Output is correct |
2 |
Correct |
628 ms |
32856 KB |
Output is correct |
3 |
Correct |
617 ms |
31920 KB |
Output is correct |
4 |
Correct |
615 ms |
31824 KB |
Output is correct |
5 |
Correct |
619 ms |
31572 KB |
Output is correct |
6 |
Correct |
645 ms |
31592 KB |
Output is correct |
7 |
Correct |
663 ms |
31672 KB |
Output is correct |
8 |
Correct |
655 ms |
31448 KB |
Output is correct |
9 |
Correct |
645 ms |
31120 KB |
Output is correct |
10 |
Correct |
639 ms |
31492 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
0 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Incorrect |
0 ms |
340 KB |
Unexpected end of file - token expected |
12 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
0 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Incorrect |
0 ms |
340 KB |
Unexpected end of file - token expected |
12 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
0 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Incorrect |
0 ms |
340 KB |
Unexpected end of file - token expected |
12 |
Halted |
0 ms |
0 KB |
- |