Submission #3001631


Source Code Expand

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cassert>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <fstream>

using namespace std;
#define TOSTRING(x) #x
#define SZ(x) (int)(x).size()
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define ALL(s) (s).begin(), (s).end()
#define so(V) sort(ALL(V))
#define rev(V) reverse(ALL(V))
#define uni(v) v.erase( unique(ALL(v)) , v.end());
#define PAU system("pause")

typedef long long unsigned int llu;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vector <int> > vvi;
const int EPS = 1e-9;
const int MOD = 1e9 + 7;
const int INF = (1 << 30);
const double PI = acos(-1);

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N, M;
	cin >> N >> M;
	stack<int> S;
	vector<bool> VB(N, false);//0-indexed
	REP(i, M) {
		int a;
		cin >> a;
		S.push(a);
	}
	while (!S.empty()) {
		int a = S.top(); S.pop();
		if (VB[a - 1])continue;
		cout << a << endl;
		VB[a - 1] = true;
	}
	REP(i, N) {
		if (!VB[i])cout << i + 1 << endl;
	}
	PAU;
	return 0;
}

Submission Info

Submission Time
Task A - 掲示板
User Daylight
Language C++14 (GCC 5.4.1)
Score 100
Code Size 1326 Byte
Status AC
Exec Time 163 ms
Memory 1476 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:61:5: warning: ignoring return value of ‘int system(const char*)’, declared with attribute warn_unused_result [-Wunused-result]
  PAU;
     ^

Judge Result

Set Name Sample Subtask1 Subtask2
Score / Max Score 0 / 0 30 / 30 70 / 70
Status
AC × 3
AC × 14
AC × 30
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
Subtask1 sample_01.txt, sample_02.txt, sample_03.txt, subtask1_00.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt
Subtask2 sample_01.txt, sample_02.txt, sample_03.txt, subtask1_00.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask2_00.txt, subtask2_01.txt, subtask2_02.txt, subtask2_03.txt, subtask2_04.txt, subtask2_05.txt, subtask2_06.txt, subtask2_07.txt, subtask2_08.txt, subtask2_09.txt, subtask2_10.txt, subtask2_11.txt, subtask2_12.txt, subtask2_13.txt, subtask2_14.txt, subtask2_15.txt
Case Name Status Exec Time Memory
sample_01.txt AC 2 ms 504 KB
sample_02.txt AC 2 ms 504 KB
sample_03.txt AC 2 ms 500 KB
subtask1_00.txt AC 2 ms 504 KB
subtask1_01.txt AC 2 ms 504 KB
subtask1_02.txt AC 2 ms 504 KB
subtask1_03.txt AC 2 ms 504 KB
subtask1_04.txt AC 2 ms 504 KB
subtask1_05.txt AC 2 ms 504 KB
subtask1_06.txt AC 2 ms 504 KB
subtask1_07.txt AC 2 ms 504 KB
subtask1_08.txt AC 2 ms 504 KB
subtask1_09.txt AC 2 ms 504 KB
subtask1_10.txt AC 2 ms 504 KB
subtask2_00.txt AC 136 ms 1144 KB
subtask2_01.txt AC 34 ms 504 KB
subtask2_02.txt AC 111 ms 1272 KB
subtask2_03.txt AC 8 ms 632 KB
subtask2_04.txt AC 56 ms 768 KB
subtask2_05.txt AC 152 ms 1400 KB
subtask2_06.txt AC 146 ms 1280 KB
subtask2_07.txt AC 26 ms 884 KB
subtask2_08.txt AC 57 ms 888 KB
subtask2_09.txt AC 39 ms 760 KB
subtask2_10.txt AC 158 ms 1476 KB
subtask2_11.txt AC 158 ms 1476 KB
subtask2_12.txt AC 163 ms 1476 KB
subtask2_13.txt AC 157 ms 1476 KB
subtask2_14.txt AC 158 ms 1476 KB
subtask2_15.txt AC 159 ms 1472 KB