Submission #19724555


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;
bool to_8(int k)
{
	while(k)
	{
		if(k%8==7)
		{
			return true;
		}
    k/=8;
  }
  return false;
}

bool to_10(int k)
{
	while(k)
	{
		if(k%10==7)
		{
			return true;
		}
		k/=10;
	}
    return false;
}

int main()
{
	int n,i,ans=0;
	cin>>n;
	for(i=1;i<=n;i++)
	{
		if(to_8(i)||to_10(i))
		{
			ans++;
		}
	}
	cout<<n-ans;
	return 0; 
}

Submission Info

Submission Time
Task C - Unlucky 7
User AliceYZ
Language C++ (GCC 9.2.1)
Score 300
Code Size 425 Byte
Status AC
Exec Time 13 ms
Memory 3596 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 13 ms 3488 KB
hand_02.txt AC 3 ms 3544 KB
hand_03.txt AC 5 ms 3524 KB
random_01.txt AC 4 ms 3400 KB
random_02.txt AC 2 ms 3552 KB
random_03.txt AC 3 ms 3596 KB
random_04.txt AC 3 ms 3572 KB
random_05.txt AC 4 ms 3484 KB
random_06.txt AC 4 ms 3528 KB
random_07.txt AC 2 ms 3524 KB
random_08.txt AC 4 ms 3484 KB
random_09.txt AC 2 ms 3528 KB
random_10.txt AC 3 ms 3528 KB
random_11.txt AC 2 ms 3548 KB
random_12.txt AC 3 ms 3484 KB
random_13.txt AC 4 ms 3360 KB
random_14.txt AC 2 ms 3576 KB
random_15.txt AC 3 ms 3340 KB
sample_01.txt AC 2 ms 3540 KB
sample_02.txt AC 4 ms 3484 KB