답안 #601452

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
601452 2022-07-22T00:19:46 Z czhang2718 Sob (COCI19_sob) C++17
110 / 110
68 ms 7116 KB
#include "bits/stdc++.h"
using namespace std;

int n, m;

int main(){
    cin.tie(0)->sync_with_stdio(0);

    cin >> n >> m;
    int j=m;
    int i=n-1;
    int k=0;
    while(i>=0){
        int j2=j;
        while((j2&i)!=i) j2++;
        int d=j2-i;
        for(int k=j; k<=j2; k++){
            cout << k-d << " " << k << "\n";
        }
        i-=j2-j+1;
        j=j2+1;
    }
}

Compilation message

sob.cpp: In function 'int main()':
sob.cpp:12:9: warning: unused variable 'k' [-Wunused-variable]
   12 |     int k=0;
      |         ^
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 38 ms 3764 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 35 ms 3804 KB Output is correct
7 Correct 17 ms 1876 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 38 ms 3764 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 35 ms 3804 KB Output is correct
11 Correct 17 ms 1876 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 11 ms 976 KB Output is correct
20 Correct 29 ms 2960 KB Output is correct
21 Correct 2 ms 340 KB Output is correct
22 Correct 1 ms 320 KB Output is correct
23 Correct 39 ms 4108 KB Output is correct
24 Correct 68 ms 7116 KB Output is correct
25 Correct 67 ms 7000 KB Output is correct