제출 #602857

#제출 시각아이디문제언어결과실행 시간메모리
602857MohamedFaresNebiliPacking Biscuits (IOI20_biscuits)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> /// #pragma GCC optimize ("Ofast") /// #pragma GCC target ("avx2") /// #pragma GCC optimize("unroll-loops") using namespace std; using ll = long long; using ii = pair<ll, ll>; using vi = vector<int>; #define ff first #define ss second #define pb push_back #define all(x) (x).begin(), (x).end() #define lb lower_bound const int oo = 1000 * 1000 * 1000 + 7; ll count_tastiness(ll X, vector<ll> A) { ll K = A.size(); ll res = 0; ll C = 0, pw[64]; pw[0] = 1; for(ll l = 1; l < 62; l++) pw[l] = pw[l - 1] * 2; for(ll l = 0; l < K; l++) C += pw[l] * A[l]; for(ll l = 0; l <= C; l++) { ll T = 0; bool O = 1; for(ll i = 0; i < K && O; i++) { if(!(l & (1 << i))) { T += A[i]; T /= 2; continue; } T += A[i]; if(T < X) O = 0; T -= X; T /= 2; } res += O; } return res; }#include <bits/stdc++.h> /// #pragma GCC optimize ("Ofast") /// #pragma GCC target ("avx2") /// #pragma GCC optimize("unroll-loops") using namespace std; using ll = long long; using ii = pair<ll, ll>; using vi = vector<int>; #define ff first #define ss second #define pb push_back #define all(x) (x).begin(), (x).end() #define lb lower_bound const int oo = 1000 * 1000 * 1000 + 7; ll count_tastiness(ll X, vector<ll> A) { ll K = A.size(); ll res = 0; ll C = 0, pw[64]; pw[0] = 1; for(ll l = 1; l < 62; l++) pw[l] = pw[l - 1] * 2; for(ll l = 0; l < K; l++) C += pw[l] * A[l]; for(ll l = 0; l <= C; l++) { ll T = 0; bool O = 1; for(ll i = 0; i < K && O; i++) { if(!(l & (1ll << i))) { T += A[i]; T /= 2; continue; } T += A[i]; if(T < X) O = 0; else { T -= X; T /= 2; } } res += (O == true); } return res; }

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

biscuits.cpp:41:14: error: stray '#' in program
   41 |             }#include <bits/stdc++.h>
      |              ^
biscuits.cpp:41:15: error: 'include' does not name a type
   41 |             }#include <bits/stdc++.h>
      |               ^~~~~~~
biscuits.cpp:58:23: error: redefinition of 'const int oo'
   58 |             const int oo = 1000 * 1000 * 1000 + 7;
      |                       ^~
biscuits.cpp:18:23: note: 'const int oo' previously defined here
   18 |             const int oo = 1000 * 1000 * 1000 + 7;
      |                       ^~
biscuits.cpp:60:16: error: redefinition of 'll count_tastiness(ll, std::vector<long long int>)'
   60 |             ll count_tastiness(ll X, vector<ll> A) {
      |                ^~~~~~~~~~~~~~~
biscuits.cpp:20:16: note: 'll count_tastiness(ll, std::vector<long long int>)' previously defined here
   20 |             ll count_tastiness(ll X, vector<ll> A) {
      |                ^~~~~~~~~~~~~~~