QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#391101#3792. 搞笑版费马大定理wanyurukong100 ✓5ms3604kbC++17645b2024-04-16 13:26:072024-04-16 13:26:08

Judging History

This is the latest submission verdict.

  • [2024-04-16 13:26:08]
  • Judged
  • Verdict: 100
  • Time: 5ms
  • Memory: 3604kb
  • [2024-04-16 13:26:07]
  • Submitted

answer

#include <bits/stdc++.h>
#define int long long
#define lson k<<1
#define rson (k<<1)|1
#define debug cout<<666<<endl;
using namespace std;
const int N=1e6+5;
void vision()
{
	int test=1;
	int x,y;
	while(cin>>x>>y){
		if(x>y)swap(x,y);
		int ans=0;
		for(int i=x;i*i*i<=1e9+3&&i<=y;i++){
			for(int j=x;j*j*j<=1e9+3&&j<=y;j++){
				int tmp=i*i*i+j*j*j;
				int hh=tmp/10;
				if(tmp%10==3&&hh>=x&&hh<=y)ans++;
			}
		}
		cout<<"Case "<<test<<": ";
		test++;
		cout<<ans<<"\n";
	}
	return ;
}
signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	int t=1;
	// cin>>t;
	while(t--){
		vision();
	}
	return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 5ms
memory: 3604kb

input:

2 13
123 456789
111 9999999
1 100000000
500 100000000
700 100000000
750 100000000
780 98765432
788 98421754
788 98421753

output:

Case 1: 2
Case 2: 16
Case 3: 9998
Case 4: 88224
Case 5: 14440
Case 6: 1650
Case 7: 370
Case 8: 26
Case 9: 2
Case 10: 0

result:

ok 10 lines