제출 #596323

#제출 시각아이디문제언어결과실행 시간메모리
596323ibm2006Flights (JOI22_flights)C++17
0 / 100
8 ms3064 KiB
#include "Ali.h" #include <string> #include <vector> #include<bits/stdc++.h> using namespace std; typedef int ll; pair<ll,ll> p[110000]; ll x,y,n,i,j; void Init(int N, std::vector<int> U, std::vector<int> V) { ll i; n=N; for(i=0;i<N;i++) SetID(i,i); for(i=0;i<(n-1);i++) { p[i]={U[i],V[i]}; } } string s; string SendA(string S) { for(i=0;i<(n-1);i++) { x=p[i].first; y=16384; for(j=0;j<15;j++) { if(x/y%2==0) s+="0"; else s+="1"; y/=2; } y=16384; x=p[i].second; for(j=0;j<15;j++) { if(x/y%2==0) s+="0"; else s+="1"; y/=2; } } return s; }
#include "Benjamin.h" #include <string> #include <vector> #include<bits/stdc++.h> using namespace std; typedef int ll; ll x,y,n,k,z,w,h[110000],i,j; vector<ll> v[110000]; string SendB(int N, int X, int Y) { x=X; y=Y; n=N; return "00000111110000011111"; } string s; ll f(ll x,ll z) { if(x==y) return 0; ll i,w; for(i=0;i<h[x];i++) { if(v[x][i]==z) continue; w=f(v[x][i],x); if(w!=-1) return w+1; } return -1; } int Answer(string T) { s=T; for(i=0;i<(n-1);i++) { z=0; for(j=0;j<15;j++) { z=z*2+s[i*30+j]-'0'; } w=0; for(j=0;j<15;j++) { w=w*2+s[i*30+15+j]-'0'; } v[z].push_back(w); v[w].push_back(z); } for(i=0;i<n;i++) h[i]=v[i].size(); return f(x,-1); }

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

Ali.cpp: In function 'void Init(int, std::vector<int>, std::vector<int>)':
Ali.cpp:12:3: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   12 |   for(i=0;i<N;i++)
      |   ^~~
Ali.cpp:14:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   14 |     for(i=0;i<(n-1);i++)
      |     ^~~
grader_ali.cpp:10:8: warning: '{anonymous}::_randmem' defined but not used [-Wunused-variable]
   10 |   char _randmem[12379];
      |        ^~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...