Submission #168421

# Submission time Handle Problem Language Result Execution time Memory
168421 2019-12-13T03:43:16 Z abil Nice sequence (IZhO18_sequence) C++14
6 / 100
3 ms 384 KB
#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

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 time Memory Grader output
1 Correct 2 ms 384 KB Ok
2 Correct 2 ms 256 KB Ok
3 Correct 2 ms 256 KB Ok
4 Correct 2 ms 376 KB Ok
5 Correct 2 ms 376 KB Ok
6 Correct 2 ms 376 KB Ok
7 Correct 2 ms 256 KB Ok
8 Correct 3 ms 256 KB Ok
9 Correct 2 ms 376 KB Ok
10 Correct 2 ms 380 KB Ok
11 Correct 2 ms 376 KB Ok
12 Correct 2 ms 376 KB Ok
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB there is incorrect sequence
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Jury has the better answer : jans = 3, pans = 0
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 Correct 2 ms 384 KB Ok
2 Correct 2 ms 256 KB Ok
3 Correct 2 ms 256 KB Ok
4 Correct 2 ms 376 KB Ok
5 Correct 2 ms 376 KB Ok
6 Correct 2 ms 376 KB Ok
7 Correct 2 ms 256 KB Ok
8 Correct 3 ms 256 KB Ok
9 Correct 2 ms 376 KB Ok
10 Correct 2 ms 380 KB Ok
11 Correct 2 ms 376 KB Ok
12 Correct 2 ms 376 KB Ok
13 Incorrect 2 ms 376 KB Jury has the better answer : jans = 3, pans = 0
14 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Ok
2 Correct 2 ms 256 KB Ok
3 Correct 2 ms 256 KB Ok
4 Correct 2 ms 376 KB Ok
5 Correct 2 ms 376 KB Ok
6 Correct 2 ms 376 KB Ok
7 Correct 2 ms 256 KB Ok
8 Correct 3 ms 256 KB Ok
9 Correct 2 ms 376 KB Ok
10 Correct 2 ms 380 KB Ok
11 Correct 2 ms 376 KB Ok
12 Correct 2 ms 376 KB Ok
13 Incorrect 2 ms 256 KB there is incorrect sequence
14 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Ok
2 Correct 2 ms 256 KB Ok
3 Correct 2 ms 256 KB Ok
4 Correct 2 ms 376 KB Ok
5 Correct 2 ms 376 KB Ok
6 Correct 2 ms 376 KB Ok
7 Correct 2 ms 256 KB Ok
8 Correct 3 ms 256 KB Ok
9 Correct 2 ms 376 KB Ok
10 Correct 2 ms 380 KB Ok
11 Correct 2 ms 376 KB Ok
12 Correct 2 ms 376 KB Ok
13 Incorrect 2 ms 256 KB there is incorrect sequence
14 Halted 0 ms 0 KB -