QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#387066#4829. Mark on a GraphCrysfly0 0ms0kbC++171.5kb2024-04-12 00:57:132024-04-12 00:57:13

Judging History

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

  • [2024-04-12 00:57:13]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:0kb
  • [2024-04-12 00:57:13]
  • 提交

answer

// what is matter? never mind. 
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,sse4,popcnt,abm,mmx,avx,avx2") 
#include<bits/stdc++.h>
#define For(i,a,b) for(int i=(a);i<=(b);++i)
#define Rep(i,a,b) for(int i=(a);i>=(b);--i)
#define ll long long
//#define int long long
#define ull unsigned long long
#define SZ(x) ((int)((x).size()))
#define ALL(x) (x).begin(),(x).end()
using namespace std;
inline int read()
{
    char c=getchar();int x=0;bool f=0;
    for(;!isdigit(c);c=getchar())f^=!(c^45);
    for(;isdigit(c);c=getchar())x=(x<<1)+(x<<3)+(c^48);
    if(f)x=-x;return x;
}

#define fi first
#define se second
#define pb push_back
#define mkp make_pair
typedef pair<int,int>pii;
typedef vector<int>vi;

#define maxn 2000005
#define inf 0x3f3f3f3f

int n,m,deg[maxn];
set<int> e[maxn];
bool vis[maxn];

signed main()
{
	cin>>n>>m;
	For(i,1,m){
		int u,v;cin>>u>>v;
		e[u].insert(v),e[v].insert(u);
	}
	For(u,1,n){
		for(int v1:e[u]) for(int v2:e[u]) for(int v3:e[u]) 
			if(v1!=v2&&v2!=v3&&e[v1].count(v2)&&e[v2].count(v3)&&e[v1].count(v3)){
				cout<<"ok"<<endl;
				exit(0);
			}
	}
	cout<<"mark"<<endl;
	vi o;
	For(i,1,n) if(e[i].size()) {
		int j=*e[i].begin();
		o.pb(i),o.pb(j); vis[i]=vis[j]=1;
		int c=2;
		For(v,1,n) if(!vis[v] && c) --c,vis[v]=1,o.pb(v);
		break;
	}
	vector<pii>res;
	For(i,1,4)For(j,i+1,4)if(!e[o[i]].count(o[j]))res.pb(mkp(o[i],o[j]));
	cout<<SZ(res)<<endl;
	for(auto [x,y]:res)cout<<x<<" "<<y<<endl;
	return 0;
}
/*

*/

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer on the first run

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
6
46 2
46 3
46 0
2 3
2 0
3 0

input:


output:


result:

wrong answer Integer parameter [name=k] equals to 6, violates the range [0, 5]