Codeforces Round #462 Editorial
Difference between en1 and en2, changed 4 character(s)
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>↵


History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en5 English Tommyr7 2018-02-15 10:12:43 2526
en4 English Tommyr7 2018-02-15 06:23:19 3612
en3 English Tommyr7 2018-02-15 04:26:05 11324
en2 English Tommyr7 2018-02-14 18:23:48 4 Tiny change: '[tutorial:869B]\n</spoi' -> '[tutorial:933B]\n</spoi'
en1 English Tommyr7 2018-02-14 18:23:01 1657 Initial revision (published)