제출 #346163

#제출 시각아이디문제언어결과실행 시간메모리
346163lLab_버섯 세기 (IOI20_mushrooms)C++14
25 / 100
145 ms512 KiB
#include "mushrooms.h" #include <bits/stdc++.h> using namespace std; vector<int> A = {0}; int count_mushrooms(int n) { int sum = 1; int i=1; while(i<n){ vector<int> S; int p=1; int nA = A.size(); int cnt = 0; for(int j=0;j<nA&&i<n;++j){ S.push_back(A[j]); S.push_back(i); p = i; i++; cnt++; } int d = use_machine(S); sum += cnt-(d+1)/2; if(d == 0) A.push_back(i-1); } return sum; }

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

mushrooms.cpp: In function 'int count_mushrooms(int)':
mushrooms.cpp:12:13: warning: variable 'p' set but not used [-Wunused-but-set-variable]
   12 |         int p=1;
      |             ^
#Verdict Execution timeMemoryGrader output
Fetching results...