답안 #1110324

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1110324 2024-11-09T08:47:25 Z KasymK Nice sequence (IZhO18_sequence) C++17
6 / 100
1 ms 504 KB
#include "bits/stdc++.h"
using namespace std;
#define ff first
#define ss second
#define all(v) v.begin(), v.end()
#define ll long long
#define pb push_back
#define pii pair<int, int>
#define pli pair<ll, int>
#define pll pair<ll, ll>
#define tr(i, c) for(auto i = c.begin(); i != c.end(); ++i)
#define wr puts("----------------")
template<class T>bool umin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T>bool umax(T& a,T b){if(a<b){a=b;return 1;}return 0;}

void solve(){
	int n, m;
	scanf("%d%d", &n, &m);
	printf("%d\n", max(n, m)-1);
	if(n>m)
		for(int i = 1; i <= max(n, m)-1; ++i)
			printf("1 ");
	else
		for(int i = 1; i <= max(n, m)-1; ++i)
			printf("-1 ");
	puts("");
}

int main(){
	int tt;
	scanf("%d", &tt);
	while(tt--)
		solve();
	return 0;
}

Compilation message

sequence.cpp: In function 'void solve()':
sequence.cpp:18:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   18 |  scanf("%d%d", &n, &m);
      |  ~~~~~^~~~~~~~~~~~~~~~
sequence.cpp: In function 'int main()':
sequence.cpp:31:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   31 |  scanf("%d", &tt);
      |  ~~~~~^~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 336 KB Ok
2 Correct 1 ms 336 KB Ok
3 Correct 1 ms 384 KB Ok
4 Correct 1 ms 336 KB Ok
5 Correct 1 ms 504 KB Ok
6 Correct 1 ms 336 KB Ok
7 Correct 1 ms 336 KB Ok
8 Correct 1 ms 336 KB Ok
9 Correct 1 ms 336 KB Ok
10 Correct 1 ms 336 KB Ok
11 Correct 1 ms 336 KB Ok
12 Correct 1 ms 336 KB Ok
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 336 KB Jury has the better answer : jans = 3, pans = 2
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 336 KB Jury has the better answer : jans = 3, pans = 2
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 336 KB Jury has the better answer : jans = 3, pans = 2
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 336 KB Ok
2 Correct 1 ms 336 KB Ok
3 Correct 1 ms 384 KB Ok
4 Correct 1 ms 336 KB Ok
5 Correct 1 ms 504 KB Ok
6 Correct 1 ms 336 KB Ok
7 Correct 1 ms 336 KB Ok
8 Correct 1 ms 336 KB Ok
9 Correct 1 ms 336 KB Ok
10 Correct 1 ms 336 KB Ok
11 Correct 1 ms 336 KB Ok
12 Correct 1 ms 336 KB Ok
13 Incorrect 1 ms 336 KB Jury has the better answer : jans = 3, pans = 2
14 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 336 KB Ok
2 Correct 1 ms 336 KB Ok
3 Correct 1 ms 384 KB Ok
4 Correct 1 ms 336 KB Ok
5 Correct 1 ms 504 KB Ok
6 Correct 1 ms 336 KB Ok
7 Correct 1 ms 336 KB Ok
8 Correct 1 ms 336 KB Ok
9 Correct 1 ms 336 KB Ok
10 Correct 1 ms 336 KB Ok
11 Correct 1 ms 336 KB Ok
12 Correct 1 ms 336 KB Ok
13 Incorrect 1 ms 336 KB Jury has the better answer : jans = 3, pans = 2
14 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 336 KB Ok
2 Correct 1 ms 336 KB Ok
3 Correct 1 ms 384 KB Ok
4 Correct 1 ms 336 KB Ok
5 Correct 1 ms 504 KB Ok
6 Correct 1 ms 336 KB Ok
7 Correct 1 ms 336 KB Ok
8 Correct 1 ms 336 KB Ok
9 Correct 1 ms 336 KB Ok
10 Correct 1 ms 336 KB Ok
11 Correct 1 ms 336 KB Ok
12 Correct 1 ms 336 KB Ok
13 Incorrect 1 ms 336 KB Jury has the better answer : jans = 3, pans = 2
14 Halted 0 ms 0 KB -