結果
| 問題 |
No.405 ローマ数字の腕時計
|
| コンテスト | |
| ユーザー |
HEGO55
|
| 提出日時 | 2017-05-27 15:19:24 |
| 言語 | Java (openjdk 23) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 697 bytes |
| コンパイル時間 | 2,082 ms |
| コンパイル使用メモリ | 74,464 KB |
| 実行使用メモリ | 41,840 KB |
| 最終ジャッジ日時 | 2024-09-21 14:34:46 |
| 合計ジャッジ時間 | 6,652 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 23 RE * 4 |
ソースコード
import java.util.*;
class No405{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int t = 0;
String[] S1List = {"I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"};
int[] TList = {1,2,3,4,5,6,7,8,9,10,11,12};
String S1 = sc.next();
int T = sc.nextInt();
for(int i=0; i<S1List.length; i++){
if(S1List[i].equals(S1)){
t = TList[i];
}
}
int add = T + t;
if(add>=0){
if(add<=12){
System.out.println(S1List[add-1]);
}else{
while(add>12){
add -= 12;
}
System.out.println(S1List[add-1]);
}
}else{
while(add<0){
add += 12;
}
System.out.println(S1List[add-1]);
}
}
}
HEGO55