제출 #207491

#제출 시각아이디문제언어결과실행 시간메모리
207491DystoriaXBali Sculptures (APIO15_sculpture)C++14
0 / 100
6 ms376 KiB
#include <bits/stdc++.h> using namespace std; int n, a, b; int y[100010]; long long dp[1010][1010], pref[1010]; int main(){ scanf("%d%d%d", &n, &a, &b); for(int i = 1; i <= n; i++){ scanf("%d", &y[i]); pref[i] = y[i] + pref[i - 1]; } for(int i = 0; i <= n; i++) for(int j = 0; j <= n; j++) dp[i][j] = 1e18; dp[0][0] = 0; for(int j = 1; j <= n; j++){ for(int i = j; i <= n; i++){ for(int k = j - 1; k < i; k++){ dp[i][j] = min(dp[i][j], dp[k][j - 1] | (pref[i] - pref[k])); } } } long long ans = 1e18; for(int i = a; i <= b; i++) ans = min(ans, dp[n][i]); printf("%lld\n", ans); return 0; }

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

sculpture.cpp: In function 'int main()':
sculpture.cpp:10: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:13:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d", &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...