QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#236420 | #3530. Small business | Soorraw | WA | 1ms | 3612kb | C++14 | 915b | 2023-11-03 22:35:04 | 2023-11-03 22:35:04 |
Judging History
answer
#define push_back pb
#define first fst
#define second sec
#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;
typedef long long ll;
const int N=2e5+10,M=5e2+10,inf=0x3f3f3f3f,mod=1e9+7;//998244353;
const ll inff=0x3f3f3f3f3f3f3f3f;
typedef double db;
const db eps=1e-9;
string s;
void solve()
{
cin>>s;
vector<int>vx;
int cnt=0;
for(auto ch:s)
{
int x=ch-'0';
if(x)
vx.pb(x);
else ++cnt;
}
int sz=s.size();
if(sz==cnt)
{
cout<<((sz==2)?"0 0\n":"-1 -1\n");
return;
}
if(sz<2||sz>36)
{
cout<<"-1 -1\n";
return;
}
sort(vx.begin(),vx.end());
if(cnt)
{
cout<<"0 ";
cout<<vx[0]<<(--cnt?string(cnt,'0'):"");
}
else cout<<vx[0]<<' ';
for(int i=1;i<vx.size();i++)
cout<<vx[i];
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int T=1;
// cin>>T;
// T=read();
while(T--)
solve();
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3516kb
input:
123456
output:
1 23456
result:
ok ok
Test #2:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
42
output:
2 4
result:
ok ok
Test #3:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
000
output:
-1 -1
result:
ok ok
Test #4:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
4418409405
output:
0 104444589
result:
ok ok
Test #5:
score: -100
Wrong Answer
time: 1ms
memory: 3612kb
input:
82933602294918208962
output:
0 1022222334668889999
result:
wrong answer Integer parameter [name=b] equals to 1022222334668889999, violates the range [-1, 10^18]