QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#355201#5101. Crystal CrosswindnvmdavaWA 0ms3848kbC++231.2kb2024-03-16 14:27:102024-03-16 14:27:11

Judging History

你现在查看的是最新测评结果

  • [2024-03-16 14:27:11]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3848kb
  • [2024-03-16 14:27:10]
  • 提交

answer

#if not LOCAL
#define NDEBUG 1
#endif
#include <bits/stdc++.h>
using namespace std;

#define rep(i, a, b) for(auto i = a; i < (b); ++i)
#define down(x, a) for (auto x = a; x--;)
#define all(x) begin(x), end(x)
#define sz(x) int(size(x))
#define let auto const

using ll = long long;
using lint = ll;
using pii = pair<int, int>;
using vi = vector<int>;

int main() {
  cin.tie(0)->sync_with_stdio(0);
  cin.exceptions(cin.failbit);

  int x, y, k;
  cin>>x>>y>>k;

  vector<vi> grid(x, vector<int>(y));

  auto bound = [&](int cx, int cy) {
    return cx < x && cx >= 0 && cy < y && cy >= 0;
  };

  rep(t, 0, k) {
    int dx, dy;
    cin>>dx>>dy;
    int b;
    cin>>b;
    while(b--) {
      int px, py;
      cin>>px>>py;
      --px; --py;
      grid[px][py] = 1000;
      if(bound(px - dx, py - dy)) grid[px - dx][py - dy] = -1000;
      while(bound(px + dx, py + dy)){
        px += dx; py += dy;
        if(grid[px][py] < 0) break;
        ++grid[px][py];
      }
    }
  }

  rep(j, 0, y) {
    rep(i, 0, x) {
      cout<< (grid[i][j] >= 1000 ? '#' : '.');
    }
    cout<<'\n';
  }
  cout<<'\n';

  rep(j, 0, y) {
    rep(i, 0, x) {
      cout<< (grid[i][j] >= k ? '#' : '.');
    }
    cout<<'\n';
  }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3848kb

input:

4 1 1
0 1 2 1 1 3 1

output:

#.#.

#.#.

result:

ok 3 lines

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3552kb

input:

4 4 2
1 0 4 2 4 2 1 1 3 1 2
-1 0 4 4 3 4 2 3 1 3 4

output:

.##.
#..#
#..#
.##.

.##.
####
####
.##.

result:

wrong answer 2nd lines differ - expected: '####', found: '#..#'