Submission #676993

#TimeUsernameProblemLanguageResultExecution timeMemory
676993penguin133Collecting Stamps 3 (JOI20_ho_t3)C++17
0 / 100
1 ms324 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define pi pair<int, int> #define pii pair<int, pi> #define fi first #define se second #ifdef _WIN32 #define getchar_unlocked _getchar_nolock #endif int n, l, A[205], B[205]; int mx = 0; void solve(){ cin >> n >> l; for(int i=1;i<=n;i++)cin >> A[i]; for(int i=1;i<=n;i++)cin >> B[i]; int cur = 0; for(int i=1;i<=n;i++){ if(B[i] >= A[i])cur++; } mx = max(mx, cur); cur = 0; for(int i=n;i>=1;i--){ if(B[i] >= l - A[i])cur++; } mx = max(mx, cur); cur = 0; for(int i=1;i<=n;i++){ if(B[i] >= A[i])cur++; int t = 2 * A[i]; int cur2 = 0; for(int j=n;j>i;j--){ if(B[j] >= l - A[j] + t)cur2++; } mx = max(mx, cur + cur2); } cur = 0; for(int i=n;i>=1;i--){ int cur2 = 0; if(B[i] >= l - A[i])cur++; int t = 2 * (l - A[i]); for(int j=1;j<i;j++){ if(B[j] >= A[j] + t)cur2++; } mx = max(mx, cur + cur2); } cout << mx; } main(){ ios::sync_with_stdio(0);cin.tie(0); int tc = 1; //cin >> tc; for(int tc1=1;tc1<=tc;tc1++){ // cout << "Case #" << tc1 << ": "; solve(); } }

Compilation message (stderr)

ho_t3.cpp:54:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   54 | main(){
      | ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...