結果

問題 No.396 クラス替え
ユーザー vjudge1
提出日時 2025-05-16 15:20:15
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 489 bytes
コンパイル時間 1,675 ms
コンパイル使用メモリ 159,980 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-05-16 15:20:18
合計ジャッジ時間 2,135 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define int long long
#define fr first
#define sc second
using namespace std;
int const N=1e6+5;
typedef pair<int,int> pii;
int n,m,sum,cnt,t,ans,x,y;
signed main()
{
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
	ios::sync_with_stdio(0);
	cin.tie(0),cout.tie(0);
    cin>>n>>m>>x>>y;
    int nx=x%(m*2);
    int ny=y%(m*2);
    if(nx==0)  nx=2*m;
    if(ny==0)   ny=2*m;
    if(nx==ny||nx+ny==2*m+1)   cout<<"YES";
    else cout<<"NO";
	return 0;
}

0