結果
| 問題 | No.405 ローマ数字の腕時計 |
| コンテスト | |
| ユーザー |
fukusei
|
| 提出日時 | 2017-05-27 15:00:38 |
| 言語 | Java (openjdk 26.0.2.1 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 725 bytes |
| 記録 | |
| コンパイル時間 | 1,335 ms |
| コンパイル使用メモリ | 83,976 KB |
| 実行使用メモリ | 45,576 KB |
| 最終ジャッジ日時 | 2026-09-01 16:44:48 |
| 合計ジャッジ時間 | 4,341 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 21 WA * 6 |
ソースコード
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