QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#256462#7629. Make SYSU Great Again IIucup-team2580WA 0ms3540kbC++201.2kb2023-11-18 19:31:592023-11-18 19:31:59

Judging History

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

  • [2023-11-18 19:31:59]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3540kb
  • [2023-11-18 19:31:59]
  • 提交

answer

//Author: Kevin
#include<bits/stdc++.h>
//#pragma GCC optimize("O2")
using namespace std;
#define ll long long
#define ull unsigned ll
#define pb emplace_back
#define mp make_pair
#define ALL(x) (x).begin(),(x).end()
#define rALL(x) (x).rbegin(),(x).rend()
#define srt(x) sort(ALL(x))
#define rev(x) reverse(ALL(x))
#define rsrt(x) sort(rALL(x))
#define sz(x) (int)(x.size())
#define inf 0x3f3f3f3f
#define pii pair<int,int>
#define lb(v,x) (int)(lower_bound(ALL(v),x)-v.begin())
#define ub(v,x) (int)(upper_bound(ALL(v),x)-v.begin())
#define uni(v) v.resize(unique(ALL(v))-v.begin())
#define longer __int128_t
void die(string S){puts(S.c_str());exit(0);}
int cnt[2020];
int a[2020];
mt19937 rnd(26381);
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int n;
	cin>>n;
	int x=1;
	while(x<n) x*=2;
	x--;
	for(int i=1;i<n;i++)
	{
		int rm=x-a[i-1];
		vector<int> vec;
		for(int j=1;j<=x;j++)
			if((j&rm)==j&&cnt[j]<2)
				vec.pb(j);
		int p=rnd()%sz(vec);
		cnt[vec[p]]++;
		a[i]=vec[p];
	}
	puts("Yes");
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<n;j++)
			cout<<a[(i+j)%n]*(x+1)+a[(i+n-j)%n]<<" ";
		cout<<'\n';
	}
	return 0;
}

详细

Test #1:

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

input:

4

output:

0 5 10 5 
5 8 5 2 
10 5 0 5 
5 2 5 8 
Yes

result:

wrong answer Unexpected Ans