Submission #783770

#TimeUsernameProblemLanguageResultExecution timeMemory
783770tolbiRail (IOI14_rail)C++17
8 / 100
46 ms504 KiB
#pragma optimize("Bismillahirrahmanirrahim") //█▀█─█──█──█▀█─█─█ //█▄█─█──█──█▄█─█■█ //█─█─█▄─█▄─█─█─█─█ //Allahuekber //ahmet23 orz... //FatihSultanMehmedHan //YavuzSultanSelimHan //AbdulhamidHan //Sani buyuk Osman Pasa Plevneden cikmam diyor. #define author tolbi #include<bits/stdc++.h> using namespace std; template<typename X, typename Y> ostream& operator<<(ostream& os, pair<X,Y> pr){return os<<pr.first<<" "<<pr.second;} ostream& operator<<(ostream& os, bool bl){return os<<(int32_t)bl;} template<typename X> ostream& operator<<(ostream& os, vector<X> v){for(auto &it : v) os<<it<<" ";return os;} template<typename X, size_t Y> ostream& operator<<(ostream& os, array<X,Y> v){for(auto &it : v) os<<it<<" ";return os;} #define deci(x) int x;cin>>x; #define endl '\n' #define decstr(x) string x;cin>>x; #define sortarr(x) sort(x.begin(), x.end()) #define sortrarr(x) sort(x.rbegin(), x.rend()) #define rev(x) reverse(x.begin(), x.end()) #define tol(bi) (1LL<<((int)(bi))) typedef long long ll; const ll INF = LONG_LONG_MAX; const int MOD = 1e9+7; mt19937 ayahya(chrono::high_resolution_clock().now().time_since_epoch().count()); #include "rail.h" void findLocation(int N, int first, int location[], int stype[]) { location[0]=first,stype[0]=1; int ens = 0; int ind = -1; for (int i = 1; i < N; i++){ int x = getDistance(0,i); if (x==getDistance(i,0)){ stype[i]=2; location[i]=x+location[0]; if (location[i]>ens) ens=location[i],ind=i; } } int ens2 = location[0]; int ind2 = 0; for (int i = 0; i < N; i++){ if (stype[i]!=0) continue; int x = getDistance(ind,i); if (x==getDistance(i,ind)){ stype[i]=1; location[i]=location[ind]-x; if (location[i]<ens2) ens2=location[i],ind2=i; } } for (int i = 0; i < N; ++i) { if (stype[i]!=0) continue; int x = getDistance(ind2,i); if (x==getDistance(i,ind2)){ stype[i]=2; location[i]=location[ind2]+x; } } }

Compilation message (stderr)

rail.cpp:1: warning: ignoring '#pragma optimize ' [-Wunknown-pragmas]
    1 | #pragma optimize("Bismillahirrahmanirrahim")
      |
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...