제출 #390356

#제출 시각아이디문제언어결과실행 시간메모리
390356MilosMilutinovic버섯 세기 (IOI20_mushrooms)C++14
0 / 100
1 ms200 KiB
/**
 *    author:  milos
 *    created: 16.04.2021 00:04:13       
**/
#include <bits/stdc++.h>
#include "mushrooms.h"
 
using namespace std;

int count_mushrooms(int n) {
  int ans = 1;
  for (int i = 1; i < n; i++) {
    vector<int> qs;
    qs.push_back(0);
    qs.push_back(i);
    if (i < n - 1) {
      qs.push_back(i + 1);
    }
    int foo = use_machine(qs); 
    if (i < n - 1) {
      ans += 2 - foo;
      i++;
    } else {
      ans += 1 - foo;
    }
  }
  return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...