結果
問題 | No.1121 Social Distancing in Cinema |
ユーザー |
![]() |
提出日時 | 2020-07-22 22:03:20 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,291 bytes |
コンパイル時間 | 1,545 ms |
コンパイル使用メモリ | 174,072 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-22 18:01:11 |
合計ジャッジ時間 | 9,630 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 |
other | WA * 47 |
ソースコード
#include <bits/stdc++.h> using namespace std; using lint = long long int; using P = pair<int, int>; using PL = pair<lint, lint>; #define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++) #define IFOR(i, begin, end) for(int i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--) #define REP(i, n) FOR(i,0,n) #define IREP(i, n) IFOR(i,0,n) #define ALL(a) (a).begin(),(a).end() constexpr int MOD = 1000000007; constexpr int INF = 2147483647; void yes(bool expr) {cout << (expr ? "Yes" : "No") << "\n";} int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int N; //cin >> N; N = 250000; int K = (N-1) / 90 + 1; vector<vector<int>> b(500, vector<int>(500)); REP(i, N) { int X, Y; //cin >> X >> Y; X = i/500 + 1; Y = i%500 + 1; b[X-1][Y-1] = i+1; } vector<int> ans; vector<int> delsize = {10, 10, 10, 10, 10, 9, 8, 8, 6, 5}; REP(i, 500) REP(j, 500) { if(b[i][j] > 0) { ans.push_back(b[i][j]); REP(k, 10) REP(l, delsize[k]) if(i+k < 500 && j+l < 500) b[i+k][j+l] = 0; REP(k, 10) REP(l, delsize[k]) if(i-k >= 0 && j+l < 500) b[i-k][j+l] = 0; } } cout << K << "\n"; if(ans.size() < K) { cout << "NG" << endl; return 0; } REP(i, K) cout << ans[i] << (i!=K-1 ? " " : ""); cout << "\n"; }