Submission #173339

# Submission time Handle Problem Language Result Execution time Memory
173339 2020-01-03T18:53:04 Z LinusTorvaldsFan Nice sequence (IZhO18_sequence) C++14
0 / 100
2 ms 376 KB
#include <bits/stdc++.h>

using namespace std;

int main() {
	int t;
	cin>>t;
	for(;t;t--){
		int n,m;
		cin>>n>>m;
		if(n==m){
			cout<<0<<"\n";
			continue;
		}
		if(n%m==0){
			cout<<n-1<<"\n";
			for(int i=0;i<n-1;i++){
				cout<<1<<" ";
			}
			cout<<"\n";
			continue;
		}
		if(m%n==0){
			cout<<m-1<<"\n";
			for(int i=0;i<m-1;i++){
				cout<<-1<<" ";
			}
			cout<<"\n";
			continue;
		}
	}
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Ok
2 Correct 2 ms 256 KB Ok
3 Incorrect 2 ms 256 KB Jury has the better answer : jans = 93, pans = 0
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Jury has the better answer : jans = 1, pans = 0
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 256 KB there is incorrect sequence
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Ok
2 Correct 2 ms 256 KB Ok
3 Incorrect 2 ms 256 KB Jury has the better answer : jans = 93, pans = 0
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Ok
2 Correct 2 ms 256 KB Ok
3 Incorrect 2 ms 256 KB Jury has the better answer : jans = 93, pans = 0
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Ok
2 Correct 2 ms 256 KB Ok
3 Incorrect 2 ms 256 KB Jury has the better answer : jans = 93, pans = 0
4 Halted 0 ms 0 KB -