QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#488241 | #3098. Ancient Machine | Rafi22 | 0 | 40ms | 9956kb | C++20 | 1.9kb | 2024-07-23 18:53:20 | 2024-07-23 18:53:20 |
Judging History
Anna
#include "Anna.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--)
namespace {
}
void Anna(int n,vector<char>S)
{
int xd=n-1;
FOR(i,0,n-1)
{
if(S[i]=='X')
{
xd=i;
break;
}
}
FOR(i,0,n-1)
{
if(i==xd) Send(1);
else if(S[i]=='Z'&&i>xd+1&&S[i-1]!='Z') Send(1);
else Send(0);
}
}
Bruno
#include "Bruno.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--)
namespace {
}
void Bruno(int n,int l,vector<int>A)
{
int last=-1,k=-1;
bool xd=0;
FOR(i,0,n-1)
{
if(A[i])
{
if(!xd)
{
k=i;
last=i;
xd=1;
}
else
{
ROF(j,i-1,last+1) Remove(j);
Remove(i);
last=i;
}
}
}
ROF(j,n-1,last+1) Remove(j);
FOR(i,0,k) Remove(i);
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3808kb
input:
18 Y X Y Z X Z X X Z Z Y Y Z Y Y Z X X
output:
18 010101001000100100
input:
18 010101001000100100
output:
0 18 2
result:
wrong answer your query is valid but your solution is not optimal: read 2 but expected 3
Subtask #2:
score: 0
Wrong Answer
Test #12:
score: 0
Wrong Answer
time: 40ms
memory: 9956kb
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:
100000 10010001000010000100000000101000000000000100010000000100001000000000101000000010100000001000100010100000100000001001001000100010000010010010001010100100000010100100000100000010101000000010001010000010010000001001010010001000000001010101010000001000101000001010010000100000100101001000100010010...
input:
100000 10010001000010000100000000101000000000000100010000000100001000000000101000000010100000001000100010100000100000001001001000100010000010010010001010100100000010100100000100000010101000000010001010000010010000001001010010001000000001010101010000001000101000001010010000100000100101001000100010010...
output:
0 100000 18467
result:
wrong answer your query is valid but your solution is not optimal: read 18467 but expected 22133