제출 #605363

#제출 시각아이디문제언어결과실행 시간메모리
605363SamAnd비스킷 담기 (IOI20_biscuits)C++17
0 / 100
1105 ms111792 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; #define fi first #define se second #define m_p make_pair #define sz(x) ((int)(x).size()) #define all(x) (x).begin(),(x).end() typedef long long ll; const int X = 20004, K = 202; map<ll, ll> dp[K]; long long count_tastiness(long long x, std::vector<long long> a) { for (int i = 0; i < 66; ++i) a.push_back(0); dp[0][0] = 1; for (int i = 0; i < sz(a); ++i) { for (auto it = dp[i].begin(); it != dp[i].end(); ++it) { int j = it->fi; dp[i + 1][(j + a[i]) / 2] += dp[i][j]; if (j + a[i] - x >= 0) dp[i + 1][(j + a[i] - x) / 2] += dp[i][j]; } } ll ans = 0; for (auto it = dp[sz(a)].begin(); it != dp[sz(a)].end(); ++it) ans += it->se; return ans; }

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

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:30:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   30 |     for (auto it = dp[sz(a)].begin(); it != dp[sz(a)].end(); ++it)
      |     ^~~
biscuits.cpp:32:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   32 |  return ans;
      |  ^~~~~~
#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...