제출 #1115128

#제출 시각아이디문제언어결과실행 시간메모리
1115128thelegendary08Flights (JOI22_flights)C++17
0 / 100
1 ms332 KiB
#include "Ali.h" #include<bits/stdc++.h> #define f0r(i,n) for(int i = 0; i<n; i++) #define pb push_back #define vi vector<int> #define FOR(i, k, n) for(int i = k; i< n; i++) using namespace std; namespace { int n; vector<vi>adj; vi par; void dfs(int x, int from){ for(auto u : adj[x]){ if(u != from){ par[u] = x; dfs(u,x); } } } } void Init(int N, std::vector<int> U, std::vector<int> V) { n = N; f0r(i,N){ SetID(i,i); } adj.resize(N); par.resize(N); f0r(i,N-1){ adj[U[i]].pb(V[i]); adj[V[i]].pb(U[i]); } dfs(0,-1); } std::string SendA(std::string S) { string s; FOR(i, 1, n){ int cur = par[i]; f0r(j, 14){ if((1 << j) & cur){ s += '1'; } else s += '0'; } } return s; }
#include "Benjamin.h" #include<bits/stdc++.h> #define f0r(i,n) for(int i = 0; i<n; i++) #define pb push_back #define vi vector<int> #define FOR(i, k, n) for(int i = k; i< n; i++) using namespace std; namespace { int n; int x,y; vi par; vi dist; vector<vi>adj; void dfs(int x, int from){ for(auto u : adj[x]){ if(u != from){ dist[u] = dist[x] + 1; dfs(u,x); } } } } std::string SendB(int N, int X, int Y) { n = N; x = X; y = Y; string s; f0r(i, 20)s += '0'; return s; } int Answer(std::string T) { par.resize(n); dist.resize(n); adj.resize(n); f0r(i,n)dist[i] = 1e9; for(int i = 0; i<T.size(); i+=14){ int cur = 0; FOR(j, i, i+14){ cur += (T[j] - '0') * (j - i); } par[i+1] = cur; adj[i+1].pb(cur); adj[cur].pb(i+1); } par[0] = -1; dist[x] = 0; dfs(x,-1); return dist[y]; }

컴파일 시 표준 에러 (stderr) 메시지

grader_ali.cpp:10:8: warning: '{anonymous}::_randmem' defined but not used [-Wunused-variable]
   10 |   char _randmem[12379];
      |        ^~~~~~~~

Benjamin.cpp: In function 'int Answer(std::string)':
Benjamin.cpp:39:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   39 |  for(int i = 0; i<T.size(); i+=14){
      |                 ~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...