2 条题解

  • 1
    @ 2026-7-20 10:05:03
    
    #include <bits/stdc++.h>
    using namespace std;
    
    int l,r,s;
    bool check(int a)
    {
    	while(a%2==0) a/=2;
    	while(a%5==0) a/=5;
    	if(a==1) return true;
    	else return false;
    }
    
    int main()
    {
    	cin >> l >> r;
    	for(int i=l;i<=r;i++)
    	{
    		if(check(i)) s++;
    	}
    	cout << s;
    	return 0;
    }
    • 0
      @ 2026-5-2 12:34:15

      #include<bits/stdc++.h> using namespace std; int l,r,s; bool check(int a){ while(a%20)a/=2; while(a%50)a/=5; if(a==1)return true; else return false; } int main(){ cin>>l>>r; for(int i=l;i<=r;i++){ if(check(i))s++; } cout<<s; return 0; }

      • 1

      信息

      ID
      3534
      时间
      1000ms
      内存
      256MiB
      难度
      4
      标签
      递交数
      89
      已通过
      38
      上传者