QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#263831 | #6834. Nine Is Greater Than Ten | vp_account# | AC ✓ | 1ms | 3816kb | C++14 | 901b | 2023-11-25 08:48:34 | 2023-11-25 08:48:35 |
Judging History
answer
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
#define per(i,a,b) for(int i=(a);i>=(b);--i)
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
typedef long long ll;
using namespace std;
constexpr int N=2e5+5,mod=998244353;
int n,m,nd[20],nm[20];
int main()
{
ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
cin>>n>>m;
int on=n,om=m;
int tn=0,tm=0;
while(n)
{
nd[++tn]=n%10,n/=10;
}
while(m)
{
nm[++tm]=m%10,m/=10;
}
reverse(nd+1,nd+1+tn);
reverse(nm+1,nm+1+tm);
rep(i,1,min(tn,tm))if(nd[i]!=nm[i])
{
if(nd[i]<nm[i]) printf("%d<%d\n",on,om);
else printf("%d>%d\n",on,om);
exit(0);
}
if(tn==tm) printf("%d=%d\n",on,om);
else if(tn<tm) printf("%d<%d\n",on,om);
else printf("%d>%d\n",on,om);
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3812kb
input:
9 10
output:
9>10
result:
ok "9>10"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3508kb
input:
114514 1919
output:
114514<1919
result:
ok "114514<1919"
Test #3:
score: 0
Accepted
time: 1ms
memory: 3508kb
input:
9 999
output:
9<999
result:
ok "9<999"
Test #4:
score: 0
Accepted
time: 0ms
memory: 3572kb
input:
99 99
output:
99=99
result:
ok "99=99"
Test #5:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
2022 924
output:
2022<924
result:
ok "2022<924"
Test #6:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
1 1
output:
1=1
result:
ok "1=1"
Test #7:
score: 0
Accepted
time: 0ms
memory: 3740kb
input:
1 2
output:
1<2
result:
ok "1<2"
Test #8:
score: 0
Accepted
time: 0ms
memory: 3668kb
input:
2 1
output:
2>1
result:
ok "2>1"
Test #9:
score: 0
Accepted
time: 0ms
memory: 3568kb
input:
20220924 20220924
output:
20220924=20220924
result:
ok "20220924=20220924"
Test #10:
score: 0
Accepted
time: 0ms
memory: 3508kb
input:
20220924 999999
output:
20220924<999999
result:
ok "20220924<999999"
Test #11:
score: 0
Accepted
time: 1ms
memory: 3576kb
input:
1 11111111
output:
1<11111111
result:
ok "1<11111111"
Test #12:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
1231 12311
output:
1231<12311
result:
ok "1231<12311"
Test #13:
score: 0
Accepted
time: 1ms
memory: 3512kb
input:
432423 1123124
output:
432423>1123124
result:
ok "432423>1123124"
Test #14:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
9999 100000
output:
9999>100000
result:
ok "9999>100000"
Test #15:
score: 0
Accepted
time: 1ms
memory: 3816kb
input:
1926 817
output:
1926<817
result:
ok "1926<817"
Test #16:
score: 0
Accepted
time: 0ms
memory: 3740kb
input:
19260817 19491001
output:
19260817<19491001
result:
ok "19260817<19491001"
Test #17:
score: 0
Accepted
time: 0ms
memory: 3708kb
input:
20220924 1
output:
20220924>1
result:
ok "20220924>1"
Test #18:
score: 0
Accepted
time: 1ms
memory: 3816kb
input:
20220924 2
output:
20220924>2
result:
ok "20220924>2"
Test #19:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
20 2
output:
20>2
result:
ok "20>2"
Test #20:
score: 0
Accepted
time: 0ms
memory: 3460kb
input:
20220924 3
output:
20220924<3
result:
ok "20220924<3"
Test #21:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
1 2022
output:
1<2022
result:
ok "1<2022"
Test #22:
score: 0
Accepted
time: 1ms
memory: 3576kb
input:
2 2022
output:
2<2022
result:
ok "2<2022"
Test #23:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
3 2022
output:
3>2022
result:
ok "3>2022"
Test #24:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
12345678 90
output:
12345678<90
result:
ok "12345678<90"