Submission #720819

#TimeUsernameProblemLanguageResultExecution timeMemory
720819baokhue232005Measures (CEOI22_measures)C++14
10 / 100
1563 ms3788 KiB
/* #pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") #pragma GCC optimize("unroll-loops") */ // lethal option #include<bits/stdc++.h> using namespace std; #define all(flg) flg.begin(), flg.end() #define int long long #define pb push_back #define fi first #define se second #define endl "\n" #define eb emplace_back #define ii pair<int, int> #define vi vector<int> #define PI 3.141592653589793238462643383279502884 #define ll long long #define ld long double #define for1(i, ff, gg) for(int i = ff; i <= gg; ++i) #define for2(i, ff, gg) for(int i = ff; i >= gg; --i) const ll mod = 1e9 + 7; const int maxN = 2e5 + 5; const ll oo = 1e18 + 7; int n, a[maxN]; int x, y, z, k, m; int ans[maxN]; int D; void conv(int num){ cout << num / 2; if(num & 1) cout << ".5"; cout << " "; } signed main(){ // freopen(".inp", "r", stdin); ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL); cin >> n >> m >> D; for1(i, 1, n){ cin >> a[i]; } for1(i, 1, m){ ++n; cin >> a[n]; sort(a + 1, a + n + 1); int ans = 0; for1(i, 1, n) for1(j, i + 1, n){ ans = max(ans, -(a[j] - a[i] - (j - i) * D)); } conv(ans); } cout << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...