QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#294451#4829. Mark on a Graphucup-team055#0 2ms7408kbC++17856b2023-12-30 13:50:322023-12-30 13:50:33

Judging History

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

  • [2023-12-30 13:50:33]
  • 评测
  • 测评结果:0
  • 用时:2ms
  • 内存:7408kb
  • [2023-12-30 13:50:32]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=(int)a;i<(int)b;i++)
#define all(p) p.begin(),p.end()
using ll =long long;

void solve(){
    int N,M;
    cin>>N>>M;
    vector<vector<int>> G(N,vector<int>(N));
    int cou=0;
    rep(i,0,N) rep(j,i+1,N){
        G[i][j]=cou;
        cou++;
    }
    int L=(1<<16);
    vector<int> p(10);
    rep(i,0,M){
        int a,b;
        cin>>a>>b;
        a--,b--;
        if(a>b) swap(a,b);
        p[G[a][b]/L]^=(G[a][b]%L);
    }
    bool ok=1;
    rep(i,0,5) if(p[i]) ok=0;
    if(ok){
        cout<<"ok\n";
        return;
    }
    cout<<"mark\n5\n";
    rep(i,0,5){
        rep(j,0,N) rep(k,j+1,N){
            if(G[j][k]==p[i]+L*i){
                cout<<j+1<<" "<<k+1<<"\n";
            }
        }
    }
}

int main(){
    solve();
}

詳細信息

Test #1:

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

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
15 982
134 439
196 672
281 448
366 808

input:

1000 3565
626 311
295 222
665 298
534 977
682 582
107 833
155 683
656 841
184 217
383 844
676 187
937 771
397 161
379 167
655 180
484 763
342 897
224 648
974 380
521 228
368 663
676 977
113 49
639 831
715 526
95 125
440 102
70 757
955 736
87 733
355 335
232 687
14 201
368 394
201 178
617 583
557 937...

output:

mark
5
5 599
132 809
209 670
287 758
388 492

result:

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