D. Print a 1337-string...
生活随笔
收集整理的這篇文章主要介紹了
D. Print a 1337-string...
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
D. Print a 1337-string...
輸出一個字符串
里面包含n個子序列 1337
#include<bits/stdc++.h>
using namespace std;
#define sc(x) scanf("%I64d",&x);
#define int long long
int t,n;
int C[];
void init()
{
for(int i=; i<=; i++)
{
C[i]=((i-)*i)/;
}
}
signed main()
{
init();
sc(t);
while(t--)
{
sc(n);
if(n<=)
{
for(int i=; i<n; i++)
{
putchar('');
}
putchar('');
putchar('');
putchar('');
cout<<'\n';
}
else
{
int x=,y=,i;
for( i=; C[i]<=n; i++)
{
x=i;
}
y=n-(n/C[x])*C[x];
// cout<<n<<' '<<C[x]<<'\n';
cout<<"";
for(int i=;i<y;i++){
cout<<'';
}
x-=;
for(int i=;i<x;i++){
cout<<'';
}
cout<<''<<'\n';
}
}
}
總結
以上是生活随笔為你收集整理的D. Print a 1337-string...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: [LeetCode] 107. 二叉树
- 下一篇: Hotspot的栈