QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#664812 | #7157. Bikes vs Cars | spycoderyt# | 0 | 3ms | 3676kb | C++14 | 845b | 2024-10-21 22:30:29 | 2024-10-21 22:30:29 |
answer
#include <bits/stdc++.h>
using namespace std;
const int N = 505;
struct node{
int a,b,w;
bool operator<(const node&x)const{
return w<x.w;
}
};
set<node> v;
int n,m,x,c,b;
int main() {
// try the largest next edge, but before that check if theres already a larger connection
cin>>n>>m;
for(int i = 1;i<n;i++) {
for(int j = 0;j<i;j++) {
cin>>x;
c = x;
v.insert({i,j,m-x});
}
}
for(int i = 1;i<n;i++) {
for(int j = 0;j<i;j++) {
cin>>x;
b = x;
v.insert({i,j,x});
}
}
if(m-c > b || m - b > c) {
cout << "NO\n";
return 0;
}
cout << v.size() << "\n";
for(auto [a,b,c] : v)cout<<a<<" " << b << " " << c << "\n";
}
/*
2 1
0
1
*/
详细
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3644kb
input:
14 1000000 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 49...
output:
2 1 0 505815 1 0 536641
result:
wrong answer The graph is not connected
Subtask #2:
score: 0
Skipped
Dependency #1:
0%
Subtask #3:
score: 0
Wrong Answer
Test #16:
score: 0
Wrong Answer
time: 0ms
memory: 3552kb
input:
14 1000000 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 494185 49...
output:
2 1 0 505815 1 0 536641
result:
wrong answer The graph is not connected
Subtask #4:
score: 0
Wrong Answer
Test #39:
score: 0
Wrong Answer
time: 3ms
memory: 3676kb
input:
163 1 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 1 0 0 ...
output:
NO
result:
wrong answer Contestant said no, judge found solution
Subtask #5:
score: 0
Skipped
Dependency #2:
0%
Subtask #6:
score: 0
Skipped
Dependency #1:
0%