QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#118418 | #1133. Monster Game | lmeowdn# | 0 | 51ms | 4680kb | C++14 | 1.8kb | 2023-07-03 15:16:25 | 2023-08-16 18:28:01 |
Judging History
This is a historical verdict posted at 2023-08-16 18:28:01.
- [2023-08-10 23:21:45]
- System Update: QOJ starts to keep a history of the judgings of all the submissions.
- [2023-07-03 15:16:25]
- Submitted
answer
#include "monster.h"
#include<bits/stdc++.h>
#define fi first
#define se second
#define eb emplace_back
#define mp make_pair
using namespace std;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef __int128 i128;
template<typename T,typename U>
T ceil(T x, U y) {return (x>0?(x+y-1)/y:x/y);}
template<typename T,typename U>
T floor(T x, U y) {return (x>0?x/y:(x-y+1)/y);}
template<class T,class S>
bool chmax(T &a,const S b) {return (a<b?a=b,1:0);}
template<class T,class S>
bool chmin(T &a,const S b) {return (a>b?a=b,1:0);}
int popcnt(int x) {return __builtin_popcount(x);}
int popcnt(ll x) {return __builtin_popcountll(x);}
int topbit(int x) {return (x==0?-1:31-__builtin_clz(x));}
int topbit(ll x) {return (x==0?-1:63-__builtin_clzll(x));}
int lowbit(int x) {return (x==0?-1:__builtin_ctz(x));}
int lowbit(ll x) {return (x==0?-1:__builtin_ctzll(x));}
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<pii> vp;
typedef tuple<int,int,int> tiii;
int read() {
int x=0,w=1; char c=getchar();
while(!isdigit(c)) {if(c=='-') w=-1; c=getchar();}
while(isdigit(c)) {x=x*10+(c-'0'); c=getchar();}
return x*w;
}
namespace {
const int N=1005;
int deg[N];
bool e[N][N];
}
vi Solve(int n) {
rep(i,0,n-1) rep(j,i+1,n-1) {
e[i][j]=Query(i,j), e[j][i]=!e[i][j];
if(e[i][j]) deg[i]++;
else deg[j]++;
}
vi p(n),q(n);
rep(i,0,n-1) {
if(deg[i]==1) {
if(!p[0]) p[0]=i;
else p[1]=i;
} else if(deg[i]==n-1) {
if(!p[n-1]) p[n-1]=i;
else p[n-2]=i;
} else p[deg[i]]=i;
}
if(!e[p[0]][p[1]]) swap(p[0],p[1]);
if(!e[p[n-2]][p[n-1]]) swap(p[n-2],p[n-1]);
rep(i,0,n-1) q[p[i]]=i;
return q;
}
详细
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 10
Accepted
time: 1ms
memory: 3708kb
input:
4 0 1 1 0 0 0
output:
Q 0 1 Q 0 2 Q 0 3 Q 1 2 Q 1 3 Q 2 3 F 4 2 1 0 3
result:
points 1.0 points 1.0
Test #2:
score: 0
Wrong Answer
time: 1ms
memory: 3688kb
input:
4 1 0 0 1 1 0
output:
Q 0 1 Q 0 2 Q 0 3 Q 1 2 Q 1 3 Q 2 3 F 4 3 0 0 2
result:
wrong answer Wrong Answer [3]
Subtask #2:
score: 0
Wrong Answer
Test #33:
score: 0
Wrong Answer
time: 36ms
memory: 4668kb
input:
995 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 1 0 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 1 0 1 0 1 0 0 1 0 1 0 1 0 1 1 0 0 1 0 0 1 1 0 0 0 0 0 0 ...
output:
Q 0 1 Q 0 2 Q 0 3 Q 0 4 Q 0 5 Q 0 6 Q 0 7 Q 0 8 Q 0 9 Q 0 10 Q 0 11 Q 0 12 Q 0 13 Q 0 14 Q 0 15 Q 0 16 Q 0 17 Q 0 18 Q 0 19 Q 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