結果
問題 |
No.396 クラス替え
|
ユーザー |
![]() |
提出日時 | 2016-07-15 22:51:55 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 516 bytes |
コンパイル時間 | 1,303 ms |
コンパイル使用メモリ | 158,800 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-15 04:39:21 |
合計ジャッジ時間 | 1,993 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 15 WA * 5 |
ソースコード
#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/m,q=a%m; int pp=b/m,qq=b%m; if(q) { if(p%2)H=m-p+1; else H=q; } else { if(p%2)H=m; else H=1; } if(qq) { if(pp%2)T=m-pp+1; else T=qq; } else { if(pp%2)T=m; else T=1; } if(H==T)cout<<"YES"<<endl; else cout<<"NO"<<endl; return 0; }