結果
問題 |
No.126 2基のエレベータ
|
ユーザー |
|
提出日時 | 2018-04-12 16:20:19 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 248 bytes |
コンパイル時間 | 620 ms |
コンパイル使用メモリ | 65,980 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-26 21:26:03 |
合計ジャッジ時間 | 1,834 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 WA * 7 |
コンパイルメッセージ
main.cpp:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 5 | main() | ^~~~
ソースコード
#include<iostream> #include<algorithm> using namespace std; int a,b,s; main() { cin>>a>>b>>s; if(abs(a-s)<=abs(b-s)) { cout<<abs(a-s)+s<<endl; } else if(a>0) { cout<<abs(b-s)+abs(a-s)+a<<endl; } else { cout<<abs(b-s)+s+1<<endl; } }