QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#703850#6677. Puzzle: Sashiganexhytom#RE 0ms3812kbC++232.6kb2024-11-02 18:41:442024-11-02 18:41:46

Judging History

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

  • [2024-11-02 18:41:46]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:3812kb
  • [2024-11-02 18:41:44]
  • 提交

answer

/*
 
_/      _/    _/      _/    _/      _/   _/_/_/_/_/     _/_/       _/      _/ 
 _/    _/     _/      _/     _/    _/        _/       _/    _/     _/      _/            
  _/  _/      _/      _/      _/  _/         _/      _/      _/    _/_/  _/_/         
   _/_/       _/_/_/_/_/        _/           _/      _/      _/    _/  _/  _/          
  _/  _/      _/      _/        _/           _/      _/      _/    _/      _/          
 _/    _/     _/      _/        _/           _/       _/    _/     _/      _/          
_/      _/    _/      _/        _/           _/         _/_/       _/      _/       
 
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
using i64 = long long;
#define rep(i,a,n) for(int i=a;i<n;i++)
#define per(i,a,n) for(int i=n-1;i>=a;i--)
#define fastio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define multi int _;cin>>_;while(_--)
#define int long long
#define pb push_back
#define eb emplace_back
ll gcd(ll a,ll b){ return b?gcd(b,a%b):a;}
mt19937_64 mrand(chrono::steady_clock().now().time_since_epoch().count());
int rnd(int l,int r){ return mrand() % (r - l + 1) + l;}
#ifdef localfreopen
#define debug(x) cerr << #x << " = " << (x) << endl;
void test() {cerr << "\n";}
template<typename T, typename... Args> 
void test(T x, Args... args) {cerr << x << " ";test(args...);}
#else
#define debug //
#define test //
#endif
const ll MOD = 998244353;
// const ll MOD = 1e9+7;
ll ksm(ll x,ll y){ll ans=1;x%=MOD;while(y){if(y&1)ans=ans*x%MOD;x=x*x%MOD,y/=2;}return ans;}

const int P1 = 972152273, base1 = 809;
const int P2 = 905563261, base2 = 919;
const ll N = 200005;
//head


signed main()
{  
#ifdef localfreopen
    // freopen("1.in","r",stdin);
#endif
    fastio
    std::cout << std::fixed << std::setprecision(10);
    int n, lx, ly, rx, ry;
    std::cin >> n >> lx >> ly;
    rx = lx;
    ry = ly;
    std::vector<std::array<int, 4>> ans;
    for (int i = 1; i < n; i++) {
    	if (lx > 1 && ly > 1) {
    		ans.push_back({lx - 1, ly - 1, i, i});;
    		lx--;
    		ly--;
    	} else if (rx < n && ly > 1) {
    		ans.push_back({rx + 1, ly - 1, -i, i});
    		rx++;
    		ly--;
    	} else if (lx < 1 && ry < n) {
    		ans.push_back({lx - 1, ry + 1, i, -i});
    		lx--;
    		ry++;
    	} else if (rx < n && ry < n) {
    		ans.push_back({rx + 1, ry + 1, -i, -i});
    		rx++;
    		ry++;
    	} else {
    		assert(0);
    	}
    }
    
    std::cout << "Yes\n";
    std::cout << ans.size() << "\n";
    for (auto [a, b, c, d] : ans) {
    	std::cout << a << " " << b << " " << c << " " << d << "\n";
    }
    return 0;
}

詳細信息

Test #1:

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

input:

5 3 4

output:

Yes
4
2 3 1 1
1 2 2 2
4 1 -3 3
5 5 -4 -4

result:

ok Correct. (1 test case)

Test #2:

score: 0
Accepted
time: 0ms
memory: 3812kb

input:

1 1 1

output:

Yes
0

result:

ok Correct. (1 test case)

Test #3:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

3 2 3

output:

Yes
2
1 2 1 1
3 1 -2 2

result:

ok Correct. (1 test case)

Test #4:

score: -100
Runtime Error

input:

10 10 5

output:


result: