반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- softeer
- 오퍼레터
- 물채우기
- dfs
- 성적평가
- 매개변수탐색
- 퇴사통보
- incr
- 경력
- 파라메트릭
- OFFSET
- boj #19237 #어른 상어
- BFS
- compose
- @P0
- 백준
- 연결요소
- 6987
- 소프티어
- msSQL
- 기술면접
- 이분탐색
- BOJ
- 처우협의
- upper_bound
- 백트래킹
- Kafka
- 처우산정
- Docker
- 13908
Archives
- Today
- Total
기술 블로그
6679번 싱기한 네자리 숫자 본문
728x90
반응형
https://www.acmicpc.net/problem/6679
글제목은 오타 아닙니다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | #include <iostream> #include <queue> #include <stack> #include <cstdio> #include <vector> #include <cstring> #include <string> #include <math.h> #include <algorithm> #include <map> using namespace std; bool visit[10001] = { false, }; int twelve(int n) { int ret = 0; while (n != 0) { ret += n % 12; n /= 12; } return ret; } int sixteen(int n) { int ret = 0; while (n != 0) { ret += n % 16; n /= 16; } return ret; } void four() { for (int i = 2992; i < 10000; i++) { int one = i % 10; int ten = (i / 10) % 10; int hun = (i / 100) % 10; int tho = (i / 1000) % 10; int sum = one + ten + hun + tho; if (sum == twelve(i) && sum == sixteen(i)) { visit[i] = true; } } } int main(void) { four(); for (int i = 2992; i < 10000; i++) { if (visit[i]) printf("%d\n", i); } return 0; } | cs |
728x90
반응형
'알고리즘 문제 > BOJ' 카테고리의 다른 글
10451번 순열 사이클 (0) | 2018.12.03 |
---|---|
6378번 디지털 루트 (0) | 2018.12.03 |
3460번 이진수 (0) | 2018.12.03 |
10101번 삼각형 외우기 (0) | 2018.11.29 |
10819번 차이를 최대로 (0) | 2018.11.29 |