QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#419876#403. Memory2Crysfly#100 ✓0ms4004kbC++171.2kb2024-05-24 12:11:332024-05-24 12:11:33

Judging History

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

  • [2024-05-24 12:11:33]
  • 评测
  • 测评结果:100
  • 用时:0ms
  • 内存:4004kb
  • [2024-05-24 12:11:33]
  • 提交

answer

#include<bits/stdc++.h>
#include"Memory2_lib.h"
#define For(i,a,b) for(register int i=(a);i<=(b);++i)
#define Rep(i,a,b) for(register int i=(a);i>=(b);--i)
//#define int long long
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 105
#define inf 0x3f3f3f3f

mt19937_64 rnd(924844033);
inline int gen(int l,int r){return rnd()%(r-l+1)+l;}

int n,a[maxn],c[maxn],col[maxn];
int st[maxn],top;

void work()
{
	int u=gen(1,top);
	For(i,1,n)c[i]=0;
	For(i,1,top)
		if(u!=i)
			col[i]=Flip(st[u]-1,st[i]-1)+1,
			c[col[i]]++;
	For(i,1,n)
		if(c[i]&1){
			col[u]=i;
			++c[i];
		}
	vector<int>o;
	For(i,1,top)
		if(c[col[i]]<=2) a[st[i]]=col[i];
		else o.pb(st[i]);
	top=0;
	for(auto it:o)
		st[++top]=it;
}

void Solve(int T,int N)
{
	n=N;
	For(i,1,n*2)st[++top]=i;
	while(top) work();
	For(i,1,n*2)For(j,i+1,n*2)if(a[i]==a[j])Answer(i-1,j-1,a[i]-1);
}

详细

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 0ms
memory: 3656kb

Test #2:

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

Test #3:

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

Test #4:

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

Test #5:

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

Test #6:

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

Test #7:

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

Test #8:

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

Subtask #2:

score: 50
Accepted

Test #9:

score: 50
Accepted
time: 0ms
memory: 3700kb

Test #10:

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

Test #11:

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

Test #12:

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

Test #13:

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

Test #14:

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

Test #15:

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

Test #16:

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

Test #17:

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

Test #18:

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

Subtask #3:

score: 40
Accepted

Test #19:

score: 40
Accepted
time: 0ms
memory: 3792kb

Test #20:

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

Test #21:

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

Test #22:

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

Test #23:

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

Test #24:

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

Test #25:

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

Test #26:

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

Test #27:

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

Test #28:

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

Extra Test:

score: 0
Extra Test Passed