結果
| 問題 |
No.2043 Ohuton and Makura
|
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2025-11-05 15:43:15 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 797 bytes |
| コンパイル時間 | 2,868 ms |
| コンパイル使用メモリ | 275,788 KB |
| 実行使用メモリ | 7,720 KB |
| 最終ジャッジ日時 | 2025-11-05 15:43:28 |
| 合計ジャッジ時間 | 12,911 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 17 WA * 1 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main(){
long long a, b, max_s;
cin >> a >> b >> max_s;
long long ans = 0;
for(int s=1; s<=max_s; s++){
for(int i=1; i*i<=s; i++){
if(s%i == 0){
int x = i, y = s/i;
long long val = (a-y+1)*1LL*(b-x+1);
if(val > 0){
ans += val;
//cout << val << ' ' << x << ' ' << y << endl;
}
if(i*i != s){
val = (a-x+1)*1LL*(b-y+1);
if(val > 0){
ans += val;
//cout << val << ' ' << y << ' ' << x << endl;
}
}
}
}
}
cout << ans << endl;
}
vjudge1