結果
問題 | No.129 お年玉(2) |
ユーザー |
![]() |
提出日時 | 2015-02-01 23:18:53 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
MLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 1,045 bytes |
コンパイル時間 | 2,522 ms |
コンパイル使用メモリ | 112,436 KB |
実行使用メモリ | 680,592 KB |
最終ジャッジ日時 | 2024-12-20 09:26:38 |
合計ジャッジ時間 | 35,893 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 MLE * 17 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace YukiCoder2{class Program{static void Main(string[] args){ulong n = Console.ReadLine().Split(' ').Select(ulong.Parse).ToArray()[0];ulong m = Console.ReadLine().Split(' ').Select(ulong.Parse).ToArray()[0];ulong rest = (n /1000L) % m;if (rest == 0){Console.WriteLine("1");return;}var buffer = new ulong[m+1,m+1];for (ulong i = 0; i < m+1; i++){buffer[i, 0] = 1;buffer[i, i] = 1;}for (ulong i = 1; i < m+1; i++){for (ulong k = 1; k < i; k++){buffer[i, k] = buffer[i - 1, k - 1] + buffer[i - 1, k];buffer[i, k] %= 1000000000;}}Console.WriteLine(buffer[m,rest]);}}}