| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1370019 | kawhiet | Nice sequence (IZhO18_sequence) | C++20 | 3 ms | 1092 KiB |
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.h"
#else
#define dbg(...) 47
#endif
void solve() {
int n, m;
cin >> n >> m;
bool is = false;
if (n > m) {
is = true;
swap(n, m);
}
vector<int> ans;
if (m % n == 0) {
for (int i = 0; i < m - 1; i++) {
ans.push_back(-1);
}
} else {
int k = 1e6;
for (int i = 0; i < m - 1; i += 2) {
ans.push_back(k);
ans.push_back(-k - 1);
}
ans.push_back(k);
}
if (is) {
for (int &x : ans) {
x *= -1;
}
}
cout << ans.size() << '\n';
for (int x : ans) {
cout << x << ' ';
}
cout << '\n';
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
while (t--) {
solve();
}
return 0;
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
