結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー packet0packet0
提出日時 2014-11-17 22:53:36
言語 D
(dmd 2.106.1)
結果
WA  
実行時間 -
コード長 526 bytes
コンパイル時間 1,222 ms
コンパイル使用メモリ 133,608 KB
実行使用メモリ 9,448 KB
最終ジャッジ日時 2023-09-02 19:09:04
合計ジャッジ時間 2,984 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

//No.67 よくある棒を切る問題 (1)
//v1
import std.stdio;
import std.conv;
void main() {
uint n, k, total = 0;
uint[] l;

readf("%s\n", &n);
l.length = n;

char[] buf;
readln(buf);
size_t bufLength = buf.length - 1;
size_t counter = 0;
uint tmp = 0;
for(size_t i = 0; i<bufLength; i++) {
	char c = buf[i];
	if(c != ' ')
		tmp = tmp * 10 + (c - '0');
	else {
		l[counter++] = tmp;
		tmp = 0;
	}
}
l[counter] = tmp;

readf("%s\n", &k);
foreach(i; l) {
	total += i/k;
}
writeln(total);
}
0