제출 #254135

#제출 시각아이디문제언어결과실행 시간메모리
254135PedroBigMan철로 (IOI14_rail)C++14
30 / 100
75 ms632 KiB
#include "rail.h" #include <iostream> #include <vector> #include <cmath> #include <algorithm> #include <string> #include <map> #include <unordered_map> #include <set> #include <unordered_set> #include <queue> #include <deque> #include <list> #include <iomanip> #include <stdlib.h> #include <time.h> #include <cstring> using namespace std; typedef long long int ll; typedef unsigned long long int ull; typedef long double ld; #define REP(i,a,b) for(ll i=(ll) a; i<(ll) b; i++) #define pb push_back #define mp make_pair #define pl pair<ll,ll> #define ff first #define ss second #define whole(x) x.begin(),x.end() #define DEBUG(i) cout<<"Pedro Is The Master "<<i<<endl #define INF 500000000LL #define EPS 0.00000001 #define pi 3.14159 void findLocation(int N, int first, int location[], int stype[]) { if(N==1) {location[0]=first; stype[0]=1; return;} vector<ll> d1, d2; REP(i,0,N) {d1.pb(getDistance(0,i));} d1[0]=INF; ll fr = (ll) (min_element(whole(d1))-d1.begin()); ll c1 = first; ll block_fr=first+d1[fr]; ll c2=2*block_fr-first; REP(i,0,N) {d2.pb(getDistance(fr,i));} d1[0]=0; location[0]=first; location[fr]=block_fr; stype[0]=1; stype[fr]=2; REP(i,0,N) { if(i==0 || i==fr) {continue;} if(d1[i]<d2[i]) {stype[i]=2; location[i]=d1[i]+location[0];} else {stype[i]=1; location[i]=c2-d1[i];} } return; }

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

rail.cpp: In function 'void findLocation(int, int, int*, int*)':
rail.cpp:40:8: warning: unused variable 'c1' [-Wunused-variable]
     ll c1 = first; ll block_fr=first+d1[fr];
        ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...