Submission #887574

#TimeUsernameProblemLanguageResultExecution timeMemory
887574Ahmed57Flights (JOI22_flights)C++17
15 / 100
34 ms3904 KiB
#include "Ali.h" #include <bits/stdc++.h> using namespace std; int target , ans = 0; vector<int> adj[100001]; void dfs(int i,int pr,int dep){ if(i==target){ ans = dep; } for(auto j:adj[i]){ if(j==pr)continue; dfs(j,i,dep+1); } } int n = 0; void Init(int N, std::vector<int> U, std::vector<int> V){ n = N; for(int i = 0;i<N;i++){ adj[i].clear(); } for(int i = 0;i<N-1;i++){ int a = U[i] , b = V[i]; adj[a].push_back(b); adj[b].push_back(a); } for(int i = 0;i<n;i++){ SetID(i,i); } } string SendA(string S){ int x = 0 , y = 0; for(int i = 0;i<10;i++){ if(S[i]=='1')x^=(1<<i); } for(int i = 10;i<20;i++){ if(S[i]=='1')y^=(1<<(i-10)); } int cnt = 0; string lol; for(int i = 0;i<16;i++){ for(int j = 0;j<16;j++){ int nx = (x|(i<<10)) , ny = (y|(j<<10)); if(nx>=n||ny>=n){ for(int e = cnt;e<cnt+14;e++){ lol+='0'; } }else{ target = ny; dfs(nx,nx,0); for(int e = cnt;e<cnt+14;e++){ if(ans&(1<<(e-cnt)))lol+='1'; else lol+='0'; } } cnt+=14; } } return lol; }
#include "Benjamin.h" #include <bits/stdc++.h> using namespace std; int x , y; string SendB(int N, int X, int Y){ x = X, y = Y; x>>=10; y>>=10; string ans; for(int i = 0;i<10;i++){ if(X&(1<<i))ans+='1'; else ans+='0'; }for(int i = 0;i<10;i++){ if(Y&(1<<i))ans+='1'; else ans+='0'; } return ans; } int Answer(string T){ int cnt = 0; long long ans = 0; for(int i = 0;i<16;i++){ for(int j = 0;j<16;j++){ if(i==x&&j==y){ for(int e = cnt;e<cnt+14;e++){ if(T[e]=='1')ans|=(1<<(e-cnt)); } }else cnt+=14; } } return ans; }

Compilation message (stderr)

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...