QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#553284 | #9241. Sphinx | JohnAlfnov# | 3 | 1ms | 4072kb | C++17 | 1.2kb | 2024-09-08 11:38:59 | 2024-09-08 11:39:00 |
answer
#include<bits/stdc++.h>
using namespace std;
#ifdef ONLINE_JUDGE
#include "sphinx.h"
#endif
#ifndef ONLINE_JUDGE
int perform_experiment(vector<int>E){
return 0;
}
#endif
int n;
vector<int>C,G;
int query(int l,int r,int c,int m){
for(int i=0;i<n;++i)C[i]=c;
for(int i=l;i<=r;++i)C[2*i+m]=-1;
return perform_experiment(C);
}
void solve(int l,int r,vector<int>g,int m){
if(l>r)return;
if(l==r){
if((signed)g.size()>1){
for(auto c:g){
int a=query(l,r,c,m);
if(a==1){
G[2*l+m]=c;
break;
}
}
}else G[2*l+m]=g[0];
return;
}
int mid=(l+r)>>1;
vector<int>g1,g2;
for(auto c:g){
int a=query(l,mid,c,m);
if(a==2*(mid-l+1)+1-(2*l+m==0)){
g2.emplace_back(c);
}else{
g1.emplace_back(c);
int b=query(mid+1,r,c,m);
if(b!=2*(r-mid)+1-(2*r+m==n-1)){
g2.emplace_back(c);
}
}
}
solve(l,mid,g1,m);
solve(mid+1,r,g2,m);
}
vector<int>find_colours(int N,vector<int>X,vector<int>Y){
n=N;
C.resize(n);G.resize(n);
vector<int>zs;
for(int i=0;i<n;++i)zs.emplace_back(i);
solve(0,n/2,zs,0);
solve(0,(n-1)/2,zs,1);
return G;
}
#ifndef ONLINE_JUDGE
int main(){
return 0;
}
#endif
详细
Subtask #1:
score: 3
Accepted
Test #1:
score: 3
Accepted
time: 1ms
memory: 4072kb
input:
1978433568 2 1 0 1 1978433568 1 1978433568 1 1978433568 2 1978433568 1 1978433568 1
output:
877694080 -1 0 877694080 0 0 877694080 -1 1 877694080 0 0 877694080 0 -1 877694081 0 0
result:
ok #experiments: 5
Test #2:
score: 3
Accepted
time: 1ms
memory: 3868kb
input:
1978433568 2 1 0 1 1978433568 1 1978433568 1 1978433568 2 1978433568 1 1978433568 2 1978433568 1
output:
877694080 -1 0 877694080 0 0 877694080 -1 1 877694080 0 0 877694080 0 -1 877694080 1 -1 877694081 0 1
result:
ok #experiments: 6
Test #3:
score: 3
Accepted
time: 1ms
memory: 3772kb
input:
1978433568 2 1 0 1 1978433568 2 1978433568 1 1978433568 1 1978433568 1 1978433568 1
output:
877694080 -1 0 877694080 -1 1 877694080 1 1 877694080 0 0 877694080 0 -1 877694081 1 0
result:
ok #experiments: 5
Test #4:
score: 3
Accepted
time: 0ms
memory: 4068kb
input:
1978433568 2 1 0 1 1978433568 2 1978433568 1 1978433568 1 1978433568 1 1978433568 2 1978433568 1
output:
877694080 -1 0 877694080 -1 1 877694080 1 1 877694080 0 0 877694080 0 -1 877694080 1 -1 877694081 1 1
result:
ok #experiments: 6
Subtask #2:
score: 0
Runtime Error
Dependency #1:
100%
Accepted
Test #5:
score: 0
Runtime Error
input:
1978433568 50 49 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 19784335...
output:
877694080 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 877694080 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 877694080 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2...
result:
Subtask #3:
score: 0
Runtime Error
Test #34:
score: 0
Runtime Error
input:
1978433568 250 249 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 ...
output:
877694080 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 ...
result:
Subtask #4:
score: 0
Runtime Error
Test #43:
score: 0
Runtime Error
input:
1978433568 250 31125 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0 33 0 34 0 35 0 36 0 37 0 38 0 39 0 40 0 41 0 42 0 43 0 44 0 45 0 46 0 47 0 48 0 49 0 50 0 51 0 52 0 53 0 54 0 55 0 56 0 57 0 5...
output:
877694080 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 ...
result:
Subtask #5:
score: 0
Skipped
Dependency #1:
100%
Accepted
Dependency #2:
0%