結果

問題 No.1211 円環はお断り
ユーザー tailstails
提出日時 2020-08-30 17:54:51
言語 cLay
(20240104-1)
結果
WA  
実行時間 -
コード長 465 bytes
コンパイル時間 1,812 ms
コンパイル使用メモリ 160,384 KB
実行使用メモリ 8,536 KB
最終ジャッジ日時 2023-09-19 01:04:19
合計ジャッジ時間 9,332 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 2 ms
5,544 KB
testcase_03 AC 2 ms
5,380 KB
testcase_04 AC 2 ms
5,372 KB
testcase_05 WA -
testcase_06 AC 2 ms
5,404 KB
testcase_07 AC 2 ms
5,400 KB
testcase_08 WA -
testcase_09 AC 2 ms
5,412 KB
testcase_10 AC 2 ms
5,380 KB
testcase_11 AC 2 ms
5,392 KB
testcase_12 AC 2 ms
5,368 KB
testcase_13 AC 59 ms
7,088 KB
testcase_14 AC 91 ms
7,604 KB
testcase_15 AC 82 ms
7,488 KB
testcase_16 AC 105 ms
8,508 KB
testcase_17 AC 11 ms
5,692 KB
testcase_18 AC 73 ms
7,336 KB
testcase_19 AC 10 ms
5,664 KB
testcase_20 AC 15 ms
5,780 KB
testcase_21 AC 13 ms
5,828 KB
testcase_22 AC 62 ms
7,192 KB
testcase_23 AC 70 ms
7,456 KB
testcase_24 AC 35 ms
6,648 KB
testcase_25 AC 4 ms
5,444 KB
testcase_26 AC 89 ms
7,720 KB
testcase_27 AC 36 ms
6,740 KB
testcase_28 AC 90 ms
7,724 KB
testcase_29 AC 64 ms
7,496 KB
testcase_30 AC 79 ms
7,788 KB
testcase_31 AC 36 ms
6,472 KB
testcase_32 AC 93 ms
8,116 KB
testcase_33 AC 96 ms
8,352 KB
testcase_34 AC 95 ms
8,536 KB
testcase_35 AC 95 ms
8,500 KB
testcase_36 AC 96 ms
8,312 KB
testcase_37 AC 96 ms
8,392 KB
testcase_38 AC 73 ms
8,316 KB
testcase_39 AC 74 ms
8,460 KB
testcase_40 WA -
testcase_41 AC 2 ms
5,548 KB
testcase_42 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ll n,k,a[1d5];
ll g,h,m;

ll j,s;
ll c[1d5],d[1d5],e[1d5];
bool f(ll m){
	j=s=0;
	rep(i,n){
		while(s<m){
			s+=a[j++%n];
			if(j-i==n){
				return false;
			}
		}
		c[i]=j;
		s-=a[i];
	}
	rrep(i,n){
		if(c[i]>=n){
			d[i]=1,e[i]=c[i]-n;
		}else{
			d[i]=1+d[c[i]],e[i]=e[c[i]];
		}
		if(d[i]==k && e[i]<=i){
			return true;
		}
	}
	return false;
}

{
	rd(n,k,a(n));
	g=1;
	h=1d14+1;
	while(g+1<h){
		m=g+h>>1;
		if(f(m)){
			g=m;
		}else{
			h=m;
		}
	}
	wt(g);
}
0