結果

問題 No.1121 Social Distancing in Cinema
ユーザー e869120
提出日時 2020-07-02 17:42:19
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 681 bytes
コンパイル時間 844 ms
コンパイル使用メモリ 73,856 KB
実行使用メモリ 6,784 KB
最終ジャッジ日時 2024-09-16 17:06:03
合計ジャッジ時間 9,313 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 9 WA * 38
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int N, X[250009], Y[250009];
vector<int> idx[90];

int main() {
	cin >> N;
	for (int i = 1; i <= N; i++) {
		cin >> X[i] >> Y[i];
		int t1 = X[i] % 9, t2 = Y[i] % 10;
		if (X[i] % 18 >= 9) t2 = (t2 + 5) % 10;
		idx[t1 * 10 + t2].push_back(i);
	}

	pair<int, int> maxn = make_pair(-1, -1);
	for (int i = 0; i < 90; i++) maxn = max(maxn, make_pair((int)idx[i].size(), i));

	cout << idx[maxn.second].size() << endl;
	for (int i = 0; i < (int)idx[maxn.second].size(); i++) {
		if (i) cout << " "; cout << idx[maxn.second][min(i, max(0, (int)idx[maxn.second].size() - 2))];
	}
	cout << endl;
	return 0;
}
0