Skip to content

Instantly share code, notes, and snippets.

@nakaji
Created December 3, 2014 03:53
Show Gist options
  • Save nakaji/c3d9febce365e680f52e to your computer and use it in GitHub Desktop.
Save nakaji/c3d9febce365e680f52e to your computer and use it in GitHub Desktop.
paizaオンラインハッカソン4 Lite ミッション2
public class Hello{
public static void Main(){
// 自分の得意な言語で
// Let's チャレンジ!!
var line = int.Parse(System.Console.ReadLine());
long total = 0;
for (var i=0; i<line; i++)
{
var buf = System.Console.ReadLine().Split(' ');
var needs = int.Parse(buf[0]);
var current = int.Parse(buf[1]);
var amount = int.Parse(buf[2]);
if (current < needs)
{
total += (needs - current) * amount;
}
}
System.Console.WriteLine("{0}", total);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment