백준 알고리즘 1436번 : 영화감독 숌

Zoo Da·2021년 11월 28일
0

백준 알고리즘

목록 보기
267/337
post-thumbnail

링크

https://www.acmicpc.net/problem/1436

sol1) 브루트 포스

#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#define fastio ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define int int64_t
using namespace std;

int Sol(int n){
  for(int i = 666; ; i++){
    if(to_string(i).find("666") != -1) n--;
    if(!n) return i;
  }
}

int32_t main() {
  fastio;
  int n; cin >> n;
  cout << Sol(n) << "\n";
}
profile
메모장 겸 블로그

0개의 댓글