結果

問題 No.78 クジ付きアイスバー
ユーザー RIGIHRIGIH
提出日時 2017-07-26 01:13:36
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2,679 ms / 5,000 ms
コード長 596 bytes
コンパイル時間 719 ms
コンパイル使用メモリ 64,944 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-17 23:44:08
合計ジャッジ時間 38,536 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 455 ms
5,376 KB
testcase_06 AC 1,183 ms
5,376 KB
testcase_07 AC 471 ms
5,376 KB
testcase_08 AC 714 ms
5,376 KB
testcase_09 AC 2,372 ms
5,376 KB
testcase_10 AC 1,227 ms
5,376 KB
testcase_11 AC 618 ms
5,376 KB
testcase_12 AC 2,067 ms
5,376 KB
testcase_13 AC 2,203 ms
5,376 KB
testcase_14 AC 2,266 ms
5,376 KB
testcase_15 AC 883 ms
5,376 KB
testcase_16 AC 1,597 ms
5,376 KB
testcase_17 AC 1,832 ms
5,376 KB
testcase_18 AC 1,853 ms
5,376 KB
testcase_19 AC 1,948 ms
5,376 KB
testcase_20 AC 2,132 ms
5,376 KB
testcase_21 AC 2,448 ms
5,376 KB
testcase_22 AC 2,259 ms
5,376 KB
testcase_23 AC 2 ms
5,376 KB
testcase_24 AC 1 ms
5,376 KB
testcase_25 AC 2 ms
5,376 KB
testcase_26 AC 2 ms
5,376 KB
testcase_27 AC 1 ms
5,376 KB
testcase_28 AC 1 ms
5,376 KB
testcase_29 AC 1 ms
5,376 KB
testcase_30 AC 2 ms
5,376 KB
testcase_31 AC 1 ms
5,376 KB
testcase_32 AC 1 ms
5,376 KB
testcase_33 AC 2 ms
5,376 KB
testcase_34 AC 524 ms
5,376 KB
testcase_35 AC 747 ms
5,376 KB
testcase_36 AC 1,952 ms
5,376 KB
testcase_37 AC 2,577 ms
5,376 KB
testcase_38 AC 2,679 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <stdio.h>
#include <cstring>
#include <math.h>
#include <algorithm>
#include <vector>
#define rep(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ll long long
#define LL long long
#define mass 1000000007
using namespace std;
int keta(int n,int k){return (n/int(pow(10,double(k-1)))) % 10;} //nの下からk桁目


int main(){
	
	int n,k;
	cin>>n>>k;
	char s[51];
	cin>>s;
	int a=0;
	int c=0;
	int b=0;

	rep(i,k){
		if(a==0){
			c++;
		}else{
			a--;
		}
		a+=int(s[b])-48;
		b++;
		if(b==n){
			b=0;
		}
	}
	cout<<c<<endl;

	return 0;

}

0