제출 #430477

#제출 시각아이디문제언어결과실행 시간메모리
430477alireza_kaviani버섯 세기 (IOI20_mushrooms)C++17
25 / 100
180 ms296 KiB
#include "mushrooms.h"
#include <bits/stdc++.h>
using namespace std;

const int SQ = 101;

int count_mushrooms(int n) {
	vector<int> A = {0} , B;
	int cntA = 1 , cntB = 0;
	for (int i = 1 ; i < n ; i += 2){
		vector<int> v = {i , 0};
		if(i + 1 < n)	v.push_back(i + 1);
		int x = use_machine(v); cntA += v.size() - 1 - x;
		/*if(x == 0){
			cntA++;
			A.push_back(i);
		}
		if(x == 1){
			cntB++;
			B.push_back(i);
		}*/
	}
	return cntA;
}

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

mushrooms.cpp: In function 'int count_mushrooms(int)':
mushrooms.cpp:9:17: warning: unused variable 'cntB' [-Wunused-variable]
    9 |  int cntA = 1 , cntB = 0;
      |                 ^~~~
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…