이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll>pairll;
typedef pair<ll,pairll>pairlll;
typedef pair<pairll,ll>pairllL;
typedef pair<pairll,pairll>pairllll;
typedef pair<ll,pairllll>pairlllll;
typedef long double ld;
typedef pair<ll,string>pairls;
#define endl '\n'
#define INF 100000000007
#define M 1000000000
#define P 316
#define MOD 998244353
#define pb push_back
#define fr first
#define sc second
ll k,d,res,r;
int main()
{
cin>>k;
for(int i=1;i<=k;i++){
cin>>d;
}
k--;
if(d==9){
res=9;
r=10;
while(res+k>=r){
res+=8*r;
r*=10;
}
cout<<res<<endl;
return 0;
}
if(d==0){
d=10;
}
res=d;
r=0;
while(r<k){
if(r==0)r=10;
else r*=10;
res*=10;
}
cout<<res<<endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |