QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#648225 | #3506. Team Contest | KiharaTouma# | 0 | 31ms | 7420kb | C++14 | 1.0kb | 2024-10-17 17:45:03 | 2024-10-17 17:45:07 |
Judging History
answer
//qoj3506
#include <bits/stdc++.h>
using namespace std;
const int N = 1.5e5 + 10;
int n;
int main(){
scanf("%d", &n);
priority_queue<pair<int, int> > a, b, c;
for(int i = 1; i <= n; ++ i){
int x, y, z;
scanf("%d%d%d", &x, &y, &z);
a.push(make_pair(x, i));
b.push(make_pair(y, i));
c.push(make_pair(z, i));
}
while(a.size() && b.size() && c.size()){
pair<int, int> x = a.top();
pair<int, int> y = b.top();
pair<int, int> z = c.top();
if(x.second == y.second && y.second == z.second){
a.pop();
b.pop();
c.pop();
} else if(x.second == y.second){
a.pop();
b.pop();
} else if(y.second == z.second){
b.pop();
c.pop();
} else if(x.second == z.second){
a.pop();
c.pop();
} else {
printf("%d\n", x.first + y.first + z.first);
return 0;
}
}
puts("-1");
return 0;
}
详细
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 8
Accepted
time: 1ms
memory: 4104kb
input:
3 1 1 2 1 2 1 2 1 1
output:
6
result:
ok single line: '6'
Test #2:
score: 8
Accepted
time: 0ms
memory: 3636kb
input:
3 1 2 2 2 1 2 2 2 1
output:
-1
result:
ok single line: '-1'
Test #3:
score: 8
Accepted
time: 1ms
memory: 3740kb
input:
3 3 3 3 2 2 2 1 1 1
output:
-1
result:
ok single line: '-1'
Test #4:
score: 8
Accepted
time: 0ms
memory: 3804kb
input:
4 3 1 1 2 2 2 1 1 3 1 2 1
output:
8
result:
ok single line: '8'
Test #5:
score: 8
Accepted
time: 0ms
memory: 3736kb
input:
3 1 2 3 1 3 4 1 4 2
output:
-1
result:
ok single line: '-1'
Test #6:
score: 8
Accepted
time: 0ms
memory: 3736kb
input:
3 4 1 3 3 1 2 2 1 4
output:
-1
result:
ok single line: '-1'
Test #7:
score: 0
Wrong Answer
time: 0ms
memory: 3788kb
input:
3 2 4 1 4 3 1 3 2 1
output:
9
result:
wrong answer 1st lines differ - expected: '-1', found: '9'
Subtask #2:
score: 0
Skipped
Dependency #1:
0%
Subtask #3:
score: 0
Wrong Answer
Test #36:
score: 9
Accepted
time: 31ms
memory: 7420kb
input:
150000 3 3 1 2 5 5 1 3 5 4 3 5 3 4 4 4 4 2 4 3 5 5 1 2 5 4 1 2 3 3 4 4 5 3 3 5 2 4 3 1 3 2 5 2 4 4 5 3 2 5 1 5 4 3 3 2 5 1 1 4 3 2 5 2 3 5 3 3 4 1 3 4 2 4 3 1 5 4 2 1 4 1 4 4 5 4 3 4 5 3 2 1 2 5 4 5 4 5 4 5 1 2 1 4 1 3 1 4 2 5 2 3 5 3 3 4 2 5 1 4 5 2 1 1 2 2 1 3 2 5 4 3 5 4 5 3 2 4 5 5 2 5 3 3 3 4 4...
output:
15
result:
ok single line: '15'
Test #37:
score: 0
Wrong Answer
time: 15ms
memory: 5840kb
input:
99999 1 1 2 2 4 1 2 4 5 3 4 5 1 5 5 4 2 5 1 1 2 2 4 2 2 4 4 3 4 2 4 4 5 2 4 4 1 2 2 1 1 2 1 2 1 1 5 5 1 1 1 5 3 5 2 4 1 1 4 4 2 5 5 1 1 2 3 4 4 2 4 2 4 2 5 3 3 4 1 2 2 4 5 3 3 4 2 4 5 3 2 4 5 1 1 1 3 4 4 2 4 1 1 1 1 3 5 5 3 4 1 2 4 2 3 4 5 1 2 2 1 2 1 4 4 4 1 1 1 2 1 4 1 4 5 3 5 5 2 4 5 3 4 5 3 3 4 ...
output:
15
result:
wrong answer 1st lines differ - expected: '8', found: '15'
Subtask #4:
score: 0
Skipped
Dependency #3:
0%
Subtask #5:
score: 0
Skipped
Dependency #4:
0%
Subtask #6:
score: 0
Skipped
Dependency #5:
0%
Subtask #7:
score: 0
Skipped
Dependency #1:
0%