Submission #26006

#TimeUsernameProblemLanguageResultExecution timeMemory
26006kajebiii카드 역배치 (KOI15_reversal)C++14
25 / 25
0 ms2020 KiB
// =====================================================================================
//
//       Filename:  10804.cpp
//
//    Description:  BOJ
//
//        Version:  1.0
//        Created:  08/31/2016 00:25:02
//       Revision:  none
//       Compiler:  g++
//
//         Author:  JongBeom Kim (KJBS2), qja0950@gmail.com
//   Organization:  KJBS2
//
// =====================================================================================

#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <numeric>
#include <string.h>
#include <string>
#include <queue>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <math.h>

using namespace std;

typedef pair<int, int> pi;
typedef long long ll;
#define mp make_pair
#define pb push_back
#define fi first
#define se second
pi operator +(const pi &x, const pi &y) {return mp(x.fi+y.fi, x.se+y.se);}

const int INF = 0x7fffffff;
const pi Ch[4] = {mp(-1, 0), mp(0, -1), mp(1, 0), mp(0, 1)};

int Nr[22];
int main() {
	for(int i=1; i<=20; i++) Nr[i] = i;
	for(int i=1; i<=10; i++)
	{
		int x, y; scanf("%d%d", &x, &y);
		reverse(Nr+x, Nr+y+1);
	}
	for(int i=1; i<=20; i++) printf("%d ", Nr[i]);
	return 0;
}










Compilation message (stderr)

reversal.cpp: In function 'int main()':
reversal.cpp:48:34: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   int x, y; scanf("%d%d", &x, &y);
                                  ^
#Verdict Execution timeMemoryGrader output
Fetching results...