QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#86176#5361. 土豆评测机xiaoyaowudi100 ✓2ms3416kbC++142.2kb2023-03-09 14:51:112023-03-09 14:51:11

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-09 14:51:11]
  • 评测
  • 测评结果:100
  • 用时:2ms
  • 内存:3416kb
  • [2023-03-09 14:51:11]
  • 提交

answer

#include <iostream>
#include <algorithm>
constexpr int p(153353),c(75207);
#define o(x) std::cout<<(x)<<"\n"
int main()
{
	int T;std::cin>>T;
	o("assign i n");
	o("label rp");
	o("calc i i - 1");
	o("read");
	if(T==1)
	{
		o("calc k k ^ x");
		o("assign t i");
		o("cjump rp");
		o("assign result[0] k");
		o("end");
		return 0;
	}
	o("assign k x");
	o("calc k k + 2654435769");
	o("calc t k >> 16");
	o("calc k k ^ t");
	o("calc k k * 2246822507");
	o("calc t x >> 13");
	o("calc k k ^ t");
	o("calc k k * 3266489909");
	o("calc t k >> 16");
	o("calc k k ^ t");
	o("assign q k");
	o("calc k k / 153353");
	o("calc t k == 0");
	o("cjump nm");
	o("calc k k - 1");
	o("label nm");
	o("calc k k * 153353");
	o("calc k k + 75207");
	for(int i(0);i<15;++i)
	{
		o("calc p q * 2246822507");
		o("calc j q >> 13");
		o("calc q q ^ p");
		o("calc q q ^ j");
		o("calc q q + 2654435769");
		o("calc t q & 65536");
		std::cout<<"cjump nins"<<char('A'+i)<<"\n";
		std::cout<<"calc a["<<i<<"] a["<<i<<"] ^ k"<<"\n";
		std::cout<<"calc a["<<i+15<<"] a["<<i+15<<"] ^ x"<<"\n";
		std::cout<<"label nins"<<char('A'+i)<<"\n";
	}
	o("assign t i");
	o("cjump rp");
	o("assign j 0");
	o("assign i 0");
	o("label al");
	o("assign p 0");
	o("assign k 0");
	o("label ca");
	o("calc t i >> k");
	o("calc t t & 1");
	o("calc t t ^ 1");
	o("cjump nadd");
	o("calc p p ^ a[k]");
	o("label nadd");
	o("calc k k + 1");
	o("calc t 15 - k");
	o("cjump ca");
	o("calc t p % 153353");
	o("calc t t - 75207");
	o("cjump nna");
	o("assign p 0");
	o("assign k 0");
	o("label cb");
	o("calc t i >> k");
	o("calc t t & 1");
	o("calc t t ^ 1");
	o("cjump nxor");
	o("calc k k + 15");
	o("calc p p ^ a[k]");
	o("calc k k - 15");
	o("label nxor");
	o("calc k k + 1");
	o("calc t 15 - k");
	o("cjump cb");
	o("assign k 0");
	o("label check");
	o("calc t k == j");
	o("cjump ok");
	o("calc t result[k] == p");
	o("cjump nok");
	o("calc k k + 1");
	o("jump check");
	o("label ok");
	o("calc t j == m");
	o("cjump nok");
	o("assign result[j] p");
	o("calc j j + 1");
	o("label nok");
	o("label nna");
	o("calc i i + 1");
	o("calc t 32768 - i");
	o("cjump al");
	o("end");
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 5
Accepted
time: 2ms
memory: 3268kb

input:

1

output:

assign i n
label rp
calc i i - 1
read
calc k k ^ x
assign t i
cjump rp
assign result[0] k
end

result:

ok AC

Test #2:

score: 10
Accepted
time: 2ms
memory: 3308kb

input:

2

output:

assign i n
label rp
calc i i - 1
read
assign k x
calc k k + 2654435769
calc t k >> 16
calc k k ^ t
calc k k * 2246822507
calc t x >> 13
calc k k ^ t
calc k k * 3266489909
calc t k >> 16
calc k k ^ t
assign q k
calc k k / 153353
calc t k == 0
cjump nm
calc k k - 1
label nm
calc k k * 153353
calc k k ...

result:

ok AC

Test #3:

score: 5
Accepted
time: 2ms
memory: 3264kb

input:

3

output:

assign i n
label rp
calc i i - 1
read
assign k x
calc k k + 2654435769
calc t k >> 16
calc k k ^ t
calc k k * 2246822507
calc t x >> 13
calc k k ^ t
calc k k * 3266489909
calc t k >> 16
calc k k ^ t
assign q k
calc k k / 153353
calc t k == 0
cjump nm
calc k k - 1
label nm
calc k k * 153353
calc k k ...

result:

ok AC

Test #4:

score: 5
Accepted
time: 0ms
memory: 3312kb

input:

4

output:

assign i n
label rp
calc i i - 1
read
assign k x
calc k k + 2654435769
calc t k >> 16
calc k k ^ t
calc k k * 2246822507
calc t x >> 13
calc k k ^ t
calc k k * 3266489909
calc t k >> 16
calc k k ^ t
assign q k
calc k k / 153353
calc t k == 0
cjump nm
calc k k - 1
label nm
calc k k * 153353
calc k k ...

result:

ok AC

Test #5:

score: 15
Accepted
time: 2ms
memory: 3296kb

input:

5

output:

assign i n
label rp
calc i i - 1
read
assign k x
calc k k + 2654435769
calc t k >> 16
calc k k ^ t
calc k k * 2246822507
calc t x >> 13
calc k k ^ t
calc k k * 3266489909
calc t k >> 16
calc k k ^ t
assign q k
calc k k / 153353
calc t k == 0
cjump nm
calc k k - 1
label nm
calc k k * 153353
calc k k ...

result:

ok AC

Test #6:

score: 10
Accepted
time: 2ms
memory: 3416kb

input:

6

output:

assign i n
label rp
calc i i - 1
read
assign k x
calc k k + 2654435769
calc t k >> 16
calc k k ^ t
calc k k * 2246822507
calc t x >> 13
calc k k ^ t
calc k k * 3266489909
calc t k >> 16
calc k k ^ t
assign q k
calc k k / 153353
calc t k == 0
cjump nm
calc k k - 1
label nm
calc k k * 153353
calc k k ...

result:

ok AC

Test #7:

score: 10
Accepted
time: 2ms
memory: 3316kb

input:

7

output:

assign i n
label rp
calc i i - 1
read
assign k x
calc k k + 2654435769
calc t k >> 16
calc k k ^ t
calc k k * 2246822507
calc t x >> 13
calc k k ^ t
calc k k * 3266489909
calc t k >> 16
calc k k ^ t
assign q k
calc k k / 153353
calc t k == 0
cjump nm
calc k k - 1
label nm
calc k k * 153353
calc k k ...

result:

ok AC

Test #8:

score: 40
Accepted
time: 2ms
memory: 3316kb

input:

8

output:

assign i n
label rp
calc i i - 1
read
assign k x
calc k k + 2654435769
calc t k >> 16
calc k k ^ t
calc k k * 2246822507
calc t x >> 13
calc k k ^ t
calc k k * 3266489909
calc t k >> 16
calc k k ^ t
assign q k
calc k k / 153353
calc t k == 0
cjump nm
calc k k - 1
label nm
calc k k * 153353
calc k k ...

result:

points 1.0 max #(cell used) = 30