Submission #321750

#TimeUsernameProblemLanguageResultExecution timeMemory
321750alextodoranTenis (COCI20_tenis)C++17
50 / 110
1094 ms2156 KiB
/** ____ ____ ____ ____ ____ ||a |||t |||o |||d |||o || ||__|||__|||__|||__|||__|| |/__\|/__\|/__\|/__\|/__\| **/ #include <bits/stdc++.h> using namespace std; typedef long long ll; const int N_MAX = 100002; int n; int a[N_MAX], b[N_MAX], c[N_MAX]; int apos[N_MAX], bpos[N_MAX], cpos[N_MAX]; int f (int x, int y) { if(x > y) swap(x, y); return x * n + y; } int cnta, cntb, cntc; int wins[N_MAX]; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> n; for(int i = 1; i <= n; i++) { cin >> a[i]; apos[a[i]] = i; } for(int i = 1; i <= n; i++) { cin >> b[i]; bpos[b[i]] = i; } for(int i = 1; i <= n; i++) { cin >> c[i]; cpos[c[i]] = i; } for(int i = 1; i <= n; i++) for(int j = i + 1; j <= n; j++) { int fa = f(apos[i], apos[j]); int fb = f(bpos[i], bpos[j]); int fc = f(cpos[i], cpos[j]); int mi = min({fa, fb, fc}); if(fa == mi) { cnta++; if(apos[i] < apos[j]) wins[i]++; else wins[j]++; } else if(fb == mi) { cntb++; if(bpos[i] < bpos[j]) wins[i]++; else wins[j]++; } else { cntc++; if(cpos[i] < cpos[j]) wins[i]++; else wins[j]++; } } cout << cnta << " " << cntb << " " << cntc << "\n"; for(int i = 1; i <= n; i++) cout << wins[i] << " "; cout << "\n"; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...