結果

問題 No.360 増加門松列
ユーザー koyumeishi
提出日時 2016-04-17 04:13:39
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 468 bytes
コンパイル時間 621 ms
コンパイル使用メモリ 75,836 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-04 10:23:35
合計ジャッジ時間 1,433 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

//なんか嘘っぽいの
#include <iostream>
#include <cassert>
#include <map>

using namespace std;

int main(){
	int n = 7;
	map<int,int> m;
	for(int i=0; i<n; i++){
		int a;
		cin >> a;
		m[a]++;
	}

	bool ok = true;
	for(auto p : m){
		if(p == *m.begin()){
			if(p.second != 1) ok = false;
		}
		if(p == *m.rbegin()){
			if(p.second != 1) ok = false;
		}
		if(p.second > 2) ok = false;
	}

	if(ok) cout << "YES" << endl;
	else cout << "NO" << endl;

	return 0;
}
0