# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
411028 | 2021-05-24T06:59:31 Z | 조영욱(#7633) | 길고양이 (JOI20_stray) | C++17 | 67 ms | 22916 KB |
#include "Anthony.h" #include <bits/stdc++.h> using namespace std; typedef pair<int,int> P; namespace { vector<P> adj[100000]; vector<int> ret; int dist[100000]; int pr[100000]; } vector<int> Mark(int n,int m,int a,int b,vector<int> u,vector<int> v) { for(int i=0;i<m;i++) { adj[u[i]].push_back(P(v[i],i)); adj[v[i]].push_back(P(u[i],i)); } ret.resize(m); queue<int> q; q.push(0); memset(dist,-1,sizeof(dist)); dist[0]=0; memset(pr,0,sizeof(pr)); while (!q.empty()) { int now=q.front(); q.pop(); for(int i=0;i<adj[now].size();i++) { int nt=adj[now][i].first; if (dist[nt]==-1) { q.push(nt); dist[nt]=dist[now]+1; ret[adj[now][i].second]=dist[now]%3; pr[nt]=now; } else { if (nt==pr[now]) { continue; } if (dist[nt]==dist[now]+1) { ret[adj[now][i].second]=dist[now]%3; } else if (dist[now]==dist[nt]) { ret[adj[now][i].second]=dist[now]%3; } else if (dist[nt]==dist[now]-1) { ret[adj[now][i].second]=(dist[now]+2)%3; } } } } return ret; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 51 ms | 18020 KB | Output is correct |
2 | Correct | 3 ms | 3692 KB | Output is correct |
3 | Correct | 39 ms | 17444 KB | Output is correct |
4 | Correct | 66 ms | 19040 KB | Output is correct |
5 | Correct | 63 ms | 18996 KB | Output is correct |
6 | Correct | 50 ms | 17944 KB | Output is correct |
7 | Correct | 43 ms | 17736 KB | Output is correct |
8 | Correct | 67 ms | 18388 KB | Output is correct |
9 | Correct | 56 ms | 18504 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 51 ms | 18020 KB | Output is correct |
2 | Correct | 3 ms | 3692 KB | Output is correct |
3 | Correct | 39 ms | 17444 KB | Output is correct |
4 | Correct | 66 ms | 19040 KB | Output is correct |
5 | Correct | 63 ms | 18996 KB | Output is correct |
6 | Correct | 50 ms | 17944 KB | Output is correct |
7 | Correct | 43 ms | 17736 KB | Output is correct |
8 | Correct | 67 ms | 18388 KB | Output is correct |
9 | Correct | 56 ms | 18504 KB | Output is correct |
10 | Correct | 43 ms | 15820 KB | Output is correct |
11 | Correct | 47 ms | 16016 KB | Output is correct |
12 | Incorrect | 41 ms | 15908 KB | Wrong Answer [6] |
13 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 46 ms | 15552 KB | Output is correct |
2 | Correct | 3 ms | 3692 KB | Output is correct |
3 | Correct | 45 ms | 15324 KB | Output is correct |
4 | Correct | 63 ms | 16936 KB | Output is correct |
5 | Correct | 59 ms | 16968 KB | Output is correct |
6 | Correct | 41 ms | 15632 KB | Output is correct |
7 | Correct | 41 ms | 15700 KB | Output is correct |
8 | Correct | 50 ms | 16344 KB | Output is correct |
9 | Correct | 48 ms | 16272 KB | Output is correct |
10 | Correct | 48 ms | 16004 KB | Output is correct |
11 | Correct | 47 ms | 15956 KB | Output is correct |
12 | Correct | 50 ms | 16016 KB | Output is correct |
13 | Correct | 50 ms | 15996 KB | Output is correct |
14 | Correct | 57 ms | 16256 KB | Output is correct |
15 | Correct | 54 ms | 16280 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 46 ms | 15552 KB | Output is correct |
2 | Correct | 3 ms | 3692 KB | Output is correct |
3 | Correct | 45 ms | 15324 KB | Output is correct |
4 | Correct | 63 ms | 16936 KB | Output is correct |
5 | Correct | 59 ms | 16968 KB | Output is correct |
6 | Correct | 41 ms | 15632 KB | Output is correct |
7 | Correct | 41 ms | 15700 KB | Output is correct |
8 | Correct | 50 ms | 16344 KB | Output is correct |
9 | Correct | 48 ms | 16272 KB | Output is correct |
10 | Correct | 48 ms | 16004 KB | Output is correct |
11 | Correct | 47 ms | 15956 KB | Output is correct |
12 | Correct | 50 ms | 16016 KB | Output is correct |
13 | Correct | 50 ms | 15996 KB | Output is correct |
14 | Correct | 57 ms | 16256 KB | Output is correct |
15 | Correct | 54 ms | 16280 KB | Output is correct |
16 | Correct | 40 ms | 14156 KB | Output is correct |
17 | Correct | 38 ms | 14012 KB | Output is correct |
18 | Runtime error | 43 ms | 22916 KB | Execution killed with signal 11 |
19 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 3692 KB | Wrong Answer [2] |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 11 ms | 4940 KB | Wrong Answer [2] |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 12 ms | 4856 KB | Wrong Answer [2] |
2 | Halted | 0 ms | 0 KB | - |