이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
using namespace std;
int main()
{
int n, i, j, c, v, b, na, a;
cin >> n;
for(i=1;i<=n;i++){
na=0;
cin >> a;
c=a/8;
na=a%8;
v=na/5;
na=na%5;
b=na/3;
na=na%3;
if(na>=1){
if(a%8==0){
for(j=1;j<=a/8;j++)cout << "8";
cout << endl;
}
if(a%5==0){
for(j=1;j<=a/5;j++)cout << "5";
cout << endl;
}
if(a%3==0){
for(j=1;j<=a/3;j++)cout << "3";
cout << endl;
}
else cout << "-1" << endl;
}
else{
for(j=1;j<=b;j++)cout << "3";
for(j=1;j<=v;j++)cout << "5";
for(j=1;j<=c;j++)cout << "8";
cout << 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... |