結果
| 問題 |
No.991 N×Mマス計算(構築)
|
| コンテスト | |
| ユーザー |
msm1993
|
| 提出日時 | 2020-04-02 17:02:42 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 130 ms / 2,000 ms |
| コード長 | 914 bytes |
| コンパイル時間 | 590 ms |
| コンパイル使用メモリ | 75,324 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-28 15:08:27 |
| 合計ジャッジ時間 | 6,641 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 28 |
ソースコード
#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#define llint long long
#define inf 1e18
#define mod 1000000007
using namespace std;
llint x;
llint h, w, k;
char op;
llint a[100005], b[100005];
int main(void)
{
ios::sync_with_stdio(0);
cin.tie(0);
cin >> x;
if(x == 0){
h = 3, w = 2, k = 129;
op = '+', b[1] = 12, b[2] = 34;
a[1] = 10, a[2] = 20, a[3] = 30;
}
else{
h = 100000, k = 1000000000;
op = '*';
if(x % h == 0) h--;
w = (x+h-1)/h;
for(int i = 1; i <= x/h; i++) b[i] = k;
b[x/h+1] = 1;
for(int i = 1; i <= x%h; i++) a[i] = k;
llint rem = k-x;
if(rem < h-x%h) rem += h;
a[x%h+1] = k - (rem-(h-x%h-1));
for(int i = x%h+2; i <= h; i++) a[i] = k-1;
}
cout << h << " " << w << " " << k << endl;
cout << op;
for(int i = 1; i <= w; i++) cout << " " << b[i]; cout << endl;
for(int i = 1; i <= h; i++) cout << a[i] << endl;
return 0;
}
msm1993