QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#644557#6418. Ah, It's Yesterday Once Morerush-from-behind#WA 0ms3620kbC++231.6kb2024-10-16 14:35:402024-10-16 14:35:42

Judging History

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

  • [2024-10-16 14:35:42]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3620kb
  • [2024-10-16 14:35:40]
  • 提交

answer

// MagicDark
#include <bits/stdc++.h>
#define debug cerr << "\33[32m[" << __LINE__ << "]\33[m "
#define SZ(x) ((int) x.size() - 1)
#define all(x) x.begin(), x.end()
#define ms(x, y) memset(x, y, sizeof x)
#define F(i, x, y) for (int i = (x); i <= (y); i++)
#define DF(i, x, y) for (int i = (x); i >= (y); i--)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
template <typename T> T& chkmax(T& x, T y) {return x = max(x, y);}
template <typename T> T& chkmin(T& x, T y) {return x = min(x, y);}
template <typename T> T& read(T &x) {
	x = 0; int f = 1; char c = getchar();
	for (; !isdigit(c); c = getchar()) if (c == '-') f = - f;
	for (; isdigit(c); c = getchar()) x = (x << 1) + (x << 3) + (c ^ 48);
	return x *= f;
}
const int dx[4] = {0, 1, 0, - 1};
const int dy[4] = {1, 0, -1, 0};
bool st[25][25];
signed main() {
	cout << 20 << ' ' << 20 << '\n';
	F(i, 1, 20)
		F(j, 1, 20)
			st[i][j] = 0;
	int cur = 0;
	int tx = 1, ty = 1;
	bool flag = false;
	while (true) {
		if (tx + dx[cur] * 2 >= 1 && ty + dy[cur] * 2 >= 1 && st[tx + dx[cur] * 2][ty + dy[cur] * 2] == 1) {
			cur = (cur + 1) % 4;
			if (flag) break;
			flag = true;
			continue;
		}
		// debug << tx << " " << ty << " " << cur << endl;
		if (st[tx][ty]) break;
		flag = false;
		st[tx][ty] = 1;
		if (tx + dx[cur] > 20 || tx + dx[cur] < 1 || ty + dy[cur] < 1 || ty + dy[cur] > 20) {
			cur = (cur + 1) % 4;
		}
		tx += dx[cur], ty += dy[cur];
		flag = false;
	}
	st[11][10] = 0;
	F(i, 1, 20) {
		F(j, 1, 20)
			cout << st[i][j];
		cout << '\n';
	}
	return 0;
}
/* why?
*/

詳細信息

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3620kb

input:



output:

20 20
11111111111111111111
00000000000000000001
11111111111111111101
10000000000000000101
10111111111111110101
10100000000000010101
10101111111111010101
10101000000001010101
10101011111101010101
10101010000101010101
10101010100101010101
10101010111101010101
10101010000001010101
10101011111111010101
...

result:

wrong answer 86 successful hack.