Submission #168422

# Submission time Handle Problem Language Result Execution time Memory
168422 2019-12-13T03:47:40 Z abil Nice sequence (IZhO18_sequence) C++14
0 / 100
2 ms 376 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(n >= m){
		int x = 1;
		printf("%d\n", max(n, m) - 1);
		for(int i = 1;i <= max(n, m) - 1; i++){
			printf("%d ", x);
		}
		printf("\n");
	}
	else{
		int x = -1;
		printf("%d\n", m);
		for(int i = 1;i <= n; i++){
			printf("%d ", x);
		}
		for(int i = n + 1;i <= m; i++){
			printf("%d", mod - 8);
		}
		printf("\n");
	}
}

main()
{
	int t;
	cin >> t;
	while(t--){
		solve();
	}
}

Compilation message

sequence.cpp:41: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 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 256 KB Jury has the better answer : jans = 3, pans = 2
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 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 256 KB there is incorrect sequence
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 Incorrect 2 ms 256 KB there is incorrect sequence
2 Halted 0 ms 0 KB -