QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#73391#4820. Kitten's ComputerJerryTclCompile Error//C++145.6kb2023-01-24 23:38:262023-01-24 23:38:27

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-01-24 23:38:27]
  • 评测
  • [2023-01-24 23:38:26]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
const int W = 64;
typedef int Rg;
#define fi first
#define se second
int s[600], t;
int New() { return s[t--]; }
void Del(int x) { s[++t] = x; }
void Set(Rg out, Rg in) { printf("SET %d %d\n", out, in); }
void Xor(Rg out, Rg in0, Rg in1) { printf("XOR %d %d %d\n", out, in0, in1); }
void And(Rg out, Rg in0, Rg in1) { printf("AND %d %d %d\n", out, in0, in1); }
void Or(Rg out, Rg in0, Rg in1) { printf("OR %d %d %d\n", out, in0, in1); }
void Lsh(Rg out, int k) { printf("LSH %d %d\n", out, k); }
void Rsh(Rg out, int k) { printf("RSH %d %d\n", out, k); }
void Get(Rg in, int k) { Lsh(in, W - k - 1), Rsh(in, W - 1); }
void Fill(Rg in, Rg h[3]) {
	const Rg h0 = h[0], h1 = h[1], h2 = h[2];
	Set(h0, in), Set(h1, in), Set(h2, in);
	Lsh(h0, 1), Lsh(h1, 2), Lsh(h2, 3);
	Or(in, in, h0), Or(h1, h1, h2), Or(in, in, h1);
	Set(h0, in), Set(h1, in), Set(h2, in);
	Lsh(h0, 4), Lsh(h1, 8), Lsh(h2, 12);
	Or(in, in, h0), Or(h1, h1, h2), Or(in, in, h1);
	Set(h0, in), Set(h1, in), Set(h2, in);
	Lsh(h0, 16), Lsh(h1, 32), Lsh(h2, 48);
	Or(in, in, h0), Or(h1, h1, h2), Or(in, in, h1);
}
void Add(Rg in0, Rg in1, Rg out, Rg h[128]) {
	Rg *const h0 = h, *const h1 = h + 64;
	h0[0] = out, And(h0[0], in0, in1), Xor(h1[0], in0, in1);
	for(int i = 1; i < W - 1; ++i) Set(h0[i], h0[0]), Lsh(h0[i], i + 1);
	for(int i = 1; i < W - 1; ++i) Set(h1[i], h1[0]), Lsh(h1[i], i + 1);
	Set(h0[W - 1], 3), Set(h1[W - 1], 3);
	Lsh(h0[0], 1), Xor(h0[0], h0[0], h1[0]), Lsh(h1[0], 1);
	for(int l = 1; l < W; l <<= 1)
		for(int i = 0; i < W; i += (l << 1))
			for(int j = l; j < (l << 1); ++j)
				And(h1[i + j], h1[i + l - 1], h1[i + j]);
	for(int i = 1; i < W; ++i) And(h0[i], h0[i], h1[i - 1]);
	for(int l = 1; l < W; l <<= 1)
		for(int i = 0; i < W; i += (l << 1)) Xor(h0[i], h0[i], h0[i + l]);
}
void Add3(Rg in0, Rg in1, Rg in2, Rg h[2]) {
	const Rg h0 = h[0], h1 = h[1];
	Xor(h0, in0, in1), And(h1, in0, in1);
	And(in1, in2, h0), Xor(in1, in1, h1);
	Xor(in0, in2, h0), Lsh(in1, 1);
}
int main() {
	for(int i = 400; i >= 4; --i) Del(i);
	int a[W], b[W], c[W * 3], a0, a1, a2, d;
	for(int i = 0; i < W; ++i) a[i] = New();
	for(int i = 0; i < W; ++i) b[i] = New();
	for(int i = 0; i < W * 3; ++i) c[i] = New();
	// for(int i = 0; i < W; ++i) {
		// Set(a[i], 1), Lsh(a[i], i);
		// Set(b[i], 2), Get(b[i], i);
		// Fill(b[i], c + i * 3);
		// And(a[i], a[i], b[i]);
	// }
	// priority_queue<pair<int, int>> Q;
	// for(int i = 0; i < W; ++i) Q.emplace(0, a[i]);
	// for(int i = 0; i < W - 2; ++i) {
		// a0 = Q.top().se, Q.pop(), a1 = Q.top().se, Q.pop();
		// a2 = Q.top().se, d = Q.top().fi, Q.pop();
		// Add3(a0, a1, a2, c + i * 2);
		// Q.emplace(a0, d + 2), Q.emplace(a2, d + 4);
	// }
	// a0 = Q.top().se, Q.pop(), a1 = Q.top().se, Add(a0, a1, 1, c);
	Set(4, 1), Add(2, 4, 1, c);
	return 0;
}#include <bits/stdc++.h>
using namespace std;
const int W = 64;
typedef int Rg;
#define fi first
#define se second
int s[600], t;
int New() { return s[t--]; }
void Del(int x) { s[++t] = x; }
void Set(Rg out, Rg in) { printf("SET %d %d\n", out, in); }
void Xor(Rg out, Rg in0, Rg in1) { printf("XOR %d %d %d\n", out, in0, in1); }
void And(Rg out, Rg in0, Rg in1) { printf("AND %d %d %d\n", out, in0, in1); }
void Or(Rg out, Rg in0, Rg in1) { printf("OR %d %d %d\n", out, in0, in1); }
void Lsh(Rg out, int k) { printf("LSH %d %d\n", out, k); }
void Rsh(Rg out, int k) { printf("RSH %d %d\n", out, k); }
void Get(Rg in, int k) { Lsh(in, W - k - 1), Rsh(in, W - 1); }
void Fill(Rg in, Rg h[3]) {
	const Rg h0 = h[0], h1 = h[1], h2 = h[2];
	Set(h0, in), Set(h1, in), Set(h2, in);
	Lsh(h0, 1), Lsh(h1, 2), Lsh(h2, 3);
	Or(in, in, h0), Or(h1, h1, h2), Or(in, in, h1);
	Set(h0, in), Set(h1, in), Set(h2, in);
	Lsh(h0, 4), Lsh(h1, 8), Lsh(h2, 12);
	Or(in, in, h0), Or(h1, h1, h2), Or(in, in, h1);
	Set(h0, in), Set(h1, in), Set(h2, in);
	Lsh(h0, 16), Lsh(h1, 32), Lsh(h2, 48);
	Or(in, in, h0), Or(h1, h1, h2), Or(in, in, h1);
}
void Add(Rg in0, Rg in1, Rg out, Rg h[128]) {
	Rg *const h0 = h, *const h1 = h + 64;
	h0[0] = out, And(h0[0], in0, in1), Xor(h1[0], in0, in1);
	for(int i = 1; i < W - 1; ++i) Set(h0[i], h0[0]), Lsh(h0[i], i + 1);
	for(int i = 1; i < W - 1; ++i) Set(h1[i], h1[0]), Lsh(h1[i], i + 1);
	Set(h0[W - 1], 3), Set(h1[W - 1], 3);
	Lsh(h0[0], 1), Xor(h0[0], h0[0], h1[0]), Lsh(h1[0], 1);
	for(int l = 1; l < W; l <<= 1)
		for(int i = 0; i < W; i += (l << 1))
			for(int j = l; j < (l << 1); ++j)
				And(h1[i + j], h1[i + l - 1], h1[i + j]);
	for(int i = 1; i < W; ++i) And(h0[i], h0[i], h1[i - 1]);
	for(int l = 1; l < W; l <<= 1)
		for(int i = 0; i < W; i += (l << 1)) Xor(h0[i], h0[i], h0[i + l]);
}
void Add3(Rg in0, Rg in1, Rg in2, Rg h[2]) {
	const Rg h0 = h[0], h1 = h[1];
	Xor(h0, in0, in1), And(h1, in0, in1);
	And(in1, in2, h0), Xor(in1, in1, h1);
	Xor(in0, in2, h0), Lsh(in1, 1);
}
int main() {
	for(int i = 400; i >= 4; --i) Del(i);
	int a[W], b[W], c[W * 3], a0, a1, a2, d;
	for(int i = 0; i < W; ++i) a[i] = New();
	for(int i = 0; i < W; ++i) b[i] = New();
	for(int i = 0; i < W * 3; ++i) c[i] = New();
	// for(int i = 0; i < W; ++i) {
		// Set(a[i], 1), Lsh(a[i], i);
		// Set(b[i], 2), Get(b[i], i);
		// Fill(b[i], c + i * 3);
		// And(a[i], a[i], b[i]);
	// }
	// priority_queue<pair<int, int>> Q;
	// for(int i = 0; i < W; ++i) Q.emplace(0, a[i]);
	// for(int i = 0; i < W - 2; ++i) {
		// a0 = Q.top().se, Q.pop(), a1 = Q.top().se, Q.pop();
		// a2 = Q.top().se, d = Q.top().fi, Q.pop();
		// Add3(a0, a1, a2, c + i * 2);
		// Q.emplace(a0, d + 2), Q.emplace(a2, d + 4);
	// }
	// a0 = Q.top().se, Q.pop(), a1 = Q.top().se, Add(a0, a1, 1, c);
	Set(4, 1), Add(2, 4, 1, c);
	return 0;
}

