結果
問題 |
No.396 クラス替え
|
ユーザー |
![]() |
提出日時 | 2025-05-16 15:05:20 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,361 bytes |
コンパイル時間 | 2,277 ms |
コンパイル使用メモリ | 192,784 KB |
実行使用メモリ | 7,848 KB |
最終ジャッジ日時 | 2025-05-16 15:05:23 |
合計ジャッジ時間 | 3,268 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 17 WA * 3 |
ソースコード
/* ?????? ?????? ?????? ?????? D P ???? ?????? ?????? ?????? ?????? ??? l l? ?????? ?????? ?? OI ?? ?????? */ #include<bits/stdc++.h> using namespace std; #define int long long //#define eps 1e-9 //#define ENF 1e13 const int N=1e1; const int mod=1e9+7; inline int read() { int x=0,f=1;char ch=getchar(); while (ch<'0'||ch>'9'){if (ch=='-') f=-1;ch=getchar();} while (ch>='0'&&ch<='9'){x=(x<<3)+(x<<1)+ch-48;ch=getchar();} return x*f; } void write(int x) { if(x<0)putchar('-'),x=-x; if(x<10)putchar(x+'0'); else write(x/10),putchar(x%10+'0'); } int n,m,x,y; int ans1,ans2; signed main(){ // freopen("class.in","r",stdin); // freopen("class.out","w",stdout); n=read(),m=read(); x=read(),y=read(); int z=x/m; if(x%m==0)z--; if(z&1){ ans1=m-x%m+1; if(ans1==0)ans1=m; } else{ ans1=x%m; if(ans1==0)ans1=m; } z=y/m; if(y%m==0)z--; if(z&1){ ans2=m-y%m+1; if(ans2==0)ans2=m; } else{ ans2=y%m; if(ans2==0)ans2=m; } if(ans1==ans2)cout<<"YES\n"; else cout<<"NO\n"; return 0; } // ?????????????AC???? // ????????????????????????? // ?????????????????? // ???????????????????????????????????? // ??????????????????????????????? // ???????????? // ???????????? // ???????????? // ???????????????????? // ???????????????????? // ???????????????????????????????? // ??????????????????????? // ??????????? // ?????????????