結果
| 問題 | No.1446 ハンバーグと納豆ごはん |
| コンテスト | |
| ユーザー |
heaveneleven521
|
| 提出日時 | 2021-03-31 15:00:59 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 309 bytes |
| 記録 | |
| コンパイル時間 | 1,608 ms |
| コンパイル使用メモリ | 179,192 KB |
| 実行使用メモリ | 7,972 KB |
| 最終ジャッジ日時 | 2026-05-25 14:15:36 |
| 合計ジャッジ時間 | 5,181 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 5 TLE * 1 -- * 27 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
long long a,b,n,m;
cin >> a >> b >> n >> m;
if(a>b){
int p = (a-b)/n;
while(a>b){
a-=p;
b+=p;
}
cout << a << endl;
}
else{
int q = (b-a)/m;
while(b>=a){
a+=q;
b-=q;
}
}
}
heaveneleven521