QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#713155#6677. Puzzle: Sashiganelibantian#RE 0ms0kbC++231.3kb2024-11-05 18:19:532024-11-05 18:19:55

Judging History

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

  • [2024-11-05 18:19:55]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:0kb
  • [2024-11-05 18:19:53]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define INF 0x3f3f3f3f3f3f3f3f
#define pii pair<int,int>
#define x first
#define y second
#define all(_a) _a.begin(), _a.end()
#define rep(i,p,q) for (int i=(p);i<=(q);i++)
#define pre(i,p,q) for (int i=(p);i>=(q);i--)
const int N=100010; struct node{int x,y,p,q;}a[N];
void solve(){
    int n,x,y,t=0,p=0;
    scanf("%d%d%d",&n,&x,&y);
    if (x==y) {
        rep(i,1,x-1) a[++t]={i,i,n-1-p,n-1-p},p++;
        pre(i,n,y+1) a[++t]={i,i,-(n-1-p),-(n-1-p)},p++;
    }
    if (x<y) {
        rep(i,1,x-1) a[++t]={i,i,n-1-p,n-1-p},p++;
        pre(i,n,y+1) a[++t]={i,i,-(n-1-p),-(n-1-p)},p++;
        int x0=y,y0=x;
        rep(i,x,y-1) a[++t]={x0,y0,-(n-1-p),n-1-p},x0--,y0++,p++;
    }
    if (x>y) {
        rep(i,1,y-1) a[++t]={i,i,n-1-p,n-1-p},p++;
        pre(i,n,x+1) a[++t]={i,i,-(n-1-p),-(n-1-p)},p++;
        int x0=y,y0=x;
        rep(i,y,x-1) a[++t]={x0,y0,n-1-p,-(n-1-p)},x0++,y0--,p++;
    }
    printf("Yes\n%d\n",t);
    rep(i,1,t) printf("%d %d %d %d\n",a[i].x,a[i].y,a[i].p,a[i].q);
}
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr), cout.tie(nullptr);
    cout << setiosflags(ios::fixed) << setprecision(15);
    int T;
    T=1;
    //cin>>T;
    while(T--)solve();
    return 0;
}

详细

Test #1:

score: 0
Runtime Error

input:

5 3 4

output:


result: