제출 #575359

#제출 시각아이디문제언어결과실행 시간메모리
575359birthdaycakeA Difficult(y) Choice (BOI21_books)C++17
0 / 100
3 ms308 KiB
#include <bits/stdc++.h> #include "books.h" using namespace std; long long b[200001], vs[200001]; void idk(int x, int y){ vector<int>fin; for(int i = x; i <= y; i++) fin.push_back(i); answer(fin); } void solve(int n, int k, long long a, int s) { int j = 0, tot = 0; vector<int>fin; for(int i = 1; i <= n; i++) { b[i] = skim(i); if(i <= k) tot += b[i]; vs[i] = 0; } for(int i = k; i >= 1; i--){ int prev = i; for(int j = i + 1; j < n; j++){ if(!vs[j] && tot - b[prev] + b[j] <= 2 * a){ prev = j; } } tot -= b[i]; tot += b[prev]; vs[prev] = 1; } tot = 0; for(int i = 1; i <= n; i++){ if(vs[i]){ fin.push_back(i); tot += b[i]; } } if(tot >= a && tot <= 2 * a) answer(fin); impossible(); }

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

books.cpp: In function 'void solve(int, int, long long int, int)':
books.cpp:16:9: warning: unused variable 'j' [-Wunused-variable]
   16 |     int j = 0, tot = 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...