結果
問題 | No.1229 ラグビーの得点パターン |
ユーザー |
![]() |
提出日時 | 2020-09-18 21:22:29 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 694 bytes |
コンパイル時間 | 1,817 ms |
コンパイル使用メモリ | 192,540 KB |
最終ジャッジ日時 | 2025-01-14 16:18:43 |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 25 |
ソースコード
#include <bits/stdc++.h> #define rep(a,n) for (ll a = 0; a < (n); ++a) using namespace std; //using namespace atcoder; using ll = long long; typedef pair<ll,ll> P; typedef pair<ll,P> PP; typedef vector<vector<int> > Graph; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } const ll INF = 1e18; int main(){ int n; cin >> n; int ans = 0; for(int i=0;i<=100;i++){ for(int j=0;j<=i;j++){ for(int k=0;k<=100;k++){ if(i*5+j*2+k*3==n)ans++; } } } cout << ans << endl; return 0; }