Submission details
Task:Compiler
Sender:KnowYourArchitecture
Submission time:2016-11-12 15:13:42 +0200
Language:C++
Status:READY
Result:
Test results
testverdicttime
#1ACCEPTED0.06 sdetails
#20.05 sdetails
#30.05 sdetails
#40.06 sdetails
#50.05 sdetails
#60.05 sdetails
#7ACCEPTED0.05 sdetails
#80.06 sdetails
#9ACCEPTED0.06 sdetails
#100.06 sdetails
#11ACCEPTED0.07 sdetails
#12ACCEPTED0.05 sdetails
#130.05 sdetails
#140.06 sdetails
#150.06 sdetails
#160.05 sdetails
#170.06 sdetails
#180.05 sdetails
#19ACCEPTED0.06 sdetails
#20ACCEPTED0.06 sdetails

Code

#include <iostream>

using namespace std;

#define PH(i) cout<<"PH " i "\n";
#define PL(i) cout<<"PL " i "\n";
#define AD() cout<<"AD\n";
#define ZE(i) cout<<"ZE " i "\n";
#define ST(i) cout<<"ST " i "\n";
#define DI(i) cout<<"DI " i "\n";
#define A "A"
#define X "X"
#define Y "Y"

#define LO X
#define HI Y

int main() {
	int l;
	cin >> l;
	
	int low = l & 0xf;
	int high = (l >> 4) & 0xf;
	
	if (low & 1)
		ST(LO)
	else
		ZE(LO)
	if (high & 1)
		ST(HI)
	else
		ZE(HI)
	ST(A)
	
	#define INC \
	PH(A) \
	PH(A) \
	AD() \
	PL(A)
	
	INC
	if (low & 2) {
		PH(A)
		PH(LO)
		AD()
		PL(LO)
	}
	if (high & 2) {
		PH(A)
		PH(HI)
		AD()
		PL(HI)
	}
	INC
	if (low & 4) {
		PH(A)
		PH(LO)
		AD()
		PL(LO)
	}
	if (high & 4) {
		PH(A)
		PH(HI)
		AD()
		PL(HI)
	}
	INC
	if (low & 8) {
		PH(A)
		PH(LO)
		AD()
	} else
		PH(LO)
	if (high & 8) {
		PH(A)
		PH(HI)
		AD()
	} else
		PH(HI)
	AD()
	PL(A)
	DI(A)
	
	
	
	return 0;
	int x,y;
	x=1;
	if(l&1){ST(X)PH(X)}
	else{ST(X)ZE(Y)PH(Y)}
	y=l&1;
	l>>=1;
	for(int i=1;l&&i<8;++i,l>>=1){
		PH(X)
		PH(X)
		AD()
		x+=x;
		PL(X)
		if(l&1){
			PH(X)
			AD()
			y+=x;
		}
	}
	PL(Y)
	DI(Y)
	cout<<y<<'\n';
	return 0;
}

Test details

Test 1

Verdict: ACCEPTED

input
1

correct output
ST X
ST A
DI A

user output
ST X
ZE Y
ST A
PH A
PH A
...

Test 2

Verdict:

input
63

correct output
ST X
ST A
PH A
PH A
PH A
...

user output
ST X
ST Y
ST A
PH A
PH A
...

Test 3

Verdict:

input
127

correct output
ST X
ST A
PH A
PH A
PH A
...

user output
ST X
ST Y
ST A
PH A
PH A
...

Test 4

Verdict:

input
65

correct output
ST X
PH X
PH X
AD
PL A
...

user output
ST X
ZE Y
ST A
PH A
PH A
...

Test 5

Verdict:

input
192

correct output
ST X
ST A
PH A
PH A
AD
...

user output
ZE X
ZE Y
ST A
PH A
PH A
...

Test 6

Verdict:

input
254

correct output
ST X
ST A
PH A
PH A
PH A
...

user output
ZE X
ST Y
ST A
PH A
PH A
...

Test 7

Verdict: ACCEPTED

input
11

correct output
ST X
PH X
PH X
AD
PL A
...

user output
ST X
ZE Y
ST A
PH A
PH A
...

Test 8

Verdict:

input
99

correct output
ST X
PH X
PH X
AD
PL A
...

user output
ST X
ZE Y
ST A
PH A
PH A
...

Test 9

Verdict: ACCEPTED

input
4

correct output
ST X
PH X
PH X
AD
PL A
...

user output
ZE X
ZE Y
ST A
PH A
PH A
...

Test 10

Verdict:

input
239

correct output
ST X
PH X
PH X
AD
PL A
...

user output
ST X
ZE Y
ST A
PH A
PH A
...

Test 11

Verdict: ACCEPTED

input
6

correct output
ST X
ST A
PH A
PH A
AD
...

user output
ZE X
ZE Y
ST A
PH A
PH A
...

Test 12

Verdict: ACCEPTED

input
7

correct output
ST X
ST A
PH A
PH A
AD
...

user output
ST X
ZE Y
ST A
PH A
PH A
...

Test 13

Verdict:

input
245

correct output
ST X
ST A
PH A
PH A
PH A
...

user output
ST X
ST Y
ST A
PH A
PH A
...

Test 14

Verdict:

input
200

correct output
ST X
ST A
PH A
PH A
AD
...

user output
ZE X
ZE Y
ST A
PH A
PH A
...

Test 15

Verdict:

input
255

correct output
ST X
PH X
PH X
AD
PL A
...

user output
ST X
ST Y
ST A
PH A
PH A
...

Test 16

Verdict:

input
251

correct output
ST X
ST A
PH A
PH A
PH A
...

user output
ST X
ST Y
ST A
PH A
PH A
...

Test 17

Verdict:

input
133

correct output
ST X
PH X
PH X
AD
PL A
...

user output
ST X
ZE Y
ST A
PH A
PH A
...

Test 18

Verdict:

input
128

correct output
ST X
PH X
PH X
AD
PL A
...

user output
ZE X
ZE Y
ST A
PH A
PH A
...

Test 19

Verdict: ACCEPTED

input
15

correct output
ST X
PH X
PH X
AD
PL A
...

user output
ST X
ZE Y
ST A
PH A
PH A
...

Test 20

Verdict: ACCEPTED

input
0

correct output
ZE A
DI A

user output
ZE X
ZE Y
ST A
PH A
PH A
...