結果
問題 | No.73 helloworld |
ユーザー |
|
提出日時 | 2017-01-24 14:36:43 |
言語 | D (dmd 2.109.1) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 885 bytes |
コンパイル時間 | 830 ms |
コンパイル使用メモリ | 116,736 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-12 06:34:06 |
合計ジャッジ時間 | 1,536 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 |
ソースコード
import std.algorithm, std.conv, std.range, std.stdio, std.string; import std.container; // SList, DList, BinaryHeap import std.typecons; // Tuple, Nullable, BigFlags import std.math; // math functions import std.numeric; // gcd import std.bigint; // BigInt import std.random; // random import std.bitmanip; // BitArray import core.bitop; // bit operation import std.regex; // RegEx import std.uni; // unicode void main() { auto ci = 26.iota.map!(_ => readln.chomp.to!long).array; auto r = ci['h' - 'a'] * ci['e' - 'a'] * ci['w' - 'a'] * ci['r' - 'a'] * ci['d' - 'a']; r *= calcO(ci['o' - 'a']) * calcL(ci['l' - 'a']); writeln(r); } auto calcO(long c) { auto r = 0L; foreach (x; 1..c) r = max(r, x * (c - x)); return r; } auto calcL(long c) { auto r = 0L; foreach (x; 2..c) r = max(r, x * (x - 1) / 2 * (c - x)); return r; }