QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#668656#7897. Largest DigitChunyoCompile Error//C++20573b2024-10-23 15:23:362024-10-23 15:23:38

Judging History

你现在查看的是最新测评结果

  • [2024-10-23 15:23:38]
  • 评测
  • [2024-10-23 15:23:36]
  • 提交

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() {
      |               ^