Submission #18996666


Source Code Expand

#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif

#include <bits/stdc++.h>

using namespace std;

typedef long double ld;

#ifdef DEBUG
#define eprintf(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#else
#define eprintf(...) ;
#endif

#define sz(x) ((int) (x).size())
#define TASK "text"

const int inf = (int) 1.01e9;
const long long infll = (long long) 1.01e18;
const ld eps = 1e-9;
const ld pi = acos((ld) -1);

#ifdef DEBUG
mt19937 mrand(300); 
#else
mt19937 mrand(chrono::steady_clock::now().time_since_epoch().count()); 
#endif

int rnd(int x) {
  return mrand() % x;
}

void precalc() {
}

int n;

bool read() {
  if (scanf("%d", &n) < 1) {
    return false;
  }
  return true;
}

const int d = 10;

int fix(int x) {
  while (x >= n) {
    int bit = 31 - __builtin_clz(x);
    x -= (1 << bit);
  }
  return x;
}

void solve() {
  for (int i = 0; i < n; ++i) {
    int j = ((2 * i) & ((1 << d) - 1));
    int a = fix(j), b = fix(j + 1);
    printf("%d %d\n", a + 1, b + 1);
  }
}

int main() {
  precalc();
#ifdef DEBUG
  assert(freopen(TASK ".in", "r", stdin));
  assert(freopen(TASK ".out", "w", stdout));
#endif
  while (read()) {
    solve();
#ifdef DEBUG
    eprintf("Time %.2f\n", (double) clock() / CLOCKS_PER_SEC);
#endif
  }
  return 0;
}

Submission Info

Submission Time
Task A - AtCoder Jumper
User aid
Language C++ (GCC 9.2.1)
Score 500
Code Size 1330 Byte
Status AC
Exec Time 10 ms
Memory 3820 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 500 / 500
Status
AC × 2
AC × 12
Set Name Test Cases
Sample example0.txt, example1.txt
All 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, example0.txt, example1.txt
Case Name Status Exec Time Memory
000.txt AC 7 ms 3596 KiB
001.txt AC 10 ms 3636 KiB
002.txt AC 5 ms 3724 KiB
003.txt AC 6 ms 3720 KiB
004.txt AC 2 ms 3816 KiB
005.txt AC 2 ms 3820 KiB
006.txt AC 2 ms 3728 KiB
007.txt AC 4 ms 3608 KiB
008.txt AC 2 ms 3720 KiB
009.txt AC 4 ms 3764 KiB
example0.txt AC 3 ms 3716 KiB
example1.txt AC 2 ms 3724 KiB