제출 #697768

#제출 시각아이디문제언어결과실행 시간메모리
697768Sandarach151A Difficult(y) Choice (BOI21_books)C++17
5 / 100
210 ms1056 KiB
#include <bits/stdc++.h> #include "books.h" using namespace std; // // --- Sample implementation for the task books --- // // To compile this program with the sample grader, place: // books.h books_sample.cpp sample_grader.cpp // in a single folder and run: // g++ books_sample.cpp sample_grader.cpp // in this folder. // void solve(int n, int k, long long a, int s) { long long arr[n]; vector<int> ans; for(int i=0; i<n; i++){ arr[i] = skim(i+1); } long long cur = 0; for(int i=0; i<n; i++){ for(int j=i+1; j<n; j++){ for(int k=j+1; k<n; k++){ if(a<=(arr[i]+arr[j]+arr[k]) && (arr[i]+arr[j]+arr[k])<=2*a){ ans.push_back(i+1); ans.push_back(j+1); ans.push_back(k+1); answer(ans); return; } } } } //for(int i=0; i<k; i++){ //cur+=arr[i]; //} //for(int i=0; i<=n-k; i++){ //if(a<=cur && cur<=2*a){ //for(int j=i; j<i+k; j++){ //ans.push_back(i+1); //} //answer(ans); //return; //} //if(i!=n-k){ //cur-=arr[i]; //cur+=arr[i+k]; //} //} impossible(); return; }

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

books.cpp: In function 'void solve(int, int, long long int, int)':
books.cpp:21:12: warning: unused variable 'cur' [-Wunused-variable]
   21 |  long long cur = 0;
      |            ^~~
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...