제출 #588925

#제출 시각아이디문제언어결과실행 시간메모리
588925LIF버섯 세기 (IOI20_mushrooms)C++14
0 / 100
104 ms208 KiB
#include "mushrooms.h" #include<bits/stdc++.h> using namespace std; int count_mushrooms(int n) { std::vector <int> m; int aans = 1; int pointer = 1; bool check[200005]; for(int i=0;i<n;i++) { check[i] = false; } check[0] = true; for(int i=2;i<n;i+=2) { if(i+1<n) { m.push_back(i); m.push_back(0); m.push_back(i-1); int ans = use_machine(m); aans += (2-ans); m.clear(); } } if(n%2==0) { m.push_back(0); m.push_back(n-1); int ans = use_machine(m); if(ans == 0)aans++; } return aans; }

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

mushrooms.cpp: In function 'int count_mushrooms(int)':
mushrooms.cpp:8:6: warning: unused variable 'pointer' [-Wunused-variable]
    8 |  int pointer = 1;
      |      ^~~~~~~
mushrooms.cpp:9:7: warning: variable 'check' set but not used [-Wunused-but-set-variable]
    9 |  bool check[200005];
      |       ^~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...