結果
| 問題 | 
                            No.1121 Social Distancing in Cinema
                             | 
                    
| コンテスト | |
| ユーザー | 
                             e869120
                         | 
                    
| 提出日時 | 2020-07-03 15:30:52 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 870 bytes | 
| コンパイル時間 | 758 ms | 
| コンパイル使用メモリ | 74,072 KB | 
| 実行使用メモリ | 11,392 KB | 
| 最終ジャッジ日時 | 2024-09-16 17:06:12 | 
| 合計ジャッジ時間 | 8,286 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | -- * 2 | 
| other | AC * 17 TLE * 2 -- * 28 | 
ソースコード
#include <iostream>
#include <vector>
#include <cassert>
#include <algorithm>
using namespace std;
int N, X[250009], Y[250009];
vector<int> idx[90];
int main() {
	cin >> N; assert(1 <= N && N <= 250000);
	for (int i = 1; i <= N; i++) {
		cin >> X[i] >> Y[i]; assert(1 <= X[i] && X[i] <= 500 && 1 <= Y[i] && Y[i] <= 500);
		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);
	}
	for (int i = 1; i <= N; i++) {
	    for (int j = i + 1; j <= N; j++) assert(make_pair(X[i], Y[i]) != make_pair(X[j], Y[j]));
	}
	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 < idx[maxn.second].size(); i++) {
		if (i) cout << " "; cout << idx[maxn.second][i];
	}
	cout << endl;
	return 0;
}
            
            
            
        
            
e869120