結果
| 問題 |
No.18 うーさー暗号
|
| ユーザー |
skyline
|
| 提出日時 | 2020-02-02 12:56:51 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,092 bytes |
| コンパイル時間 | 2,217 ms |
| コンパイル使用メモリ | 75,048 KB |
| 実行使用メモリ | 57,132 KB |
| 最終ジャッジ日時 | 2024-09-18 20:36:14 |
| 合計ジャッジ時間 | 5,162 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 13 |
ソースコード
import java.util.Scanner;
class Main {
public static void main(String[] args) {
No0005 no = new No0005();
System.out.println(no.result());
}
}
class No0005 {
public static int MIN_CODE = Character.getNumericValue('A');
public static int MAX_CODE = Character.getNumericValue('Z');
public static int CHAR_NUM = MAX_CODE - MIN_CODE + 1;
private String s;
private String result;
public No0005() {
Scanner sc = new Scanner(System.in);
this.s = sc.next();
StringBuffer sb = new StringBuffer("");
for (int i = 0; i < this.s.length(); i++) {
int code = this.s.codePointAt(i) - MIN_CODE + 1;
code = code - (i + 1);
if (code > 0) {
sb.append(Character.getName(MIN_CODE + code));
} else {
code %= CHAR_NUM;
sb.append(Character.getName(MAX_CODE + code));
}
}
this.result = sb.toString();
}
public String result() {
return this.result;
}
}
skyline