제출 #1175535

#제출 시각아이디문제언어결과실행 시간메모리
1175535hyakup버섯 세기 (IOI20_mushrooms)C++20
10 / 100
50 ms420 KiB
#include "mushrooms.h" #include <bits/stdc++.h> using namespace std; #define vi vector<int> int count_mushrooms( int n ){ int resp = 1, last = -1; for( int i = 1; i < n; i ++ ){ // if( i == n - 1 ){ vi a = { 0, i }; if( use_machine(a) == 0 ) resp++; // } // else if( last == -1 ){ // vi a = { 0, i, i + 1 }; // int x = use_machine(a); // if( x == 0 ) resp += 2; // else if( x == 2 ) resp++; // else last = i; // } // else{ // vi a = { last, last + 1, i, i + 1 }; // int x = use_machine(a); // if( x == 3 ) resp += 2; // else if( x == 1 || x == 2 ) resp++; // last = -1; // } } // if( last != -1 ){ // vi a = {0, last}; // if( use_machine(a) == 0 ) resp++; // } return resp; }
#Verdict Execution timeMemoryGrader output
Fetching results...