結果
| 問題 |
No.405 ローマ数字の腕時計
|
| コンテスト | |
| ユーザー |
fukusei
|
| 提出日時 | 2017-05-27 15:07:04 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 719 bytes |
| コンパイル時間 | 1,937 ms |
| コンパイル使用メモリ | 74,244 KB |
| 実行使用メモリ | 41,508 KB |
| 最終ジャッジ日時 | 2024-09-21 14:34:36 |
| 合計ジャッジ時間 | 5,856 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 24 WA * 3 |
ソースコード
import java.util.*;
class test{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
String S1 = sc.next();
int def = 0;
int sum = 0;
int T = sc.nextInt();
String roma[] = {"I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"};
for(int i=0; i<roma.length; i++){
if(S1.equals(roma[i])){
def = i+1;
}
}
while(def > 12){
def -= 12;
}
while(def <= -12){
def += 12;
}
while(T > 12){
T -= 12;
}
while(T <= -12){
T += 12;
}
sum = def + T;
while(sum > 12){
sum -= 12;
}
while(sum < 0){
sum += 12;
}
for(int i=0; i<roma.length; i++){
if(sum == i+1){
System.out.println(roma[i]);
}
}
}
}
fukusei