Submission #6453212


Source Code Expand

Copy
#include <bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;

int get(int a, int b) {
    return (a + b - 1) / b;
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    vector<int> a(n), b(n);
    for (int i = 0; i < n; ++i) cin >> a[i];
    for (int i = 0; i < n; ++i) b[i] = a[i];
    sort(b.begin(), b.end());
    int fm = b[n - 2], sm = b[n - 1];
    for (int i = 0; i < n; ++i) {
        if (a[i] == sm) cout << fm << endl;
        else cout << sm << endl;
    }
    return 0;
}

Submission Info

Submission Time
Task C - Exception Handling
User idtj
Language C++14 (GCC 5.4.1)
Score 300
Code Size 582 Byte
Status AC
Exec Time 47 ms
Memory 4736 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 2
AC × 12
Set Name Test Cases
Sample a01, a02
All a01, a02, b03, b04, b05, b06, b07, b08, b09, b10, b11, b12
Case Name Status Exec Time Memory
a01 AC 1 ms 256 KB
a02 AC 1 ms 256 KB
b03 AC 1 ms 256 KB
b04 AC 1 ms 256 KB
b05 AC 1 ms 256 KB
b06 AC 35 ms 4736 KB
b07 AC 28 ms 3840 KB
b08 AC 35 ms 4736 KB
b09 AC 34 ms 4608 KB
b10 AC 47 ms 4736 KB
b11 AC 38 ms 4736 KB
b12 AC 34 ms 4608 KB