제출 #400009

#제출 시각아이디문제언어결과실행 시간메모리
400009faresbasbs비스킷 담기 (IOI20_biscuits)C++14
9 / 100
1096 ms3456 KiB
#include <bits/stdc++.h> #include "biscuits.h" using namespace std; long long x,cnt,arr1[200001],arr2[200001]; vector<long long> a; long long count_tastiness(long long X , vector<long long> A){ a = A , x = X; while(a.size() < 60){ a.push_back(0ll); } memset(arr1,-1,sizeof arr1); arr1[0] = 0; for(int i = 0 ; i < 60 ; i += 1){ memset(arr2,-1,sizeof arr2); cnt = 0; for(int j = 0 ; j <= 200000 ; j += 1){ if(arr1[j] == -1){ break; } int p = arr1[j]+a[i]; arr2[cnt++] = p/2; if(p >= x){ arr2[cnt++] = (p-x)/2; } } swap(arr1,arr2); } long long ret = 0; for(int i = 0 ; i <= 200000 ; i += 1){ if(arr1[i] == -1){ break; } ret += 1; } return ret; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...