QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#320278#8215. Isomorphic Delightucup-team266#WA 1ms3656kbC++202.4kb2024-02-03 15:10:142024-02-03 15:10:15

Judging History

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

  • [2024-02-03 15:10:15]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3656kb
  • [2024-02-03 15:10:14]
  • 提交

answer

/*
Things to notice:
1. do not calculate useless values
2. do not use similar names
 
Things to check:
1. submit the correct file
2. time (it is log^2 or log)
3. memory
4. prove your naive thoughts 
5. long long
6. corner case like n=0,1,inf or n=m
7. check if there is a mistake in the ds or other tools you use
8. fileio in some oi-contest

9. module on time 
10. the number of a same divisor in a math problem
11. multi-information and queries for dp and ds problems
*/
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
const int mod=998244353;
const int inf=0x3f3f3f3f;
int n,g[15][15],per[15];
//bool chk()
//{
//	for(int i=1;i<=n;i++) per[i]=i;
//	next_permutation(per+1,per+1+n);
//	do
//	{
//		int flg=1;
//		for(int i=1;i<=n;i++) for(int j=i+1;j<=n;j++) if(g[i][j]!=g[per[i]][per[j]])
//		{
////			return 0;
//			flg=0;
////			break;
//		}
//		if(flg)
//		
//		{
//			return 0;
//			cout<<"bad: \n";
//			for(int i=1;i<=n;i++) cout<<per[i]<<" ";
//			cout<<"\n";
//		}
//	}while(next_permutation(per+1,per+1+n));
//	return 1;
//}
void solve()
{
	cin>>n;
	if(n==1)
	{
		cout<<"YES\n0\n";
		return;
	}
	if(n<=5)
	{
		cout<<"NO\n";
		return;
	}
	if(n==6||n==7)
	{
		cout<<"YES\n6\n";
		cout<<"1 2\n2 3\n3 1\n1 4\n4 5\n2 6\n";
		return;
	}
	cout<<"YES\n"<<n-2<<"\n";
	cout<<"1 2\n1 3\n1 4\n3 5\n2 6\n";
	for(int i=7;i<=n-1;i++) cout<<i-1<<" "<<i<<"\n";
//	for(int i=1;i<n-3;i++) cout<<i<<" "<<i+1<<"\n";
//	cout<<1<<" "<<n-3<<"\n";
//	cout<<1<<" "<<n-2<<"\n"<<n-2<<" "<<n-1<<"\n"<<2<<" "<<n<<"\n";
	
//	int m;
//	cin>>m;
//	
//		while(m--)
//		{
//			int u,v;
//			cin>>u>>v;
//			g[u][v]=g[v][u]=1;
//		}
//		if(chk()) cerr<<"ok\n";
//	int tot=n*(n-1)/2;
//	for(int mask=0;mask<(1<<tot);mask++) //if(__builtin_popcount(mask)==m)
//	{
//
//		memset(g,0,sizeof(g));
//		int idx=0;
//		for(int i=1;i<=n;i++) for(int j=i+1;j<=n;j++)
//		{
//			if(mask&(1<<idx)) g[i][j]=g[j][i]=1;
//			idx++;
//		}
		
//		{
//			idx=0;
//			for(int i=1;i<=n;i++) for(int j=i+1;j<=n;j++)
//			{
//				if(mask&(1<<idx)) cout<<i<<" "<<j<<"\n";
//				idx++;
//			}
//			return;
//		}
//	} 
//	while(m--)
//	{
//		int x,y;
//		cin>>x>>y;
//		g[x][y]=g[y][x]=1;
//	}
	
}
signed main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	int _=1;
//	cin>>_;
	while(_--) solve();
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3628kb

input:

1

output:

YES
0

result:

ok Everything ok

Test #2:

score: 0
Accepted
time: 0ms
memory: 3632kb

input:

6

output:

YES
6
1 2
2 3
3 1
1 4
4 5
2 6

result:

ok Everything ok

Test #3:

score: 0
Accepted
time: 0ms
memory: 3632kb

input:

4

output:

NO

result:

ok Everything ok

Test #4:

score: 0
Accepted
time: 0ms
memory: 3640kb

input:

2

output:

NO

result:

ok Everything ok

Test #5:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

3

output:

NO

result:

ok Everything ok

Test #6:

score: 0
Accepted
time: 0ms
memory: 3604kb

input:

5

output:

NO

result:

ok Everything ok

Test #7:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

7

output:

YES
6
1 2
2 3
3 1
1 4
4 5
2 6

result:

ok Everything ok

Test #8:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

8

output:

YES
6
1 2
1 3
1 4
3 5
2 6
6 7

result:

ok Everything ok

Test #9:

score: 0
Accepted
time: 0ms
memory: 3628kb

input:

9

output:

YES
7
1 2
1 3
1 4
3 5
2 6
6 7
7 8

result:

ok Everything ok

Test #10:

score: 0
Accepted
time: 0ms
memory: 3640kb

input:

10

output:

YES
8
1 2
1 3
1 4
3 5
2 6
6 7
7 8
8 9

result:

ok Everything ok

Test #11:

score: 0
Accepted
time: 1ms
memory: 3568kb

input:

11

output:

YES
9
1 2
1 3
1 4
3 5
2 6
6 7
7 8
8 9
9 10

result:

ok Everything ok

Test #12:

score: 0
Accepted
time: 0ms
memory: 3632kb

input:

12

output:

YES
10
1 2
1 3
1 4
3 5
2 6
6 7
7 8
8 9
9 10
10 11

result:

ok Everything ok

Test #13:

score: 0
Accepted
time: 0ms
memory: 3628kb

input:

13

output:

YES
11
1 2
1 3
1 4
3 5
2 6
6 7
7 8
8 9
9 10
10 11
11 12

result:

ok Everything ok

Test #14:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

14

output:

YES
12
1 2
1 3
1 4
3 5
2 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13

result:

ok Everything ok

Test #15:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

15

output:

YES
13
1 2
1 3
1 4
3 5
2 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14

result:

ok Everything ok

Test #16:

score: -100
Wrong Answer
time: 1ms
memory: 3656kb

input:

16

output:

YES
14
1 2
1 3
1 4
3 5
2 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15

result:

wrong answer contestant's solution is worse (more edges) than jury's