# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
53851 | ainta | Sandwich (JOI16_sandwich) | C++17 | 6194 ms | 11968 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
int Q[3 << 17], Deg[3 << 17], Res[3 << 17], ord[3 << 17], cnt, vis[3 << 17];
char p[1 << 9][1 << 9];
int F[3 << 17][2], CF[3 << 17];
int n, m;
int Num(int x, int y, int ck) {
if (x<1 || x>n || y<1 || y>m)return 0;
int cc = 0;
if (p[x][y] == 'N') {
if (ck == 0 || ck == 3)cc = 1;
else cc = 2;
}
else {
if (ck == 0 || ck == 2)cc = 1;
else cc = 2;
}
return ((x - 1)*m + (y - 1)) * 2 + cc;
}
void Add_Edge(int a, int b) {
if (!a || !b)return;
Deg[a]++;
F[b][CF[b]++] = a;
}
int main() {
int i, j;
//freopen("input.txt", "r", stdin);
scanf("%d%d", &n, &m);
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |