제출 #946666

#제출 시각아이디문제언어결과실행 시간메모리
946666PagodePaiva통행료 (IOI18_highway)C++17
0 / 100
10 ms600 KiB
#include "highway.h" #include<bits/stdc++.h> #define N 90010 #define ll long long using namespace std; void find_pair(int n, std::vector<int> u, std::vector<int> v, int an, int bn) { ll a = an; ll b = bn; int l = 0, r = n-2; vector <int> w(n-1); for(int i = 0;i < n-1;i++) w[i] = 0; ll custo = ask(w); ll d = custo/a; while(l < r){ int mid = (l+r)/2; for(int i = l;i <= mid;i++){ w[i] = 1; } custo = ask(w); if(d*a == custo){ l = mid+1; } else{ r = mid; } } answer(l, l+d); return; // int M = U.size(); // for (int j = 0; j < 50; ++j) { // std::vector<int> w(M); // for (int i = 0; i < M; ++i) { // w[i] = 0; // } // long long toll = ask(w); // } // answer(0, N - 1); }

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

highway.cpp: In function 'void find_pair(int, std::vector<int>, std::vector<int>, int, int)':
highway.cpp:10:6: warning: unused variable 'b' [-Wunused-variable]
   10 |   ll b = bn;
      |      ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...