QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#342894#7619. Make SYSU Great Again ILainWA 0ms3756kbC++231.4kb2024-03-01 19:20:482024-03-01 19:20:48

Judging History

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

  • [2024-03-01 19:20:48]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3756kb
  • [2024-03-01 19:20:48]
  • 提交

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;
      pts[j].first += delta[j].first;
      pts[j].second += delta[j].second;
      curr++;
      if (curr <= k) {
        cout << '\n';
      }
    }
  }
  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;
    curr += 2;
    if (curr <= k) {
      cout << '\n';
    }
  }

  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;;
    if (i < k) {
      cout << '\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: 3756kb

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 -317606784 is not the same.