結果

問題 No.78 クジ付きアイスバー
ユーザー mokomoko
提出日時 2018-01-24 14:00:08
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 749 bytes
コンパイル時間 1,237 ms
コンパイル使用メモリ 143,940 KB
実行使用メモリ 7,820 KB
最終ジャッジ日時 2023-08-27 02:11:44
合計ジャッジ時間 16,020 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1,091 ms
4,376 KB
testcase_06 AC 2,857 ms
4,376 KB
testcase_07 AC 1,136 ms
4,380 KB
testcase_08 AC 1,751 ms
4,376 KB
testcase_09 TLE -
testcase_10 AC 2,976 ms
4,380 KB
testcase_11 AC 1,509 ms
4,376 KB
testcase_12 TLE -
testcase_13 TLE -
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 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
//#include <math.h>
using namespace std;

#define INF 1.1e9
#define LINF 1.1e18
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define BIT(x,n) bitset<n>(x)
#define PI 3.14159265358979323846

typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> PP;

//-----------------------------------------------------------------------------

int n,k;
string s;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	cin>>n>>k>>s;
	int i=0,cnt=0,tmp=0;
	while(i<k) {
		if(tmp==0) cnt++;
		else tmp--;
		int now=s[i%n]-'0';
		tmp+=now;
		i++;
	}
	cout<<cnt<<endl;

	return 0;
}
0