結果
問題 |
No.406 鴨等間隔の法則
|
ユーザー |
![]() |
提出日時 | 2020-01-21 12:35:03 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 332 bytes |
コンパイル時間 | 1,872 ms |
コンパイル使用メモリ | 172,092 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-05 07:04:09 |
合計ジャッジ時間 | 3,809 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 27 WA * 2 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> X(N); for (int i = 0; i < N; i++) cin >> X.at(i); sort(X.begin(), X.end()); int tmp = X.at(1) - X.at(0); string ans = "YES"; for (int i = 1; i < N; i++) if (X.at(i) - X.at(i - 1) != tmp) ans = "NO"; cout << ans << "\n"; }