# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
92866 | 2019-01-05T11:33:13 Z | davitmarg | Nice sequence (IZhO18_sequence) | C++17 | 2 ms | 376 KB |
/* DEATH-MATCH Davit-Marg */ #include <iostream> #include <algorithm> #include <cmath> #include <vector> #include <string> #include <cstring> #include <map> #include <set> #include <queue> #include <deque> #include <stack> #include <iterator> #include <ctype.h> #include <stdlib.h> #include <cassert> #include <fstream> #define mod 1000000007ll #define LL long long #define LD long double #define MP make_pair #define PB push_back using namespace std; int t,n, m; bool sw; vector<int> a; int main() { cin >> t; while (t--) { cin >> n >> m; sw = 0; a.resize(0); if (n < m) { sw = 1; swap(n, m); } if (m == 2) { a.PB(2); a.PB(-3); a.PB(2); LL sum = 1; for (int i = 4; i <= n; i++) { if (i % 2 == 0) a.PB(-(a.back() + 1)); else a.PB(-(sum - 1)); sum += a.back(); } if (n % 2 == 0) a.pop_back(); cout << a.size() << endl; if (a.size() != 0) { for (int i = 0; i < a.size(); i++) cout << a[i] * (2 * (sw) - 1) << " "; cout << endl; } } } return 0; } /* */
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | Unexpected end of file - int32 expected |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | there is incorrect sequence |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | there is incorrect sequence |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 256 KB | Unexpected end of file - int32 expected |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | Unexpected end of file - int32 expected |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | Unexpected end of file - int32 expected |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | Unexpected end of file - int32 expected |
2 | Halted | 0 ms | 0 KB | - |