結果
問題 | No.398 ハーフパイプ(2) |
ユーザー | ぴろず |
提出日時 | 2016-07-15 22:54:28 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 145 ms / 2,000 ms |
コード長 | 5,745 bytes |
コンパイル時間 | 2,626 ms |
コンパイル使用メモリ | 89,236 KB |
実行使用メモリ | 41,888 KB |
最終ジャッジ日時 | 2024-06-27 14:33:05 |
合計ジャッジ時間 | 5,729 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 137 ms
41,600 KB |
testcase_01 | AC | 133 ms
41,564 KB |
testcase_02 | AC | 134 ms
41,888 KB |
testcase_03 | AC | 135 ms
41,636 KB |
testcase_04 | AC | 141 ms
41,464 KB |
testcase_05 | AC | 128 ms
41,068 KB |
testcase_06 | AC | 141 ms
41,520 KB |
testcase_07 | AC | 145 ms
41,592 KB |
testcase_08 | AC | 133 ms
41,728 KB |
testcase_09 | AC | 134 ms
41,728 KB |
testcase_10 | AC | 124 ms
41,620 KB |
testcase_11 | AC | 117 ms
40,736 KB |
testcase_12 | AC | 139 ms
41,372 KB |
testcase_13 | AC | 133 ms
41,548 KB |
testcase_14 | AC | 133 ms
41,728 KB |
testcase_15 | AC | 129 ms
40,752 KB |
testcase_16 | AC | 125 ms
41,200 KB |
ソースコード
package no398; import java.util.Scanner; public class Main { public static long[] hoge = {601L,2985L,8915L,20700L,41796L,76170L,128305L,203145L,306731L,445530L,626460L,856830L,1144981L,1499595L,1929755L,2444850L,3055236L,3771540L,4604725L,5565975L,6667391L,7921260L,9340140L,10936740L,12724621L,14717445L,16929095L,19373520L,22065456L,25019670L,28251085L,31774605L,35605871L,39760470L,44254080L,49102290L,54321361L,59927415L,65936615L,72364950L,79229016L,86545200L,94329865L,102599115L,111369611L,120657720L,130479720L,140851560L,151789681L,163310145L,175428875L,188161380L,201523596L,215531010L,230198905L,245542065L,261575651L,278314290L,295772340L,313963590L,332902141L,352601475L,373074755L,394334490L,416393436L,439263660L,462956845L,487483935L,512856071L,539083620L,566176500L,594143820L,622994821L,652737885L,683380895L,714930840L,747394776L,780778830L,815088565L,850328565L,886503431L,923616750L,961671480L,1000669530L,1040612761L,1081501935L,1123337135L,1166117310L,1209841296L,1254506760L,1300110625L,1346648595L,1394116211L,1442507760L,1491816720L,1542035280L,1593155401L,1645167705L,1698061955L,1751826540L,1806449556L,1861917705L,1918216810L,1975331310L,2033245421L,2091942030L,2151403230L,2211609825L,2272542496L,2334180660L,2396503055L,2459487210L,2523110616L,2587349595L,2652179890L,2717576100L,2783512901L,2849963880L,2916902130L,2984299695L,3052128796L,3120360630L,3188966015L,3257914800L,3327177096L,3396722085L,3466518670L,3536534850L,3606739001L,3677098650L,3747581130L,3818152965L,3888781156L,3959431920L,4030071395L,4100664990L,4171178676L,4241577735L,4311827470L,4381892520L,4451738201L,4521329220L,4590630390L,4659605955L,4728220936L,4796439810L,4864227275L,4931547540L,4998365676L,5064646305L,5130354370L,5195454390L,5259911861L,5323691910L,5386760070L,5449081545L,5510622616L,5571349260L,5631227975L,5690225010L,5748307776L,5805443475L,5861599930L,5916744780L,5970846941L,6023875200L,6075799050L,6126587895L,6176212516L,6224643630L,6271852775L,6317811480L,6362492736L,6405869565L,6447915910L,6488605770L,6527914721L,6565818450L,6602293650L,6637317165L,6670867516L,6702923400L,6733464635L,6762471270L,6789925116L,6815808255L,6840103990L,6862795920L,6883869521L,6903310620L,6921106350L,6937244235L,6951713776L,6964504890L,6975608915L,6985017660L,6992724996L,6998725305L,7003014490L,7005588990L,7006447421L,7005588990L,7003014490L,6998725305L,6992724996L,6985017660L,6975608915L,6964504890L,6951713776L,6937244235L,6921106350L,6903310620L,6883869521L,6862795920L,6840103990L,6815808255L,6789925116L,6762471270L,6733464635L,6702923400L,6670867516L,6637317165L,6602293650L,6565818450L,6527914721L,6488605770L,6447915910L,6405869565L,6362492736L,6317811480L,6271852775L,6224643630L,6176212516L,6126587895L,6075799050L,6023875200L,5970846941L,5916744780L,5861599930L,5805443475L,5748307776L,5690225010L,5631227975L,5571349260L,5510622616L,5449081545L,5386760070L,5323691910L,5259911861L,5195454390L,5130354370L,5064646305L,4998365676L,4931547540L,4864227275L,4796439810L,4728220936L,4659605955L,4590630390L,4521329220L,4451738201L,4381892520L,4311827470L,4241577735L,4171178676L,4100664990L,4030071395L,3959431920L,3888781156L,3818152965L,3747581130L,3677098650L,3606739001L,3536534850L,3466518670L,3396722085L,3327177096L,3257914800L,3188966015L,3120360630L,3052128796L,2984299695L,2916902130L,2849963880L,2783512901L,2717576100L,2652179890L,2587349595L,2523110616L,2459487210L,2396503055L,2334180660L,2272542496L,2211609825L,2151403230L,2091942030L,2033245421L,1975331310L,1918216810L,1861917705L,1806449556L,1751826540L,1698061955L,1645167705L,1593155401L,1542035280L,1491816720L,1442507760L,1394116211L,1346648595L,1300110625L,1254506760L,1209841296L,1166117310L,1123337135L,1081501935L,1040612761L,1000669530L,961671480L,923616750L,886503431L,850328565L,815088565L,780778830L,747394776L,714930840L,683380895L,652737885L,622994821L,594143820L,566176500L,539083620L,512856071L,487483935L,462956845L,439263660L,416393436L,394334490L,373074755L,352601475L,332902141L,313963590L,295772340L,278314290L,261575651L,245542065L,230198905L,215531010L,201523596L,188161380L,175428875L,163310145L,151789681L,140851560L,130479720L,120657720L,111369611L,102599115L,94329865L,86545200L,79229016L,72364950L,65936615L,59927415L,54321361L,49102290L,44254080L,39760470L,35605871L,31774605L,28251085L,25019670L,22065456L,19373520L,16929095L,14717445L,12724621L,10936740L,9340140L,7921260L,6667391L,5565975L,4604725L,3771540L,3055236L,2444850L,1929755L,1499595L,1144981L,856830L,626460L,445530L,306731L,203145L,128305L,76170L,41796L,20700L,8915L,2985L,601L,}; public static void main(String[] args) { // umekomi(); Scanner sc = new Scanner(System.in); int x = (int) Math.round(sc.nextDouble() * 4); System.out.println(hoge[x]); } public static void umekomi() { int n = 6; long[][][][] dp = new long[n][101][101][601]; for(int i=0;i<=100;i++) { dp[0][i][i][i] = 1; } for(int i=0;i<n-1;i++) { for(int min=0;min<=100;min++) { for(int max=min;max<=100;max++) { for(int sum=0;sum<=600;sum++) { if (dp[i][min][max][sum] == 0) { continue; } for(int k=0;k<=100;k++) { int nmin = Math.min(min, k); int nmax = Math.max(max, k); int nsum = sum + k; dp[i+1][nmin][nmax][nsum] += dp[i][min][max][sum]; } } } } } long[] ans = new long[401]; for(int min=0;min<=100;min++) { for(int max=min;max<=100;max++) { for(int sum=0;sum<=600;sum++) { int x = sum - min - max; if (x >= 0 && x <= 400) { ans[sum-min-max] += dp[n-1][min][max][sum]; } } } } StringBuilder sb = new StringBuilder(); for(int i=0;i<=400;i++) { sb.append(ans[i] + "L,"); } System.out.println(sb.toString()); } }