結果
| 問題 | No.78 クジ付きアイスバー |
| コンテスト | |
| ユーザー |
beet
|
| 提出日時 | 2019-03-23 17:30:40 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 448 bytes |
| 記録 | |
| コンパイル時間 | 1,891 ms |
| コンパイル使用メモリ | 209,632 KB |
| 実行使用メモリ | 9,856 KB |
| 最終ジャッジ日時 | 2026-06-07 09:20:10 |
| 合計ジャッジ時間 | 87,507 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 30 TLE * 5 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
//INSERT ABOVE HERE
signed main(){
Int n,k;
string s;
cin>>n>>k>>s;
Int ans=0,cnt=0,res=0;
while(cnt<k){
if(res>0) res--;
else ans++;
res+=s[cnt%n]-'0';
cnt++;
}
cout<<ans<<endl;
return 0;
}
beet