結果

問題 No.78 クジ付きアイスバー
ユーザー kuuso1kuuso1
提出日時 2014-11-26 00:02:40
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
実行時間 -
コード長 1,094 bytes
コンパイル時間 2,556 ms
コンパイル使用メモリ 113,464 KB
実行使用メモリ 27,932 KB
最終ジャッジ日時 2024-04-16 04:46:29
合計ジャッジ時間 57,675 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
24,176 KB
testcase_01 AC 27 ms
17,664 KB
testcase_02 AC 28 ms
17,792 KB
testcase_03 AC 28 ms
17,920 KB
testcase_04 AC 25 ms
18,048 KB
testcase_05 AC 976 ms
18,176 KB
testcase_06 AC 2,459 ms
17,664 KB
testcase_07 AC 929 ms
17,792 KB
testcase_08 AC 1,416 ms
18,048 KB
testcase_09 AC 4,619 ms
18,048 KB
testcase_10 AC 2,415 ms
18,176 KB
testcase_11 AC 1,331 ms
17,920 KB
testcase_12 AC 4,104 ms
17,920 KB
testcase_13 AC 4,722 ms
17,920 KB
testcase_14 AC 4,309 ms
18,048 KB
testcase_15 AC 1,807 ms
18,048 KB
testcase_16 AC 3,061 ms
18,048 KB
testcase_17 AC 3,617 ms
18,048 KB
testcase_18 AC 3,594 ms
18,176 KB
testcase_19 AC 4,034 ms
17,792 KB
testcase_20 AC 4,795 ms
17,792 KB
testcase_21 TLE -
testcase_22 AC 4,628 ms
26,020 KB
testcase_23 AC 27 ms
26,276 KB
testcase_24 AC 26 ms
24,180 KB
testcase_25 AC 27 ms
23,924 KB
testcase_26 AC 26 ms
24,056 KB
testcase_27 AC 26 ms
24,180 KB
testcase_28 AC 26 ms
23,796 KB
testcase_29 AC 28 ms
27,932 KB
testcase_30 AC 26 ms
24,240 KB
testcase_31 AC 26 ms
23,984 KB
testcase_32 AC 27 ms
24,240 KB
testcase_33 AC 31 ms
26,348 KB
testcase_34 AC 1,489 ms
26,148 KB
testcase_35 AC 1,780 ms
26,016 KB
testcase_36 AC 4,134 ms
26,012 KB
testcase_37 TLE -
testcase_38 TLE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections;
using System.Collections.Generic;
 
class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		int cnt=0;
		int stk=0;
		int p=0;
		while(K>0){
			if(p==N)p=0;
			if(stk>0){
				stk--;
			}else{
				cnt++;
			}
			K--;
			stk+=(int)(S[p]-'0');
			p++;
		}
		Console.WriteLine(cnt);
	}
	int N,K;
	String S;
	public Sol(){
		var d=ria();
		N=d[0];K=d[1];
		S=rs();
	}




	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(){return Console.ReadLine().Split(' ');}
	static int[] ria(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>int.Parse(e));}
	static long[] rla(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>long.Parse(e));}
	static double[] rda(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>double.Parse(e));}
}
0