제출 #308478

#제출 시각아이디문제언어결과실행 시간메모리
308478CaroLinda버섯 세기 (IOI20_mushrooms)C++14
10 / 100
258 ms512 KiB
#include "mushrooms.h" #include <bits/stdc++.h> #define debug printf #define lp(i,a,b) for(int i = a ; i < b; i++) #define pb push_back #define ff first #define ss second #define mk make_pair #define pii pair<int,int> #define ll long long #define all(x) x.begin(),x.end() using namespace std ; int count_mushrooms(int n) { if( n <= 226 ) { vector<int> type(n,1) ; for(int i = 1 ; i < n ; i++ ) { int x = use_machine( {i,i-1} ) ; type[i] = type[i-1] ; if(x) type[i] ^= 1 ; } int cnt = 0 ; lp(i,0,n) cnt += type[i] ; return cnt ; } }

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

mushrooms.cpp: In function 'int count_mushrooms(int)':
mushrooms.cpp:36:1: warning: control reaches end of non-void function [-Wreturn-type]
   36 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...