結果
問題 | No.1229 ラグビーの得点パターン |
ユーザー |
![]() |
提出日時 | 2020-09-18 21:25:12 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 676 bytes |
コンパイル時間 | 2,209 ms |
コンパイル使用メモリ | 191,504 KB |
最終ジャッジ日時 | 2025-01-14 16:22:57 |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 25 |
ソースコード
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define rrep(i, n) for (int i = (n - 1); i >= 0; i--) #define ALL(v) v.begin(), v.end() using namespace std; using P = pair<int, int>; typedef long long ll; 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 int dx[4] = {1, 0, -1, 0}; const int dy[4] = {0, 1, 0, -1}; int main() { int n; cin >> n; int ans = 0; rep(i, 21){ rep(j, 35){ rep(k,51){ if(i * 5 + 3 * j + k * 2 == n && i >= k)ans++; } } } cout << ans << endl; }