QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#314972 | #7897. Largest Digit | hyjsws | WA | 3ms | 3672kb | C++14 | 586b | 2024-01-26 16:00:05 | 2024-01-26 16:00:06 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N=1000010;
typedef long long LL;
LL a,b,c,d,n,m,idx,ans,e[N],ne[N],h[N],l1,l2,r1,r2,x1,x2,y3,y2;
void init(LL u)
{
while(u)
{
ans=max(ans,u%10);
u/=10;
}
}
void solve()
{
cin>>a>>b>>c>>d;
if(b+d-a-c>=10)
{
cout<<9<<endl;
}
else
{
for(LL i=a+c;i<=b+d;i++)
{
init(i);
}
cout<<ans<<endl;
}
}
int main()
{
LL N=1;
cin>>N;
while(N--)
{
solve();
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3672kb
input:
2 178 182 83 85 2 5 3 6
output:
7 9
result:
ok 2 lines
Test #2:
score: -100
Wrong Answer
time: 3ms
memory: 3608kb
input:
1000 158260522 877914575 24979445 602436426 1 5 1101111 1101112 2 5 33333 33335 1 5 10111 10111 138996221 797829355 353195922 501899080 212 215 10302 10302 101100 101101 1 2 111 114 1101000 1101001 265804420 569328197 234828607 807497925 1110110 1110112 11100 11103 323 327 23 27 1 1 1 5 316412581 80...
output:
9 7 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 ...
result:
wrong answer 4th lines differ - expected: '6', found: '9'