제출 #605408

#제출 시각아이디문제언어결과실행 시간메모리
605408HamletPetrosyan비스킷 담기 (IOI20_biscuits)C++17
컴파일 에러
0 ms0 KiB
#include "biscuits.h" #include <iostream> #include <map> using namespace std; #define ll long long #define add push_back #define len(a) ((int)(a).size()) map<ll, ll> dp[70]; long long count_tastiness(long long x, vector<long long> a) { for(int i = 0; i <= len(a) + 8; i++){ dp[i].clear(); } dp[0][0] = 1; for(int i = 0; i <= len(a) + 7; i++){ for(auto v : dp[i]){ dp[i + 1][((v.fr + (i >= len(a) ? 0 : a[i])) / 2)] += v.sc; if((i >= len(a) ? 0 : a[i]) + v.fr >= x) dp[i + 1][(v.fr + (i >= len(a) ? 0 : a[i]) - x) / 2] += v.sc; } } ll ret = 0; for(auto v : dp[len(a) + 7]){ ret += v.sc; } return ret; }

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

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:20:18: error: 'struct std::pair<const long long int, long long int>' has no member named 'fr'
   20 |    dp[i + 1][((v.fr + (i >= len(a) ? 0 : a[i])) / 2)] += v.sc;
      |                  ^~
biscuits.cpp:20:60: error: 'struct std::pair<const long long int, long long int>' has no member named 'sc'
   20 |    dp[i + 1][((v.fr + (i >= len(a) ? 0 : a[i])) / 2)] += v.sc;
      |                                                            ^~
biscuits.cpp:21:36: error: 'struct std::pair<const long long int, long long int>' has no member named 'fr'
   21 |    if((i >= len(a) ? 0 : a[i]) + v.fr >= x) dp[i + 1][(v.fr + (i >= len(a) ? 0 : a[i]) - x) / 2] += v.sc;
      |                                    ^~
biscuits.cpp:21:58: error: 'struct std::pair<const long long int, long long int>' has no member named 'fr'
   21 |    if((i >= len(a) ? 0 : a[i]) + v.fr >= x) dp[i + 1][(v.fr + (i >= len(a) ? 0 : a[i]) - x) / 2] += v.sc;
      |                                                          ^~
biscuits.cpp:21:103: error: 'struct std::pair<const long long int, long long int>' has no member named 'sc'
   21 |    if((i >= len(a) ? 0 : a[i]) + v.fr >= x) dp[i + 1][(v.fr + (i >= len(a) ? 0 : a[i]) - x) / 2] += v.sc;
      |                                                                                                       ^~
biscuits.cpp:26:12: error: 'struct std::pair<const long long int, long long int>' has no member named 'sc'
   26 |   ret += v.sc;
      |            ^~