QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#671762 | #2880. Letters Q and F | Folity# | WA | 0ms | 3696kb | C++20 | 529b | 2024-10-24 14:21:54 | 2024-10-24 14:21:54 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=305;
int n,m;
string a[N];
bool chk(int i,int j){
return i>=0&&i<n&&j>=0&&j<m&&a[i][j]=='#';
}
int main(){
cin>>n>>m;
for(int i=0;i<n;++i)cin>>a[i];
int cnt=0,sum=0;
for(int i=0;i<n;++i)
for(int j=0;j<m;++j)if(a[i][j]=='#'){
++sum;
if(chk(i,j+1)&&chk(i,j+2)&&chk(i+1,j)&&chk(i+2,j)&&chk(i+2,j+1)&&!chk(i+1,j+1))++cnt;
}
cout<<(sum-8*cnt)/2<<' '<<(10*cnt-sum)/2;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3564kb
input:
5 3 ### #.# ### ..# ..#
output:
1 0
result:
ok single line: '1 0'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
5 3 ### #.. ##. #.. #..
output:
0 1
result:
ok single line: '0 1'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
5 8 ###..### #.#..#.. ###..##. ..#..#.. ..#..#..
output:
1 1
result:
ok single line: '1 1'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3696kb
input:
8 8 .....### ###..#.# #.###### ###.#### #.###.## #.#.###. ..#...#. ......#.
output:
2 2
result:
ok single line: '2 2'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3572kb
input:
10 10 ....###... ....#.###. ....###... ....#.##.. ###.#.#### #.###.##.. ###.#..##. #.###..#.. #...#..#.. ....#.....
output:
1 4
result:
ok single line: '1 4'
Test #6:
score: -100
Wrong Answer
time: 0ms
memory: 3548kb
input:
50 50 ###..................###.......###...###.......### #.....###.........####..###....#.....#.####.####.# #####.#...######..#.###.#.###..##....####...#..### #.#...##..#.##....####..###....#.......###..##...# #.##..#...#####.###.##..#.##...#.###...##...#....# ..#####.###.##..#.#.#...#.#......#.####...
output:
58 80
result:
wrong answer 1st lines differ - expected: '66 70', found: '58 80'