結果
問題 |
No.360 増加門松列
|
ユーザー |
![]() |
提出日時 | 2016-04-18 16:26:05 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 978 bytes |
コンパイル時間 | 727 ms |
コンパイル使用メモリ | 84,144 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-04 13:42:42 |
合計ジャッジ時間 | 1,449 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 WA * 1 |
ソースコード
/* -*- coding: utf-8 -*- * * 360.cc: No.360 増加門松列 - yukicoder */ #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<iostream> #include<string> #include<vector> #include<map> #include<set> #include<stack> #include<list> #include<queue> #include<deque> #include<algorithm> #include<numeric> #include<utility> #include<complex> #include<functional> using namespace std; /* constant */ const int N = 7; const int MAX_D = 100; /* typedef */ /* global variables */ int ds[N], cnts[MAX_D + 1]; /* subroutines */ /* main */ int main() { int mind = MAX_D + 1, maxd = 0; for (int i = 0; i < N; i++) { cin >> ds[i]; if (mind > ds[i]) mind = ds[i]; if (maxd < ds[i]) maxd = ds[i]; cnts[ds[i]]++; } bool ok = true; if (cnts[mind] > 1 || cnts[maxd] > 1) ok = false; else for (int d = mind + 1; ok && d < maxd; d++) if (cnts[d] > 2) ok = false; cout << (ok ? "YES" : "NO") << endl; return 0; }