# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
195659 | 2020-01-16T17:54:28 Z | T0p_ | Art Exhibition (JOI18_art) | C++14 | 12 ms | 508 KB |
#include<bits/stdc++.h> using namespace std; long long a[20], b[20]; int main(){ int n; long long ans = 0; scanf(" %d",&n); if(n > 16) return 0; for(int i=1 ; i<=n ; i++) scanf(" %lld %lld",&a[i],&b[i]); for(int i=0 ; i<(1<<n) ; i++){ int temp = i; long long S = 0, AM = -1e18, Am = 1e18; for(int j=1 ; j<=n ; j++){ cout << temp%2 ; if(temp%2){ S += b[i]; AM = max(AM, a[j]); Am = min(Am, a[j]); } temp/=2; } cout << endl; ans = max(ans, S - AM + Am); } printf("%lld\n",ans); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 12 ms | 508 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 12 ms | 508 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 12 ms | 508 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 12 ms | 508 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |