結果

問題 No.1121 Social Distancing in Cinema
ユーザー tnakao0123tnakao0123
提出日時 2020-07-24 22:02:21
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 1,250 bytes
コンパイル時間 842 ms
コンパイル使用メモリ 90,560 KB
実行使用メモリ 5,500 KB
最終ジャッジ日時 2023-09-08 04:12:03
合計ジャッジ時間 6,941 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,384 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,384 KB
testcase_05 AC 1 ms
4,384 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 1 ms
4,384 KB
testcase_10 AC 1 ms
4,384 KB
testcase_11 AC 1 ms
4,384 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 1 ms
4,384 KB
testcase_15 AC 3 ms
4,384 KB
testcase_16 AC 6 ms
4,380 KB
testcase_17 AC 19 ms
4,384 KB
testcase_18 AC 34 ms
5,084 KB
testcase_19 AC 40 ms
5,404 KB
testcase_20 AC 3 ms
4,380 KB
testcase_21 AC 2 ms
4,384 KB
testcase_22 AC 3 ms
4,380 KB
testcase_23 AC 2 ms
4,380 KB
testcase_24 AC 2 ms
4,384 KB
testcase_25 AC 12 ms
4,380 KB
testcase_26 AC 15 ms
4,384 KB
testcase_27 AC 2 ms
4,384 KB
testcase_28 AC 35 ms
5,096 KB
testcase_29 AC 14 ms
4,380 KB
testcase_30 AC 11 ms
4,380 KB
testcase_31 AC 39 ms
5,500 KB
testcase_32 AC 30 ms
4,848 KB
testcase_33 AC 14 ms
4,384 KB
testcase_34 AC 13 ms
4,384 KB
testcase_35 AC 31 ms
5,024 KB
testcase_36 AC 37 ms
5,328 KB
testcase_37 AC 10 ms
4,380 KB
testcase_38 AC 16 ms
4,384 KB
testcase_39 AC 35 ms
5,076 KB
testcase_40 AC 8 ms
4,380 KB
testcase_41 AC 3 ms
4,380 KB
testcase_42 AC 38 ms
5,320 KB
testcase_43 AC 38 ms
5,268 KB
testcase_44 AC 38 ms
5,264 KB
testcase_45 AC 38 ms
5,332 KB
testcase_46 AC 36 ms
5,208 KB
testcase_47 AC 2 ms
4,384 KB
testcase_48 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/* -*- coding: utf-8 -*-
 *
 * 1121.cc:  No.1121 Social Distancing in Cinema - 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 MAX_N = 250000;
const int DY = 9;
const int DX = 10;

/* typedef */

/* global variables */

int xs[MAX_N], ys[MAX_N];
int cs[DY][DX];

/* subroutines */

/* main */

int main() {
  int n;
  scanf("%d", &n);

  for (int i = 0; i < n; i++) scanf("%d%d", xs + i, ys + i);

  for (int i = 0; i < n; i++)
    cs[ys[i] % DY][(xs[i] + ((ys[i] / DY) & 1) * DX / 2) % DX]++;

  int maxc = -1, maxy = -1, maxx = -1;
  for (int y = 0; y < DY; y++)
    for (int x = 0; x < DX; x++)
      if (maxc < cs[y][x])
	maxc = cs[y][x], maxy = y, maxx = x;
  
  printf("%d\n", maxc);
  for (int i = 0, cont = 0; i < n; i++)
    if (ys[i] % DY == maxy &&
	(xs[i] + ((ys[i] / DY) & 1) * DX / 2) % DX == maxx) {
      if (cont) putchar(' ');
      printf("%d", i + 1);
      cont = 1;
    }
  putchar('\n');
  return 0;
}
0