結果
| 問題 | No.3765 321-avoiding Grid |
| コンテスト | |
| ユーザー |
simasima_71
|
| 提出日時 | 2026-10-16 22:14:39 |
| 言語 | C++23(gcc16) (gcc 16.2.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 13 ms / 1,000 ms |
| + 340µs | |
| コード長 | 1,609 bytes |
| 記録 | |
| コンパイル時間 | 9,942 ms |
| コンパイル使用メモリ | 714,712 KB |
| 実行使用メモリ | 9,916 KB |
| 最終ジャッジ日時 | 2026-10-16 22:14:55 |
| 合計ジャッジ時間 | 12,194 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define rep(i, l, r) for (ll i = (l); i < (r); ++i)
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pl = pair<ll,ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vvvl = vector<vector<vector<ll>>>;
template<class T> using pq_ = priority_queue<T, vector<T>, greater<T>>;
#define sz(x) (int)(x).size()
typedef pair<int, int> pii;
using mint=modint998244353;
// g++ a.cpp -std=c++23 -I.
// g++ -std=c++23 -I. a.cpp -o main
// g++ -std=c++23 -I. anaive.cpp -o naive
// g++ -std=c++23 -I. agene.cpp -o gene
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
using Bint = mp::cpp_int;
using Real = mp::number<mp::cpp_dec_float<1024>>;
int main(){
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
ll n;
cin>>n;
ll a,b,c;
cin>>a>>b>>c;
vvl z(n,vl(n));
vl d;
rep(i,0,a)d.push_back(1);
rep(i,0,b)d.push_back(2);
rep(i,0,c)d.push_back(3);
ll now=0;
rep(i,0,n){
rep(j,0,n){
if((i+j)%2==0){
z[i][j]=d[now];
now++;
}
}
}
rep(i,0,n){
rep(j,0,n){
if((i+j)%2==1){
z[i][j]=d[now];
now++;
}
}
}
rep(i,0,n){
rep(j,0,n){
cout<<z[i][j];
}
cout<<endl;
}
}
simasima_71