Submission #9252399


Source Code Expand

Copy
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
            ∧_∧
      ∧_∧  (´<_` )  Welcome to My Coding Space!
     ( ´_ゝ`) /  ⌒i     @hamayanhamayan0
    /   \     | |
    /   / ̄ ̄ ̄ ̄/  |
  __(__ニつ/     _/ .| .|____
     \/____/ (u ⊃
---------------------------------------------------------------------------------------------------*/














int N, A[201010];
int cnt[201010];
//---------------------------------------------------------------------------------------------------
void _main() {
	cin >> N;
	rep(i, 0, N) cin >> A[i];

	rep(i, 0, N) cnt[A[i]]++;

	int x = -1, y = -1;
	rep(i, 1, N + 1) {
		if (cnt[i] == 0) x = i;
		if (cnt[i] == 2) y = i;
	}

	if (x < 0) cout << "Correct" << endl;
	else cout << y << " " << x << endl;
}





Submission Info

Submission Time
Task D - Duplicated?
User hamayanhamayan
Language C++14 (GCC 5.4.1)
Score 7
Code Size 1699 Byte
Status
Exec Time 19 ms
Memory 1792 KB

Judge Result

Set Name Score / Max Score Test Cases
Sample 0 / 0 example_01.txt, example_02.txt
All 7 / 7 example_01.txt, example_02.txt, subtask_01_01.txt, subtask_01_02.txt, subtask_01_03.txt, subtask_01_04.txt, subtask_01_05.txt, subtask_01_06.txt, subtask_01_07.txt, subtask_01_08.txt, subtask_01_09.txt, subtask_01_10.txt, subtask_01_11.txt, subtask_01_12.txt, subtask_01_13.txt, subtask_01_14.txt, subtask_01_15.txt, subtask_01_16.txt, subtask_01_17.txt, subtask_01_18.txt, subtask_01_19.txt, subtask_01_20.txt
Case Name Status Exec Time Memory
example_01.txt 1 ms 256 KB
example_02.txt 1 ms 256 KB
subtask_01_01.txt 1 ms 256 KB
subtask_01_02.txt 19 ms 1792 KB
subtask_01_03.txt 19 ms 1792 KB
subtask_01_04.txt 19 ms 1792 KB
subtask_01_05.txt 19 ms 1792 KB
subtask_01_06.txt 10 ms 1152 KB
subtask_01_07.txt 2 ms 384 KB
subtask_01_08.txt 9 ms 1024 KB
subtask_01_09.txt 7 ms 896 KB
subtask_01_10.txt 4 ms 512 KB
subtask_01_11.txt 13 ms 1280 KB
subtask_01_12.txt 1 ms 256 KB
subtask_01_13.txt 1 ms 256 KB
subtask_01_14.txt 18 ms 1792 KB
subtask_01_15.txt 18 ms 1792 KB
subtask_01_16.txt 18 ms 1792 KB
subtask_01_17.txt 18 ms 1792 KB
subtask_01_18.txt 19 ms 1792 KB
subtask_01_19.txt 18 ms 1792 KB
subtask_01_20.txt 18 ms 1792 KB