제출 #51378

#제출 시각아이디문제언어결과실행 시간메모리
51378adamczh1Sure Bet (CEOI17_sure)C++17
20 / 100
77 ms744 KiB
#include <bits/stdc++.h> using namespace std; const int MAXN = 1e5 + 5; int n; double a[MAXN], b[MAXN]; int main() { scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%lf %lf", &a[i], &b[i]); } double res = 0; for (int mask = 0; mask < (1 << (2 * n)); mask++) { double x = 0, y = 0; for (int i = 0; i < n; i++) { if ((mask >> (2 * i)) & 1) { x += a[i] - 1; y--; } if ((mask >> (2 * i + 1)) & 1) { x--; y += b[i] - 1; } } res = max(res, min(x, y)); } printf("%.4lf", res); return 0; }

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

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