제출 #1121558

#제출 시각아이디문제언어결과실행 시간메모리
1121558vjudge1Ice Hockey World Championship (CEOI15_bobek)C++17
100 / 100
392 ms8816 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define inf 0x3F3F3F3F signed main() { ios_base::sync_with_stdio(0); cin.tie(0); int n, m; cin >> n >> m; vector<int> a; vector<int> v1, v2; int x[n]; for (int &i : x) cin >> i; for (int i = 0; i < n; i++) { if (i < 20) v1.push_back(x[i]); else v2.push_back(x[i]); } for (int i = 0; i < (1 << (int)v1.size()); i++) { int s = 0; for (int j = 0; j < v1.size(); j++) { if (i >> j & 1) s += v1[j]; } a.push_back(s); } sort(a.begin(), a.end()); int res = 0; for (int i = 0; i < (1 << (int)v2.size()); i++) { int s = 0; for (int j = 0; j < v2.size(); j++) { if (i >> j & 1) s += v2[j]; } res += upper_bound(a.begin(), a.end(), m - s) - a.begin(); } cout << res << '\n'; }

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

bobek.cpp: In function 'int main()':
bobek.cpp:26:23: 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]
   26 |     for (int j = 0; j < v1.size(); j++)
      |                     ~~^~~~~~~~~~~
bobek.cpp:37:23: 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]
   37 |     for (int j = 0; j < v2.size(); j++)
      |                     ~~^~~~~~~~~~~
#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...
#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...