QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#228180 | #7636. Fair Elections | ucup-team918# | WA | 1ms | 3528kb | C++17 | 454b | 2023-10-28 13:07:23 | 2023-10-28 13:07:23 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define int long long
int n, a[10010][3];
int c[4], p[4] = {0, 1, 2, 3};
signed main() {
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i][0] >> a[i][1] >> a[i][2];
int k = 1;
for (int j = 2; j >= 0; j--, k *= 1e6)
c[a[i][j]] += k;
}
sort(p + 1, p + 3 + 1, [&](int x, int y) {
if (c[x] != c[y]) return c[x] > c[y];
return x < y;
});
cout << p[1] << endl;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3408kb
input:
3 3 2 1 1 2 3 2 1 3
output:
2
result:
ok 1 number(s): "2"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3408kb
input:
5 1 2 3 2 3 1 1 3 2 3 1 2 2 1 3
output:
1
result:
ok 1 number(s): "1"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
5 1 2 3 3 2 1 1 2 3 1 2 3 3 2 1
output:
1
result:
ok 1 number(s): "1"
Test #4:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
5 3 2 1 3 1 2 2 3 1 1 2 3 2 1 3
output:
2
result:
ok 1 number(s): "2"
Test #5:
score: 0
Accepted
time: 0ms
memory: 3408kb
input:
5 3 2 1 3 2 1 1 3 2 1 3 2 3 2 1
output:
3
result:
ok 1 number(s): "3"
Test #6:
score: 0
Accepted
time: 0ms
memory: 3344kb
input:
5 3 2 1 3 1 2 1 2 3 1 3 2 1 3 2
output:
1
result:
ok 1 number(s): "1"
Test #7:
score: -100
Wrong Answer
time: 0ms
memory: 3408kb
input:
20 1 2 3 2 3 1 1 3 2 3 1 2 2 1 3 1 2 3 3 2 1 1 2 3 1 2 3 3 2 1 3 2 1 3 1 2 2 3 1 1 2 3 2 1 3 3 2 1 3 2 1 1 3 2 1 3 2 3 2 1
output:
3
result:
wrong answer 1st numbers differ - expected: '1', found: '3'