結果

問題 No.991 N×Mマス計算(構築)
ユーザー leaf_1415leaf_1415
提出日時 2020-02-14 23:09:29
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 782 bytes
コンパイル時間 860 ms
コンパイル使用メモリ 65,880 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-16 02:51:16
合計ジャッジ時間 7,045 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 131 ms
6,940 KB
testcase_02 AC 128 ms
6,944 KB
testcase_03 AC 129 ms
6,940 KB
testcase_04 AC 130 ms
6,940 KB
testcase_05 AC 131 ms
6,940 KB
testcase_06 AC 128 ms
6,944 KB
testcase_07 AC 128 ms
6,940 KB
testcase_08 AC 125 ms
6,944 KB
testcase_09 AC 128 ms
6,944 KB
testcase_10 AC 129 ms
6,944 KB
testcase_11 AC 125 ms
6,940 KB
testcase_12 AC 131 ms
6,940 KB
testcase_13 AC 128 ms
6,940 KB
testcase_14 AC 129 ms
6,940 KB
testcase_15 AC 131 ms
6,944 KB
testcase_16 AC 130 ms
6,940 KB
testcase_17 AC 130 ms
6,940 KB
testcase_18 AC 129 ms
6,944 KB
testcase_19 AC 130 ms
6,940 KB
testcase_20 AC 127 ms
6,940 KB
testcase_21 AC 131 ms
6,944 KB
testcase_22 AC 131 ms
6,940 KB
testcase_23 AC 128 ms
6,944 KB
testcase_24 AC 130 ms
6,944 KB
testcase_25 AC 128 ms
6,940 KB
testcase_26 AC 129 ms
6,940 KB
testcase_27 AC 129 ms
6,940 KB
testcase_28 AC 130 ms
6,940 KB
testcase_29 AC 128 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
	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;
}
0