結果

問題 No.18 うーさー暗号
ユーザー te-sh
提出日時 2017-01-11 14:45:36
言語 D
(dmd 2.109.1)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 246 bytes
コンパイル時間 776 ms
コンパイル使用メモリ 94,428 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-12 06:18:24
合計ジャッジ時間 1,636 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.d(6): Deprecation: foreach: loop index implicitly converted from `size_t` to `int`

ソースコード

diff #

import std.algorithm, std.conv, std.range, std.stdio, std.string;

void main()
{
  auto s = readln.chomp.dup;
  foreach (int i, ref c; s) {
    int d = c - 'A';
    d = (d - (i + 1) + 26 * 50) % 26;
    c = (d + 'A').to!char;
  }
  writeln(s);
}
0