結果
| 問題 | No.78 クジ付きアイスバー |
| コンテスト | |
| ユーザー |
woodsgreen
|
| 提出日時 | 2022-01-13 00:28:17 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 264 bytes |
| 記録 | |
| コンパイル時間 | 1,208 ms |
| コンパイル使用メモリ | 214,100 KB |
| 実行使用メモリ | 7,968 KB |
| 最終ジャッジ日時 | 2026-06-24 23:55:40 |
| 合計ジャッジ時間 | 19,116 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 5 TLE * 1 -- * 29 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int n,k,cnt,ans;
char s[60];
int main(){
cin>>n>>k>>s;
for(int i=0;k>0;i=(i+1)%n,--k){
if(cnt) --cnt;
else ++ans;
cnt+=s[i]-'0';
}
cout<<ans<<endl;
return 0;
}
woodsgreen