結果

問題 No.991 N×Mマス計算(構築)
ユーザー kotatsugame
提出日時 2020-02-07 06:49:37
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 496 bytes
コンパイル時間 561 ms
コンパイル使用メモリ 69,744 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-25 07:11:43
合計ジャッジ時間 4,227 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 14 WA * 14
権限があれば一括ダウンロードができます
コンパイルメッセージ
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
	{
		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