結果
| 問題 |
No.2043 Ohuton and Makura
|
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2025-11-05 20:49:11 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 842 ms / 2,000 ms |
| コード長 | 590 bytes |
| コンパイル時間 | 1,870 ms |
| コンパイル使用メモリ | 194,620 KB |
| 実行使用メモリ | 7,720 KB |
| 最終ジャッジ日時 | 2025-11-05 20:49:23 |
| 合計ジャッジ時間 | 11,066 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
signed main(){
int a, b, max_s;
cin >> a >> b >> max_s;
long long ans = 0;
for(int i=1; i<=max_s; i++){
for(int j=1; j*j<=i; j++){
if(i%j == 0){
int x = j, y = i / j;
if((a-y+1) > 0 and (b-x+1) > 0){
ans += (a-y+1)*1LL*(b-x+1);
}
if(j*j == i)break;
if((a-x+1) > 0 and (b-y+1) > 0){
ans += (a-x+1)*1LL*(b-y+1);
}
}
}
}
cout << ans << '\n';
}
vjudge1