제출 #45747

#제출 시각아이디문제언어결과실행 시간메모리
45747antimirageBali Sculptures (APIO15_sculpture)C++17
0 / 100
27 ms32048 KiB
#include <bits/stdc++.h> #define fr first #define sc second #define mk make_pair #define pb push_back #define OK puts("OK"); #define sz(s) (int)s.size() #define all(s) s.begin(), s.end() #define int long long using namespace std; const int N = 2005; int n, a, b, ar[N], dp[N][N], pref[N], ans = 1e18; main() { cin >> n >> a >> b; for (int i = 1; i <= n; i++) scanf("%d", &ar[i]), pref[i] = ar[i] + pref[i - 1]; memset ( dp, 0x3f3f3f3f, sizeof(dp) ); dp[0][0] = 0; for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) for (int k = 1; k <= j; k++) dp[i][j] = min(dp[i][j], ( dp[i - 1][k - 1] | (pref[j] - pref[k - 1]) ) ); for (int i = a; i <= b; i++) ans = min(ans, dp[i][n]); cout << ans << endl; }

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

sculpture.cpp:18:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main()
      ^
sculpture.cpp: In function 'int main()':
sculpture.cpp:22:27: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long int*' [-Wformat=]
         scanf("%d", &ar[i]), pref[i] = ar[i] + pref[i - 1];
                     ~~~~~~^
sculpture.cpp:22:28: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d", &ar[i]), pref[i] = ar[i] + pref[i - 1];
         ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#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...