제출 #207499

#제출 시각아이디문제언어결과실행 시간메모리
207499DystoriaXBali Sculptures (APIO15_sculpture)C++14
9 / 100
1093 ms632 KiB
#include <bits/stdc++.h> using namespace std; int n, a, b; int y[1010]; long long pref[1010]; long long ans = 1e18, sum = 0; void rec(int depth, int last){ if(last > n){ if(a <= depth && depth <= b) ans = min(ans, sum); return; } else { long long tp = sum; for(int i = last; i <= n; i++){ sum |= (pref[i] - pref[last - 1]); rec(depth + 1, i + 1); sum = tp; } } } int main(){ scanf("%d%d%d", &n, &a, &b); for(int i = 1; i <= n; i++) scanf("%d", &y[i]), pref[i] = pref[i - 1] + y[i]; rec(0, 1); printf("%lld\n", ans); return 0; }

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

sculpture.cpp: In function 'int main()':
sculpture.cpp:25:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d%d", &n, &a, &b);
     ~~~~~^~~~~~~~~~~~~~~~~~~~~~
sculpture.cpp:27:51: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     for(int i = 1; i <= n; i++) scanf("%d", &y[i]), pref[i] = pref[i - 1] + y[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...