Hi, all!↵
↵
This is not [user:Tommyr7,2018-02-14], but the **impostor** behind the round again (guess who I am? :P). The statements are written by me. Thank you, everyone, and hope you've all enjoyed the round!↵
↵
Any feedback on problems and tutorials are welcome — we look forward to doing even better in the future!↵
↵
Here are some of the detailed tutorials!↵
↵
### Tutorials↵
↵
### [problem:934B]↵
**Author** [user:Tommyr7,2018-02-14] / **Preparation** [user:cyand1317,2018-02-14] / **Tutorial** [user:cyand1317,2018-02-14]↵
↵
<spoiler summary="Tutorial">↵
[tutorial:934B]↵
</spoiler>↵
↵
<spoiler summary="Solution (Tommyr7)">↵
~~~~~↵
#include <bits/stdc++.h>↵
using namespace std;↵
int n,k;↵
int main()↵
{↵
scanf("%d",&k);↵
if (k>36) printf("%d\n",-1);↵
else↵
{↵
while (k>0)↵
{↵
if (k>=2)↵
{↵
printf("%d",8);↵
k-=2;↵
} else↵
{↵
printf("%d",9);↵
k-=1;↵
}↵
}↵
printf("\n");↵
}↵
return 0;↵
}↵
↵
~~~~~↵
</spoiler>↵
↵
### [problem:933B]↵
**Author** [user:Tommyr7,2018-02-14] / **Preparation** [user:cyand1317,2018-02-14] / **Tutorial** [user:cyand1317,2018-02-14]↵
↵
<spoiler summary="Tutorial">↵
[tutorial:869933B]↵
</spoiler>↵
↵
<spoiler summary="Solution (Tommyr7)">↵
~~~~~↵
#include <bits/stdc++.h>↵
using namespace std;↵
long long p;↵
int k;↵
int cnt=0;↵
int ans[107];↵
int get()↵
{↵
int x=p%k;↵
if (x<0) x+=k;↵
return x%k;↵
}↵
int main()↵
{↵
scanf("%lld%d",&p,&k);↵
while (p!=0)↵
{↵
++cnt;↵
ans[cnt]=get();↵
p-=get();↵
p/=(-k);↵
}↵
printf("%d\n",cnt);↵
for (int i=1;i<=cnt;i++)↵
printf("%d ",ans[i]);↵
printf("\n");↵
return 0;↵
}↵
↵
~~~~~↵
</spoiler>↵
↵
↵
↵
This is not [user:Tommyr7,2018-02-14], but the **impostor** behind the round again (guess who I am? :P). The statements are written by me. Thank you, everyone, and hope you've all enjoyed the round!↵
↵
Any feedback on problems and tutorials are welcome — we look forward to doing even better in the future!↵
↵
Here are some of the detailed tutorials!↵
↵
### Tutorials↵
↵
### [problem:934B]↵
**Author** [user:Tommyr7,2018-02-14] / **Preparation** [user:cyand1317,2018-02-14] / **Tutorial** [user:cyand1317,2018-02-14]↵
↵
<spoiler summary="Tutorial">↵
[tutorial:934B]↵
</spoiler>↵
↵
<spoiler summary="Solution (Tommyr7)">↵
~~~~~↵
#include <bits/stdc++.h>↵
using namespace std;↵
int n,k;↵
int main()↵
{↵
scanf("%d",&k);↵
if (k>36) printf("%d\n",-1);↵
else↵
{↵
while (k>0)↵
{↵
if (k>=2)↵
{↵
printf("%d",8);↵
k-=2;↵
} else↵
{↵
printf("%d",9);↵
k-=1;↵
}↵
}↵
printf("\n");↵
}↵
return 0;↵
}↵
↵
~~~~~↵
</spoiler>↵
↵
### [problem:933B]↵
**Author** [user:Tommyr7,2018-02-14] / **Preparation** [user:cyand1317,2018-02-14] / **Tutorial** [user:cyand1317,2018-02-14]↵
↵
<spoiler summary="Tutorial">↵
[tutorial:
</spoiler>↵
↵
<spoiler summary="Solution (Tommyr7)">↵
~~~~~↵
#include <bits/stdc++.h>↵
using namespace std;↵
long long p;↵
int k;↵
int cnt=0;↵
int ans[107];↵
int get()↵
{↵
int x=p%k;↵
if (x<0) x+=k;↵
return x%k;↵
}↵
int main()↵
{↵
scanf("%lld%d",&p,&k);↵
while (p!=0)↵
{↵
++cnt;↵
ans[cnt]=get();↵
p-=get();↵
p/=(-k);↵
}↵
printf("%d\n",cnt);↵
for (int i=1;i<=cnt;i++)↵
printf("%d ",ans[i]);↵
printf("\n");↵
return 0;↵
}↵
↵
~~~~~↵
</spoiler>↵
↵
↵