Submission #3235546


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;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 0
Code Size 631 Byte
Status WA
Exec Time 169 ms
Memory 22604 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 400
Status
AC × 4
AC × 21
WA × 3
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 9300 KB
a02 AC 22 ms 11220 KB
a03 AC 22 ms 11220 KB
a04 AC 22 ms 11220 KB
b05 AC 22 ms 11348 KB
b06 AC 164 ms 18620 KB
b07 AC 22 ms 11220 KB
b08 AC 169 ms 20544 KB
b09 AC 21 ms 9172 KB
b10 AC 22 ms 11220 KB
b11 AC 22 ms 11220 KB
b12 AC 22 ms 11220 KB
b13 AC 121 ms 20300 KB
b14 WA 119 ms 20300 KB
b15 AC 126 ms 20300 KB
b16 AC 119 ms 18252 KB
b17 AC 147 ms 20172 KB
b18 AC 139 ms 22472 KB
b19 AC 131 ms 19792 KB
b20 WA 140 ms 22604 KB
b21 WA 142 ms 20300 KB
b22 AC 144 ms 20172 KB
b23 AC 21 ms 9300 KB
b24 AC 24 ms 11320 KB