QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#321907#4829. Mark on a Graphsocpite0 2ms3668kbC++14842b2024-02-05 21:32:012024-02-05 21:32:02

Judging History

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

  • [2024-02-05 21:32:02]
  • 评测
  • 测评结果:0
  • 用时:2ms
  • 内存:3668kb
  • [2024-02-05 21:32:01]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;

const int maxn = 1e3+5;

vector<int> g[maxn];
int used[maxn];

int main(){
    int n, m;
    cin >> n >> m;
    for(int i = 0; i < m; i++){
        int a, b;
        cin >> a >> b;
        g[a].push_back(b);
        g[b].push_back(a);
    }
    int mn = 1;
    for(int i = 1; i <= n; i++){
        if(g[i].size() > g[mn].size())mn = i;
    }
    // cout << mn << " " << g[mn].size() << endl;
    if(g[mn].size() >= m*2/n + 10*m/2000)cout << "ok";
    else{
        cout << "mark\n";
        cout << "5\n";
        int cnt = 0;
        for(auto v: g[mn])used[v] = 1;
        for(int i = 1; i <= n; i++){
            if(used[i] || i == mn)continue;
            cout << mn << " " << i << "\n";
            cnt++;
            if(cnt == 5)return 0;
        }
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 2ms
memory: 3668kb

input:

1000 3560
603 151
415 20
102 569
895 552
678 734
24 614
689 518
440 223
751 919
223 433
711 551
502 634
706 583
812 501
514 535
780 751
720 530
532 384
888 139
864 791
292 675
171 881
30 592
464 557
280 299
654 650
894 335
250 532
792 10
83 969
118 771
579 300
852 983
243 940
957 939
817 889
911 319...

output:

mark
5
310 1
310 2
310 3
310 4
310 5

input:

1000 3565
721 353
295 222
429 542
522 656
682 141
194 833
746 181
656 841
263 583
392 102
221 187
643 633
788 161
180 790
481 180
640 763
583 378
224 873
974 302
521 639
368 691
720 39
113 433
679 583
16 526
882 125
351 806
70 757
464 840
87 733
161 916
232 79
178 201
182 394
201 34
883 528
916 901
...

output:

mark
5
669 1
669 2
669 3
669 4
669 5

result:

wrong answer Token "mark" doesn't correspond to pattern "ok"