| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 43391 | yerkimbekov | Nice sequence (IZhO18_sequence) | C++14 | 2 ms | 632 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
// #pragma comment(linker, "/stack:200000000")
// #pragma GCC optimize("Ofast,no-stack-protector")
// #pragma GCC target("avx")
 
// timus 219263UI
//    (><)
 
#include <iostream>
#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <ctime>
#include <queue>
#include <vector>
#include <sstream>
#include <iomanip>
#include <cstdlib>
#include <stdio.h>
#include <assert.h>  
#include <string.h>
#include <algorithm>
#include <unordered_map>
 
using namespace std;
 
typedef long long ll;
 
#define y1 needtrainharder
#define f first
#define s second
#define gg exit(0)
#define sz() size()
#define pb push_back
#define mp make_pair
#define skip continue
#define all(x) x.begin(), x.end()
#define alln(x, y) x, x + y
#define boost ios_base::sync_with_stdio(0),cin.tie(NULL),cout.tie(NULL)
#define file(s) if(fopen(task".in", "r"))freopen(s".in","r",stdin),freopen(s".out","w",stdout);
#define task "sorting"
 
const int inf = 1e9 + 5;  
const ll infll = 1e18 + 5ll;  
const long double eps = 1e-9;
const int maxn = 1e5 + 100;
const ll maxlog = 21;
const int P = 97;
const int mod = 1e9 + 7;   
/*
Izho Eshka
*/
int t, n, m;
int main() {
  file(task);
  
  cin >> t;
  while (t--) {
    cin >> n >> m;
    if (max(n, m) % min(n, m) == 0) {
      cout << max(n, m) - 1 << '\n';
      if (n > m) {
        for (int i = 1; i <= n - 1; ++i)
          cout << (i&1?2:3) * (i&1?-1:1) << ' ';
      } else {
        for (int i = 1; i <= m - 1; ++i)
          cout << ((i&1)?2:3) * (!(i&1)?-1:1) << ' ';
      }
      cout << '\n';
    } else {
      cout << 0 << '\n';
    }
  }
  return 0;
}                
/*
*/  
컴파일 시 표준 에러 (stderr) 메시지
| # | 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... | ||||
