// =====================================================================================
//
// Filename: 10804.cpp
//
// Description: BOJ
//
// Version: 1.0
// Created: 08/31/2016 00:25:02
// Revision: none
// Compiler: g++
//
// Author: JongBeom Kim (KJBS2), [email protected]
// 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
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 time |
Memory |
Grader output |
1 |
Correct |
0 ms |
2020 KB |
Output is correct |
2 |
Correct |
0 ms |
2020 KB |
Output is correct |
3 |
Correct |
0 ms |
2020 KB |
Output is correct |
4 |
Correct |
0 ms |
2020 KB |
Output is correct |
5 |
Correct |
0 ms |
2020 KB |
Output is correct |
6 |
Correct |
0 ms |
2020 KB |
Output is correct |
7 |
Correct |
0 ms |
2020 KB |
Output is correct |
8 |
Correct |
0 ms |
2020 KB |
Output is correct |
9 |
Correct |
0 ms |
2020 KB |
Output is correct |
10 |
Correct |
0 ms |
2020 KB |
Output is correct |
11 |
Correct |
0 ms |
2020 KB |
Output is correct |
12 |
Correct |
0 ms |
2020 KB |
Output is correct |
13 |
Correct |
0 ms |
2020 KB |
Output is correct |
14 |
Correct |
0 ms |
2020 KB |
Output is correct |
15 |
Correct |
0 ms |
2020 KB |
Output is correct |
16 |
Correct |
0 ms |
2020 KB |
Output is correct |
17 |
Correct |
0 ms |
2020 KB |
Output is correct |
18 |
Correct |
0 ms |
2020 KB |
Output is correct |
19 |
Correct |
0 ms |
2020 KB |
Output is correct |
20 |
Correct |
0 ms |
2020 KB |
Output is correct |