QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#88112 | #3251. 数正方体 | l1924365846 | WA | 5ms | 4316kb | C++14 | 2.7kb | 2023-03-15 10:48:40 | 2023-03-15 10:48:44 |
Judging History
answer
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <string>
#include <set>
#include <unordered_map>
#include <unordered_set>
#define int long long
#define ms(a,b) memset((a),(b),sizeof(a))
#define mc(a,b) memcpy((a),(b),sizeof(a))
#define PI acos(-1)
#define ssin(x) sin(x*PI/180.00)
#define ccos(x) cos(x*PI/180.00)
#define ttan(X) tan(x*PI/180.00)
#define rep(i, a, n) for (int i = a; i < n; i++)
#define per(i, n, a) for (int i = n - 1; i >= a; i--)
#define IOS ios::sync_with_stdio(false)
#define sl(x) scanf("%lld",&x)
#define sll(x, y) scanf("%lld %lld",&x, &y)
#define slll(x, y, z) scanf("%lld %lld %lld",&x, &y, &z)
#define sllll(x, y, z, w) scanf("%lld %lld %lld %lld",&x, &y, &z, &w)
#define pf(x) printf("%lld",x)
#define sd(x) scanf("%lf",&x)
#define sdd(x, y) scanf("%lf %lf",&x, &y)
#define sddd(x, y, z) scanf("%lf %lf %lf",&x, &y, &z)
#define sdddd(x, y, z, w) scanf("%lf %lf %lf %lf",&x, &y, &z, &w)
#define fi first
#define se second
#define pb push_back
#define mk make_mair
using namespace std;
typedef unsigned long long ull;
typedef pair<int, int> PII;
const int mod = 1e9 + 7;
const int P = 131;
const int N = 10010;
const int inf = 0x3f3f3f3f;
const int lnf = 9e18;
const double eps = 1e-6;
map<PII, int> ma;
int r, cc, res;
string s[N];
void solve() {
sll (r, cc);
getchar();
for (int i = 0; i < r; i ++) {
getline (cin, s[i]);
}
int c = 0, cnt;
for (int k = 0; k < r; k ++) {
int kk = 0;
while (s[k][kk] == '.')
kk++;
if (s[k][kk] == '|' && s[k + 1][kk] == '|') {
cnt = k - 2;
for (int i = cnt; i > 0;) {
int fg = 0;
for (int j = 0; j < cc - 4; j ++) {
if (s[i][j] == '/' && s[i][j + 1] == ' ' && s[i][j + 2] == ' ' && s[i][j + 3] == ' ' && s[i][j + 4] == '/' && ma[ {i, j}] == 0 && ma[ {i, j + 4}] == 0) {
ma[ {i, j}] = 1;
c++;
fg = 1;
}
}
if (fg == 0) {
break;
}
i -= 2;
}
res += c;
}
}
cout << res << endl;
}
signed main() {
// IOS;
// cin.tie (0);
// cout.tie (0);
int T = 1;
// sl (T);
while ( T-- ) {
solve();
}
return 0;
}
/*
14 17
....+---+---+....
.../ / /|....
..+---+---+ |....
./ /| | +---+
+---+ | |/ /|
| | +---+---+ |
| |/ /| | +
+---+---+ | |/|
| | | +---+ |
| | |/ /| +
+---+---+---+ |/.
| | | | +..
| | | |/...
+---+---+---+....
29
8 9
....+---+
.../ /|
..+---+ |
./ /| +
+---+ |/.
| | +..
| |/...
+---+....
10
9 7
..+---+
./ /|
+---+ |
| | +
| |/|
+---+ |
| | +
| |/.
+---+..
*/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 5ms
memory: 4316kb
input:
371 259 ......................................................................+---+---+.................................................................................................................................................................................... ...................................
output:
96572
result:
wrong answer 1st lines differ - expected: '84826', found: '96572'