Submission #62076579


Source Code Expand

Copy
#include<cstdio>
#include<algorithm>
int n,m;
char c[1005];
char s[1005][1005];
int ll=1e9,rr,uu=1e9,dd;
int main(){
scanf("%d%d",&n,&m);
for(int i=1;i<=n;i++){
scanf("%s",c+1);
for(int j=1;j<=m;j++){
s[i][j]=c[j];
if(c[j]=='#')ll=std::min(ll,j),rr=std::max(rr,j),uu=std::min(uu,i),dd=std::max(dd,i);
}
}
for(int i=uu;i<=dd;i++)for(int j=ll;j<=rr;j++)if(s[i][j]=='.')return puts("No"),0;
puts("Yes");
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include<cstdio>
#include<algorithm>
int n,m;
char c[1005];
char s[1005][1005];
int ll=1e9,rr,uu=1e9,dd;
int main(){
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++){
        scanf("%s",c+1);
        for(int j=1;j<=m;j++){
            s[i][j]=c[j];
            if(c[j]=='#')ll=std::min(ll,j),rr=std::max(rr,j),uu=std::min(uu,i),dd=std::max(dd,i);
        }
    }
    for(int i=uu;i<=dd;i++)for(int j=ll;j<=rr;j++)if(s[i][j]=='.')return puts("No"),0;
    puts("Yes");
}

Submission Info

Submission Time
Task C - Paint to make a rectangle
User D0000
Language C++ 20 (gcc 12.2)
Score 300
Code Size 487 Byte
Status AC
Exec Time 7 ms
Memory 2628 KB

Compile Error

Main.cpp: In function ‘int main()’:
Main.cpp:8:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |     scanf("%d%d",&n,&m);
      |     ~~~~~^~~~~~~~~~~~~~
Main.cpp:10:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |         scanf("%s",c+1);
      |         ~~~~~^~~~~~~~~~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 41
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 0 ms 1624 KB
example_01.txt AC 0 ms 1608 KB
example_02.txt AC 0 ms 1604 KB
hand_00.txt AC 4 ms 2572 KB
hand_01.txt AC 4 ms 2516 KB
hand_02.txt AC 4 ms 2424 KB
hand_03.txt AC 4 ms 2564 KB
hand_04.txt AC 4 ms 2544 KB
hand_05.txt AC 0 ms 1588 KB
hand_06.txt AC 0 ms 1596 KB
hand_07.txt AC 0 ms 1620 KB
hand_08.txt AC 1 ms 2576 KB
hand_09.txt AC 4 ms 2544 KB
hand_10.txt AC 4 ms 2628 KB
hand_11.txt AC 4 ms 2548 KB
hand_12.txt AC 4 ms 2524 KB
random_00.txt AC 5 ms 2532 KB
random_01.txt AC 6 ms 2452 KB
random_02.txt AC 3 ms 2340 KB
random_03.txt AC 6 ms 2628 KB
random_04.txt AC 7 ms 2612 KB
random_05.txt AC 3 ms 2544 KB
random_06.txt AC 4 ms 2572 KB
random_07.txt AC 4 ms 2480 KB
random_08.txt AC 3 ms 2500 KB
random_09.txt AC 3 ms 2340 KB
random_10.txt AC 4 ms 2420 KB
random_11.txt AC 4 ms 2416 KB
random_12.txt AC 3 ms 2528 KB
random_13.txt AC 4 ms 2452 KB
random_14.txt AC 3 ms 2532 KB
random_15.txt AC 4 ms 2508 KB
random_16.txt AC 4 ms 2464 KB
random_17.txt AC 3 ms 2436 KB
random_18.txt AC 3 ms 2480 KB
random_19.txt AC 4 ms 2528 KB
random_20.txt AC 3 ms 2544 KB
random_21.txt AC 3 ms 2552 KB
random_22.txt AC 4 ms 2608 KB
random_23.txt AC 3 ms 2532 KB
random_24.txt AC 4 ms 2544 KB


2025-02-27 (Thu)
22:37:47 +00:00