Submission #111770
Source Code Expand
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public Main() { // TODO 自動生成されたコンストラクター・スタブ } /** * @param args */ public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ String[] strs = null; strs = read(strs); solve(strs); } private static void solve(String[] strs) { // TODO 自動生成されたメソッド・スタブ String ans = ""; int[] x = new int[3]; int[] y = new int[3]; String nums[] = strs[0].split(" "); for(int i = 0; i<3; i++){ x[i] = Integer.parseInt(nums[2*i]); y[i] = Integer.parseInt(nums[2*i + 1]); } int xmin = x[0]; int ymin = y[0]; int xmax = x[0]; int ymax = y[0]; for(int i = 1; i<3; i++){ x[i] -= x[0]; y[i] -= y[0]; } // float sqea = (xmax - xmin) * (ymax - ymin); float sqea = (float)Math.abs((x[1] * y[2]) - (y[1] * x[2]))/2; ans = String.format("%.1f", (float)sqea); // int num = strs.length; // // String[] s = new String[num]; // String[] e = new String[num]; // // for(int index = 0; index<strs.length; index++){ // String[] split = strs[index].split("-"); // s[index] = split[0]; // e[index] = split[1]; // } // // roundStart(s); // roundEnd(e); // // sort(s,e); // // marge(s,e); // // for(int index = 0; index<s.length; index++){ // if(s[index].equals("null")){ // break; // } // ans += s[index] + "-" + e[index] + "\n"; // } System.out.println(ans); } private static void roundStart(String[] s){ for(int index = 0; index < s.length; index++){ int time = Integer.parseInt(s[index]); int i = time % 10; time -= i % 5; s[index] = String.valueOf(time); } } private static void roundEnd(String[] e){ for(int index = 0; index < e.length; index++){ int time = Integer.parseInt(e[index]); int i = time % 10; if(i != 0 && i != 5){ time += 5 - (i % 5); e[index] = String.valueOf(time); } } } private static void sort(String[] s, String[] e){ for(int i=0;i<s.length-1;i++){ for(int j=s.length-1;j>i;j--){ int s1 = Integer.parseInt(s[j]); int s2 = Integer.parseInt(s[j-1]); if(s1<s2){ String tmp; tmp = s[j]; s[j] = s[j-1]; s[j-1] = tmp; tmp = e[j]; e[j] = e[j-1]; e[j-1] = tmp; } } } } private static void marge(String[] s, String[] e){ String NULL = "null"; for(int index = 1; index < s.length; index++){ if(s[index].equals(NULL)){ break; } int i_s = Integer.parseInt(s[index]); int i_e = Integer.parseInt(e[index-1]); if(i_e >= i_s){ if(Integer.parseInt(e[index-1])<Integer.parseInt(e[index])){ e[index -1] = e[index]; } for(int i = index; i<s.length - 1;i++){ s[i] = s[i+1]; e[i] = e[i+1]; } s[s.length-1] = NULL; e[e.length-1] = NULL; index--; } } } private static String[] read(String[] strs){ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String[] num = new String[1]; try { num[0] = in.readLine(); // int i_num = Integer.parseInt(num); // strs = new String[i_num]; // for(int i = 0; i < i_num; i++){ // strs[i] = in.readLine(); // } } catch (IOException e) { // TODO 自動生成された catch ブロック e.printStackTrace(); } //return strs; return num; } }
Submission Info
Submission Time | |
---|---|
Task | C - 直訴 |
User | keitaro9ml |
Language | Java (OpenJDK 1.7.0) |
Score | 100 |
Code Size | 3618 Byte |
Status | AC |
Exec Time | 437 ms |
Memory | 21352 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, 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, test_59.txt, test_60.txt, test_61.txt, test_62.txt, test_63.txt, test_64.txt, test_65.txt, test_66.txt, test_67.txt, test_68.txt, test_69.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample_01.txt | AC | 398 ms | 21164 KB |
00_sample_02.txt | AC | 391 ms | 21216 KB |
00_sample_03.txt | AC | 389 ms | 21212 KB |
test_01.txt | AC | 392 ms | 21336 KB |
test_02.txt | AC | 395 ms | 21216 KB |
test_03.txt | AC | 416 ms | 21224 KB |
test_04.txt | AC | 387 ms | 21208 KB |
test_05.txt | AC | 394 ms | 21200 KB |
test_06.txt | AC | 390 ms | 21208 KB |
test_07.txt | AC | 390 ms | 21336 KB |
test_08.txt | AC | 396 ms | 21212 KB |
test_09.txt | AC | 388 ms | 21292 KB |
test_10.txt | AC | 393 ms | 21344 KB |
test_11.txt | AC | 401 ms | 21212 KB |
test_12.txt | AC | 393 ms | 21216 KB |
test_13.txt | AC | 409 ms | 21208 KB |
test_14.txt | AC | 401 ms | 21220 KB |
test_15.txt | AC | 400 ms | 21220 KB |
test_16.txt | AC | 395 ms | 21212 KB |
test_17.txt | AC | 414 ms | 21344 KB |
test_18.txt | AC | 404 ms | 21208 KB |
test_19.txt | AC | 402 ms | 21208 KB |
test_20.txt | AC | 411 ms | 21288 KB |
test_21.txt | AC | 391 ms | 21208 KB |
test_22.txt | AC | 428 ms | 21344 KB |
test_23.txt | AC | 400 ms | 21208 KB |
test_24.txt | AC | 395 ms | 21204 KB |
test_25.txt | AC | 403 ms | 21212 KB |
test_26.txt | AC | 395 ms | 21212 KB |
test_27.txt | AC | 395 ms | 21080 KB |
test_28.txt | AC | 411 ms | 21212 KB |
test_29.txt | AC | 437 ms | 21200 KB |
test_30.txt | AC | 404 ms | 21216 KB |
test_31.txt | AC | 400 ms | 21352 KB |
test_32.txt | AC | 406 ms | 21088 KB |
test_33.txt | AC | 403 ms | 21088 KB |
test_34.txt | AC | 401 ms | 21216 KB |
test_35.txt | AC | 394 ms | 21216 KB |
test_36.txt | AC | 435 ms | 21300 KB |
test_37.txt | AC | 403 ms | 21200 KB |
test_38.txt | AC | 397 ms | 21212 KB |
test_39.txt | AC | 411 ms | 21212 KB |
test_40.txt | AC | 408 ms | 21212 KB |
test_41.txt | AC | 395 ms | 21340 KB |
test_42.txt | AC | 406 ms | 21200 KB |
test_43.txt | AC | 399 ms | 21212 KB |
test_44.txt | AC | 392 ms | 21208 KB |
test_45.txt | AC | 402 ms | 21208 KB |
test_46.txt | AC | 415 ms | 21208 KB |
test_47.txt | AC | 409 ms | 21216 KB |
test_48.txt | AC | 392 ms | 21212 KB |
test_49.txt | AC | 422 ms | 21208 KB |
test_50.txt | AC | 402 ms | 21208 KB |
test_51.txt | AC | 400 ms | 21208 KB |
test_52.txt | AC | 391 ms | 21208 KB |
test_53.txt | AC | 405 ms | 21220 KB |
test_54.txt | AC | 399 ms | 21208 KB |
test_55.txt | AC | 404 ms | 21208 KB |
test_56.txt | AC | 414 ms | 21212 KB |
test_57.txt | AC | 434 ms | 21212 KB |
test_58.txt | AC | 394 ms | 21216 KB |
test_59.txt | AC | 398 ms | 21208 KB |
test_60.txt | AC | 397 ms | 21204 KB |
test_61.txt | AC | 411 ms | 21212 KB |
test_62.txt | AC | 401 ms | 21088 KB |
test_63.txt | AC | 408 ms | 21164 KB |
test_64.txt | AC | 396 ms | 21216 KB |
test_65.txt | AC | 397 ms | 21204 KB |
test_66.txt | AC | 407 ms | 21216 KB |
test_67.txt | AC | 406 ms | 21088 KB |
test_68.txt | AC | 407 ms | 21212 KB |
test_69.txt | AC | 408 ms | 21204 KB |