Submission #12644257


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, M;
//---------------------------------------------------------------------------------------------------
void _main() {
	cin >> N >> M;

	if (M == 1) {
		printf("1 2\n");
		return;
	}

	int i1 = 1;
	int i2 = M + 2;

	rrep(diff, M, 1) {
		printf("%d %d\n", i1, i1 + diff);
		i1++;
		swap(i1, i2);
	}
}





Submission Info

Submission Time
Task E - Rotation Matching
User hamayanhamayan
Language C++ (GCC 9.2.1)
Score 500
Code Size 1614 Byte
Status AC
Exec Time 18 ms
Memory 3772 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 500 / 500
Status
AC × 2
AC × 32
Set Name Test Cases
Sample Sample_01.txt, Sample_02.txt
All Sample_01.txt, Sample_02.txt, basic_01.txt, basic_02.txt, basic_03.txt, basic_04.txt, basic_05.txt, basic_06.txt, basic_07.txt, basic_08.txt, basic_09.txt, basic_10.txt, rand_large01.txt, rand_large02.txt, rand_large03.txt, rand_large04.txt, rand_large05.txt, rand_small01.txt, rand_small02.txt, rand_small03.txt, rand_small04.txt, rand_small05.txt, second_01.txt, second_02.txt, second_03.txt, second_04.txt, second_05.txt, second_06.txt, second_07.txt, second_08.txt, second_09.txt, second_10.txt
Case Name Status Exec Time Memory
Sample_01.txt AC 5 ms 3612 KB
Sample_02.txt AC 2 ms 3608 KB
basic_01.txt AC 2 ms 3644 KB
basic_02.txt AC 2 ms 3560 KB
basic_03.txt AC 2 ms 3684 KB
basic_04.txt AC 2 ms 3676 KB
basic_05.txt AC 2 ms 3596 KB
basic_06.txt AC 18 ms 3672 KB
basic_07.txt AC 18 ms 3680 KB
basic_08.txt AC 7 ms 3680 KB
basic_09.txt AC 12 ms 3716 KB
basic_10.txt AC 13 ms 3676 KB
rand_large01.txt AC 6 ms 3612 KB
rand_large02.txt AC 3 ms 3608 KB
rand_large03.txt AC 4 ms 3484 KB
rand_large04.txt AC 2 ms 3680 KB
rand_large05.txt AC 11 ms 3636 KB
rand_small01.txt AC 3 ms 3716 KB
rand_small02.txt AC 2 ms 3588 KB
rand_small03.txt AC 2 ms 3652 KB
rand_small04.txt AC 2 ms 3712 KB
rand_small05.txt AC 2 ms 3584 KB
second_01.txt AC 4 ms 3472 KB
second_02.txt AC 2 ms 3772 KB
second_03.txt AC 2 ms 3588 KB
second_04.txt AC 2 ms 3716 KB
second_05.txt AC 2 ms 3592 KB
second_06.txt AC 2 ms 3716 KB
second_07.txt AC 8 ms 3608 KB
second_08.txt AC 14 ms 3560 KB
second_09.txt AC 14 ms 3556 KB
second_10.txt AC 15 ms 3556 KB