結果
問題 |
No.1229 ラグビーの得点パターン
|
ユーザー |
![]() |
提出日時 | 2021-01-21 10:27:24 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 36 ms / 2,000 ms |
コード長 | 450 bytes |
コンパイル時間 | 146 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-12-24 08:00:09 |
合計ジャッジ時間 | 2,275 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 25 |
ソースコード
# c = 組み合わせのカウンタ N = int(input()) c = 0 # トライはint(N/5)回まであり得る # eg N=11 t=int(11/5)=2 # コンバージョンはt以下まであり得る # ペナルティゴールはn-t*5-g*2が # 3の倍数であれば成立する for t in range(int(N/5)+1): for g in range(t+1): if (N-t*5-g*2)%3==0 and t*5+g*2<=N: c+=1 # print(str(t)+","+str(g)+","+str(int((N-t*5-g*2)/3))) print(c)