結果

問題 No.761 平均値ゲーム
ユーザー kotatsugamekotatsugame
提出日時 2020-02-22 20:17:06
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 573 bytes
コンパイル時間 679 ms
コンパイル使用メモリ 64,372 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-18 03:03:23
合計ジャッジ時間 7,135 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 2 ms
5,376 KB
testcase_06 WA -
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 WA -
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 2 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 2 ms
5,376 KB
testcase_17 WA -
testcase_18 AC 2 ms
5,376 KB
testcase_19 AC 2 ms
5,376 KB
testcase_20 AC 2 ms
5,376 KB
testcase_21 AC 2 ms
5,376 KB
testcase_22 WA -
testcase_23 AC 2 ms
5,376 KB
testcase_24 AC 2 ms
5,376 KB
testcase_25 AC 2 ms
5,376 KB
testcase_26 AC 2 ms
5,376 KB
testcase_27 AC 2 ms
5,376 KB
testcase_28 AC 2 ms
5,376 KB
testcase_29 WA -
testcase_30 AC 2 ms
5,376 KB
testcase_31 AC 2 ms
5,376 KB
testcase_32 AC 2 ms
5,376 KB
testcase_33 AC 45 ms
5,376 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 29 ms
5,376 KB
testcase_37 AC 43 ms
5,376 KB
testcase_38 AC 43 ms
5,376 KB
testcase_39 AC 55 ms
5,376 KB
testcase_40 AC 54 ms
5,376 KB
testcase_41 AC 51 ms
5,376 KB
testcase_42 AC 55 ms
5,376 KB
testcase_43 AC 11 ms
5,376 KB
testcase_44 WA -
testcase_45 AC 50 ms
5,376 KB
testcase_46 AC 27 ms
5,376 KB
testcase_47 AC 28 ms
5,376 KB
testcase_48 AC 5 ms
5,376 KB
testcase_49 AC 56 ms
5,376 KB
testcase_50 WA -
testcase_51 WA -
testcase_52 AC 6 ms
5,376 KB
testcase_53 WA -
testcase_54 AC 32 ms
5,376 KB
testcase_55 AC 57 ms
5,376 KB
testcase_56 WA -
testcase_57 WA -
testcase_58 WA -
testcase_59 AC 53 ms
5,376 KB
testcase_60 AC 17 ms
5,376 KB
testcase_61 WA -
testcase_62 WA -
testcase_63 AC 13 ms
5,376 KB
testcase_64 AC 50 ms
5,376 KB
testcase_65 AC 22 ms
5,376 KB
testcase_66 WA -
testcase_67 WA -
testcase_68 AC 8 ms
5,376 KB
testcase_69 AC 45 ms
5,376 KB
testcase_70 AC 30 ms
5,376 KB
testcase_71 AC 14 ms
5,376 KB
testcase_72 WA -
testcase_73 WA -
testcase_74 AC 13 ms
5,376 KB
testcase_75 AC 27 ms
5,376 KB
testcase_76 AC 17 ms
5,376 KB
testcase_77 AC 44 ms
5,376 KB
testcase_78 AC 29 ms
5,376 KB
testcase_79 AC 12 ms
5,376 KB
testcase_80 WA -
testcase_81 AC 8 ms
5,376 KB
testcase_82 AC 36 ms
5,376 KB
testcase_83 AC 64 ms
5,376 KB
testcase_84 WA -
testcase_85 AC 62 ms
5,376 KB
testcase_86 WA -
testcase_87 WA -
testcase_88 WA -
testcase_89 AC 63 ms
5,376 KB
testcase_90 AC 62 ms
5,376 KB
testcase_91 WA -
testcase_92 WA -
testcase_93 AC 2 ms
5,376 KB
testcase_94 WA -
testcase_95 AC 59 ms
5,376 KB
testcase_96 WA -
testcase_97 AC 63 ms
5,376 KB
testcase_98 AC 45 ms
5,376 KB
testcase_99 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
using namespace std;
int N;
long A[1<<17];
bool dp[1<<17];
main()
{
	cin>>N;
	for(int i=0;i<N;i++)cin>>A[i];
	long sum=0;
	for(int i=N;i--;)
	{
		sum+=A[i];
		long cnt=N-i;
		{
			int L=i-1,R=N;
			while(R-L>1)
			{
				int M=L+R>>1;
				if(A[M]*cnt>=sum)R=M;
				else L=M;
			}
			if(i<R&&!dp[R])
			{
				dp[i]=true;
				continue;
			}
		}
		{
			int L=i-1,R=N;
			while(R-L>1)
			{
				int M=L+R>>1;
				if(A[M]*cnt>sum)R=M;
				else L=M;
			}
			if(i<R&&!dp[R])
			{
				dp[i]=true;
				continue;
			}
		}
	}
	cout<<(dp[0]?"First":"Second")<<endl;
}
0