Submission #62073880
Source Code Expand
Copy
#include<bits/stdc++.h>#define ll long long#define ss second#define ff first#define pb push_back#define mod 1000000007#define endl "\n"using namespace std;ll n,m,a[1005],mx,my,ix=99999999999,iy=999999999999;char c[1005][1005];int main(){ios::sync_with_stdio(false);cout.tie(0);cin.tie(0);cin>>n>>m;for (ll i=1; i<=n; i++){for (ll j=1; j<=m; j++){cin>>c[i][j];if (c[i][j]=='#') {mx=max(mx,i); my=max(my,j); ix=min(ix,i); iy=min(iy,j);}}
#include<bits/stdc++.h> #define ll long long #define ss second #define ff first #define pb push_back #define mod 1000000007 #define endl "\n" using namespace std; ll n,m,a[1005],mx,my,ix=99999999999,iy=999999999999; char c[1005][1005]; int main(){ ios::sync_with_stdio(false); cout.tie(0); cin.tie(0); cin>>n>>m; for (ll i=1; i<=n; i++) { for (ll j=1; j<=m; j++) {cin>>c[i][j]; if (c[i][j]=='#') {mx=max(mx,i); my=max(my,j); ix=min(ix,i); iy=min(iy,j);} } } for(int i=ix; i<=mx; i++) { for(int j=iy; j<=my; j++) {if (c[i][j]=='.') {cout<<"No"; exit(0);} } } cout<<"Yes"; }
Submission Info
Submission Time | |
---|---|
Task | C - Paint to make a rectangle |
User | Tegshzaya |
Language | C++ 20 (gcc 12.2) |
Score | 300 |
Code Size | 703 Byte |
Status | AC |
Exec Time | 16 ms |
Memory | 4588 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | example_00.txt, example_01.txt, example_02.txt |
All | example_00.txt, example_01.txt, example_02.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, hand_08.txt, hand_09.txt, hand_10.txt, hand_11.txt, hand_12.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_20.txt, random_21.txt, random_22.txt, random_23.txt, random_24.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
example_00.txt | AC | 1 ms | 3416 KB |
example_01.txt | AC | 1 ms | 3440 KB |
example_02.txt | AC | 1 ms | 3440 KB |
hand_00.txt | AC | 10 ms | 4420 KB |
hand_01.txt | AC | 8 ms | 4360 KB |
hand_02.txt | AC | 8 ms | 4392 KB |
hand_03.txt | AC | 9 ms | 4556 KB |
hand_04.txt | AC | 8 ms | 4472 KB |
hand_05.txt | AC | 1 ms | 3412 KB |
hand_06.txt | AC | 1 ms | 3568 KB |
hand_07.txt | AC | 1 ms | 3496 KB |
hand_08.txt | AC | 1 ms | 4464 KB |
hand_09.txt | AC | 9 ms | 4488 KB |
hand_10.txt | AC | 8 ms | 4460 KB |
hand_11.txt | AC | 9 ms | 4556 KB |
hand_12.txt | AC | 9 ms | 4488 KB |
random_00.txt | AC | 11 ms | 4392 KB |
random_01.txt | AC | 14 ms | 4400 KB |
random_02.txt | AC | 8 ms | 4408 KB |
random_03.txt | AC | 14 ms | 4392 KB |
random_04.txt | AC | 16 ms | 4476 KB |
random_05.txt | AC | 8 ms | 4440 KB |
random_06.txt | AC | 8 ms | 4552 KB |
random_07.txt | AC | 8 ms | 4308 KB |
random_08.txt | AC | 8 ms | 4472 KB |
random_09.txt | AC | 7 ms | 4472 KB |
random_10.txt | AC | 8 ms | 4412 KB |
random_11.txt | AC | 9 ms | 4476 KB |
random_12.txt | AC | 8 ms | 4296 KB |
random_13.txt | AC | 9 ms | 4356 KB |
random_14.txt | AC | 8 ms | 4456 KB |
random_15.txt | AC | 8 ms | 4360 KB |
random_16.txt | AC | 9 ms | 4408 KB |
random_17.txt | AC | 8 ms | 4300 KB |
random_18.txt | AC | 7 ms | 4416 KB |
random_19.txt | AC | 9 ms | 4480 KB |
random_20.txt | AC | 8 ms | 4524 KB |
random_21.txt | AC | 8 ms | 4420 KB |
random_22.txt | AC | 9 ms | 4464 KB |
random_23.txt | AC | 8 ms | 4372 KB |
random_24.txt | AC | 8 ms | 4588 KB |