# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1107560 | 2024-11-01T13:28:18 Z | 8pete8 | 길고양이 (JOI20_stray) | C++17 | 43 ms | 16216 KB |
#include "Anthony.h" #include <vector> #include<iostream> #include<stack> #include<map> #include<vector> #include<string> #include<cassert> #include<unordered_map> #include <queue> #include <cstdint> #include<cstring> #include<limits.h> #include<cmath> #include<set> #include<algorithm> #include <iomanip> #include<numeric> #include<bitset> using namespace std; #define ll long long #define f first #define s second #define pii pair<int,int> #define ppii pair<int,pii> #define vi vector<int> #define pb push_back #define all(x) x.begin(),x.end() #define rall(x) x.rbegin(),x.rend() #define F(n) for(int i=0;i<n;i++) #define lb lower_bound #define ub upper_bound #define fastio ios::sync_with_stdio(false);cin.tie(NULL); #pragma GCC optimize ("03,unroll-lopps") using namespace std; namespace { int FunctionExample(int i, int A) { return i % A; } } // namespace vector<int> Mark(int n,int m, int a, int b,vector<int> U,vector<int> V) { vector<int> X(m); vector<int>lvl(n+1,1e9),vis(n,0); vector<vector<pii>>adj(n); for(int i=0;i<m;i++){ adj[U[i]].pb({V[i],i}),adj[V[i]].pb({U[i],i}); } queue<int>q; lvl[0]=0; q.push(0); while(!q.empty()){ int cur=q.front(); q.pop(); if(vis[cur])continue; vis[cur]=1; for(auto i:adj[cur])if(!vis[i.f]&&lvl[i.f]>lvl[cur]+1){ lvl[i.f]=lvl[cur]+1; q.push(i.f); } } if(a>=3){ for(int i=0;i<n;i++)for(auto j:adj[i]){ if(lvl[j.f]<lvl[i])X[j.s]=(lvl[j.f]%3); else X[j.s]=lvl[i]%3; } } else{ //0 0 1 1 0 1 0 0 1 1 0 1 0 0 1 1 0 1 0 0 1 1 0 1 //1 0 1 1 0 0 1 0 1 1 0 0 1 0 1 1 0 0 1 0 1 1 0 0 vector<int>pat={0,0,1,1,0,1}; function<void(int,int)> dfs=[&](int cur,int p){ for(auto i:adj[cur])if(i.f!=p){ X[i.s]=pat[lvl[cur]%6]; dfs(i.f,cur); } }; dfs(0,-1); } return X; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 31 ms | 15460 KB | Output is correct |
2 | Correct | 2 ms | 764 KB | Output is correct |
3 | Correct | 28 ms | 14684 KB | Output is correct |
4 | Correct | 43 ms | 16216 KB | Output is correct |
5 | Correct | 43 ms | 16200 KB | Output is correct |
6 | Correct | 34 ms | 15316 KB | Output is correct |
7 | Correct | 34 ms | 15156 KB | Output is correct |
8 | Correct | 38 ms | 15968 KB | Output is correct |
9 | Correct | 39 ms | 15740 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 31 ms | 15460 KB | Output is correct |
2 | Correct | 2 ms | 764 KB | Output is correct |
3 | Correct | 28 ms | 14684 KB | Output is correct |
4 | Correct | 43 ms | 16216 KB | Output is correct |
5 | Correct | 43 ms | 16200 KB | Output is correct |
6 | Correct | 34 ms | 15316 KB | Output is correct |
7 | Correct | 34 ms | 15156 KB | Output is correct |
8 | Correct | 38 ms | 15968 KB | Output is correct |
9 | Correct | 39 ms | 15740 KB | Output is correct |
10 | Correct | 33 ms | 13028 KB | Output is correct |
11 | Correct | 35 ms | 13260 KB | Output is correct |
12 | Correct | 28 ms | 13268 KB | Output is correct |
13 | Correct | 31 ms | 13260 KB | Output is correct |
14 | Correct | 32 ms | 13512 KB | Output is correct |
15 | Correct | 32 ms | 13836 KB | Output is correct |
16 | Correct | 32 ms | 15748 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 30 ms | 12896 KB | Output is correct |
2 | Correct | 1 ms | 764 KB | Output is correct |
3 | Correct | 34 ms | 12336 KB | Output is correct |
4 | Correct | 39 ms | 14344 KB | Output is correct |
5 | Correct | 37 ms | 14172 KB | Output is correct |
6 | Correct | 32 ms | 13080 KB | Output is correct |
7 | Correct | 30 ms | 12860 KB | Output is correct |
8 | Correct | 39 ms | 13592 KB | Output is correct |
9 | Correct | 33 ms | 13664 KB | Output is correct |
10 | Correct | 36 ms | 13376 KB | Output is correct |
11 | Correct | 32 ms | 13408 KB | Output is correct |
12 | Correct | 34 ms | 13360 KB | Output is correct |
13 | Correct | 40 ms | 13380 KB | Output is correct |
14 | Correct | 39 ms | 13588 KB | Output is correct |
15 | Correct | 34 ms | 13588 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 30 ms | 12896 KB | Output is correct |
2 | Correct | 1 ms | 764 KB | Output is correct |
3 | Correct | 34 ms | 12336 KB | Output is correct |
4 | Correct | 39 ms | 14344 KB | Output is correct |
5 | Correct | 37 ms | 14172 KB | Output is correct |
6 | Correct | 32 ms | 13080 KB | Output is correct |
7 | Correct | 30 ms | 12860 KB | Output is correct |
8 | Correct | 39 ms | 13592 KB | Output is correct |
9 | Correct | 33 ms | 13664 KB | Output is correct |
10 | Correct | 36 ms | 13376 KB | Output is correct |
11 | Correct | 32 ms | 13408 KB | Output is correct |
12 | Correct | 34 ms | 13360 KB | Output is correct |
13 | Correct | 40 ms | 13380 KB | Output is correct |
14 | Correct | 39 ms | 13588 KB | Output is correct |
15 | Correct | 34 ms | 13588 KB | Output is correct |
16 | Correct | 27 ms | 11308 KB | Output is correct |
17 | Correct | 27 ms | 11212 KB | Output is correct |
18 | Correct | 27 ms | 11212 KB | Output is correct |
19 | Correct | 27 ms | 11212 KB | Output is correct |
20 | Correct | 32 ms | 11936 KB | Output is correct |
21 | Correct | 31 ms | 11720 KB | Output is correct |
22 | Correct | 33 ms | 13540 KB | Output is correct |
23 | Correct | 30 ms | 11476 KB | Output is correct |
24 | Correct | 27 ms | 11484 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 1024 KB | Wrong Answer [6] |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 25 ms | 10804 KB | Wrong Answer [6] |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 26 ms | 11104 KB | Wrong Answer [6] |
2 | Halted | 0 ms | 0 KB | - |