# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
613704 | 2022-07-30T09:32:46 Z | KoD | Nice sequence (IZhO18_sequence) | C++17 | 1 ms | 452 KB |
#include <bits/stdc++.h> using ll = long long; using std::vector; using std::array; using std::pair; using std::tuple; vector<int> solve(const int N, const int M) { if (M % N == 0) { return vector(M - 1, -1); } vector<int> ret(M, N - 1); for (int i = N - 1; i < M; i += N) { ret[i] = -N; } } int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(nullptr); int T; std::cin >> T; while (T--) { int N, M; std::cin >> N >> M; vector<int> A; if (N > M) { A = solve(M, N); for (auto& x : A) { x = -x; } } else { A = solve(N, M); } std::cout << A.size() << '\n'; for (int i = 0; i < (int)A.size(); ++i) { if (i > 0) { std::cout << ' '; } std::cout << A[i]; } std::cout << '\n'; } return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Ok |
2 | Correct | 1 ms | 212 KB | Ok |
3 | Correct | 0 ms | 212 KB | Ok |
4 | Correct | 1 ms | 212 KB | Ok |
5 | Correct | 0 ms | 212 KB | Ok |
6 | Correct | 0 ms | 212 KB | Ok |
7 | Correct | 1 ms | 212 KB | Ok |
8 | Correct | 1 ms | 320 KB | Ok |
9 | Correct | 1 ms | 212 KB | Ok |
10 | Correct | 1 ms | 212 KB | Ok |
11 | Correct | 0 ms | 212 KB | Ok |
12 | Correct | 0 ms | 212 KB | Ok |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 444 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 340 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 452 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Ok |
2 | Correct | 1 ms | 212 KB | Ok |
3 | Correct | 0 ms | 212 KB | Ok |
4 | Correct | 1 ms | 212 KB | Ok |
5 | Correct | 0 ms | 212 KB | Ok |
6 | Correct | 0 ms | 212 KB | Ok |
7 | Correct | 1 ms | 212 KB | Ok |
8 | Correct | 1 ms | 320 KB | Ok |
9 | Correct | 1 ms | 212 KB | Ok |
10 | Correct | 1 ms | 212 KB | Ok |
11 | Correct | 0 ms | 212 KB | Ok |
12 | Correct | 0 ms | 212 KB | Ok |
13 | Runtime error | 1 ms | 340 KB | Execution killed with signal 11 |
14 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Ok |
2 | Correct | 1 ms | 212 KB | Ok |
3 | Correct | 0 ms | 212 KB | Ok |
4 | Correct | 1 ms | 212 KB | Ok |
5 | Correct | 0 ms | 212 KB | Ok |
6 | Correct | 0 ms | 212 KB | Ok |
7 | Correct | 1 ms | 212 KB | Ok |
8 | Correct | 1 ms | 320 KB | Ok |
9 | Correct | 1 ms | 212 KB | Ok |
10 | Correct | 1 ms | 212 KB | Ok |
11 | Correct | 0 ms | 212 KB | Ok |
12 | Correct | 0 ms | 212 KB | Ok |
13 | Runtime error | 1 ms | 444 KB | Execution killed with signal 11 |
14 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Ok |
2 | Correct | 1 ms | 212 KB | Ok |
3 | Correct | 0 ms | 212 KB | Ok |
4 | Correct | 1 ms | 212 KB | Ok |
5 | Correct | 0 ms | 212 KB | Ok |
6 | Correct | 0 ms | 212 KB | Ok |
7 | Correct | 1 ms | 212 KB | Ok |
8 | Correct | 1 ms | 320 KB | Ok |
9 | Correct | 1 ms | 212 KB | Ok |
10 | Correct | 1 ms | 212 KB | Ok |
11 | Correct | 0 ms | 212 KB | Ok |
12 | Correct | 0 ms | 212 KB | Ok |
13 | Runtime error | 1 ms | 444 KB | Execution killed with signal 11 |
14 | Halted | 0 ms | 0 KB | - |