| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 74518 | 朱宸瑜 | 幸运数字 | C++ | Accepted | 100 | 12 MS | 252 KB | 345 | 2023-05-27 14:09:48 |
#include<bits/stdc++.h> using namespace std; int n,ans; int main(){ cin>>n; for(int x=1;x<=n;x++){ if(x%4==0||x%7==0) ans++; else{ int x1=x,last=0; while(x1>0){ int ne=x1%10; if(ne==7&&last==7||ne==4&&last==4){ ans++; break; }else last=ne; x1/=10; } } } cout<<ans; return 0; }