| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 833649 | vjudge1 | Bomb (IZhO17_bomb) | C++17 | 155 ms | 104964 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
// os.erase(os.find_by_order(os.order_of_key(val)));
#define ordered_set tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update>
#define MAX LLONG_MAX
#define MOD 1000000007
#define int long long
#define ll __int128
#define endl '\n'
#define fi first
#define se second
#define pii pair<int, int>
#define pb push_back
#define all(x) x.begin(), x.end()
#define pv(x) for (auto i : x) cout << i << ' '; cout << endl;
#define vini(x, y) for (int i = 0; i < y; i++) cin >> x[i];
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a * (b / gcd(a,b)))
#define countonbit(a) __builtin_popcountll(a)
using namespace std;
void solve()
{
int a, b; cin >> a >> b;
vector <string> arr(a);
vini(arr, a);
int counter = 0;
int x = b, y = a;
int dph[a][b];
int dpv[a][b];
for (int i = 0; i < a; i++)
{
for (int j = 0; j < b; j++)
{
dph[i][j] = -1;
dpv[i][j] = -1;
}
}
for (int i = 0; i < a; i++)
{
for (int j = 0; j < b; j++)
{
int count;
if (arr[i][j] == '0') continue;
if (dph[i][j] != -1) goto here;
count = 0;
for (int k = j; k < b; k++)
{
if (arr[i][k] == '0') break;
dph[i][k] = 1;
count++;
}
x = min(x, count);
here:
if (dpv[i][j] != -1) continue;
count = 0;
for (int k = i; k < a; k++)
{
if (arr[k][j] == '0') break;
dpv[k][j] = 1;
count++;
}
y = min(y, count);
}
}
cout << x * y << endl;
}
int32_t main()
{
ios::sync_with_stdio(false); cin.tie(NULL);
int a = 1;
//cin >> a;
while(a--) solve();
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
