Submission #3235803


Source Code Expand

using System;
class Program{
	static void Main(){
		long[] s=Array.ConvertAll(Console.ReadLine().Split(),long.Parse);
		long[][] arr=new long[s[0]][];
		long a=0,b=0;
		for(int i=0;i<s[0];i++){
			arr[i]=Array.ConvertAll(Console.ReadLine().Split(),long.Parse);
			a=Math.Max(a,arr[i][0]);
		}
		Array.Sort(arr,ca);
		for(int i=0;i<s[0]&&arr[i][1]>a&&s[1]>0;i++){
			s[1]-=arr[i][1];
			b++;
		}
		if(s[1]<=0){Console.WriteLine("{0}",b);}
		else{Console.WriteLine("{0}",s[1]/a+(s[1]%a==0?0:1)+b);}
	}
	static int ca(long[] a,long[] b){
		if(a[1]<b[1]){return 1;}
		else if(a[1]>b[1]){return -1;}
		else{return 0;}
	}
}

Submission Info

Submission Time
Task D - Katana Thrower
User fgwiebfaoish
Language C# (Mono 4.6.2.0)
Score 400
Code Size 640 Byte
Status AC
Exec Time 170 ms
Memory 22348 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 4
AC × 24
Set Name Test Cases
Sample a01, a02, a03, a04
All a01, a02, a03, a04, b05, b06, b07, b08, b09, b10, b11, b12, b13, b14, b15, b16, b17, b18, b19, b20, b21, b22, b23, b24
Case Name Status Exec Time Memory
a01 AC 22 ms 11348 KB
a02 AC 23 ms 11348 KB
a03 AC 22 ms 11348 KB
a04 AC 22 ms 11220 KB
b05 AC 22 ms 11220 KB
b06 AC 168 ms 20540 KB
b07 AC 21 ms 11220 KB
b08 AC 170 ms 20544 KB
b09 AC 22 ms 11220 KB
b10 AC 23 ms 11220 KB
b11 AC 23 ms 11220 KB
b12 AC 22 ms 11220 KB
b13 AC 119 ms 20300 KB
b14 AC 119 ms 22348 KB
b15 AC 120 ms 20300 KB
b16 AC 126 ms 20300 KB
b17 AC 155 ms 18248 KB
b18 AC 142 ms 18252 KB
b19 AC 143 ms 19792 KB
b20 AC 136 ms 20556 KB
b21 AC 145 ms 20300 KB
b22 AC 148 ms 20168 KB
b23 AC 22 ms 11220 KB
b24 AC 25 ms 11320 KB