제출 #607543

#제출 시각아이디문제언어결과실행 시간메모리
607543MohamedFaresNebili철로 (IOI14_rail)C++14
0 / 100
71 ms728 KiB
#include <bits/stdc++.h> #include "rail.h" /// #pragma GCC optimize ("Ofast") /// #pragma GCC target ("avx2") /// #pragma GCC optimize("unroll-loops") using namespace std; using ll = long long; using ld = long double; #define ff first #define ss second #define pb push_back #define all(x) (x).begin(), (x).end() #define lb lower_bound const int MOD = 998244353; int getDistance(int i, int j); int DP[5005][5005]; int query(int i, int j) { if(i == j) return 0; if(DP[i][j] != -1) return DP[i][j]; return DP[i][j] = getDistance(i, j); } void findLocation(int n, int first, int location[], int stype[]) { location[0] = first; stype[0] = 1; int D = first + 1; for(int l = 1; l < n; l++) { if(query(0, l) < query(0, D)) D = l; } for(int l = 1; l < n; l++) { int A = query(0, l), B = query(D, l), C = query(0, D); if(C + D == A) stype[l] = 1, location[l] = A - 2 * C; else stype[l] = 2, location[l] = first + A; } }

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

rail.cpp: In function 'void findLocation(int, int, int*, int*)':
rail.cpp:37:42: warning: unused variable 'B' [-Wunused-variable]
   37 |                     int A = query(0, l), B = query(D, l), C = query(0, D);
      |                                          ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...