답안 #390690

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
390690 2021-04-16T14:06:47 Z AdOjis485 비스킷 담기 (IOI20_biscuits) C++17
9 / 100
1000 ms 340 KB
#include "biscuits.h"
#include <iostream>
#define int long long
using namespace std;


int count_tastiness(int x, vector<int> a) 
{
	int ans = 0;
	for(int i = 0; i <= 1e5; i ++)
	{
		vector<int> a2 = a;
		bool poss = true;
		int i2 = i;
		int j = 0;
		while(i2 > 0)
		{
			if(i2 % 2 == 1)
			{
				if(a2[j] < x)
				{
					poss = false;
					break;
				}
				a2[j] -= x;
			}
			if(j + 1 == a2.size()) a2.push_back(0);
			a2[j + 1] += a2[j] / 2;	
			i2 /= 2;
			j ++;
		}
		ans += poss;
	}
	return ans;
}

Compilation message

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:27:13: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   27 |    if(j + 1 == a2.size()) a2.push_back(0);
      |       ~~~~~~^~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 115 ms 204 KB Output is correct
2 Correct 42 ms 204 KB Output is correct
3 Correct 210 ms 204 KB Output is correct
4 Correct 162 ms 276 KB Output is correct
5 Correct 211 ms 340 KB Output is correct
6 Correct 140 ms 272 KB Output is correct
7 Correct 210 ms 272 KB Output is correct
8 Correct 145 ms 324 KB Output is correct
9 Correct 210 ms 276 KB Output is correct
10 Correct 34 ms 204 KB Output is correct
11 Correct 60 ms 204 KB Output is correct
12 Correct 99 ms 204 KB Output is correct
13 Correct 95 ms 292 KB Output is correct
14 Correct 73 ms 280 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 115 ms 268 KB Output is correct
2 Incorrect 116 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 130 ms 284 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1097 ms 332 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 115 ms 204 KB Output is correct
2 Correct 42 ms 204 KB Output is correct
3 Correct 210 ms 204 KB Output is correct
4 Correct 162 ms 276 KB Output is correct
5 Correct 211 ms 340 KB Output is correct
6 Correct 140 ms 272 KB Output is correct
7 Correct 210 ms 272 KB Output is correct
8 Correct 145 ms 324 KB Output is correct
9 Correct 210 ms 276 KB Output is correct
10 Correct 34 ms 204 KB Output is correct
11 Correct 60 ms 204 KB Output is correct
12 Correct 99 ms 204 KB Output is correct
13 Correct 95 ms 292 KB Output is correct
14 Correct 73 ms 280 KB Output is correct
15 Correct 115 ms 268 KB Output is correct
16 Incorrect 116 ms 204 KB Output isn't correct
17 Halted 0 ms 0 KB -