結果
| 問題 |
No.398 ハーフパイプ(2)
|
| コンテスト | |
| ユーザー |
mban
|
| 提出日時 | 2017-01-10 20:18:27 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
TLE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 2,661 bytes |
| コンパイル時間 | 3,601 ms |
| コンパイル使用メモリ | 105,472 KB |
| 実行使用メモリ | 130,688 KB |
| 最終ジャッジ日時 | 2024-06-27 15:41:46 |
| 合計ジャッジ時間 | 40,319 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | TLE * 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;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;
using System.IO;
class Magatro
{
static Scanner sc = new Scanner('.');
static int X;
static long[] dp = new long[6 * 101 * 101 * 601];
static void Main()
{
Read();
for(int i = 0; i <= 100; i++)
{
dp[Converter(0, i, i, i)] = 1;
}
for(int i = 1; i < 6; i++)
{
for(int min = 0; min <= 100; min++)
{
for (int max = min; max <= 100; max++)
{
for(int sum = i * min; sum <= max * i; sum++)
{
if (dp[Converter(i - 1, min, max, sum)] == 0)
{
continue;
}
for(int j = 0; j <= 100; j++)
{
dp[Converter(i, Math.Min(j, min), Math.Max(j, max), sum + j)] += dp[Converter(i - 1, min, max, sum)];
}
}
}
}
}
long ans = 0;
for(int min = 0; min <= 100; min++)
{
for(int max = min; max <= 100; max++)
{
ans += dp[Converter(5, min, max, X + min + max)];
}
}
Console.WriteLine(ans);
}
static void Read()
{
int a = sc.NextInt();
int b = sc.NextInt();
X = 4 * a + b / 25;
}
static int Converter(int i,int min,int max,int sum)
{
if (i > 5 || min > 100 || max > 100 || sum > 600 || i < 0 || min < 0 || max < 0 || sum < 0)
{
throw new Exception();
}
return i * (101 * 101 * 601) + min * (101 * 601) + max * 601 + sum;
}
}
public class Scanner
{
public string[] S;
private int Index;
private char Separator;
public Scanner(char separator=' ')
{
Index = 0;
Separator = separator;
}
public string Next()
{
string result;
if (S == null || Index >= S.Length)
{
S = Line();
Index = 0;
}
result = S[Index];
Index++;
return result;
}
private string[] Line()
{
return Console.ReadLine().Split(Separator);
}
public int NextInt()
{
return int.Parse(Next());
}
public double NextDouble()
{
return double.Parse(Next());
}
public long NextLong()
{
return long.Parse(Next());
}
}
mban