QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#342892#7619. Make SYSU Great Again ILainWA 0ms3540kbC++231.4kb2024-03-01 19:18:242024-03-01 19:18:25

Judging History

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

  • [2024-03-01 19:18:25]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3540kb
  • [2024-03-01 19:18:24]
  • 提交

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;
      if (curr != k) {
        cout << '\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;
    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 (curr != k) {
      cout << '\n';
    }
    taken.insert({currx, curry});
  }
}

詳細信息

Test #1:

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

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