Submission #168421

#TimeUsernameProblemLanguageResultExecution timeMemory
168421abilNice sequence (IZhO18_sequence)C++14
6 / 100
3 ms384 KiB
#include <bits/stdc++.h> #define fr first #define sc second #define pb push_bacak #define mk make_pair #define all(s) s.begin(),s.end() //#define int long long using namespace std; const int N = (1e6 + 12); const int mod = (1e9 + 7); const int INF = (0x3f3f3f3f); void solve(){ int n, m; scanf("%d%d", &n, &m); if(max(n, m) % min(n, m) == 0){ int x = 1; if(m > n){ x = -1; } printf("%d\n", max(n, m) - 1); for(int i = 1;i <= max(n, m) - 1; i++){ printf("%d ", x); } printf("\n"); } } main() { int t; cin >> t; while(t--){ solve(); } }

Compilation message (stderr)

sequence.cpp:33:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main()
      ^
sequence.cpp: In function 'void solve()':
sequence.cpp:19:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d", &n, &m);
  ~~~~~^~~~~~~~~~~~~~~~
#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...