QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#668656 | #7897. Largest Digit | Chunyo | Compile Error | / | / | C++20 | 573b | 2024-10-23 15:23:36 | 2024-10-23 15:23:38 |
Judging History
answer
#include<bits/stdc++.h>
#define endl '\n'
#define int long long
using namespace std;
int la,ra,lb,rb;
void solve() {
cin>>la>>ra>>lb>>rb;
if(ra-la>=10||lb-rb>=10){
cout<<9<<endl;
return;
}
int ans=0;
for(int i=la;i<=ra;i++){
for(int j=lb;j<=rb;j++){
int x=i+j;
string s=to_string(x);
for(int k=0;k<(int)s.size();k++){
ans=max(ans,(int)(s[k]-'0'));
}
}
}
cout<<ans<<endl;
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t=1;
cin>>t;
while(t--) {
solve();
}
return 0;
Details
answer.code: In function ‘int main()’: answer.code:33:18: error: expected ‘}’ at end of input 33 | return 0; | ^ answer.code:24:15: note: to match this ‘{’ 24 | signed main() { | ^