Submission #223160
Source Code Expand
import java.math.BigDecimal; import java.util.Scanner; public class Main { private final static Main main = new Main(); public static void main(String[] args) { main.answer(); } private void answer() { Scanner sc = new Scanner(System.in); float deg = sc.nextInt()/10f; float dis = round(sc.nextInt()/60f); sc.close(); int power = getPower(dis); System.out.println((power==0 ? "C" : getDeg(deg)) + " " + power); } private String getDeg(float deg) { if(11.25 <= deg && deg < 33.75) { return "NNE"; } if(33.75 <= deg && deg < 56.25) { return "NE"; } if(56.25 <= deg && deg < 78.75) { return "ENE"; } if(78.75 <= deg && deg < 101.25) { return "E"; } if(101.25 <= deg && deg < 123.75) { return "ESE"; } if(123.75 <= deg && deg < 146.25) { return "SE"; } if(146.25 <= deg && deg < 168.75) { return "SSE"; } if(168.75 <= deg && deg < 191.25) { return "S"; } if(191.25 <= deg && deg < 213.75) { return "SSW"; } if(213.57 <= deg && deg < 236.35) { return "SW"; } if(236.25 <= deg && deg < 258.75) { return "WSW"; } if(259.75 <= deg && deg < 281.75) { return "W"; } if(281.75 <= deg && deg < 303.75) { return "WNW"; } if(303.75 <= deg && deg < 326.25) { return "NW"; } if(326.25 <= deg && deg < 348.75) { return "NNW"; } return "N"; } private int getPower(float dis) { float[] array = {0.2f, 1.5f, 3.3f, 5.4f, 7.9f, 10.7f, 13.8f, 17.1f, 20.7f, 24.4f, 28.4f, 32.7f}; for(int i=0; i<array.length; ++i) { if(dis <= array[i]) { return i; } } return 12; } private float round(float dis) { return new BigDecimal(dis).setScale(1, BigDecimal.ROUND_HALF_UP).floatValue(); } }
Submission Info
Submission Time | |
---|---|
Task | C - 風力観測 |
User | poxoq |
Language | Java (OpenJDK 1.7.0) |
Score | 0 |
Code Size | 2583 Byte |
Status | WA |
Exec Time | 424 ms |
Memory | 22900 KB |
Judge Result
Set Name | all | ||||
---|---|---|---|---|---|
Score / Max Score | 0 / 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 | 413 ms | 22792 KB |
00_sample_02.txt | AC | 411 ms | 22832 KB |
00_sample_03.txt | AC | 399 ms | 22704 KB |
00_sample_04.txt | WA | 402 ms | 22828 KB |
00_sample_05.txt | WA | 402 ms | 22696 KB |
00_sample_06.txt | AC | 402 ms | 22864 KB |
00_sample_07.txt | WA | 404 ms | 22696 KB |
00_sample_08.txt | AC | 411 ms | 22704 KB |
test_01.txt | AC | 411 ms | 22576 KB |
test_02.txt | WA | 410 ms | 22820 KB |
test_03.txt | WA | 409 ms | 22832 KB |
test_04.txt | WA | 401 ms | 22820 KB |
test_05.txt | WA | 403 ms | 22696 KB |
test_06.txt | AC | 405 ms | 22692 KB |
test_07.txt | AC | 407 ms | 22832 KB |
test_08.txt | WA | 406 ms | 22704 KB |
test_09.txt | AC | 405 ms | 22704 KB |
test_10.txt | AC | 409 ms | 22832 KB |
test_11.txt | AC | 411 ms | 22824 KB |
test_12.txt | WA | 409 ms | 22684 KB |
test_13.txt | AC | 408 ms | 22680 KB |
test_14.txt | AC | 407 ms | 22696 KB |
test_15.txt | AC | 406 ms | 22692 KB |
test_16.txt | AC | 403 ms | 22832 KB |
test_17.txt | AC | 403 ms | 22776 KB |
test_18.txt | AC | 410 ms | 22744 KB |
test_19.txt | AC | 422 ms | 22900 KB |
test_20.txt | AC | 401 ms | 22704 KB |
test_21.txt | AC | 400 ms | 22692 KB |
test_22.txt | AC | 407 ms | 22832 KB |
test_23.txt | AC | 416 ms | 22672 KB |
test_24.txt | AC | 420 ms | 22692 KB |
test_25.txt | AC | 412 ms | 22704 KB |
test_26.txt | AC | 406 ms | 22704 KB |
test_27.txt | AC | 400 ms | 22700 KB |
test_28.txt | AC | 400 ms | 22692 KB |
test_29.txt | AC | 404 ms | 22692 KB |
test_30.txt | AC | 402 ms | 22824 KB |
test_31.txt | AC | 402 ms | 22704 KB |
test_32.txt | AC | 404 ms | 22692 KB |
test_33.txt | AC | 402 ms | 22704 KB |
test_34.txt | AC | 406 ms | 22704 KB |
test_35.txt | AC | 401 ms | 22820 KB |
test_36.txt | AC | 406 ms | 22692 KB |
test_37.txt | AC | 408 ms | 22704 KB |
test_38.txt | AC | 407 ms | 22688 KB |
test_39.txt | AC | 402 ms | 22832 KB |
test_40.txt | AC | 400 ms | 22704 KB |
test_41.txt | AC | 415 ms | 22700 KB |
test_42.txt | AC | 402 ms | 22692 KB |
test_43.txt | AC | 402 ms | 22696 KB |
test_44.txt | AC | 410 ms | 22832 KB |
test_45.txt | AC | 407 ms | 22820 KB |
test_46.txt | AC | 411 ms | 22704 KB |
test_47.txt | AC | 404 ms | 22828 KB |
test_48.txt | AC | 402 ms | 22820 KB |
test_49.txt | AC | 402 ms | 22700 KB |
test_50.txt | AC | 401 ms | 22828 KB |
test_51.txt | AC | 405 ms | 22696 KB |
test_52.txt | AC | 402 ms | 22828 KB |
test_53.txt | WA | 402 ms | 22692 KB |
test_54.txt | WA | 407 ms | 22700 KB |
test_55.txt | WA | 424 ms | 22832 KB |
test_56.txt | AC | 404 ms | 22832 KB |
test_57.txt | AC | 411 ms | 22828 KB |
test_58.txt | AC | 402 ms | 22824 KB |