QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#506374 | #5671. Programmable Virus | UESTC_DECAYALI# | WA | 1ms | 3924kb | C++14 | 2.0kb | 2024-08-05 16:59:26 | 2024-08-05 16:59:26 |
Judging History
answer
#include <bits/stdc++.h>
#define STOP ans.push_back(0);
#define NEXT ans.push_back(1);
#define PREV ans.push_back(2);
#define INC ans.push_back(3);
#define DEC ans.push_back(4);
#define IN ans.push_back(5);
#define OUT ans.push_back(6);
#define BEGIN ans.push_back(7);
#define END ans.push_back(8);
#define TRUE -2
#define FALSE -3
#define INPUT -4
#define STATUS -5
int k;
int mempool[2000001], *mem = mempool + 1000000;
std::vector<int> ans;
int p = 0;
void move(int to) {
while(p > to) p--, PREV
while(p < to) p++, NEXT
}
void set(int val) {
BEGIN INC END
if(val < 0) DEC
else while(val--) INC
}
void fork(std::function<void(int)> callback) {
static int fork_count = 0;
int tp = p;
for(int i = 0; i <= 10; ++i) {
move(tp);
BEGIN;
move(fork_count * 11 + (i == 10 ? -1 : i));
INC;
move(FALSE);
END;
DEC;
}
fork_count += 1;
for(int i = 0; i <= 10; ++i) {
move(fork_count * 11 + (i == 10 ? -1 : i));
DEC;
BEGIN;
callback(i == 10 ? -1 : i);
move(fork_count * 11 + (i == 10 ? -1 : i));
INC;
END;
}
fork_count -= 1;
}
void work() {
move(INPUT);
IN;
fork([&](int input) {
move(STATUS);
fork([&](int status) {
if(input == -1) {
set(status == 0);
OUT;
STOP;
}
move(STATUS);
set((status * 10 + input) % k);
});
});
}
const char *v[10] = {
"CCC",
"ACG",
"UGA",
"UGC",
"UAC",
"GCG",
"UCC",
"AGG",
"UGU",
"CAC",
};
int main() {
std::cin >> k;
move(TRUE);
INC
BEGIN
work();
move(TRUE);
END
for(auto ans: ans) std::cout << v[ans];
std::cout << std::endl;
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3924kb
input:
1
output:
UGAUGAUGCAGGUGAUGAGCGAGGACGACGACGACGUGCUGAUGAUGAUGUUACUGAAGGACGACGACGACGACGUGCUGAUGAUGAUGAUGUUACUGAAGGACGACGACGACGACGACGUGCUGAUGAUGAUGAUGAUGUUACUGAAGGACGACGACGACGACGACGACGUGCUGAUGAUGAUGAUGAUGAUGUUACUGAAGGACGACGACGACGACGACGACGACGUGCUGAUGAUGAUGAUGAUGAUGAUGUUACUGAAGGACGACGACGACGACGACGACGACGACGUGCUGAUGA...
result:
wrong answer step out of bound