結果
問題 | No.1121 Social Distancing in Cinema |
ユーザー |
|
提出日時 | 2020-07-22 23:21:21 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 152 ms / 2,000 ms |
コード長 | 1,052 bytes |
コンパイル時間 | 2,905 ms |
コンパイル使用メモリ | 197,192 KB |
最終ジャッジ日時 | 2025-01-12 03:51:20 |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 47 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ int G[500][500]; auto inside = [&](int a, int b){ return a>=0 && a<500 && b>=0 && b<500; }; vector<pair<int, int>> SS = {{-1, -4}, {4, 5}}; int num[] = {1, 2, 3, 4, 5, 5, 5, 5, 5, 4, 3, 2, 1}; for(auto [SX, SY] : SS){ for(int sx=SX; sx<=600; sx+=10) for(int sy=SY; sy<=600; sy+=18){ int g = 0; for(int ay=0; ay<13; ay++){ int n = num[ay]; for(int ax=1-n; ax<=n; ax++){ int i = sx+ax, j = sy+ay; if(inside(i, j)) G[i][j] = g; g++; } } } } vector<int> vs[90]; int N; cin >> N; for(int i=0; i<N; i++){ int x, y; cin >> x >> y; vs[G[x-1][y-1]].push_back(i); } int opt = 0; for(int g=0; g<90; g++) if(vs[opt].size() < vs[g].size()) opt = g; cout << vs[opt].size() << endl; for(int a : vs[opt]) cout << a+1 << " "; cout << endl; return 0; }