QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#342889#7619. Make SYSU Great Again ILainWA 0ms3572kbC++231.3kb2024-03-01 19:15:572024-03-01 19:15:57

Judging History

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

  • [2024-03-01 19:15:57]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3572kb
  • [2024-03-01 19:15:57]
  • 提交

answer

#include "bits/stdc++.h"
using namespace std;

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  int n, k;
  cin >> n >> k;
  set<pii> taken;
  vector<pii> pts = {
    make_pair(1, 1),
    make_pair(1, n),
    make_pair(n, n),
    make_pair(n, 1),
  };
  vector<pii> delta =  {
    make_pair(1, 1),
    make_pair(1, -1),
    make_pair(-1, -1),
    make_pair(-1, 1),
  };
  int curr = 1;
  rep(i, n%2, (n+1)/2) {
    rep(j, 0, 4) {
      taken.insert(pts[j]);
      cout << pts[j].first << " " << pts[j].second << '\n';
      pts[j].first += delta[j].first;
      pts[j].second += delta[j].second;
    }
    curr += 4;
  }
  if (n%2) {
    int x = (n+1)/2;
    taken.insert({x, x});
    cout << x << " " << x << '\n';
    taken.insert({x+1, x});
    cout << x+1 << " " << x << '\n';
    curr += 2;
  }

  int currx = 1, curry = 1;
  rep(i, curr, k+1) {
    while(taken.count({currx, curry})) {
      currx++;
      if (currx > n) {
        currx = 1, curry++;
      }
    }
    cout << currx << " " << curry << '\n';
    taken.insert({currx, curry});
  }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3572kb

input:

3 6

output:

1 1
1 3
3 3
3 1
2 2
3 2

result:

wrong answer The answer is wrong: The maximum common divisor of row 2 and column -477371264 is not the same.