이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using ll = long long;
using namespace __gnu_pbds;
template < class key, class compare = less < key > >
using iset = tree < key, null_type, compare, rb_tree_tag,
tree_order_statistics_node_update >;
void
solve (int tc, int ttc)
{
int n, m;
cin >> n >> m;
cout << max (n, m) - 1 << '\n';
for (int i = 0; i < max (n, m) - 1; ++i) cout << (n > m ? 1 : -1) << ' ';
cout << '\n';
}
int
main ()
{
ios::sync_with_stdio (false);
cin.tie (nullptr);
int ttc = 1;
cin >> ttc;
for (int tc = 1; tc <= ttc; ++tc) solve (tc, ttc);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |