답안 #719589

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
719589 2023-04-06T10:16:06 Z Rafi22 Measures (CEOI22_measures) C++14
0 / 100
1500 ms 872 KB
#include <bits/stdc++.h>

using namespace std;

#define endl '\n'
#define ll long long
#define st first
#define nd second
#define pb push_back
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
ll mod=1000000007;
int inf=1000000007;
ll infl=1000000000000000007;

signed main()
{
    int n,m,d,x;
    cin>>n>>m>>d;
    d*=2;
    vector<int>a(n);
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        a[i]*=2;
    }
    for(int i=0;i<m;i++)
    {
        cin>>x;
        a.pb(2*x);
        sort(all(a));
        int l=a[0],k=0;
        for(int j=1;j<n+i+1;j++)
        {
            if(l+d>a[j]+k)
            {
                int m=(l+d-a[j]-k)/2;
                k+=m;
                l+=d-m;
            }
            else l=max(a[j]-k,l+d);
        }
        if(k%2==1) cout<<k/2<<".5"<<" ";
        else cout<<k/2<<" ";
    }

    return 0;
}

# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 2 ms 212 KB Output is correct
4 Correct 3 ms 324 KB Output is correct
5 Correct 2 ms 212 KB Output is correct
6 Incorrect 2 ms 212 KB Output isn't correct
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 2 ms 212 KB Output is correct
4 Correct 3 ms 324 KB Output is correct
5 Correct 2 ms 212 KB Output is correct
6 Incorrect 2 ms 212 KB Output isn't correct
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1569 ms 872 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1569 ms 872 KB Time limit exceeded
2 Halted 0 ms 0 KB -