답안 #77221

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
77221 2018-09-24T05:26:19 Z antimirage Nice sequence (IZhO18_sequence) C++17
6 / 100
4 ms 832 KB
#include <bits/stdc++.h>

#define fr first
#define sc second
#define mk make_pair
#define pb push_back
#define sz(s) (int)s.size()
#define all(s) s.begin(), s.end()

using namespace std;

int tests, n, m, fl = 1;

main()
{
    cin >> tests;
    while (tests--)
    {
        fl = -1;
        scanf("%d%d", &n, &m);
        if ( n > m ) swap(n, m), fl = 1;

        printf("%d\n", m - 1);

        for (int i = 1; i < m; i++)
            printf("%d ", 1 * fl);

        printf("\n");
    }
}

Compilation message

sequence.cpp:14:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main()
      ^
sequence.cpp: In function 'int main()':
sequence.cpp:20:14: 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 2 ms 508 KB Ok
2 Correct 2 ms 612 KB Ok
3 Correct 2 ms 688 KB Ok
4 Correct 2 ms 788 KB Ok
5 Correct 2 ms 788 KB Ok
6 Correct 2 ms 788 KB Ok
7 Correct 2 ms 788 KB Ok
8 Correct 2 ms 788 KB Ok
9 Correct 2 ms 788 KB Ok
10 Correct 2 ms 788 KB Ok
11 Correct 2 ms 832 KB Ok
12 Correct 2 ms 832 KB Ok
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 832 KB Jury has the better answer : jans = 3, pans = 2
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 832 KB Jury has the better answer : jans = 3, pans = 2
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 4 ms 832 KB Jury has the better answer : jans = 3, pans = 2
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 508 KB Ok
2 Correct 2 ms 612 KB Ok
3 Correct 2 ms 688 KB Ok
4 Correct 2 ms 788 KB Ok
5 Correct 2 ms 788 KB Ok
6 Correct 2 ms 788 KB Ok
7 Correct 2 ms 788 KB Ok
8 Correct 2 ms 788 KB Ok
9 Correct 2 ms 788 KB Ok
10 Correct 2 ms 788 KB Ok
11 Correct 2 ms 832 KB Ok
12 Correct 2 ms 832 KB Ok
13 Incorrect 2 ms 832 KB Jury has the better answer : jans = 3, pans = 2
14 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 508 KB Ok
2 Correct 2 ms 612 KB Ok
3 Correct 2 ms 688 KB Ok
4 Correct 2 ms 788 KB Ok
5 Correct 2 ms 788 KB Ok
6 Correct 2 ms 788 KB Ok
7 Correct 2 ms 788 KB Ok
8 Correct 2 ms 788 KB Ok
9 Correct 2 ms 788 KB Ok
10 Correct 2 ms 788 KB Ok
11 Correct 2 ms 832 KB Ok
12 Correct 2 ms 832 KB Ok
13 Incorrect 2 ms 832 KB Jury has the better answer : jans = 3, pans = 2
14 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 508 KB Ok
2 Correct 2 ms 612 KB Ok
3 Correct 2 ms 688 KB Ok
4 Correct 2 ms 788 KB Ok
5 Correct 2 ms 788 KB Ok
6 Correct 2 ms 788 KB Ok
7 Correct 2 ms 788 KB Ok
8 Correct 2 ms 788 KB Ok
9 Correct 2 ms 788 KB Ok
10 Correct 2 ms 788 KB Ok
11 Correct 2 ms 832 KB Ok
12 Correct 2 ms 832 KB Ok
13 Incorrect 2 ms 832 KB Jury has the better answer : jans = 3, pans = 2
14 Halted 0 ms 0 KB -