QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#351898 | #6418. Ah, It's Yesterday Once More | PorNPtree# | WA | 0ms | 3596kb | C++20 | 2.7kb | 2024-03-12 16:55:17 | 2024-03-12 16:55:18 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int n, m, a[25][25];
signed main()
{
puts(R"(20 20
11101110111011101111
10101010101010101010
10101010101010101011
10101010101010101010
10101010101010101011
10101010101010101010
10101010101010101011
10101010101010101010
10101010101010101011
10101010101010101010
10101010101010101011
10101010101010101010
10101010101010101011
10101010101010101010
10101010101010101011
10101010101010101010
10101010101010101011
10101010101010101010
10101010101010101010
10111011101110111011)");
return 0;
scanf("%d%d", &n, &m);
for (int i = 1; i <= n; ++i) {
string s;
cin >> s;
for (int j = 1; j <= m; ++j) {
a[i][j] = (s[j - 1] == '1');
}
}
mt19937 tz(time(0));
int cnt = 0;
for (int T = 0; T < 500; ++T) {
set< pair<int, int> > S, tS;
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= m; ++j) {
if (a[i][j]) {
S.insert(make_pair(i, j));
}
}
}
mt19937 rnd(tz());
for (int i = 0; i < 50000 && S.size() > 1; ++i) {
int t = rnd() % 4;
int tx = (t <= 1 ? 0 : (t == 2 ? 1 : -1));
int ty = (t >= 2 ? 0 : (t == 0 ? 1 : -1));
tS.clear();
for (auto [x, y] : S) {
int zx = x + tx, zy = y + ty;
if (zx >= 1 && zx <= n && zy >= 1 && zy <= n && a[zx][zy]) {
tS.insert({zx, zy});
} else {
tS.insert({x, y});
}
}
S = tS;
}
printf("%d\n", (int)S.size());
cnt += (int)S.size() != 1;
}
printf("%d %.2lf%%\n",cnt, (double)cnt / 5);
return 0;
}
/*
20 20
11101110111011101111
00101010101010101010
11101010101010101011
10001010101010101010
11111010101010101011
00000010101010101010
11111110101010101011
10000000101010101010
11111111101010101011
00000000001010101010
11111111111010101011
10000000000010101010
11111111111110101011
00000000000000101010
11111111111111101011
10000000000000001010
11111111111111111011
00000000000000000010
11111111111111111111
10101010101010101010
20 20
11101110111011101111
00101010101010101010
11101010101010101011
10001010101010101010
11111010101010101011
00000010101010101010
11111110101010101011
10000000101010101010
11111111101010101011
00000000001010101010
11111111111010101011
10000000000010101010
11111111111110101011
00000000000000101010
11111111111111101011
10000000000000001010
11111111111111111011
00000000000000000010
11111111111111111111
10101010101010101010
*/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3596kb
input:
output:
20 20 11101110111011101111 10101010101010101010 10101010101010101011 10101010101010101010 10101010101010101011 10101010101010101010 10101010101010101011 10101010101010101010 10101010101010101011 10101010101010101010 10101010101010101011 10101010101010101010 10101010101010101011 10101010101010101010 ...
result:
wrong answer 99 successful hack.