QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#19440 | #1806. Character Grid | YaoBIG# | AC ✓ | 3ms | 3672kb | C++17 | 2.0kb | 2022-01-31 02:08:48 | 2022-05-06 05:22:18 |
Judging History
answer
#include "bits/stdc++.h"
#define rep(i,a,n) for(auto i=a;i<=n;i++)
#define per(i,a,n) for(auto i=n;i>=a;i--)
#define pb push_back
#define mp make_pair
#define FI first
#define SE second
#define all(A) A.begin(),A.end()
#define sz(A) (int)A.size()
template<class T> bool chmax(T &a, const T &b) {if(a<b) {a=b; return 1;} return 0;}
template<class T> bool chmin(T &a, const T &b) {if(b<a) {a=b; return 1;} return 0;}
using namespace std;
string to_string(const string& s) {return '"' + s + '"';}
string to_string(const char* s) {return to_string((string) s);}
template<typename A, typename B> string to_string(pair<A, B> p) {return "(" + to_string(p.FI) + ", " + to_string(p.SE) + ")";}
template<typename A> string to_string(A v)
{
bool first = 1;
string res = "{";
for(const auto &x: v)
{
if (!first) res += ", ";
first = 0;
res += to_string(x);
}
res += "}";
return res;
}
void debug_out() {cerr << endl;}
template<typename Head, typename... Tail> void debug_out(Head H, Tail... T)
{
cerr << " " << to_string(H);
debug_out(T...);
}
#ifndef ONLINE_JUDGE
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) if(0) puts("No effect.")
#endif
using ll = long long;
//using LL = __int128;
using pii = pair<int,int>;
using vi = vector<int>;
using db = double;
using ldb = long double;
const int maxn = 200000;
const int mod = 1000000007;
const int inf = 0x3f3f3f3f;
inline void chsub(int &x,const int &y) {x-=y; if(x<0) x+=mod;}
inline void chadd(int &x,const int &y) {x+=y; if(x>=mod) x-=mod;}
int main()
{
int n = 13;
char a[15][15] = {};
int tot = 12;
rep(i,1,n)
{
char fixed = 'a'+tot+i;
if(i&1)
{
rep(j,1,n) a[i][j] = j&1 ? fixed : 'a'+(j/2)-1;
}
else
{
rep(j,1,n) a[i][j] = j&1 ? 'a'+6+(j/2) : fixed;
}
}
printf("%d\n",n);
rep(i,1,n) puts(a[i]+1);
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 3ms
memory: 3672kb
input:
output:
13 nanbncndnenfn gohoiojokolom papbpcpdpepfp gqhqiqjqkqlqm rarbrcrdrerfr gshsisjskslsm tatbtctdtetft guhuiujukulum vavbvcvdvevfv gwhwiwjwkwlwm xaxbxcxdxexfx gyhyiyjykylym zazbzczdzezfz
result:
ok accepted