详细

answer.code:73:2: error: stray ‘#’ in program
   73 | }#include <bits/stdc++.h>
      |  ^
answer.code:73:3: error: ‘include’ does not name a type
   73 | }#include <bits/stdc++.h>
      |   ^~~~~~~
answer.code:75:11: error: redefinition of ‘const int W’
   75 | const int W = 64;
      |           ^
answer.code:3:11: note: ‘const int W’ previously defined here
    3 | const int W = 64;
      |           ^
answer.code:79:5: error: redefinition of ‘int s [600]’
   79 | int s[600], t;
      |     ^
answer.code:7:5: note: ‘int s [600]’ previously declared here
    7 | int s[600], t;
      |     ^
answer.code:79:13: error: redefinition of ‘int t’
   79 | int s[600], t;
      |             ^
answer.code:7:13: note: ‘int t’ previously declared here
    7 | int s[600], t;
      |             ^
answer.code:80:5: error: redefinition of ‘int New()’
   80 | int New() { return s[t--]; }
      |     ^~~
answer.code:8:5: note: ‘int New()’ previously defined here
    8 | int New() { return s[t--]; }
      |     ^~~
answer.code:81:6: error: redefinition of ‘void Del(int)’
   81 | void Del(int x) { s[++t] = x; }
      |      ^~~
