結果
問題 |
No.396 クラス替え
|
ユーザー |
![]() |
提出日時 | 2016-07-15 22:40:48 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 516 bytes |
コンパイル時間 | 1,316 ms |
コンパイル使用メモリ | 158,220 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-15 04:32:56 |
合計ジャッジ時間 | 1,916 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 WA * 9 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef pair<int, int> pii; #define pb push_back #define mp make_pair #define fi first #define se second int main() { int n,m,a,b,H,T; cin>>n>>m>>a>>b; int p=a/n,q=a%n; int pp=b/n,qq=b%n; if(q) { if(p%2)H=m-p; else H=p; } else { if(p%2)H=m+1; else H=1; } if(qq) { if(pp%2)T=m-pp+1; else T=pp; } else { if(pp%2)T=m; else T=1; } if(H==T)cout<<"YES"<<endl; else cout<<"NO"<<endl; return 0; }