QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#480083 | #403. Memory2 | Rafi22 | 100 ✓ | 0ms | 4012kb | C++20 | 1.6kb | 2024-07-16 03:53:57 | 2024-07-16 03:53:58 |
Judging History
answer
#include "Memory2_lib.h"
#include <bits/stdc++.h>
using namespace std;
#ifdef DEBUG
auto&operator<<(auto&o,pair<auto,auto>p){return o<<"("<<p.first<<", "<<p.second<<")";}
auto operator<<(auto&o,auto x)->decltype(x.end(),o){o<<"{";int i=0;for(auto e:x)o<<","+!i++<<e;return o<<"}";}
#define debug(X...)cerr<<"["#X"]: ",[](auto...$){((cerr<<$<<"; "),...)<<endl;}(X)
#else
#define debug(...){}
#endif
#define ll long long
#define ld long double
//#define endl '\n'
#define st first
#define nd second
#define pb push_back
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
#define FOR(i,l,r) for(int i=(l);i<=(r);i++)
#define ROF(i,r,l) for(int i=(r);i>=(l);i--)
int inf=1000000007;
ll infl=1000000000000000007;
ll mod=1000000007;
ll mod1=998244353;
const int N=57;
vector<int>ans[N];
vector<int>cnt[N];
void Solve(int t,int n)
{
vector<int>V(2*n);
FOR(i,0,2*n-1) V[i]=i;
while(sz(V)>2)
{
random_shuffle(all(V));
int i=0;
FOR(j,1,sz(V)-1)
{
int x=Flip(V[i],V[j]);
cnt[x].pb(j);
if(sz(cnt[x])==3)
{
int a=cnt[x][0],b=cnt[x][1];
cnt[x].clear();
cnt[Flip(V[a],V[j])].pb(a);
cnt[Flip(V[b],V[j])].pb(b);
cnt[x].pb(i);
i=j;
}
}
debug(i);
vector<int>nV={V[i]};
FOR(j,0,n-1)
{
debug(j,cnt[j]);
for(auto x:cnt[j])
{
if(sz(cnt[j])==2)
{
debug(x,sz(V));
ans[j].pb(V[x]);
}
else nV.pb(V[x]);
}
cnt[j].clear();
}
V=nV;
}
debug(V);
FOR(i,0,n-1)
{
if(sz(ans[i])==0) ans[i]=V;
debug(ans[i][0],ans[i][1]);
Answer(ans[i][0],ans[i][1],i);
}
return;
}
Details
Subtask #1:
score: 10
Accepted
Test #1:
score: 10
Accepted
time: 0ms
memory: 3768kb
Test #2:
score: 0
Accepted
time: 0ms
memory: 3740kb
Test #3:
score: 0
Accepted
time: 0ms
memory: 3796kb
Test #4:
score: 0
Accepted
time: 0ms
memory: 3784kb
Test #5:
score: 0
Accepted
time: 0ms
memory: 3716kb
Test #6:
score: 0
Accepted
time: 0ms
memory: 4012kb
Test #7:
score: 0
Accepted
time: 0ms
memory: 3804kb
Test #8:
score: 0
Accepted
time: 0ms
memory: 3712kb
Subtask #2:
score: 50
Accepted
Test #9:
score: 50
Accepted
time: 0ms
memory: 3968kb
Test #10:
score: 0
Accepted
time: 0ms
memory: 4012kb
Test #11:
score: 0
Accepted
time: 0ms
memory: 3968kb
Test #12:
score: 0
Accepted
time: 0ms
memory: 3804kb
Test #13:
score: 0
Accepted
time: 0ms
memory: 3968kb
Test #14:
score: 0
Accepted
time: 0ms
memory: 3776kb
Test #15:
score: 0
Accepted
time: 0ms
memory: 3744kb
Test #16:
score: 0
Accepted
time: 0ms
memory: 4012kb
Test #17:
score: 0
Accepted
time: 0ms
memory: 3812kb
Test #18:
score: 0
Accepted
time: 0ms
memory: 3740kb
Subtask #3:
score: 40
Accepted
Test #19:
score: 40
Accepted
time: 0ms
memory: 4008kb
Test #20:
score: 0
Accepted
time: 0ms
memory: 3744kb
Test #21:
score: 0
Accepted
time: 0ms
memory: 3720kb
Test #22:
score: 0
Accepted
time: 0ms
memory: 3716kb
Test #23:
score: 0
Accepted
time: 0ms
memory: 3796kb
Test #24:
score: 0
Accepted
time: 0ms
memory: 3664kb
Test #25:
score: 0
Accepted
time: 0ms
memory: 3712kb
Test #26:
score: 0
Accepted
time: 0ms
memory: 4004kb
Test #27:
score: 0
Accepted
time: 0ms
memory: 3808kb
Test #28:
score: 0
Accepted
time: 0ms
memory: 3968kb
Extra Test:
score: 0
Extra Test Passed