Submission #62047112
Source Code Expand
Copy
#include<bits/stdc++.h>#define ll long long#define ld long double#define pb push_back#define gcd __gcd#define MOD 998244353#define MOD2 1000000007#define inti __int128_t#define lset 63-__builtin_clzll#define fset __builtin_ctzll#define stcnt __builtin_popcountll#define pll pair<ll,ll>using namespace std;int main(){ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#include<bits/stdc++.h> #define ll long long #define ld long double #define pb push_back #define gcd __gcd #define MOD 998244353 #define MOD2 1000000007 #define inti __int128_t #define lset 63-__builtin_clzll #define fset __builtin_ctzll #define stcnt __builtin_popcountll #define pll pair<ll,ll> using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); ll t; t=1; while(t--){ ll n,m; cin>>n>>m; vector<string>arr(n); for(ll i=0;i<n;i++){ cin>>arr[i]; } ll l = 1e15; ll r= -1; ll t= 1e15;; ll b = -1; for(ll i=0;i<n;i++){ for(ll j=0;j<m;j++){ if(arr[i][j]=='#'){ l=min(l,i); t=min(t,j); b=max(b,j); r=max(r,i); } } } if(r==-1){ cout<<"Yes"<<endl; continue; }else{ bool sam = true; for(ll i=l;i<=r;i++){ for(ll j=t;j<=b;j++){ if(arr[i][j]=='.'){ sam=false; } } } if(sam)cout<<"Yes"<<endl; else cout<<"No"<<endl; } } }
Submission Info
Submission Time | |
---|---|
Task | C - Paint to make a rectangle |
User | MayankBhakat |
Language | C++ 20 (gcc 12.2) |
Score | 300 |
Code Size | 1254 Byte |
Status | AC |
Exec Time | 7 ms |
Memory | 4592 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 | 3476 KB |
example_01.txt | AC | 1 ms | 3424 KB |
example_02.txt | AC | 1 ms | 3364 KB |
hand_00.txt | AC | 4 ms | 4476 KB |
hand_01.txt | AC | 3 ms | 4536 KB |
hand_02.txt | AC | 3 ms | 4464 KB |
hand_03.txt | AC | 4 ms | 4592 KB |
hand_04.txt | AC | 3 ms | 4468 KB |
hand_05.txt | AC | 1 ms | 3428 KB |
hand_06.txt | AC | 1 ms | 3492 KB |
hand_07.txt | AC | 1 ms | 3432 KB |
hand_08.txt | AC | 1 ms | 3548 KB |
hand_09.txt | AC | 3 ms | 4336 KB |
hand_10.txt | AC | 3 ms | 4592 KB |
hand_11.txt | AC | 4 ms | 4400 KB |
hand_12.txt | AC | 4 ms | 4384 KB |
random_00.txt | AC | 4 ms | 4404 KB |
random_01.txt | AC | 6 ms | 4444 KB |
random_02.txt | AC | 3 ms | 4240 KB |
random_03.txt | AC | 6 ms | 4324 KB |
random_04.txt | AC | 7 ms | 4448 KB |
random_05.txt | AC | 3 ms | 4472 KB |
random_06.txt | AC | 3 ms | 4436 KB |
random_07.txt | AC | 3 ms | 4476 KB |
random_08.txt | AC | 3 ms | 4468 KB |
random_09.txt | AC | 3 ms | 4348 KB |
random_10.txt | AC | 3 ms | 4428 KB |
random_11.txt | AC | 3 ms | 4428 KB |
random_12.txt | AC | 3 ms | 4532 KB |
random_13.txt | AC | 4 ms | 4452 KB |
random_14.txt | AC | 3 ms | 4424 KB |
random_15.txt | AC | 3 ms | 4492 KB |
random_16.txt | AC | 4 ms | 4388 KB |
random_17.txt | AC | 3 ms | 4376 KB |
random_18.txt | AC | 3 ms | 4324 KB |
random_19.txt | AC | 4 ms | 4572 KB |
random_20.txt | AC | 3 ms | 4460 KB |
random_21.txt | AC | 3 ms | 4532 KB |
random_22.txt | AC | 4 ms | 4368 KB |
random_23.txt | AC | 3 ms | 4428 KB |
random_24.txt | AC | 3 ms | 4436 KB |