제출 #56078

#제출 시각아이디문제언어결과실행 시간메모리
56078gabrielsimoesSure Bet (CEOI17_sure)C++17
0 / 100
2 ms376 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MAXN = 1e5+10; int n; ll pa[MAXN], pb[MAXN]; ll ans = 0; void dfs(int i, ll a, ll b) { if (i == n) { ans = max(ans, min(a, b)); } else { dfs(i+1, a, b); dfs(i+1, a-10000, b+pb[i]-10000); dfs(i+1, a+pa[i]-10000, b-10000); } } int main() { scanf("%d", &n); for (int i = 0; i < n; i++) { double a, b; scanf("%lf %lf", &a, &b); // printf("%lf %lf\n", a, b); pa[i] = 1e4 * a; pb[i] = 1e4 * b; } dfs(0, 0, 0); printf("%lf\n", double(ans) / 1e4); }

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

sure.cpp: In function 'int main()':
sure.cpp:23:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &n);
     ~~~~~^~~~~~~~~~
sure.cpp:27:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%lf %lf", &a, &b);
         ~~~~~^~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...