제출 #305938

#제출 시각아이디문제언어결과실행 시간메모리
305938Jarif_Rahman버섯 세기 (IOI20_mushrooms)C++17
10 / 100
267 ms512 KiB
#include "mushrooms.h"
#include <bits/stdc++.h>
#define pb push_back
#define f first
#define sc second
#define um use_machine
using namespace std;
typedef long long int ll;
typedef string str;
int n;
int count_mushrooms(int nn){
    n = nn;
    int ans = 1;
    bool cur = 1;
    for(int i = 1; i < n; i++){
        if(um({i-1, i}) > 0) cur = !cur;
        if(cur) ans++;
    }
    return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...