結果

問題 No.73 helloworld
ユーザー 西尾西尾
提出日時 2018-03-21 17:33:08
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 1,238 bytes
コンパイル時間 2,027 ms
コンパイル使用メモリ 163,836 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-09-12 17:08:39
合計ジャッジ時間 2,515 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,388 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int iNumL[] =
{
0, 0, 0, 1, 3, 6, 12, 20, 30, 45, 63, 84, 112, 144, 180, 225, 275, 330, 396, 468, 546, 637, 735, 840, 960, 1088, 1224, 1377, 1539, 1710, 1900, 2100, 2310, 2541, 2783, 3036, 3312, 3600, 3900, 4225, 4563, 4914, 5292, 5684, 6090, 6525, 6975, 7440, 7936, 8448, 8976, 9537, 10115, 10710, 11340, 11988, 12654, 13357, 14079, 14820, 15600, 16400, 17220, 18081, 18963, 19866, 20812, 21780, 22770, 23805, 24863, 25944, 27072, 28224, 29400, 30625, 31875, 33150, 34476, 35828, 37206, 38637, 40095, 41580, 43120, 44688, 46284, 47937, 49619, 51330, 53100, 54900, 56730, 58621, 60543, 62496, 64512, 66560, 68640, 70785, 72963
};

int main()
{
int i;
int A;
int N;
long long iNum;
char C;

	iNum = 1;
	for( i = 0; iNum > 0 && i < 26; i++ )
	{
		cin >> N;
		
		C = 'a' + i;
		switch( C )
		{
		case 'h':
		case 'e':
		case 'r':
		case 'w':
		case 'd':
			if( N < 1 )
				iNum = 0;
			else if( N > 1 )
				iNum *= N;

			break;
		case 'l':
			if( N < 3 )
				iNum = 0;
			else if( N > 3 )
				iNum *= iNumL[ N ];

			break;
		case 'o':
			if( N < 2 )
				iNum = 0;
			else if( N > 2 )
			{
				A = N / 2;
				iNum *= A * ( N - A );
			}

			break;
		}
	}

	cout << iNum << endl;

	return 0;
}
0