QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#228180#7636. Fair Electionsucup-team918#WA 1ms3528kbC++17454b2023-10-28 13:07:232023-10-28 13:07:23

Judging History

你现在查看的是最新测评结果

  • [2023-10-28 13:07:23]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3528kb
  • [2023-10-28 13:07:23]
  • 提交

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;
}

詳細信息

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'