Submission #6452392


Source Code Expand

Copy
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
using namespace std;

int main(){
  int N;
  cin >> N;
  int a[N];
  for(int i = 0; i < N; i++) cin >> a[i];

  int ind = max_element(a, a + N) - a;
  int mx = *max_element(a, a + N);

  //cout << ind << endl;
  for(int i = 0; i < N; i++){
    if(i == ind){
      cout << max(*max_element(a, a + ind), *max_element(a + ind + 1, a + N)) << endl;
    } else {
      cout << mx << endl;
    }
  }

  return 0;
}

Submission Info

Submission Time
Task C - Exception Handling
User syawacha
Language C++14 (GCC 5.4.1)
Score 0
Code Size 661 Byte
Status WA
Exec Time 391 ms
Memory 2432 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 2
AC × 10
WA × 2
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 WA 1 ms 256 KB
b04 AC 1 ms 256 KB
b05 AC 1 ms 256 KB
b06 AC 391 ms 2432 KB
b07 WA 335 ms 1408 KB
b08 AC 375 ms 2432 KB
b09 AC 377 ms 2176 KB
b10 AC 379 ms 2432 KB
b11 AC 385 ms 2432 KB
b12 AC 376 ms 2176 KB