結果
問題 |
No.396 クラス替え
|
ユーザー |
|
提出日時 | 2019-09-22 12:03:31 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 623 bytes |
コンパイル時間 | 1,070 ms |
コンパイル使用メモリ | 159,576 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-19 03:29:08 |
合計ジャッジ時間 | 1,678 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 20 |
ソースコード
#include "bits/stdc++.h" using namespace std; typedef long long ll; ll N; ll findClass(ll M, ll X){ ll ans = 0; if(X % M == 0){ if(X / M % 2 == 1){ return M; }else{ return 1; } } if(X / M % 2 == 0){ return X % M; }else{ return M - X % M + 1; } } int main(){ ll N, M, X, Y; cin >> N >> M >> X >> Y; ll classA = findClass(M, X); ll classB = findClass(M, Y); cout << classA << ", " << classB << endl; if(classA == classB){ cout << "YES" << endl; }else{ cout << "NO" << endl; } }