# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
227916 | 2020-04-29T08:48:41 Z | Vimmer | Strah (COCI18_strah) | C++14 | 1000 ms | 9856 KB |
#include <bits/stdc++.h> //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> #pragma GCC optimize("unroll-loops") #pragma GCC optimize("-O3") #pragma GCC optimize("Ofast") //#pragma GCC optimize("fast-math") //#pragma GCC optimize("no-stack-protector") #define F first #define S second #define sz(x) int(x.size()) #define pb push_back #define N 305 #define M ll(1e9 + 7) using namespace std; //using namespace __gnu_pbds; typedef long double ld; typedef long long ll; typedef short int si; //typedef tree<int, null_type, less <int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set; int n, m, pr[N][N]; ll ans; int main() { //freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); ios_base::sync_with_stdio(0); istream::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> n >> m; string s[n]; for (int i = 0; i < n; i++) cin >> s[i]; for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) { if (i != 0) pr[i][j] += pr[i - 1][j]; if (j != 0) pr[i][j] += pr[i][j - 1]; if (i != 0 && j != 0) pr[i][j] -= pr[i - 1][j - 1]; if (s[i][j] == '#') pr[i][j]++; } for (register int i = 0; i < n; i++) for (register int j = 0; j < m; j++) for (register int a = 1; a <= n - i; a++) for (register int b = 1; b <= m - j; b++) { int sm = pr[i + a - 1][j + b - 1]; if (i != 0) sm -= pr[i - 1][j + b - 1]; if (j != 0) sm -= pr[i + a - 1][j - 1]; if (i != 0 && j != 0) sm += pr[i - 1][j - 1]; if (sm != 0) break; ans += a * b; } cout << ans << endl; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 384 KB | Output is correct |
2 | Correct | 4 ms | 384 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 384 KB | Output is correct |
2 | Correct | 4 ms | 384 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 47 ms | 768 KB | Output is correct |
2 | Correct | 57 ms | 848 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 53 ms | 768 KB | Output is correct |
2 | Correct | 55 ms | 768 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1091 ms | 768 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 13 ms | 3584 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 15 ms | 6528 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 14 ms | 4608 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 7 ms | 1920 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 22 ms | 9856 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |