結果

問題 No.991 N×Mマス計算(構築)
ユーザー kotatsugamekotatsugame
提出日時 2020-02-07 05:34:31
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 34 ms / 2,000 ms
コード長 615 bytes
コンパイル時間 518 ms
コンパイル使用メモリ 70,068 KB
実行使用メモリ 4,396 KB
最終ジャッジ日時 2023-10-25 22:58:23
合計ジャッジ時間 2,430 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 5 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 31 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 3 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 8 ms
4,348 KB
testcase_12 AC 7 ms
4,348 KB
testcase_13 AC 15 ms
4,348 KB
testcase_14 AC 3 ms
4,348 KB
testcase_15 AC 1 ms
4,348 KB
testcase_16 AC 8 ms
4,348 KB
testcase_17 AC 7 ms
4,348 KB
testcase_18 AC 13 ms
4,396 KB
testcase_19 AC 5 ms
4,348 KB
testcase_20 AC 2 ms
4,348 KB
testcase_21 AC 8 ms
4,348 KB
testcase_22 AC 7 ms
4,348 KB
testcase_23 AC 23 ms
4,348 KB
testcase_24 AC 2 ms
4,348 KB
testcase_25 AC 8 ms
4,348 KB
testcase_26 AC 2 ms
4,348 KB
testcase_27 AC 8 ms
4,348 KB
testcase_28 AC 34 ms
4,348 KB
testcase_29 AC 10 ms
4,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:8:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    8 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
#include<map>
using namespace std;
int N,M;
char op;
long A[1<<17],B[1<<17];
long K,X;
main()
{
	cin>>X;
	if(X==0)
	{
		N=1;
		M=2;
		K=2;
		A[0]=B[0]=B[1]=1;
	}
	else if(X<=5e4)
	{
		K=1e9;
		N=1;
		M=2*X;
		A[0]=1;
		for(int j=0;j<X;j++)B[j]=K;
		for(int j=X;j<M;j++)B[j]=1;
	}
	else
	{
		K=1e9;
		M=5e4;
		N=X/M+1;
		int L=N*M-X;
		for(int i=0;i<N-1;i++)A[i]=1e9;
		A[N-1]=1;
		B[0]=X-(L-1);
		for(int j=1;j<L;j++)B[j]=1;
		for(int j=L;j<M;j++)B[j]=1e9;
	}
	cout<<N<<" "<<M<<" "<<K<<endl;
	cout<<"*";
	for(int j=0;j<M;j++)cout<<" "<<B[j];
	cout<<endl;
	for(int i=0;i<N;i++)cout<<A[i]<<endl;
}
0