Submission #320918

#TimeUsernameProblemLanguageResultExecution timeMemory
320918shrek12357Nice sequence (IZhO18_sequence)C++14
0 / 100
1 ms364 KiB
#include <iostream> #include <vector> #include <algorithm> #include <string> #include <map> #include <set> #include <climits> #include <cmath> #include <fstream> #include <queue> #include <stack> #include <bitset> using namespace std; #define ll long long //cin.tie(0);ios_base::sync_with_stdio(0); void solve() { int n, m; cin >> n >> m; int sign = 1; if (m > n) { sign = -1; } if (n < m) { swap(n, m); } if(n == m){ cout << 0 << endl; return; } if (n % m == 0) { cout << n - 1 << endl; for (int i = 0; i < n - 1; i++) { cout << 1 * sign << " "; } cout << endl; return; } } int main(){ int t; cin >> t; while (t--) { solve(); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...