QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#664812#7157. Bikes vs Carsspycoderyt#0 3ms3676kbC++14845b2024-10-21 22:30:292024-10-21 22:30:29

Judging History

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

  • [2024-10-21 22:30:29]
  • 评测
  • 测评结果:0
  • 用时:3ms
  • 内存:3676kb
  • [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%