QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#488278#3098. Ancient MachineRafi220 34ms9928kbC++202.6kb2024-07-23 19:48:302024-07-23 19:48:30

Judging History

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

  • [2024-07-23 19:48:30]
  • 评测
  • 测评结果:0
  • 用时:34ms
  • 内存:9928kb
  • [2024-07-23 19:48:30]
  • 提交

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 code(vector<int>V)
	{
		vector<ll>fib(41);
		fib[0]=1;
		fib[1]=2;
		FOR(i,2,40) fib[i]=fib[i-1]+fib[i-2];
		ll x=0;
		ROF(i,39,0) if(V[i]) x+=fib[i];
		FOR(i,0,27)
		{
			if(x&(1<<i)) Send(1);
			else Send(0);
		}
	}
}

void Anna(int n,vector<char>S)
{
	int xd=n;
	FOR(i,0,n-1)
	{
		if(S[i]=='X')
		{
			xd=i;
			break;
		}
	}
	int m=100000;
	vector<int>a(m,0);
	if(xd<n-1)
	{
		a[xd]=1;
		FOR(i,xd+1,n-2) if(S[i]=='Z'&&(i==n-1||S[i+1]!='Z')) a[i+1]=1;
	}
	for(int i=0;i<m;i+=40)
	{
		vector<int>T;
		FOR(j,i,i+39) T.pb(a[j]);
		code(T);
	}
}

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)
{
	cout<<sz(A)<<endl;
	vector<ll>fib(41);
	fib[0]=1;
	fib[1]=2;
	FOR(i,2,40) fib[i]=fib[i-1]+fib[i-2];
	int m=100000;
	vector<int>a(m+1,0);
	int it=0;
	for(int i=0;i<sz(A);i+=28)
	{
		int x=0;
		FOR(j,0,27) if(A[i+j]) x+=(1<<j);
		ROF(j,39,0)
		{
			if(x>=fib[j])
			{
				x-=fib[j];
				a[it+j]=1;
			}
		}
		it+=40;
	}
	a[n]=1;
	int last=-1,k=-1;
	bool xd=0;
	FOR(i,0,n)
	{
		if(a[i])
		{
			if(!xd)
			{
				ROF(j,i,1) Remove(j-1);
				k=i+1;
				last=i+1;
				xd=1;
			}
			else
			{
				ROF(j,i-1,last+1) Remove(j-1);
				Remove(i-1);
				last=i;
			}
		}
	}
	if(k<=n) Remove(k-1);
}


Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 2ms
memory: 4544kb

input:

18
Y X Y Z X Z X X Z Z Y Y Z Y Y Z X X

output:

70000
100101001011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

input:

70000
100101001011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

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: 34ms
memory: 9928kb

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:

70000
001101010110110010010100000010010010010110000000000101011110110111101000101101010010001111001100110110100111101101001100000101111000100111010100011110111100110100111001000010110101111101011010100111011001001100010111111011000110100000001111001010110001000101000011011111010100100010000110100010...

input:

70000
001101010110110010010100000010010010010110000000000101011110110111101000101101010010001111001100110110100111101101001100000101111000100111010100011110111100110100111001000010110101111101011010100111011001001100010111111011000110100000001111001010110001000101000011011111010100100010000110100010...

output:

Unauthorized output

result:

wrong output format Expected integer, but "Unauthorized" found