結果

問題 No.747 循環小数N桁目 Hard
ユーザー ikd
提出日時 2018-10-19 22:35:08
言語 D
(dmd 2.109.1)
結果
WA  
実行時間 -
コード長 465 bytes
コンパイル時間 892 ms
コンパイル使用メモリ 93,312 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-13 01:53:42
合計ジャッジ時間 4,385 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 105 WA * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

void main() {
  import std.stdio, std.string, std.conv, std.algorithm;

  auto n = readln.chomp.to!(char[]);
  auto k = readln.chomp.to!(char[]);

  int s = 0;
  foreach (c; n) {
    s = (s * 10 + (c - '0')) % 6;
  }
  writeln("428571"[s]);

}

void rd(T...)(ref T x) {
  import std.stdio : readln;
  import std.string : split;
  import std.conv : to;

  auto l = readln.split;
  assert(l.length == x.length);
  foreach (i, ref e; x)
    e = l[i].to!(typeof(e));
}
0