結果
問題 | No.396 クラス替え |
ユーザー |
![]() |
提出日時 | 2017-08-10 19:02:52 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 378 bytes |
コンパイル時間 | 1,368 ms |
コンパイル使用メモリ | 167,952 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-12 04:05:41 |
合計ジャッジ時間 | 2,305 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 6 | main(){ | ^~~~
ソースコード
#include<bits/stdc++.h> typedef long long ll; using namespace std; int INF = 1e9; int MOD = 1e9+7; main(){ int N,M,X[2]; cin >> N >> M >> X[0] >> X[1]; X[0]--,X[1]--; int a[2]; for(int i = 0;i < 2;i++){ if((X[i]/M)%2) a[i] = M - X[i]%M - 1; else a[i] = X[i]%M; } if(a[0] == a[1])cout << "YES" << endl; else cout << "NO" << endl; }