Submission #62075856


Source Code Expand

Copy
/*
Start:
End:
Time used:
……
…………
DON'T GET STUCK ON ONE APPROACH!!!
*/
#include <bits/stdc++.h>//
#define re register//
#define rep(i,a,b) for (re int i = (a);i <= (b); ++i)
#define debug(x) cout << #x << '=',print(x),putchar(' ')
#define file(x) freopen(x".in","r",stdin),freopen(x".out","w",stdout)
#define pi pair<int,int>
#define mp(a,b) make_pair(a,b)
typedef long long ll;
using namespace std;//
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
/*
Start: 
End: 
Time used: 
「責任を負う人の話は、あなたと話したことがありますよね」 
「当時の私はまだわからないけど……今は理解できるようになった」 
「大人としての責務。そして、その延長線上にある、あなたの選択」 
「それに代表されるアイデアもあります」 
「だから、先生」 
「信じられる大人のあなたなら、この歪んだ変形の終点とは、違う結果……そこにつながる選択肢……きっとあなたは見つけることができます」
DON'T GET STUCK ON ONE APPROACH!!!
*/
#include <bits/stdc++.h>//喵内~
#define re register//喵内~
#define rep(i,a,b) for (re int i = (a);i <= (b); ++i)
#define debug(x) cout << #x << '=',print(x),putchar(' ')
#define file(x) freopen(x".in","r",stdin),freopen(x".out","w",stdout)
#define pi pair<int,int>
#define mp(a,b) make_pair(a,b)
typedef long long ll;
using namespace std;//喵内~
inline ll read(){
    ll s = 0,f = 1;char c = getchar();
    while (!isdigit(c)){if (c == '-')f = -1;c = getchar();}
    while (isdigit(c)){s = (s<<3) + (s<<1) + (c ^ 48);c = getchar();}
    return s * f;
}//喵内~
void print(__int128 x){if (x < 0) {putchar('-'),print(-x);return ;}if (x >= 10) print(x / 10);putchar(x % 10 + 48);}//喵内~
const int Mod = 1e9 + 7;//喵内~要填数字哟~
//const int Mod = 998244353;//喵内~要填数字哟~
const ll INF = 0x3f3f3f3f;
const int N = 1005;//喵内~要填数字哟~
ll qpow(ll x,ll y){
   ll res = 1;
    for (;y;y >>= 1,x = x * x % Mod) if (y & 1) res = res * x % Mod;
    return res;
}
//ATTENTION IS ALL YOU NEED
int minx = N,miny = N,maxx = 0,maxy = 0;
char s[N][N];
int n,m;
signed main(){
    n = read(),m = read();
    for (int i = 1;i <= n;++i){
        for (int j = 1;j <= m;++j){
            cin >> s[i][j];
            if (s[i][j] == '#'){
                minx = min(minx,i);
                maxx = max(maxx,i);
                miny = min(miny,j);
                maxy = max(maxy,j);
            }
        }
    }

    for (int i = minx;i <= maxx;++i){
        for (int j = miny;j <= maxy;++j){
            if (s[i][j] == '.'){puts("No"); return 0;}
        }
    } puts("Yes");
    return 0;
}//喵内~
/*
What's wrong with my code?
1. 小数据?特殊数据?如 n = 1?
2. 最小值,最大值取多少?是否会溢出?
3. 初始值有没有赋值?有没有建树?
4. 数组大小?是否越界?
5. 思考暴力的时候,考虑是否可能是多个连续段?或者是个数不确定无法暴力?
6. 进行详细的分类讨论?
7. 选择的区间是否可以为空?

Trick:
1. 连通 通常带有特殊性质
2. LIS 有另一种求法
3. Brovuka?

About implementation skills:
1. 全局变量多用长变量名,而局部变量,临时变量,和函数传递的参数使用短变量名。
2. 大模拟尽量遵循:怎么方便怎么写。
3. 对于一些数据很小的需要维护的量并且需要大量讨论时,可以考虑把数组拆掉换成变量。
4. 写成多个函数。
*/

Submission Info

Submission Time
Task C - Paint to make a rectangle
User FlamingBlade
Language C++ 20 (gcc 12.2)
Score 300
Code Size 3162 Byte
Status AC
Exec Time 39 ms
Memory 4660 KB

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 1 ms 3492 KB
example_01.txt AC 1 ms 3536 KB
example_02.txt AC 1 ms 3476 KB
hand_00.txt AC 35 ms 4528 KB
hand_01.txt AC 34 ms 4600 KB
hand_02.txt AC 34 ms 4660 KB
hand_03.txt AC 35 ms 4396 KB
hand_04.txt AC 33 ms 4592 KB
hand_05.txt AC 1 ms 3540 KB
hand_06.txt AC 1 ms 3680 KB
hand_07.txt AC 1 ms 3520 KB
hand_08.txt AC 1 ms 4472 KB
hand_09.txt AC 34 ms 4500 KB
hand_10.txt AC 34 ms 4520 KB
hand_11.txt AC 36 ms 4524 KB
hand_12.txt AC 34 ms 4440 KB
random_00.txt AC 35 ms 4592 KB
random_01.txt AC 36 ms 4416 KB
random_02.txt AC 30 ms 4352 KB
random_03.txt AC 37 ms 4516 KB
random_04.txt AC 39 ms 4500 KB
random_05.txt AC 31 ms 4560 KB
random_06.txt AC 33 ms 4592 KB
random_07.txt AC 31 ms 4412 KB
random_08.txt AC 33 ms 4636 KB
random_09.txt AC 28 ms 4440 KB
random_10.txt AC 29 ms 4432 KB
random_11.txt AC 33 ms 4408 KB
random_12.txt AC 30 ms 4452 KB
random_13.txt AC 33 ms 4436 KB
random_14.txt AC 31 ms 4492 KB
random_15.txt AC 34 ms 4416 KB
random_16.txt AC 30 ms 4572 KB
random_17.txt AC 32 ms 4404 KB
random_18.txt AC 28 ms 4392 KB
random_19.txt AC 32 ms 4456 KB
random_20.txt AC 30 ms 4624 KB
random_21.txt AC 29 ms 4484 KB
random_22.txt AC 31 ms 4640 KB
random_23.txt AC 35 ms 4504 KB
random_24.txt AC 31 ms 4432 KB


2025-03-05 (Wed)
20:46:28 +00:00