제출 #101292

#제출 시각아이디문제언어결과실행 시간메모리
101292arman_ferdousBali Sculptures (APIO15_sculpture)C++17
0 / 100
3 ms256 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { int n, A, B; ll arr[22]; scanf("%d %d", &n, &A, &B); for(int i = 0; i < n; i++) scanf("%lld", &arr[i]); ll ans = (1ll<<62); for(int mask = 0; mask < (1<<n); mask++) { ll here = 0, cnt = 0; for(int i = 0; i < n; ) { ll sum = 0; for(int j = i; j < n; j++, i++) { sum += arr[j]; if(mask>>j&1) { i++; cnt++; break; } } here |= sum; } if(A <= cnt && cnt <= B) ans = min(ans, here); } printf("%lld\n", ans); return 0; }

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

sculpture.cpp: In function 'int main()':
sculpture.cpp:9:27: warning: too many arguments for format [-Wformat-extra-args]
  scanf("%d %d", &n, &A, &B);
                           ^
sculpture.cpp:9:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d", &n, &A, &B);
  ~~~~~^~~~~~~~~~~~~~~~~~~~~
sculpture.cpp:11:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%lld", &arr[i]);
   ~~~~~^~~~~~~~~~~~~~~~~
#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...