結果
問題 | No.78 クジ付きアイスバー |
ユーザー | kotatsugame |
提出日時 | 2019-10-12 06:02:08 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 420 bytes |
コンパイル時間 | 637 ms |
コンパイル使用メモリ | 65,720 KB |
実行使用メモリ | 10,268 KB |
最終ジャッジ日時 | 2024-05-05 08:46:50 |
合計ジャッジ時間 | 16,686 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
6,816 KB |
testcase_01 | AC | 1 ms
5,376 KB |
testcase_02 | AC | 2 ms
5,376 KB |
testcase_03 | AC | 1 ms
5,376 KB |
testcase_04 | AC | 1 ms
5,376 KB |
testcase_05 | AC | 4,703 ms
5,376 KB |
testcase_06 | AC | 1 ms
5,376 KB |
testcase_07 | AC | 4,556 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 | TLE | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
testcase_22 | -- | - |
testcase_23 | -- | - |
testcase_24 | -- | - |
testcase_25 | -- | - |
testcase_26 | -- | - |
testcase_27 | -- | - |
testcase_28 | -- | - |
testcase_29 | -- | - |
testcase_30 | -- | - |
testcase_31 | -- | - |
testcase_32 | -- | - |
testcase_33 | -- | - |
testcase_34 | -- | - |
testcase_35 | -- | - |
testcase_36 | -- | - |
testcase_37 | -- | - |
testcase_38 | -- | - |
コンパイルメッセージ
main.cpp:11:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 11 | main() | ^~~~
ソースコード
#include<iostream> using namespace std; int N; long K; string s; int sum[55]; long f(long X) { return sum[N]*(X/N)+sum[X%N]; } main() { cin>>N>>K>>s; for(int i=0;i<N;i++)sum[i+1]=sum[i]+(s[i]=='0'?0:s[i]=='1'?1:2); long L=0,R=K; while(R-L>1) { long M=L+R>>1; long T=M,pre=0; while(T<K) { long now=f(T); if(now==pre)break; T+=now-pre; pre=now; } if(T<K)L=M; else R=M; } cout<<R<<endl; }