This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
const int MAXN = 5e5 + 10;
void speed()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}
int n;
int a[MAXN], b[MAXN];
int gr1 = 1;
void read()
{
cin >> n;
for (int i = 1; i <= n; ++ i)
{
cin >> a[i] >> b[i];
if(i > 1 && b[i] != b[i-1])
{
gr1 = 0;
}
}
}
void solve10p()
{
sort(a+1, a+n+1);
int cnt = 0;
for (int i = 2; i <= n; ++ i)
{
if(a[i] != a[i-1])cnt ++;
}
cout << cnt << endl;
}
int main()
{
speed();
read();
if(gr1 == 1)
{
solve10p();
return 0;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |