Submission #733333

# Submission time Handle Problem Language Result Execution time Memory
733333 2023-04-30T13:40:28 Z myrcella The Collection Game (BOI21_swaps) C++17
0 / 100
1 ms 1500 KB
//by szh
#include<bits/stdc++.h>
using namespace std;

#define fi first
#define se second
#define pii pair<int,int>
#define pll pair<long long,long long>
#define pb push_back
#define debug(x) cerr<<#x<<"="<<x<<endl
#define pq priority_queue
#define inf 0x3f
#define rep(i,a,b) for (int i=a;i<(b);i++)
#define MP make_pair
#define SZ(x) (int(x.size()))
#define ll long long
#define mod 1000000007
#define ALL(x) x.begin(),x.end()
void inc(int &a,int b) {a=(a+b)%mod;}
void dec(int &a,int b) {a=(a-b+mod)%mod;}
int lowbit(int x) {return x&(-x);}
ll p0w(ll base,ll p) {ll ret=1;while(p>0){if (p%2ll==1ll) ret=ret*base%mod;base=base*base%mod;p/=2ll;}return ret;}

#include "swaps.h"

const int maxn = 555;
int grid[maxn][maxn];

bool cmp(int x,int y) {
	if (grid[x][y]!=-1) return grid[x][y];
	return grid[y][x]^1;
}

void solve(int N, int V) {
    // TODO implement this function
    memset(grid,-1,sizeof(grid));
    for (int i=1;i+1<=N;i+=2) schedule(i,i+1);
    vector <int> tmp = visit();
    for (int i=1;i+1<=N;i+=2) grid[i][i+1] = tmp[i/2];
    for (int i=2;i+1<=N;i+=2) schedule(i,i+1);
    tmp = visit();
    for (int i=2;i+1<N;i+=2) grid[i][i+1] = tmp[(i-1)/2];
    rep(i,2,N) {
		for (int j=1;j+i<=N;j++) schedule(j,j+i);
		tmp = visit();
		for (int j=1;j+i<=N;j++) grid[j][j+i] = tmp[j-1];
	}
	vector <int> ret;
	rep(i,0,N) ret.pb(i+1);
	sort(ALL(ret),cmp);
	answer(ret);
	return;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1488 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1500 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1488 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1488 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1488 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1488 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1488 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1488 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1488 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1488 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1488 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1488 KB Not correct
2 Halted 0 ms 0 KB -