Submission #136679
Source Code Expand
object Main { def main(args:Array[String]) { val tmp = readLine.split(" ") val deg = tmp(0).toInt val dis = tmp(1).toDouble val w = (dis / 6).round match { case x if x <= 2 => 0 case x if x <= 15 => 1 case x if x <= 33 => 2 case x if x <= 54 => 3 case x if x <= 79 => 4 case x if x <= 107 => 5 case x if x <= 138 => 6 case x if x <= 171 => 7 case x if x <= 207 => 8 case x if x <= 244 => 9 case x if x <= 284 => 10 case x if x <= 326 => 11 case _ => 12 } val dir = if ( w == 0) "C" else { deg * 10 match { case x if x < 1125 => "N" case x if x < 3375 => "NNE" case x if x < 5625 => "NE" case x if x < 7875 => "ENE" case x if x < 10125 => "E" case x if x < 12375 => "ESE" case x if x < 14625 => "SE" case x if x < 16875 => "SSE" case x if x < 19125 => "S" case x if x < 21375 => "SSW" case x if x < 23625 => "SW" case x if x < 25875 => "WSW" case x if x < 28125 => "W" case x if x < 30375 => "WNW" case x if x < 32625 => "NW" case x if x < 34875 => "NNW" case _ => "N" } } if ( w == 0) println("C 0") else println(dir + " " + w) } }
Submission Info
Submission Time | |
---|---|
Task | C - 風力観測 |
User | tets331 |
Language | Scala (2.9.1) |
Score | 100 |
Code Size | 1250 Byte |
Status | AC |
Exec Time | 1111 ms |
Memory | 42236 KB |
Judge Result
Set Name | all | ||
---|---|---|---|
Score / Max Score | 100 / 100 | ||
Status |
|
Set Name | Test Cases |
---|---|
all | 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt, 00_sample_05.txt, 00_sample_06.txt, 00_sample_07.txt, 00_sample_08.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt, test_14.txt, test_15.txt, test_16.txt, test_17.txt, test_18.txt, test_19.txt, test_20.txt, test_21.txt, test_22.txt, test_23.txt, test_24.txt, test_25.txt, test_26.txt, test_27.txt, test_28.txt, test_29.txt, test_30.txt, test_31.txt, test_32.txt, test_33.txt, test_34.txt, test_35.txt, test_36.txt, test_37.txt, test_38.txt, test_39.txt, test_40.txt, test_41.txt, test_42.txt, test_43.txt, test_44.txt, test_45.txt, test_46.txt, test_47.txt, test_48.txt, test_49.txt, test_50.txt, test_51.txt, test_52.txt, test_53.txt, test_54.txt, test_55.txt, test_56.txt, test_57.txt, test_58.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample_01.txt | AC | 1033 ms | 41976 KB |
00_sample_02.txt | AC | 977 ms | 41924 KB |
00_sample_03.txt | AC | 987 ms | 41928 KB |
00_sample_04.txt | AC | 1013 ms | 42052 KB |
00_sample_05.txt | AC | 1006 ms | 42108 KB |
00_sample_06.txt | AC | 979 ms | 41980 KB |
00_sample_07.txt | AC | 975 ms | 42124 KB |
00_sample_08.txt | AC | 979 ms | 42056 KB |
test_01.txt | AC | 979 ms | 42120 KB |
test_02.txt | AC | 981 ms | 42096 KB |
test_03.txt | AC | 1006 ms | 42068 KB |
test_04.txt | AC | 1025 ms | 42104 KB |
test_05.txt | AC | 973 ms | 42128 KB |
test_06.txt | AC | 996 ms | 42076 KB |
test_07.txt | AC | 1111 ms | 42120 KB |
test_08.txt | AC | 1000 ms | 42032 KB |
test_09.txt | AC | 987 ms | 41992 KB |
test_10.txt | AC | 985 ms | 42028 KB |
test_11.txt | AC | 1027 ms | 41944 KB |
test_12.txt | AC | 994 ms | 42104 KB |
test_13.txt | AC | 996 ms | 42116 KB |
test_14.txt | AC | 988 ms | 42032 KB |
test_15.txt | AC | 992 ms | 42068 KB |
test_16.txt | AC | 993 ms | 42120 KB |
test_17.txt | AC | 989 ms | 42040 KB |
test_18.txt | AC | 1003 ms | 42116 KB |
test_19.txt | AC | 990 ms | 42184 KB |
test_20.txt | AC | 981 ms | 42100 KB |
test_21.txt | AC | 977 ms | 42104 KB |
test_22.txt | AC | 986 ms | 42120 KB |
test_23.txt | AC | 993 ms | 42100 KB |
test_24.txt | AC | 1007 ms | 42100 KB |
test_25.txt | AC | 1001 ms | 42236 KB |
test_26.txt | AC | 974 ms | 42072 KB |
test_27.txt | AC | 983 ms | 42104 KB |
test_28.txt | AC | 1003 ms | 42100 KB |
test_29.txt | AC | 992 ms | 42104 KB |
test_30.txt | AC | 1002 ms | 42112 KB |
test_31.txt | AC | 1011 ms | 42116 KB |
test_32.txt | AC | 1049 ms | 42068 KB |
test_33.txt | AC | 1067 ms | 42048 KB |
test_34.txt | AC | 1024 ms | 42056 KB |
test_35.txt | AC | 1001 ms | 42120 KB |
test_36.txt | AC | 998 ms | 41976 KB |
test_37.txt | AC | 990 ms | 41996 KB |
test_38.txt | AC | 1064 ms | 42092 KB |
test_39.txt | AC | 1008 ms | 42064 KB |
test_40.txt | AC | 1007 ms | 42112 KB |
test_41.txt | AC | 992 ms | 42072 KB |
test_42.txt | AC | 1014 ms | 42112 KB |
test_43.txt | AC | 1013 ms | 42072 KB |
test_44.txt | AC | 1004 ms | 42188 KB |
test_45.txt | AC | 999 ms | 42104 KB |
test_46.txt | AC | 1012 ms | 41980 KB |
test_47.txt | AC | 1004 ms | 41996 KB |
test_48.txt | AC | 1005 ms | 41960 KB |
test_49.txt | AC | 1012 ms | 42028 KB |
test_50.txt | AC | 1022 ms | 42040 KB |
test_51.txt | AC | 1020 ms | 42120 KB |
test_52.txt | AC | 1020 ms | 42108 KB |
test_53.txt | AC | 1005 ms | 42088 KB |
test_54.txt | AC | 986 ms | 42192 KB |
test_55.txt | AC | 1045 ms | 42048 KB |
test_56.txt | AC | 1094 ms | 42112 KB |
test_57.txt | AC | 1006 ms | 42008 KB |
test_58.txt | AC | 995 ms | 42116 KB |