제출 #798801

#제출 시각아이디문제언어결과실행 시간메모리
798801vjudge1Advertisement 2 (JOI23_ho_t2)C++14
10 / 100
116 ms14008 KiB
#include<bits/stdc++.h> #define fi first #define se second #define ll long long using namespace std ; const int N = 5e5 ; bool flag1 ; int n, ans = 1 ; pair<int, int> p[N + 1] ; signed main() { ios_base::sync_with_stdio( 0 ) ; cin.tie( 0 ) ; cout.tie( 0 ) ; cin >> n ; for(int i = 1 ; i <= n ; i++) { cin >> p[i].fi >> p[i].se ; if(p[i].se != p[1].se)flag1 = 1 ; } sort(p + 1, p + n + 1) ; if(!flag1) { for(int i = 1 ; i < n ; i++) ans += (p[i].fi != p[i + 1].fi) ; cout << ans ; 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...