結果
| 問題 |
No.2043 Ohuton and Makura
|
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2025-11-05 16:51:24 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 729 bytes |
| コンパイル時間 | 3,449 ms |
| コンパイル使用メモリ | 285,904 KB |
| 実行使用メモリ | 111,652 KB |
| 最終ジャッジ日時 | 2025-11-05 16:51:32 |
| 合計ジャッジ時間 | 7,380 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 TLE * 1 |
| other | -- * 18 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
ll a, b, s;
map<ll, vector<pair<ll, ll>>> mp;
cin >> a >> b >> s;
for (ll i = 1; i <= s; i++) {
for (ll x = 1; x * x <= i; x++) {
if (i % x == 0) {
mp[i].push_back({x, i / x});
if (x != i / x) {
mp[i].push_back({i / x, x});
}
}
}
}
ll ans = 0;
for (ll i = 0; i <= a; i++) {
for (ll j = 0; j <= b; j++) {
for (ll x = 1; x <= s; x++) {
for (auto p : mp[x]) {
if (i + p.first <= a && j + p.second <= b) {
ans++;
}
}
}
}
}
cout << ans << endl;
return 0;
}
vjudge1