QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#665463#4829. Mark on a Graphsongziyan0 0ms44700kbC++141.1kb2024-10-22 13:06:062024-10-22 13:06:10

Judging History

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

  • [2024-10-22 13:06:10]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:44700kb
  • [2024-10-22 13:06:06]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define int long long
// char buf[1<<22],*p1,*p2;
// #define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<22,stdin),p1==p2)?0:*p1++)
inline int read(){
    int x=0,f=1;char ch=getchar();
    while(!isdigit(ch))f=(ch=='-')?-1:1,ch=getchar();
    while(isdigit(ch))x=(x<<3)+(x<<1)+(ch^48),ch=getchar();
    return x*f;
}
const int N=5005;
int n,m,g[N][N];
int pu[N],pv[N],vis[N][N];
signed main(){
    // mt19937 rnd(998244353);
    // mt19937 rnd(19260817);
    n=read();m=read();
    for(int i=1;i<=m;i++){
        int u=read(),v=read();
        g[u][v]=g[v][u]=1;
    }
    pu[1]=835;pv[1]=188;
    pu[2]=104;pv[2]=781;
    pu[3]=216;pv[3]=778;
    pu[4]=678;pv[4]=958;
    pu[5]=301;pv[5]=87;
    int flg=1;
    for(int i=1;i<=5;i++)flg&=g[pu[i]][pv[i]];
    if(flg){puts("ok");return 0;}
    puts("mark");
    int cnt=0;
    for(int i=1;i<=5;i++)if(!g[pu[i]][pv[i]])++cnt;
    printf("%lld\n",cnt);
    for(int i=1;i<=5;i++)if(!g[pu[i]][pv[i]])printf("%lld %lld\n",pu[i],pv[i]);
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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
835 188
104 781
216 778
678 958
301 87

input:

1000 3565
626 643
295 222
665 298
534 338
682 275
50 833
155 683
656 841
184 95
383 844
450 259
937 771
335 355
379 167
402 763
582 250
950 401
224 648
974 380
521 246
368 418
794 262
920 351
643 831
554 526
553 125
506 102
70 757
955 736
87 733
355 37
600 53
14 201
368 394
201 178
951 583
221 937
2...

output:

mark
5
835 188
104 781
216 778
678 958
301 87

result:

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