답안 #1023607

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1023607 2024-07-15T03:40:09 Z vjudge1 Just Long Neckties (JOI20_ho_t1) C++17
9 / 100
1000 ms 8840 KB
#include <bits/stdc++.h>
#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
#define FOR(i,n) for(int i=0;i<n;i++)
#define ROF(i,m,n) for(int i=m;i<=n;i++)
#define vi vector<int>
#define pb push_back
#define alle(a) a.begin(),a.end()
#define rall(n) rbegin(n),rend(n)
#define int long long
#define vecs vector<int> 
#define ll long long
#define ss second 
#define ff first
const int INF = 1e9 + 1;
const int MOD = 1e9 + 7;
const int N = 2005;

void solve(){
    int n;
    cin >> n;
    vector<int> a(n + 1), b(n);
    for(int i = 0; i <= n; i++){
        cin >> a[i];
    }
    for(int i = 0; i < n; i++){
        cin >> b[i];
    }
    for(int i = 0; i <= n; i++){
        vector<int> c = a;
        c.erase(c.begin() + i);
        sort(c.begin(), c.end());
        sort(b.begin(),b.end());
        int mx = 0;
        for(int j = 0; j < n; j++){
            int h = 0;
            int y = max(c[j] - b[j],h);
            mx = max(y, mx);
        }
        cout << mx << " ";
    }
    cout << endl;
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    int t = 1;
    while (t--) {
        solve();
    }
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 456 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 456 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 19 ms 348 KB Output is correct
15 Correct 60 ms 512 KB Output is correct
16 Correct 1 ms 344 KB Output is correct
17 Correct 112 ms 344 KB Output is correct
18 Correct 88 ms 348 KB Output is correct
19 Correct 85 ms 516 KB Output is correct
20 Correct 76 ms 344 KB Output is correct
21 Correct 83 ms 524 KB Output is correct
22 Correct 76 ms 348 KB Output is correct
23 Correct 85 ms 600 KB Output is correct
24 Correct 103 ms 348 KB Output is correct
25 Correct 123 ms 344 KB Output is correct
26 Correct 112 ms 344 KB Output is correct
27 Correct 109 ms 348 KB Output is correct
28 Correct 126 ms 596 KB Output is correct
29 Correct 89 ms 504 KB Output is correct
30 Correct 105 ms 508 KB Output is correct
31 Correct 129 ms 600 KB Output is correct
32 Correct 144 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 456 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 19 ms 348 KB Output is correct
15 Correct 60 ms 512 KB Output is correct
16 Correct 1 ms 344 KB Output is correct
17 Correct 112 ms 344 KB Output is correct
18 Correct 88 ms 348 KB Output is correct
19 Correct 85 ms 516 KB Output is correct
20 Correct 76 ms 344 KB Output is correct
21 Correct 83 ms 524 KB Output is correct
22 Correct 76 ms 348 KB Output is correct
23 Correct 85 ms 600 KB Output is correct
24 Correct 103 ms 348 KB Output is correct
25 Correct 123 ms 344 KB Output is correct
26 Correct 112 ms 344 KB Output is correct
27 Correct 109 ms 348 KB Output is correct
28 Correct 126 ms 596 KB Output is correct
29 Correct 89 ms 504 KB Output is correct
30 Correct 105 ms 508 KB Output is correct
31 Correct 129 ms 600 KB Output is correct
32 Correct 144 ms 348 KB Output is correct
33 Execution timed out 1022 ms 8840 KB Time limit exceeded
34 Halted 0 ms 0 KB -