QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#293736 | #3999. BpbBppbpBB | rageOfThunder# | AC ✓ | 38ms | 4624kb | C++14 | 2.1kb | 2023-12-29 17:20:56 | 2023-12-29 17:20:56 |
Judging History
answer
// MagicDark
#include <bits/stdc++.h>
#define debug cerr << "[" << __LINE__ << "] "
#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> inline void chkmax(T& x, T y) {x = max(x, y);}
template <typename T> inline void chkmin(T& x, T y) {x = min(x, y);}
template <typename T> inline void 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);
x *= f;
}
const int N = 1010;
int n, m, s, ss;
string t[N];
string st[] = {
"##########",
"##########",
"##########",
"####..####",
"###....###",
"###....###",
"####..####",
"##########",
"##########",
"##########"
};
signed main() {
cin.tie(0) -> sync_with_stdio(0); // don't use puts
cin >> n >> m;
F(i, 1, n) {
cin >> t[i];
t[i] = ' ' + t[i];
s += count(all(t[i]), '#');
}
F(i, 1, n - 9)
F(j, 1, m - 9) {
bool flag = true;
F(a, 0, 9)
F(b, 0, 9)
if (t[i + a][j + b] != st[a][b]) {
flag = false;
break;
}
ss += flag;
// if (flag) debug << i << " " << j << endl;
}
// F(i, 2, n - 3)
// F(j, 2, m - 3)
// if (t[i][j] == '#' && t[i][j + 1] == '.' && t[i + 1][j] == '.' && t[i - 1][j - 1] == '#' && t[i - 1][j] == '#' && t[i][j - 1] == '#' && t[i + 1][j + 1] == '.' && t[i - 1][j + 1] == '#' && t[i + 1][j - 1] == '#' && t[i + 3][j] == '#' && t[i + 3][j + 1] == '.' && t[i + 2][j - 1] == '#' && t[i + 3][j - 1] == '#' && t[i + 2][j] == '.' && t[i + 2][j + 1] == '.') ss++;
debug << s << " " << ss << endl;
int a = (ss * 100 - s) / 54;
// debug << s - ss * 50 << endl;
int b = ss - 2 * a;
cout << a << ' ' << b;
// F(i, 0, 1e6)
// F(j, 0, 1e6)
// if (i * 146 + j * 100 == s) {
// cout << i << " " << j;
// return 0;
// }
return 0;
}
/* why?
*/
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3468kb
input:
10 17 ################# ################# ################# ####..#####..#### ###....###....### ###....###....### ####..#####..#### ################# ################# #################
output:
1 0
result:
ok single line: '1 0'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3452kb
input:
14 11 .########## .########## .########## .####..#### .###....### .###....### .####..#### .########## .########## .########## .###....... .###....... .###....... .###.......
output:
0 1
result:
ok single line: '0 1'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3464kb
input:
20 14 .##########... .##########... .##########... .####..####... .###....###... .###....###... .####..####... .##########... .##########... .##########... .############# .############# .############# .#######..#### ....###....### ....###....### ....####..#### ############## ############## #########...
output:
0 2
result:
ok single line: '0 2'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3516kb
input:
1 1 .
output:
0 0
result:
ok single line: '0 0'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3468kb
input:
50 50 .................................................. .................................................. .................................................. .................................................. .................................................. ..........................................
output:
4 1
result:
ok single line: '4 1'
Test #6:
score: 0
Accepted
time: 1ms
memory: 3516kb
input:
50 50 .................................................. .................................................. .................................................. .................................................. .................................................. ..........................................
output:
3 7
result:
ok single line: '3 7'
Test #7:
score: 0
Accepted
time: 37ms
memory: 4504kb
input:
1000 1000 ...................###.......................................................##########................##########.###.............................................................##############.............................#################..............................#################........
output:
1621 2804
result:
ok single line: '1621 2804'
Test #8:
score: 0
Accepted
time: 34ms
memory: 4504kb
input:
1000 1000 .....##############.....................................................................................##############.....................................##############...................................##########...................................................................#########...
output:
0 5024
result:
ok single line: '0 5024'
Test #9:
score: 0
Accepted
time: 34ms
memory: 4540kb
input:
1000 1000 .....................................................................................................................................................................................................................................................#################...............................
output:
3629 0
result:
ok single line: '3629 0'
Test #10:
score: 0
Accepted
time: 38ms
memory: 4548kb
input:
1000 1000 ........................................##########...............................................................................##########..........................................................................................................................................................
output:
944 3746
result:
ok single line: '944 3746'
Test #11:
score: 0
Accepted
time: 32ms
memory: 4512kb
input:
1000 1000 ...................................................................................#################........##############......................................................................................................................................................##############.......
output:
2305 1903
result:
ok single line: '2305 1903'
Test #12:
score: 0
Accepted
time: 14ms
memory: 4504kb
input:
1000 1000 ...........................................................................................................................................................##########................................................................................................................................
output:
258 523
result:
ok single line: '258 523'
Test #13:
score: 0
Accepted
time: 14ms
memory: 4624kb
input:
1000 1000 .....................................................................................................................................................................................................................................................................................................
output:
539 235
result:
ok single line: '539 235'
Test #14:
score: 0
Accepted
time: 12ms
memory: 4580kb
input:
1000 1000 .....................................................................................................................................................................................................................................................................................................
output:
0 1
result:
ok single line: '0 1'
Test #15:
score: 0
Accepted
time: 8ms
memory: 4504kb
input:
1000 1000 .....................................................................................................................................................................................................................................................................................................
output:
1 0
result:
ok single line: '1 0'
Test #16:
score: 0
Accepted
time: 3ms
memory: 3624kb
input:
100 1000 ###################################################################################################################################################################################################################################################################################################...
output:
500 0
result:
ok single line: '500 0'
Test #17:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
100 1000 ###################################################################################################################################################################################################################################################################################################...
output:
580 0
result:
ok single line: '580 0'
Test #18:
score: 0
Accepted
time: 2ms
memory: 3560kb
input:
100 1000 ###################################################################################################################################################################################################################################################################################################...
output:
0 700
result:
ok single line: '0 700'
Test #19:
score: 0
Accepted
time: 3ms
memory: 3692kb
input:
100 1000 ###################################################################################################################################################################################################################################################################################################...
output:
0 710
result:
ok single line: '0 710'
Test #20:
score: 0
Accepted
time: 3ms
memory: 3580kb
input:
100 1000 ###################################################################################################################################################################################################################################################################################################...
output:
0 700
result:
ok single line: '0 700'
Test #21:
score: 0
Accepted
time: 3ms
memory: 3572kb
input:
100 1000 ##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....
output:
0 710
result:
ok single line: '0 710'
Test #22:
score: 0
Accepted
time: 3ms
memory: 3652kb
input:
100 1000 ###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......#...
output:
0 700
result:
ok single line: '0 700'
Test #23:
score: 0
Accepted
time: 2ms
memory: 3576kb
input:
100 1000 ###################################################################################################################################################################################################################################################################################################...
output:
0 710
result:
ok single line: '0 710'
Test #24:
score: 0
Accepted
time: 3ms
memory: 3632kb
input:
100 1000 .......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###....
output:
0 700
result:
ok single line: '0 700'
Test #25:
score: 0
Accepted
time: 2ms
memory: 3652kb
input:
100 1000 ....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....#######...
output:
0 710
result:
ok single line: '0 710'
Test #26:
score: 0
Accepted
time: 15ms
memory: 4500kb
input:
1000 1000 ##########..##########..##########..##########..##########..##########..##########..##########..##########..##########..##########..##########..##########..##########..##########..##########..##########..##########..##########..##########..##########..##########..##########..##########..##...
output:
4316 0
result:
ok single line: '4316 0'
Test #27:
score: 0
Accepted
time: 18ms
memory: 4540kb
input:
1000 1000 ##############..##############..##############..##############..##############..##############..##############..##############..##############..##############..##############..##############..##############..##############..##############..##############..##############..##############..##...
output:
0 5146
result:
ok single line: '0 5146'
Test #28:
score: 0
Accepted
time: 26ms
memory: 4548kb
input:
1000 1000 ##################################################################################################################################################################################################################################################################################################...
output:
5800 0
result:
ok single line: '5800 0'
Test #29:
score: 0
Accepted
time: 22ms
memory: 4584kb
input:
1000 1000 ##################################################################################################################################################################################################################################################################################################...
output:
5800 0
result:
ok single line: '5800 0'
Test #30:
score: 0
Accepted
time: 18ms
memory: 4548kb
input:
1000 1000 ##################################################################################################################################################################################################################################################################################################...
output:
0 7100
result:
ok single line: '0 7100'
Test #31:
score: 0
Accepted
time: 21ms
memory: 4580kb
input:
1000 1000 ##################################################################################################################################################################################################################################################################################################...
output:
0 7100
result:
ok single line: '0 7100'
Test #32:
score: 0
Accepted
time: 23ms
memory: 4500kb
input:
1000 1000 ##################################################################################################################################################################################################################################################################################################...
output:
0 7100
result:
ok single line: '0 7100'
Test #33:
score: 0
Accepted
time: 21ms
memory: 4516kb
input:
1000 1000 ##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########...
output:
0 7100
result:
ok single line: '0 7100'
Test #34:
score: 0
Accepted
time: 16ms
memory: 4556kb
input:
1000 1000 ###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###..........
output:
0 7100
result:
ok single line: '0 7100'
Test #35:
score: 0
Accepted
time: 21ms
memory: 4560kb
input:
1000 1000 ##################################################################################################################################################################################################################################################################################################...
output:
0 7100
result:
ok single line: '0 7100'
Test #36:
score: 0
Accepted
time: 22ms
memory: 4508kb
input:
1000 1000 .......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###.......###...
output:
0 7100
result:
ok single line: '0 7100'
Test #37:
score: 0
Accepted
time: 26ms
memory: 4620kb
input:
1000 1000 ....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....##########....######...
output:
0 7100
result:
ok single line: '0 7100'