結果
| 問題 | No.18 うーさー暗号 | 
| コンテスト | |
| ユーザー |  t8m8⛄️ | 
| 提出日時 | 2015-04-03 05:05:44 | 
| 言語 | Java (openjdk 23) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 150 ms / 5,000 ms | 
| コード長 | 921 bytes | 
| コンパイル時間 | 2,876 ms | 
| コンパイル使用メモリ | 76,732 KB | 
| 実行使用メモリ | 55,428 KB | 
| 最終ジャッジ日時 | 2024-07-07 05:37:55 | 
| 合計ジャッジ時間 | 5,302 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 13 | 
ソースコード
//No.18 うーさー暗号
import java.util.*;
import java.io.*;
import static java.util.Arrays.*;
import static java.lang.Math.*;
public class No18 {
    
    static final Scanner sc = new Scanner(System.in);
    static final PrintWriter out = new PrintWriter(System.out,false);
    static void solve() {
        String s = sc.next();
        String ans = "";
        for (int i=0; i<s.length(); i++) {
            int x = (s.charAt(i) - (i+1)%26 - 'A');
            while (x < 0) {
                x += 26;
            }
            ans += (char)(x+'A');
        }
        out.println(ans);
    }
    public static void main(String[] args) {
        long start = System.currentTimeMillis();
        solve();
        out.flush();
        long end = System.currentTimeMillis();
        //trace(end-start + "ms");
        sc.close();
    }
    static void trace(Object... o) { System.out.println(deepToString(o));}
}
            
            
            
        