結果
| 問題 |
No.129 お年玉(2)
|
| コンテスト | |
| ユーザー |
しらゆき
|
| 提出日時 | 2016-01-05 20:31:36 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
MLE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 1,687 bytes |
| コンパイル時間 | 915 ms |
| コンパイル使用メモリ | 114,060 KB |
| 実行使用メモリ | 803,552 KB |
| 最終ジャッジ日時 | 2024-12-01 13:40:38 |
| 合計ジャッジ時間 | 32,898 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 MLE * 19 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Linq;
using System.Collections.Generic;
class Program
{
static void Main()
{
var n = rl();
var m = rl();
var mod = 1000000000;
n /= 1000;
n = n % m;
var pas = new long[m + 1, m + 1];
for(int i = 0; i < m + 1; i++)
{
for(int j = 0; j < m + 1; j++)
{
if (j == 0 || i == j)
{
pas[i, j] = 1;
continue;
}
if (j > i) continue;
pas[i, j] = pas[i, j] = (pas[i - 1, j - 1] + pas[i - 1, j]) % mod;
}
}
Console.WriteLine(pas[m, n]);
}
#region Scan
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 rs() { return Console.ReadLine(); }
static int[] ria() { return Console.ReadLine().Trim().Split().Select(int.Parse).ToArray(); }
static long[] rla() { return Console.ReadLine().Trim().Split().Select(long.Parse).ToArray(); }
static double[] rda() { return Console.ReadLine().Trim().Split().Select(double.Parse).ToArray(); }
static string[] rsa() { return Console.ReadLine().Trim().Split(); }
static void mul(out int a, out int b) { var arr = ria(); a = arr[0]; b = arr[1]; }
public void mul(out int a, out int b, out int c) { var arr = ria(); a = arr[0]; b = arr[1]; c = arr[2]; }
public void mul(out int a, out int b, out int c, out int d) { var arr = ria(); a = arr[0]; b = arr[1]; c = arr[2]; d = arr[3]; }
#endregion
}
しらゆき