QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#20404 | #3098. Ancient Machine | uezexh# | 0 | 52ms | 9336kb | C++20 | 1.4kb | 2022-02-15 23:56:24 | 2023-01-17 10:44:52 |
Judging History
Anna
#include "Anna.h"
#include <vector>
using namespace std;
void Anna(int N,vector<char> S){
using ll=long long;
vector<int> a([](int n){
while(n%64)
++n;
return n;
}(N));
ll fib[66]={0,1};
for(int i=2;i<66;++i)
fib[i]=fib[i-1]+fib[i-2];
bool f=false;
for(int i=0;i<N;++i){
if(!f){
if(S[i]=='X'){
f=true;
a[i]=1;
++i;
}
}else if(S[i]=='Z'){
if(S[i-1]=='Z')
a[i-1]=0;
a[i]=1;
}
}
for(int i=0;i<int(a.size());i+=64){
ll s=0;
for(int j=0;j<64;++j)
if(a[i+j])
s+=fib[65-j];
for(int j=0;j<45;++j)
Send((s>>j)&1);
}
}
Bruno
#include "Bruno.h"
#include <cstdio>
using namespace std;
void Bruno(int N,int L,vector<int> A){
using ll=long long;
vector<int> a([](int n){
while(n%64)
++n;
return n;
}(N));
ll fib[66]={0,1};
for(int i=2;i<66;++i)
fib[i]=fib[i-1]+fib[i-2];
for(int i=0;i<int(A.size());i+=45){
ll s=0;
for(int j=0;j<45;++j)
if(A[i+j])
s|=(1LL<<j);
printf("%lld\n",s);
for(int j=0;j<64;++j)
if(s>=fib[65-j]){
s-=fib[65-j];
a[i+(j++)]=1;
}
}
vector<int> p;
for(int i=0;i<N;++i)
if(a[i])
p.push_back(i);
if(int(p.size())<=1){
for(int i=0;i<N;++i)
Remove(i);
}else{
for(int i=0;i<p[0];++i)
Remove(i);
for(int i=p.back()+1;i<N;++i)
Remove(i);
for(int i=1;i<int(p.size());++i){
for(int j=p[i]-1;j>p[i-1];--j)
Remove(j);
Remove(p[i]);
}
Remove(p[0]);
}
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 4ms
memory: 3132kb
input:
18 Y X Y Z X Z X X Z Z Y Y Z Y Y Z X X
output:
45 111110000110100111010010011010100100000011110
input:
45 111110000110100111010010011010100100000011110
output:
Unauthorized output
result:
wrong output format Expected integer, but "Unauthorized" found
Subtask #2:
score: 0
Wrong Answer
Test #12:
score: 0
Wrong Answer
time: 52ms
memory: 9336kb
input:
100000 X Z X Z Z X Y Z Y X Y X Z Z Z Y X Z Y X Y Y X Y Y Y Z Y Z Z Y X X Y X X Y Y X X X Z Y Y Y Z Z Z Z Y X Y Y Z Z Z X Y Z X X X X Y X Y X X Z X Z Z Z X Y X X X Z X Z X X X Y Y Y Y Z X X Y Z Y Y X Z X Z Z Z Z Z Y Z Y X Y Y Y Y X Z Z Y Z Z Y Z Z Z X Z Z X X Z Z Z Z X X Z Y Y Z Y Y Z Z Y Y Z Y Z Y Z...
output:
70335 010011111001110100001001110001111100111001001111010101110111011000010001110110100010101000010110111110001100100010110101010100100100110101100010000011010011111011110101101011101100100000111011111000110111010011110010100101101011000001100000000111110101111101101010110001111010101000001001001001...
input:
70335 010011111001110100001001110001111100111001001111010101110111011000010001110110100010101000010110111110001100100010110101010100100100110101100010000011010011111011110101101011101100100000111011111000110111010011110010100101101011000001100000000111110101111101101010110001111010101000001001001001...
output:
Unauthorized output
result:
wrong output format Expected integer, but "Unauthorized" found