답안 #720811

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
720811 2023-04-09T10:58:41 Z baokhue232005 Measures (CEOI22_measures) C++14
0 / 100
1500 ms 340 KB
/*
#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, abs(a[j] - a[i] - (j - i) * D));
        }
        conv(ans);
    }
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 25 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 25 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1573 ms 340 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1573 ms 340 KB Time limit exceeded
2 Halted 0 ms 0 KB -