Submission #887399

# Submission time Handle Problem Language Result Execution time Memory
887399 2023-12-14T12:18:49 Z pcc Nice sequence (IZhO18_sequence) C++14
0 / 100
1 ms 596 KB
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define pll pair<ll,ll>
#define pii pair<int,int>
#define fs first
#define sc second
#define tlll tuple<ll,ll,ll>

const int big = 1e8;

void solve(){
	int n,m;
	cin>>n>>m;
	int sign = -1;
	if(m>n){
		sign = 1;
		swap(n,m);
	}
	if(n%2 == 0){
		cout<<n-1<<'\n';
		for(int i = 1;i<n;i++)cout<<(i&1?-big*sign:(big-1)*sign)<<' ';
		cout<<'\n';
	}
	else{
		cout<<n<<'\n';
		for(int i = 1;i<=n;i++)cout<<(i&1?-big*sign:(big-1)*sign)<<' ';
		cout<<'\n';
	}
	return;
}

int main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	int t;cin>>t;
	while(t--)solve();
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB there is incorrect sequence
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB there is incorrect sequence
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 504 KB there is incorrect sequence
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 596 KB there is incorrect sequence
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB there is incorrect sequence
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB there is incorrect sequence
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB there is incorrect sequence
2 Halted 0 ms 0 KB -