제출 #1080479

#제출 시각아이디문제언어결과실행 시간메모리
1080479veehjCity (JOI17_city)C++17
0 / 100
258 ms9464 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define F first #define S second #define pb push_back #define sz(a) (ll) a.size() #define all(x) (x).begin(), (x).end() #include "Encoder.h" vector<vector<ll>> adj; vector<bool> vist; set<ll> s; void go(int nw){ vist[nw]=1; ll c=nw; for(auto& u : s){ c*=11; c+=u; } s.insert(nw); Code(nw-1, c); for(auto& u : adj[nw]){ if(vist[u]) continue; go(u); } s.erase(nw); } void Encode(int N, int A[], int B[]){ N++; adj.assign(N, vector<ll>(0)); vist.assign(N, 0); for(int i=0; i<N-2; i++){ adj[A[i]+1].pb(B[i]+1); adj[B[i]+1].pb(A[i]+1); } go(1); }
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define F first #define S second #define pb push_back #define sz(a) (ll) a.size() #define all(x) (x).begin(), (x).end() #include "Device.h" void InitDevice(){ } int Answer(long long s, long long t){ set<int> a={}, b={}; int A, B; while(s){ if(s<11){ A=s; break; } a.insert(s%11); s/=10; } while(t){ if(t<11){ B=t; break; } b.insert(t%11); t/=10; } if(a.count(B)) return 0; if(b.count(A)) return 1; return 2; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...