結果
| 問題 |
No.1229 ラグビーの得点パターン
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-09-18 21:49:17 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 2,000 ms |
| コード長 | 282 bytes |
| コンパイル時間 | 2,841 ms |
| コンパイル使用メモリ | 191,160 KB |
| 最終ジャッジ日時 | 2025-01-14 16:58:17 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 25 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
cin.tie(nullptr);
ios::sync_with_stdio(false);
int n; cin >> n;
int res=0;
for(int i=0;i<=n/5;i++){
for(int j=0;j<=i;j++){
if(i*5+j*2<=n&&(n-i*5-j*2)%3==0)res++;
}
}
printf("%d\n",res);
}