QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#488238#3098. Ancient MachineRafi220 40ms9836kbC++202.0kb2024-07-23 18:52:012024-07-23 18:52:01

Judging History

你现在查看的是最新测评结果

  • [2024-07-23 18:52:01]
  • 评测
  • 测评结果:0
  • 用时:40ms
  • 内存:9836kb
  • [2024-07-23 18:52:01]
  • 提交

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>0&&S[i-1]!='Z'&&i-1!=xd)) 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: 3784kb

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: 9836kb

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