답안 #797882

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
797882 2023-07-30T04:49:07 Z boyliguanhan 비스킷 담기 (IOI20_biscuits) C++17
12 / 100
2 ms 340 KB
#include "biscuits.h"
#include<algorithm>
long long count_tastiness(long long x, std::vector<long long> a){
	long long ans = 1, l = 0, sum = 1;
    while(a.size()!=130)
        a.push_back(0);
    for(int i = 0; i < 129; i++) {
        long long new_v=a[i]%2;
        if(!new_v&&a[i])
            new_v+=2;
        a[i+1]+=(a[i]-new_v)/2;
        a[i]=new_v;
    }
    for(int i = 0; i < 60; i++) {
        long long new_v=a[i]%2;
        if(!new_v&&a[i])
            new_v+=2;
        a[i+1]+=(a[i]-new_v)/2;
        a[i]=new_v;
    }
    for(int i = 0; i < 130; i++) {
        if(!a[i]) {
            ans *= sum;
            l = 0;
            sum = 1;
        } else {
            if(!l)
                l = i+1;
            sum+=a[i]<<(i-l+1);
        }
    }
    return ans;
}

# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 288 KB Output is correct
4 Correct 0 ms 284 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -