답안 #199665

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
199665 2020-02-02T13:40:55 Z SamAnd Sob (COCI19_sob) C++17
110 / 110
108 ms 9336 KB
#include <bits/stdc++.h>
using namespace std;
const int N = 1000006;

int n, m;

int ans[N];
int main()
{
    scanf("%d%d", &n, &m);
    int j = m;
    for (int i = n - 1; i >= 0; --i)
    {
        int k = j;
        while ((j & i) != i)
        {
            ++j;
        }
        int jj;
        for (i = i, jj = j; jj >= k; --jj, --i)
            ans[i] = jj;
        ++j;
        ++i;
    }
    for (int i = 0; i < n; ++i)
    {
        printf("%d %d\n", i, ans[i]);
    }
    return 0;
}

Compilation message

sob.cpp: In function 'int main()':
sob.cpp:10:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d", &n, &m);
     ~~~~~^~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 6 ms 256 KB Output is correct
4 Correct 51 ms 4856 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 376 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 5 ms 256 KB Output is correct
4 Correct 5 ms 128 KB Output is correct
5 Correct 5 ms 376 KB Output is correct
6 Correct 51 ms 4984 KB Output is correct
7 Correct 27 ms 2424 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 5 ms 376 KB Output is correct
4 Correct 5 ms 376 KB Output is correct
5 Correct 5 ms 256 KB Output is correct
6 Correct 5 ms 376 KB Output is correct
7 Correct 5 ms 128 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 6 ms 256 KB Output is correct
4 Correct 51 ms 4856 KB Output is correct
5 Correct 6 ms 376 KB Output is correct
6 Correct 5 ms 256 KB Output is correct
7 Correct 5 ms 256 KB Output is correct
8 Correct 5 ms 128 KB Output is correct
9 Correct 5 ms 376 KB Output is correct
10 Correct 51 ms 4984 KB Output is correct
11 Correct 27 ms 2424 KB Output is correct
12 Correct 5 ms 256 KB Output is correct
13 Correct 5 ms 376 KB Output is correct
14 Correct 5 ms 376 KB Output is correct
15 Correct 5 ms 376 KB Output is correct
16 Correct 5 ms 256 KB Output is correct
17 Correct 5 ms 376 KB Output is correct
18 Correct 5 ms 128 KB Output is correct
19 Correct 13 ms 1272 KB Output is correct
20 Correct 36 ms 3832 KB Output is correct
21 Correct 6 ms 504 KB Output is correct
22 Correct 6 ms 376 KB Output is correct
23 Correct 52 ms 5368 KB Output is correct
24 Correct 99 ms 9336 KB Output is correct
25 Correct 108 ms 9080 KB Output is correct