제출 #531870

#제출 시각아이디문제언어결과실행 시간메모리
531870nigusBomb (IZhO17_bomb)C++14
26 / 100
1090 ms5324 KiB
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for(int i = a; i < (b); ++i) #define per(i, b, a) for(int i = b - 1; i >= a; i--) #define trav(a, x) for(auto& a : x) #define all(x) x.begin(), x.end() #define sz(x) (int)(x).size() typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<int> vi; typedef vector<ll> vl; typedef long double ld; typedef unsigned long long ull; unsigned seed = chrono::system_clock::now().time_since_epoch().count(); mt19937 eng(seed); ll random2(){ return (1ll << 31ll)*eng()+eng(); } ll n,m,k,q,T; const ll big = 1000000007; const ll big2 = 1000000009; const ll mod = 998244353; const int MAXN = 1001; bool grid[MAXN][MAXN] = {0}; bool covered[MAXN][MAXN] = {0}; bool can_place(int i, int j, int a, int b){ if(n-i < a || m-j < b)return 0; rep(c1,0,a){ rep(c2,0,b){ if(!grid[i+c1][j+c2])return 0; } } return 1; } bool solve(int a, int b){ rep(c1,0,n){ rep(c2,0,m){ if(can_place(c1,c2,a,b)){ //cerr << a << " " << b << ": " << c1+1 << " " << c2+1 << "\n"; rep(c3,0,a){ rep(c4,0,b){ covered[c1+c3][c2+c4] = 1; } } } } } rep(c1,0,n){ rep(c2,0,m){ if(grid[c1][c2] && !covered[c1][c2])return 0; } } return 1; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); // freopen("fhc.txt","r",stdin); // freopen("autput.txt","w",stdout); ll a,b,c,d,e; cin >> n >> m; rep(c1,0,n){ string s; cin >> s; rep(c2,0,m){ grid[c1][c2] = (s[c2] == '1'); } } ll ans = 0; rep(a,1,n+1){ rep(b,1,m+1){ rep(c1,0,n){ rep(c2,0,m){ covered[c1][c2] = 0; } } if(solve(a, b)){ ans = max(ans, (ll)a*b); } } } cout << ans << "\n"; return 0; }

컴파일 시 표준 에러 (stderr) 메시지

bomb.cpp: In function 'int main()':
bomb.cpp:74:8: warning: unused variable 'a' [-Wunused-variable]
   74 |     ll a,b,c,d,e;
      |        ^
bomb.cpp:74:10: warning: unused variable 'b' [-Wunused-variable]
   74 |     ll a,b,c,d,e;
      |          ^
bomb.cpp:74:12: warning: unused variable 'c' [-Wunused-variable]
   74 |     ll a,b,c,d,e;
      |            ^
bomb.cpp:74:14: warning: unused variable 'd' [-Wunused-variable]
   74 |     ll a,b,c,d,e;
      |              ^
bomb.cpp:74:16: warning: unused variable 'e' [-Wunused-variable]
   74 |     ll a,b,c,d,e;
      |                ^
#Verdict Execution timeMemoryGrader output
Fetching results...