QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#323766 | #4829. Mark on a Graph | hotboy2703 | 0 | 1ms | 3824kb | C++14 | 877b | 2024-02-10 13:18:21 | 2024-02-10 13:18:22 |
answer
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define pll pair <ll,ll>
#define fi first
#define se second
#define sz(a) (ll((a).size()))
#define BIT(mask,i) (((mask) >> (i))&1LL)
#define MASK(i) (1LL << (i))
ll n,m;
vector <ll> g[1010];
int main(){
ios_base::sync_with_stdio(0);cin.tie(nullptr);cout.tie(nullptr);
cin>>n>>m;
for (ll i = 1;i <= m;i ++){
ll u,v;
cin>>u>>v;
g[u].push_back(v);
g[v].push_back(u);
}
double average = double(m*2)/n;
if (sz(g[1])>max(0ll,llround(average-3))){
cout<<"mark"<<'\n';
if (sz(g[1])>=5)g[1].resize(5);
cout<<sz(g[1])<<'\n';
for (auto x:g[1]){
cout<<1<<' '<<x<<'\n';
}
}
else{
cout<<"ok"<<'\n';
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3824kb
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 1 46 1 488 1 238 1 705 1 247
input:
1000 3555 330 340 121 222 601 286 399 190 891 441 754 693 691 385 784 932 715 479 47 782 437 252 598 851 465 440 24 36 75 351 313 75 171 520 667 500 954 369 858 855 364 340 857 673 207 623 83 643 688 453 282 360 102 819 725 759 292 449 222 396 545 465 975 917 547 348 430 163 547 272 583 66 242 199 2...
output:
mark 5 1 537 1 920 1 785 1 131 1 320
result:
wrong answer Token "mark" doesn't correspond to pattern "ok"