# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1116338 | vjudge1 | Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) | C++17 | 1 ms | 336 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define sz size()
#define int long long
#define speed ios_base::sync_with_stdio(0);
#define in insert
#define pb push_back
using namespace std;
signed main() {
speed;
int a;
cin >> a;
int h=1;
string s="";
for(int i=0;i<1000;i++){
if(a%9==0){
a/=9;
s+="9";
}
else break;
}
for(int i=0;i<1000;i++){
if(a%8==0){
a/=8;
s+="8";
}
else break;
}
for(int i=0;i<1000;i++){
if(a%7==0){
a/=7;
s+="7";
}
else break;
}
for(int i=0;i<1000;i++){
if(a%6==0){
a/=6;
s+="6";
}
else break;
}
for(int i=0;i<1000;i++){
if(a%5==0){
a/=5;
s+="5";
}
else break;
}
for(int i=0;i<1000;i++){
if(a%4==0){
a/=4;
s+="4";
}
else break;
}
for(int i=0;i<1000;i++){
if(a%3==0){
a/=3;
s+="3";
}
else break;
}
for(int i=0;i<1000;i++){
if(a%2==0){
a/=2;
s+="2";
}
else break;
}
if(a==1){
reverse(s.begin(),s.end());
cout << s;
}
else cout << -1;
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |