QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#664823#7157. Bikes vs Carsspycoderyt#0 0ms3668kbC++14843b2024-10-21 22:34:252024-10-21 22:34:26

Judging History

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

  • [2024-10-21 22:34:26]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:3668kb
  • [2024-10-21 22:34:25]
  • 提交

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({j,i,m-x});
        }
    }
    for(int i = 1;i<n;i++) {
        for(int j = 0;j<i;j++) {
            cin>>x;
            b = x;
            v.insert({j,i,x});
        }
    }
    if(m-c > b || m - b > c) {
        cout << "NO";
        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: 0ms
memory: 3668kb

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
0 1 505815
0 1 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: 3616kb

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
0 1 505815
0 1 536641

result:

wrong answer The graph is not connected

Subtask #4:

score: 0
Wrong Answer

Test #39:

score: 0
Wrong Answer
time: 0ms
memory: 3664kb

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%