Submission #1002124
Source Code Expand
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int deg = sc.nextInt(); int dis = sc.nextInt(); String dir = getDirection(deg * 10); int speed = getSpeed(dis); if (speed == 0) { dir = "C"; } System.out.println(dir + " " + speed); } private static int getSpeed(int dis) { double sp = Math.round((double)dis / 60f * 10.0) / 10.0; int speed = 0; if (sp >= 0.0 && sp <= 0.2) { speed = 0; } else if (sp >= 0.3 && sp <= 1.5) { speed = 1; } else if (sp >= 1.6 && sp <= 3.3) { speed = 2; } else if (sp >= 3.4 && sp <= 5.4) { speed = 3; } else if (sp >= 5.5 && sp <= 7.9) { speed = 4; } else if (sp >= 8.0 && sp <= 10.7) { speed = 5; } else if (sp >= 10.8 && sp <= 13.8) { speed = 6; } else if (sp >= 13.9 && sp <= 17.1) { speed = 7; } else if (sp >= 17.2 && sp <= 20.7) { speed = 8; } else if (sp >= 20.8 && sp <= 24.4) { speed = 9; } else if (sp >= 24.5 && sp <= 28.4) { speed = 10; } else if (sp >= 28.5 && sp <= 32.6) { speed = 11; } else if (sp >= 32.7) { speed = 12; } return speed; } private static String getDirection(int deg) { String direction = "N"; if (deg >= 1125 && deg < 3375) { direction = "NNE"; } else if (deg >= 3375 && deg < 5625) { direction = "NE"; } else if (deg >= 5625 && deg < 7875) { direction = "ENE"; } else if (deg >= 7875 && deg < 10125) { direction = "E"; } else if (deg >= 10125 && deg < 12375) { direction = "ESE"; } else if (deg >= 12375 && deg < 14625) { direction = "SE"; } else if (deg >= 14625 && deg < 16875) { direction = "SSE"; } else if (deg >= 16875 && deg < 19125) { direction = "S"; } else if (deg >= 19125 && deg < 21375) { direction = "SSW"; } else if (deg >= 21375 && deg < 23625) { direction = "SW"; } else if (deg >= 23625 && deg < 25875) { direction = "WSW"; } else if (deg >= 25875 && deg < 28125) { direction = "W"; } else if (deg >= 28125 && deg < 30375) { direction = "WNW"; } else if (deg >= 30375 && deg < 32625) { direction = "NW"; } else if (deg >= 32625 && deg < 34875) { direction = "NNW"; } return direction; } }
Submission Info
Submission Time | |
---|---|
Task | C - 風力観測 |
User | taikyokuken |
Language | Java (OpenJDK 1.7.0) |
Score | 100 |
Code Size | 2334 Byte |
Status | AC |
Exec Time | 353 ms |
Memory | 22008 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 | 353 ms | 21892 KB |
00_sample_02.txt | AC | 236 ms | 21804 KB |
00_sample_03.txt | AC | 238 ms | 21888 KB |
00_sample_04.txt | AC | 241 ms | 21888 KB |
00_sample_05.txt | AC | 236 ms | 21876 KB |
00_sample_06.txt | AC | 238 ms | 21912 KB |
00_sample_07.txt | AC | 239 ms | 21884 KB |
00_sample_08.txt | AC | 233 ms | 21872 KB |
test_01.txt | AC | 244 ms | 21872 KB |
test_02.txt | AC | 237 ms | 21888 KB |
test_03.txt | AC | 241 ms | 21928 KB |
test_04.txt | AC | 238 ms | 21860 KB |
test_05.txt | AC | 235 ms | 21968 KB |
test_06.txt | AC | 235 ms | 21888 KB |
test_07.txt | AC | 236 ms | 21884 KB |
test_08.txt | AC | 237 ms | 21928 KB |
test_09.txt | AC | 236 ms | 21964 KB |
test_10.txt | AC | 236 ms | 21820 KB |
test_11.txt | AC | 235 ms | 21856 KB |
test_12.txt | AC | 235 ms | 21836 KB |
test_13.txt | AC | 236 ms | 21860 KB |
test_14.txt | AC | 238 ms | 21852 KB |
test_15.txt | AC | 241 ms | 21908 KB |
test_16.txt | AC | 238 ms | 21952 KB |
test_17.txt | AC | 236 ms | 21860 KB |
test_18.txt | AC | 233 ms | 21888 KB |
test_19.txt | AC | 234 ms | 21804 KB |
test_20.txt | AC | 238 ms | 21984 KB |
test_21.txt | AC | 240 ms | 21860 KB |
test_22.txt | AC | 234 ms | 21900 KB |
test_23.txt | AC | 232 ms | 21892 KB |
test_24.txt | AC | 235 ms | 21852 KB |
test_25.txt | AC | 240 ms | 22008 KB |
test_26.txt | AC | 247 ms | 21804 KB |
test_27.txt | AC | 248 ms | 21892 KB |
test_28.txt | AC | 243 ms | 21904 KB |
test_29.txt | AC | 239 ms | 21856 KB |
test_30.txt | AC | 233 ms | 21944 KB |
test_31.txt | AC | 237 ms | 21884 KB |
test_32.txt | AC | 237 ms | 21880 KB |
test_33.txt | AC | 238 ms | 21896 KB |
test_34.txt | AC | 236 ms | 21892 KB |
test_35.txt | AC | 242 ms | 21872 KB |
test_36.txt | AC | 237 ms | 21944 KB |
test_37.txt | AC | 246 ms | 21900 KB |
test_38.txt | AC | 235 ms | 21808 KB |
test_39.txt | AC | 237 ms | 21956 KB |
test_40.txt | AC | 235 ms | 21840 KB |
test_41.txt | AC | 233 ms | 21908 KB |
test_42.txt | AC | 236 ms | 21868 KB |
test_43.txt | AC | 238 ms | 21916 KB |
test_44.txt | AC | 237 ms | 21912 KB |
test_45.txt | AC | 234 ms | 21948 KB |
test_46.txt | AC | 234 ms | 21896 KB |
test_47.txt | AC | 238 ms | 21864 KB |
test_48.txt | AC | 237 ms | 21900 KB |
test_49.txt | AC | 235 ms | 21796 KB |
test_50.txt | AC | 235 ms | 21832 KB |
test_51.txt | AC | 234 ms | 21956 KB |
test_52.txt | AC | 237 ms | 21968 KB |
test_53.txt | AC | 234 ms | 21888 KB |
test_54.txt | AC | 235 ms | 21736 KB |
test_55.txt | AC | 236 ms | 21856 KB |
test_56.txt | AC | 236 ms | 21872 KB |
test_57.txt | AC | 236 ms | 21888 KB |
test_58.txt | AC | 235 ms | 21948 KB |