Submission #19723126


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;

int main()
{
	int n;
	cin >> n;
	int total = n;
	for(int i=1; i<=n; ++i)
	{
		int tmp = i, q;
		bool f = false;
		while(tmp != 0)
		{
			q = tmp%10;
			tmp/=10;
			if(q == 7)
			{
				--total;
				f = true;
				break;
			}
		}
		if(f) continue;
		tmp = i;
		while(tmp != 0)
		{
			q = tmp%8;
			tmp/=8;
			if(q == 7)
			{
				--total;
				f = true;
				break;

			}
		}
	}

	cout << total << endl;
	return 0;
}

Submission Info

Submission Time
Task C - Unlucky 7
User Hunter7777
Language C++ (GCC 9.2.1)
Score 300
Code Size 498 Byte
Status AC
Exec Time 9 ms
Memory 3632 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 3404 KB
hand_02.txt AC 4 ms 3632 KB
hand_03.txt AC 3 ms 3520 KB
random_01.txt AC 4 ms 3632 KB
random_02.txt AC 2 ms 3524 KB
random_03.txt AC 2 ms 3424 KB
random_04.txt AC 3 ms 3628 KB
random_05.txt AC 3 ms 3408 KB
random_06.txt AC 5 ms 3552 KB
random_07.txt AC 2 ms 3420 KB
random_08.txt AC 4 ms 3560 KB
random_09.txt AC 2 ms 3612 KB
random_10.txt AC 3 ms 3420 KB
random_11.txt AC 2 ms 3552 KB
random_12.txt AC 4 ms 3424 KB
random_13.txt AC 2 ms 3544 KB
random_14.txt AC 2 ms 3408 KB
random_15.txt AC 3 ms 3424 KB
sample_01.txt AC 3 ms 3560 KB
sample_02.txt AC 6 ms 3496 KB