結果
問題 |
No.2043 Ohuton and Makura
|
ユーザー |
![]() |
提出日時 | 2022-08-20 19:34:39 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 5 ms / 2,000 ms |
コード長 | 584 bytes |
コンパイル時間 | 512 ms |
コンパイル使用メモリ | 41,796 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-09 11:27:15 |
合計ジャッジ時間 | 1,491 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 |
ソースコード
/* -*- coding: utf-8 -*- * * 2043.cc: No.2043 Ohuton and Makura - yukicoder */ #include<cstdio> #include<algorithm> using namespace std; /* constant */ /* typedef */ typedef long long ll; /* global variables */ /* subroutines */ inline ll sigma(int n) { return (ll)n * (n + 1) / 2; } /* main */ int main() { int a, b, s; scanf("%d%d%d", &a, &b, &s); ll sum = 0; int maxp = min(a, s); for (int p = 1; p <= maxp; p++) { int q = min(s / p, b); if (q > 0) sum += (a - p + 1) * (sigma(b) - sigma(b - q)); } printf("%lld\n", sum); return 0; }