QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#453630 | #2880. Letters Q and F | em4ma2 | AC ✓ | 1ms | 3800kb | C++14 | 1.6kb | 2024-06-24 02:55:32 | 2024-06-24 02:55:33 |
Judging History
answer
// بسم الله الرحمن الرحيم
#include "bits/stdc++.h"
using namespace std;
#define ll long long
#define int long long
#define pb push_back
#define pob pop_back
//#define pb push
#define endl '\n'
#define ld long double
/*
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops,avx,avx2,ssse3,tune-native")
*/
#define applejuice ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
const ll mod=1e9+7;
const ll inf=1e18;
const ll mxsz=304;
const double pi=acos(-1.0);
char a[mxsz][mxsz];
void res(int i,int j,char c){
if (c=='f'){
a[i][j]='.';
a[i][j+1]='.';
a[i][j+2]='.';
a[i+1][j]='.';
a[i+2][j]='.';
a[i+2][j+1]='.';
a[i+3][j]='.';
a[i+4][j]='.';
}else{
a[i][j]='.';
a[i][j+1]='.';
a[i][j+2]='.';
a[i+1][j]='.';
a[i+1][j+2]='.';
a[i+2][j]='.';
a[i+2][j+1]='.';
a[i+2][j+2]='.';
a[i+3][j+2]='.';
a[i+4][j+2]='.';
}
}
signed main(){
applejuice;
int n,m;
cin>>n>>m;
for (int i=0;i<n;i++){
for (int j=0;j<m;j++){
cin>>a[i][j];
}
}
int ansq=0,ansf=0;
for (int j=0;j<m-2;j++){
for(int i=0;i<n-4;i++){
if (a[i][j]=='#'){
if(a[i+4][j]=='#'){
res(i,j,'f');
ansf++;
}else{
res(i,j,'q');
ansq++;
}
}
}
}
cout<<ansq<<" "<<ansf<<endl;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3672kb
input:
5 3 ### #.# ### ..# ..#
output:
1 0
result:
ok single line: '1 0'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3728kb
input:
5 3 ### #.. ##. #.. #..
output:
0 1
result:
ok single line: '0 1'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
5 8 ###..### #.#..#.. ###..##. ..#..#.. ..#..#..
output:
1 1
result:
ok single line: '1 1'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3664kb
input:
8 8 .....### ###..#.# #.###### ###.#### #.###.## #.#.###. ..#...#. ......#.
output:
2 2
result:
ok single line: '2 2'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3664kb
input:
10 10 ....###... ....#.###. ....###... ....#.##.. ###.#.#### #.###.##.. ###.#..##. #.###..#.. #...#..#.. ....#.....
output:
1 4
result:
ok single line: '1 4'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3600kb
input:
50 50 ###..................###.......###...###.......### #.....###.........####..###....#.....#.####.####.# #####.#...######..#.###.#.###..##....####...#..### #.#...##..#.##....####..###....#.......###..##...# #.##..#...#####.###.##..#.##...#.###...##...#....# ..#####.###.##..#.#.#...#.#......#.####...
output:
66 70
result:
ok single line: '66 70'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3688kb
input:
100 100 ....###..###........######..###..###..........###....................................###...###...... .####....#.#..#######.##.####.#..#.#....###...#....###........###...###..###..###.####.....#.####... .#..##...###..#.##..######.####..###.####.....######..........#..####....#.####...#..##.##...
output:
280 298
result:
ok single line: '280 298'
Test #8:
score: 0
Accepted
time: 1ms
memory: 3776kb
input:
300 300 ...............###.###....###..###....######........###...###..###..###....###..........###..######......###....#########...............###.............###.###..###.###.........###.........###..........###....###.######.......###......###.....###...................###..###.......###............
output:
2472 2694
result:
ok single line: '2472 2694'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
5 298 .############.######..#########.######.###.######.######.######.##################.############.###..###..###..###.###.#####################.###..#########..###..###.###.######..###..###..###.######.###..###..######..###.###.###.######.###.###..######..#########.#########.######.###..###.#####...
output:
41 39
result:
ok single line: '41 39'
Test #10:
score: 0
Accepted
time: 0ms
memory: 3800kb
input:
299 3 ### #.. ##. #.. #.. ... ... ### #.# ### ..# ..# ... ... ... ### #.# ### ..# ..# ... ### #.# ### ..# ..# ### #.# ### ..# ..# ... ### #.. ##. #.. #.. ... ... ... ### #.. ##. #.. #.. ### #.# ### ..# ..# ... ... ### #.. ##. #.. #.. ... ... ### #.# ### ..# ..# ### #.# ### ..# ..# ### #.. ##. #.. #....
output:
26 20
result:
ok single line: '26 20'
Test #11:
score: 0
Accepted
time: 0ms
memory: 3680kb
input:
123 234 .........###....###.###....###....###....###....###.....###.......######...........###..............###.###....###.......###...###......###........###............................###........###.......###....###...###..###..###......... ###..###.#...####.#.#.#....#.#.####.####.#.#....#..###..#...
output:
785 838
result:
ok single line: '785 838'
Test #12:
score: 0
Accepted
time: 0ms
memory: 3788kb
input:
234 123 .###........###.###...........###..######.............###....###...######..######................................###....... .#.#........#.#.#.#.###..###..#....#..#.#.............#.####.#.#...#..#.#..#..#.........###..............###.###.#.#######. .###........###.###.#.####.#####...##.###......
output:
805 836
result:
ok single line: '805 836'
Test #13:
score: 0
Accepted
time: 0ms
memory: 3688kb
input:
5 3 ... ... ... ... ...
output:
0 0
result:
ok single line: '0 0'
Test #14:
score: 0
Accepted
time: 1ms
memory: 3764kb
input:
300 300 .......................................................................................................................................................................................................................................................................................................
output:
0 0
result:
ok single line: '0 0'
Test #15:
score: 0
Accepted
time: 0ms
memory: 3740kb
input:
300 300 ###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###......
output:
8019 0
result:
ok single line: '8019 0'
Test #16:
score: 0
Accepted
time: 1ms
memory: 3684kb
input:
300 300 ###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###........###......
output:
0 8019
result:
ok single line: '0 8019'