結果
問題 | No.1229 ラグビーの得点パターン |
ユーザー |
![]() |
提出日時 | 2020-09-18 21:22:52 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 541 bytes |
コンパイル時間 | 2,298 ms |
コンパイル使用メモリ | 191,640 KB |
最終ジャッジ日時 | 2025-01-14 16:20:03 |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 25 |
ソースコード
#include <bits/stdc++.h> using namespace std; template<typename T, typename U> void cmax(T &a, U b) { if (a < b) a = b; } template<typename T, typename U> void cmin(T &a, U b) { if (a > b) a = b; } signed main() { cin.tie(nullptr); ios_base::sync_with_stdio(false); int N; cin >> N; long ans = 0; for (int T = 0; T < 100; T++) { for (int G = 0; G < 100; G++) { for (int PG = 0; PG < 100; PG++) { if (G > T) continue; if (T * 5 + G * 2 + PG * 3 == N) ans++; } } } cout << ans << "\n"; }