結果
| 問題 | No.208 王将 |
| コンテスト | |
| ユーザー |
horiesiniti
|
| 提出日時 | 2016-07-25 13:25:17 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 279 bytes |
| 記録 | |
| コンパイル時間 | 412 ms |
| コンパイル使用メモリ | 54,456 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-06 16:19:16 |
| 合計ジャッジ時間 | 1,415 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 23 |
ソースコード
#include <iostream>
using namespace std;
int f(int x){
if(x<0)return -x;
return x;
}
int main() {
// your code goes here
int x,y,x1,y1,ans=0;
std::cin>>x>>y>>x1>>y1;
if((x==y)&&(x1==y1)&&(x1<x)){
ans=1;
}
ans+=std::min(x,y)+f(x-y);
std::cout<<ans<<"\n";
return 0;
}
horiesiniti