answer.code:9:6: note: ‘void Del(int)’ previously defined here
    9 | void Del(int x) { s[++t] = x; }
      |      ^~~
answer.code:82:6: error: redefinition of ‘void Set(Rg, Rg)’
   82 | void Set(Rg out, Rg in) { printf("SET %d %d\n", out, in); }
      |      ^~~
answer.code:10:6: note: ‘void Set(Rg, Rg)’ previously defined here
   10 | void Set(Rg out, Rg in) { printf("SET %d %d\n", out, in); }
      |      ^~~
answer.code:83:6: error: redefinition of ‘void Xor(Rg, Rg, Rg)’
   83 | void Xor(Rg out, Rg in0, Rg in1) { printf("XOR %d %d %d\n", out, in0, in1); }
      |      ^~~
answer.code:11:6: note: ‘void Xor(Rg, Rg, Rg)’ previously defined here
   11 | void Xor(Rg out, Rg in0, Rg in1) { printf("XOR %d %d %d\n", out, in0, in1); }
      |      ^~~
answer.code:84:6: error: redefinition of ‘void And(Rg, Rg, Rg)’
   84 | void And(Rg out, Rg in0, Rg in1) { printf("AND %d %d %d\n", out, in0, in1); }
      |      ^~~
answer.code:12:6: note: ‘void And(Rg, Rg, Rg)’ previously defined here
   12 | void And(Rg out, Rg in0, Rg in1) { printf("AND %d %d %d\n", out, in0, in1); }
      |      ^~~
answer.code:85:6: error: redefinition of ‘void Or(Rg, Rg, Rg)’
   85 | void Or(Rg out, Rg in0, Rg in1) { printf("OR %d %d %d\n", out, in0, in1); }
      |      ^~
answer.code:13:6: note: ‘void Or(Rg, Rg, Rg)’ previously defined here
   13 | void Or(Rg out, Rg in0, Rg in1) { printf("OR %d %d %d\n", out, in0, in1); }
      |      ^~
answer.code:86:6: error: redefinition of ‘void Lsh(Rg, int)’
   86 | void Lsh(Rg out, int k) { printf("LSH %d %d\n", out, k); }
      |      ^~~
answer.code:14:6: note: ‘void Lsh(Rg, int)’ previously defined here
   14 | void Lsh(Rg out, int k) { printf("LSH %d %d\n", out, k); }
      |      ^~~
answer.code:87:6: error: redefinition of ‘void Rsh(Rg, int)’
   87 | void Rsh(Rg out, int k) { printf("RSH %d %d\n", out, k); }
      |      ^~~
answer.code:15:6: note: ‘void Rsh(Rg, int)’ previously defined here
   15 | void Rsh(Rg out, int k) { printf("RSH %d %d\n", out, k); }
      |      ^~~
answer.code:88:6: error: redefinition of ‘void Get(Rg, int)’
   88 | void Get(Rg in, int k) { Lsh(in, W - k - 1), Rsh(in, W - 1); }
      |      ^~~
answer.code:16:6: note: ‘void Get(Rg, int)’ previously defined here
   16 | void Get(Rg in, int k) { Lsh(in, W - k - 1), Rsh(in, W - 1); }
      |      ^~~
answer.code:89:6: error: redefinition of ‘void Fill(Rg, Rg*)’
   89 | void Fill(Rg in, Rg h[3]) {
      |      ^~~~
answer.code:17:6: note: ‘void Fill(Rg, Rg*)’ previously defined here
   17 | void Fill(Rg in, Rg h[3]) {
      |      ^~~~
answer.code:101:6: error: redefinition of ‘void Add(Rg, Rg, Rg, Rg*)’
  101 | void Add(Rg in0, Rg in1, Rg out, Rg h[128]) {
      |      ^~~
answer.code:29:6: note: ‘void Add(Rg, Rg, Rg, Rg*)’ previously defined here
   29 | void Add(Rg in0, Rg in1, Rg out, Rg h[128]) {
      |      ^~~
answer.code:116:6: error: redefinition of ‘void Add3(Rg, Rg, Rg, Rg*)’
  116 | void Add3(Rg in0, Rg in1, Rg in2, Rg h[2]) {
      |      ^~~~
answer.code:44:6: note: ‘void Add3(Rg, Rg, Rg, Rg*)’ previously defined here
   44 | void Add3(Rg in0, Rg in1, Rg in2, Rg h[2]) {
      |      ^~~~
answer.code:122:5: error: redefinition of ‘int main()’
  122 | int main() {
      |     ^~~~
answer.code:50:5: note: ‘int main()’ previously defined here
   50 | int main() {
      |     ^~~~