結果

問題 No.761 平均値ゲーム
ユーザー 37zigen37zigen
提出日時 2020-04-01 13:04:46
言語 Java21
(openjdk 21)
結果
AC  
実行時間 629 ms / 2,000 ms
コード長 842 bytes
コンパイル時間 2,161 ms
コンパイル使用メモリ 74,128 KB
実行使用メモリ 66,628 KB
最終ジャッジ日時 2023-09-08 16:41:49
合計ジャッジ時間 43,397 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
56,220 KB
testcase_01 AC 121 ms
55,452 KB
testcase_02 AC 121 ms
55,404 KB
testcase_03 AC 121 ms
55,508 KB
testcase_04 AC 124 ms
56,356 KB
testcase_05 AC 123 ms
56,248 KB
testcase_06 AC 123 ms
56,040 KB
testcase_07 AC 123 ms
56,320 KB
testcase_08 AC 122 ms
56,144 KB
testcase_09 AC 122 ms
55,824 KB
testcase_10 AC 121 ms
56,000 KB
testcase_11 AC 124 ms
55,948 KB
testcase_12 AC 121 ms
56,200 KB
testcase_13 AC 121 ms
55,720 KB
testcase_14 AC 122 ms
56,060 KB
testcase_15 AC 122 ms
55,872 KB
testcase_16 AC 122 ms
55,456 KB
testcase_17 AC 123 ms
56,204 KB
testcase_18 AC 123 ms
56,296 KB
testcase_19 AC 123 ms
56,008 KB
testcase_20 AC 123 ms
55,684 KB
testcase_21 AC 123 ms
55,472 KB
testcase_22 AC 125 ms
56,500 KB
testcase_23 AC 122 ms
56,164 KB
testcase_24 AC 122 ms
56,108 KB
testcase_25 AC 123 ms
56,068 KB
testcase_26 AC 124 ms
56,072 KB
testcase_27 AC 124 ms
55,768 KB
testcase_28 AC 123 ms
56,056 KB
testcase_29 AC 122 ms
55,768 KB
testcase_30 AC 122 ms
56,188 KB
testcase_31 AC 125 ms
56,020 KB
testcase_32 AC 122 ms
56,276 KB
testcase_33 AC 524 ms
60,504 KB
testcase_34 AC 572 ms
60,344 KB
testcase_35 AC 248 ms
59,964 KB
testcase_36 AC 474 ms
60,308 KB
testcase_37 AC 532 ms
58,452 KB
testcase_38 AC 547 ms
60,824 KB
testcase_39 AC 571 ms
61,140 KB
testcase_40 AC 573 ms
61,048 KB
testcase_41 AC 560 ms
61,044 KB
testcase_42 AC 574 ms
62,936 KB
testcase_43 AC 306 ms
59,996 KB
testcase_44 AC 494 ms
60,388 KB
testcase_45 AC 549 ms
60,688 KB
testcase_46 AC 447 ms
60,640 KB
testcase_47 AC 458 ms
60,308 KB
testcase_48 AC 228 ms
59,608 KB
testcase_49 AC 575 ms
63,212 KB
testcase_50 AC 281 ms
60,080 KB
testcase_51 AC 244 ms
59,728 KB
testcase_52 AC 252 ms
59,788 KB
testcase_53 AC 583 ms
63,324 KB
testcase_54 AC 477 ms
60,700 KB
testcase_55 AC 581 ms
63,416 KB
testcase_56 AC 393 ms
60,140 KB
testcase_57 AC 588 ms
63,896 KB
testcase_58 AC 309 ms
60,312 KB
testcase_59 AC 568 ms
60,744 KB
testcase_60 AC 375 ms
60,376 KB
testcase_61 AC 589 ms
63,860 KB
testcase_62 AC 604 ms
63,084 KB
testcase_63 AC 331 ms
60,268 KB
testcase_64 AC 552 ms
60,616 KB
testcase_65 AC 415 ms
60,604 KB
testcase_66 AC 245 ms
59,236 KB
testcase_67 AC 372 ms
60,408 KB
testcase_68 AC 272 ms
60,428 KB
testcase_69 AC 534 ms
60,144 KB
testcase_70 AC 457 ms
60,536 KB
testcase_71 AC 350 ms
60,456 KB
testcase_72 AC 269 ms
59,892 KB
testcase_73 AC 400 ms
60,300 KB
testcase_74 AC 340 ms
60,792 KB
testcase_75 AC 445 ms
60,180 KB
testcase_76 AC 386 ms
60,416 KB
testcase_77 AC 542 ms
60,660 KB
testcase_78 AC 458 ms
60,260 KB
testcase_79 AC 324 ms
60,600 KB
testcase_80 AC 292 ms
60,360 KB
testcase_81 AC 283 ms
60,544 KB
testcase_82 AC 498 ms
60,604 KB
testcase_83 AC 607 ms
64,540 KB
testcase_84 AC 609 ms
63,960 KB
testcase_85 AC 601 ms
64,500 KB
testcase_86 AC 596 ms
63,876 KB
testcase_87 AC 605 ms
66,628 KB
testcase_88 AC 617 ms
64,164 KB
testcase_89 AC 598 ms
64,004 KB
testcase_90 AC 606 ms
64,392 KB
testcase_91 AC 610 ms
64,440 KB
testcase_92 AC 629 ms
64,116 KB
testcase_93 AC 129 ms
55,672 KB
testcase_94 AC 124 ms
56,220 KB
testcase_95 AC 564 ms
62,828 KB
testcase_96 AC 587 ms
62,048 KB
testcase_97 AC 582 ms
62,608 KB
testcase_98 AC 532 ms
62,432 KB
testcase_99 AC 605 ms
64,728 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		new Main().run();
	}
	
	boolean f(int l,int r,long[] A,long[] sum) {
		if(r-l<=0)return false;
		int ok=r-1;
		int ng=l-1;
		boolean ret=false;
		while(ok-ng>1) {
			int middle=(ok+ng)/2;
			if(A[middle]*(r-l)>=(r>0?sum[r-1]:0)-(l>0?sum[l-1]:0))ok=middle;
			else ng=middle;
		}
		if(ok!=r)ret|=!f(l,ok,A,sum);
		if(ok!=l)ret|=!f(ok,r,A,sum);
		return ret;
	}
	
	void run() {
		Scanner sc=new Scanner(System.in);
		int N=sc.nextInt();
		long[] A=new long[N];
		long[] sum=new long[N];
		for(int i=0;i<N;++i)A[i]=sc.nextLong();
		for(int i=0;i<N;++i)sum[i]=A[i]+(i>0?sum[i-1]:0);
		System.out.println(f(0,N,A,sum)?"First":"Second");
	}
	
	static void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}

}

0