結果
問題 |
No.1121 Social Distancing in Cinema
|
ユーザー |
|
提出日時 | 2020-07-22 22:21:44 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,044 bytes |
コンパイル時間 | 1,478 ms |
コンパイル使用メモリ | 172,308 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-22 18:52:41 |
合計ジャッジ時間 | 8,687 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 21 WA * 26 |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for (int i = 0; i < (int)(n); i ++) #define irep(i,n) for (int i = (int)n - 1;i >= 0;--i) using namespace std; using ll = long long; using PL = pair<ll,ll>; using P = pair<int,int>; constexpr int INF = 1000000000; constexpr long long HINF = 1000000000000000; constexpr long long MOD = 1000000007;// = 998244353; constexpr double EPS = 1e-4; constexpr double PI = 3.14159265358979; int main() { int N; cin >> N; vector<vector<int>> grid(500,vector<int>(500,0)); rep(i,N) { int x,y; cin >> x >> y; grid[x - 1][y - 1] = i + 1; } vector<int> ans; int K = 0; rep(i,500) { bool flag = false; rep(j,500) { if (grid[i][j] > 0) { ans.push_back(grid[i][j]); ++K; flag = true; j += 10; } } if (flag) { i += 10; } } cout << K << '\n'; rep(i,K) { cout << ans[i] << ' '; } cout << '\n'; return 0; }