Submission #773902

#TimeUsernameProblemLanguageResultExecution timeMemory
773902n3rm1nAdvertisement 2 (JOI23_ho_t2)C++17
0 / 100
0 ms212 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...