Submission #1004029

#TimeUsernameProblemLanguageResultExecution timeMemory
1004029De3b0oFlights (JOI22_flights)C++17
15 / 100
291 ms540672 KiB
#include "Ali.h" #include<bits/stdc++.h> #define ll long long #define F first #define S second #define in insert #define pb push_back #define ppb pop_back() #define d3 ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define cans cout << ans << "\n"; #define yes cout << "Yes" << "\n"; #define no cout << "No" << "\n"; #define pll pair<ll,ll> #define lin cout << "\n"; #define sqr 340 #define mod 1000000007 #define mid ((l+r)/2) #define lc (2*x) #define rc (2*x+1) using namespace std; vector<ll> adj[10009]; ll ds[10009]; void dfs(ll x , ll p , ll d) { ds[x]=d; for(auto it : adj[x]) { if(it==p) continue; dfs(it,x,d+1); } } void Init(int N, std::vector<int> U, std::vector<int> V) { for(int i = 0 ; N>i ; i++) SetID(i,i); for(int i = 0 ; N-1>i ; i++) { adj[U[i]].pb(V[i]); adj[V[i]].pb(U[i]); } } std::string SendA(std::string S) { ll x = 0; ll yy = 0; ll b = 1; for(int i = 0 ; 14>i ; i++) { if(S[i]=='1') x+=b; b*=2; } b=1; for(int i = 14 ; 20>i ; i++) { if(S[i]=='1') yy+=b; b*=2; } dfs(x,-1,0); set<ll> y; ll w = (1<<8); for(int i = 0 ; w>i ; i++) { ll e = (i<<6)+yy; y.in(e); } string s = ""; for(auto it : y) { ll b = 1; for(int i = 0 ; 14>i ; i++) { if(it&b) s+='1'; else s+='0'; b*=2; } b=1; for(int i = 0 ; 14>i ; i++) { if(ds[it]&b) s+='1'; else s+='0'; b*=2; } } return s; }
#include "Benjamin.h" #include<bits/stdc++.h> #define ll long long #define F first #define S second #define in insert #define pb push_back #define ppb pop_back() #define d3 ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define cans cout << ans << "\n"; #define yes cout << "Yes" << "\n"; #define no cout << "No" << "\n"; #define pll pair<ll,ll> #define lin cout << "\n"; #define sqr 340 #define mod 1000000007 #define mid ((l+r)/2) #define lc (2*x) #define rc (2*x+1) using namespace std; ll y; std::string SendB(int N, int X, int Y) { y=Y; string s = ""; ll b = 1; for(int i = 0 ; 14>i ; i++) { if(b&X) s+='1'; else s+='0'; b*=2; } b=1; for(int i = 0 ; 6>i ; i++) { if(b&Y) s+='1'; else s+='0'; b*=2; } return s; } int Answer(std::string T) { ll ans; for(int i = 0 ; T.size()>i ; i+=28) { ll x = 0; ll b = 1; for(int j = i ; i+14>j ; j++) { if(T[j]=='1') x+=b; b*=2; } ll ans1 = 0; b=1; for(int j = i+14 ; i+28>j ; j++) { if(T[j]=='1') ans1+=b; b*=2; } if(x==y) ans=ans1; } return ans; }

Compilation message (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:53:29: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   53 |     for(int i = 0 ; T.size()>i ; i+=28)
      |                     ~~~~~~~~^~
Benjamin.cpp:74:12: warning: 'ans' may be used uninitialized in this function [-Wmaybe-uninitialized]
   74 |     return ans;
      |            ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...