Submission #19723754


Source Code Expand

Copy
#include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
using namespace atcoder;
#define rep(i,n) for(int i=0;i<=n;i++)
int num;
bool judge(int tg,int st){
  bool ok=true;
  int x=tg;
    //判定
    while(x){
      if(x%st==7) ok=false;
      x/=st;
    }
  return ok;
}

int main(void){
  cin>>num;
  int ans=0;
  int DEC=10;
  int OCT=8;
for(int i=1;i<=num;i++){
  bool ok1=true;
  bool ok2=true; 
  ok1=judge(i,DEC);
  ok2=judge(i,OCT);
  if(ok1==true && ok2==true) ans++;
}
 
cout<<ans<<endl;
}

Submission Info

Submission Time
Task C - Unlucky 7
User Colted
Language C++ (GCC 9.2.1)
Score 300
Code Size 542 Byte
Status AC
Exec Time 7 ms
Memory 3648 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 6 ms 3508 KB
hand_02.txt AC 5 ms 3620 KB
hand_03.txt AC 7 ms 3596 KB
random_01.txt AC 3 ms 3508 KB
random_02.txt AC 2 ms 3544 KB
random_03.txt AC 4 ms 3612 KB
random_04.txt AC 4 ms 3620 KB
random_05.txt AC 3 ms 3508 KB
random_06.txt AC 3 ms 3544 KB
random_07.txt AC 3 ms 3612 KB
random_08.txt AC 4 ms 3440 KB
random_09.txt AC 3 ms 3436 KB
random_10.txt AC 3 ms 3600 KB
random_11.txt AC 2 ms 3628 KB
random_12.txt AC 4 ms 3644 KB
random_13.txt AC 3 ms 3508 KB
random_14.txt AC 2 ms 3620 KB
random_15.txt AC 5 ms 3616 KB
sample_01.txt AC 3 ms 3508 KB
sample_02.txt AC 4 ms 3648 KB