제출 #566797

#제출 시각아이디문제언어결과실행 시간메모리
5667972fat2code비스킷 담기 (IOI20_biscuits)C++17
12 / 100
2 ms340 KiB
#include "biscuits.h" #include <bits/stdc++.h> #define fr first #define sc second #define all(s) s.begin(), s.end() #define int long long using namespace std; int ans, k; int count_tastiness(int x, vector<int> a) { ans = 1LL; k = (int)a.size(); for(int i=0;i<(int)a.size();i++){ if(a[i] >= 3){ if(i == a.size() - 1){ a.push_back(0); } a[i + 1] += ( (a[i] - 1LL) / 2LL); if(a[i] % 2 == 1LL) a[i] = 1; else a[i]= 2; } } int j = 0; while(j < (int)a.size()){ int curr = 0; int pos = j; while(j < (int)a.size() && a[j] != 0){ curr = (curr + a[j] * (1LL << (j - pos))); ++j; } curr++; ans *= curr; j++; } return ans; }

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

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:16:18: 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]
   16 |             if(i == a.size() - 1){
      |                ~~^~~~~~~~~~~~~~~
#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...