Submission #19725194


Source Code Expand

Copy
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
bool modm(int x,int m){
	while(x!=0){
		if(x%m==7)	return true;
		x/=m;
	}
	return false;
}
int main()
{
	int n,ans=0;
	cin>>n;
	ans=n;
	for(int i=1; i<=n; i++){
		if(modm(i,10) || modm(i,8))
			ans--;
	}
	cout<<ans;
	return 0;
}

Submission Info

Submission Time
Task C - Unlucky 7
User LCN100324
Language C++ (GCC 9.2.1)
Score 300
Code Size 320 Byte
Status AC
Exec Time 9 ms
Memory 3604 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 2
AC × 20
Set Name Test Cases
Sample sample_01.txt, sample_02.txt
All hand_01.txt, hand_02.txt, hand_03.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, sample_01.txt, sample_02.txt
Case Name Status Exec Time Memory
hand_01.txt AC 9 ms 3496 KB
hand_02.txt AC 3 ms 3384 KB
hand_03.txt AC 2 ms 3580 KB
random_01.txt AC 3 ms 3432 KB
random_02.txt AC 2 ms 3440 KB
random_03.txt AC 3 ms 3440 KB
random_04.txt AC 4 ms 3424 KB
random_05.txt AC 2 ms 3428 KB
random_06.txt AC 3 ms 3440 KB
random_07.txt AC 5 ms 3512 KB
random_08.txt AC 5 ms 3528 KB
random_09.txt AC 5 ms 3528 KB
random_10.txt AC 3 ms 3604 KB
random_11.txt AC 2 ms 3532 KB
random_12.txt AC 4 ms 3428 KB
random_13.txt AC 3 ms 3520 KB
random_14.txt AC 2 ms 3508 KB
random_15.txt AC 3 ms 3524 KB
sample_01.txt AC 3 ms 3576 KB
sample_02.txt AC 4 ms 3508 KB