結果
問題 | No.126 2基のエレベータ |
ユーザー |
|
提出日時 | 2018-06-15 16:02:09 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 299 bytes |
コンパイル時間 | 519 ms |
コンパイル使用メモリ | 63,168 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-30 14:49:50 |
合計ジャッジ時間 | 1,433 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 16 WA * 11 |
ソースコード
#include <iostream>using namespace std;int main(int argc, char* argv[]){int A,B,S;cin>>A>>B>>S;int xA=A-S;if (xA<0){xA=-xA;}int xB=B-S;if (xB<0){xB=-xB;}int maxX=min(xA,xB);int ans;if (maxX==xA){ans=xA+S;}else{ans=(xB+S-A+1);}cout<<ans<<endl;return 0;}