일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 1174
- N번째큰수
- C++
- 20117
- 투포인터 #백준 #boj #20922 #22862
- 최소 #공배수 #최대 #공약수 #유클리드 #호제법 #lcm #gcd #c++ #boj #3343 #백준 #장미
- 좌표압축
- 쌤쌤쌤
- 3343
- 2075
- 이분탐색 #dp #11053
- 18870
- 3D #Reconstruction #computer #vision #volume #metric #tsdf #kinect #fusion
- 호반우 상인
- backtracking #codetree #디버깅 #삼성코테
- 서울앵무새
- c++ #입출력 #속도 #ios #sync_with_stdio #cin #cout #tie
- 레드아보
- LIS #가장긴증가하는부분수열 #
- 백준
- boj #백준
- c++ #boj #
- 코딩
- 16202
- 진법변환 #2to10 #10to2 #이진법 #십진법 #변환 #bitset #c++
- 백준 #다익스트라 #dijkstra #9370 #c++
- graph #최단경로
- BOJ
- 줄어드는수
- 논문리뷰 #3DReconstruction
- Today
- Total
목록알고리즘 연습/백준 (68)
hyunjin
https://www.acmicpc.net/problem/17248 17248번: 물리 공부 A 자동차는 20m/s로, B 자동차는 60m/s로 달리고 있을 때 A의 속도가 크기 2의 가속도에 의해 1초에 22m/s, 2초에 26m/s, 3초에 32m/s ... 로 증가 하게 되어서 A의 속도가 6초에 62m/s가 된다. www.acmicpc.net 경북대 2019 프로그래밍 경시대회 문제 문제 풀이 단순 수학 계산 문제다. 소스 코드 #include using namespace std; int X,Y,Z; float answer; void Input(){ cin>>X>>Y>>Z; } void Solution(){ answer = (-1*Z + sqrt( Z*Z - 4 *Z*(2*X - 2 * Y ) )..
백준 1260 소스 코드 #include #define MAX 1001 using namespace std; void BFS(int s , vector g[], bool visit[]){ queue q; q.push(s); visit[s]=true; while( !q.empty() ){ int current = q.front(),next; q.pop(); cout
소수 찾기 백준 소수 찾기 1978 소스 코드 #include using namespace std; int main(){ int n,num,ans; cin>>n; ans = n; while(n-- ){ cin>>num; if(num
10진 -> n 진법 백준11005 소스코드 #include using namespace std; int main(){ int n,b; string ans; cin>> n>>b; while(n>0){ char c = (n%b)s >>n; cout>n; int len = n.size(); if( len %3 == 1) cout=0){ ans += '1'; tmp -=2; } else ans += '0'; if(tmp-1>=0){ ans += '1'; tmp -=1; } else ans += '0'; (i==0) ? cout
백준 2609 최대공약수 최소공배수 소스 코드 직접 구현 #include using namespace std; int GCD(int a,int b){ return b? GCD(b,a%b) : a; } int main(){ int a,b,g; scanf("%d %d",&a,&b); g = (a>b) ? GCD(a,b) : GCD(b,a); printf("%d\n%d",g,a*b/g); return 0; } gcd 라이브러리 사용 int main(){ int a,b; cin>>a>>b; cout B, cout
백준 10430 바로가기 문제 자체는 쉽지만 다음에 풀 문제들을 위해 유클리드 호제법과 함께 같이 기록해놓는다. 소스코드 #include using namespace std; int main(){ int a,b,c; scanf("%d %d %d",&a,&b,&c); printf("%d\n%d\n%d\n%d", (a+b)%c, ((a%c)+(b%c))%c, (a*b)%c, ((a%c)*(b%c))%c ); return 0; } 유클리드 호제법이란? 두 수의 최대 공약수를 구하는 알고리즘의 하나. 2개 자연수 a, b ( a > b )에 대해 a를 b로 나눈 나머지를 r이라 하면, a와 b의 최대공약수는 b와 r의 최대공약수와 같다. 또 다시 b , r 에 대해 b를 r로 나눈 나머지 r' 을 가지고 위의 ..
백준 알파벳 개수 10808 소스 코드 - 소문자 아스키 #include using namespace std; int main(){ int i=0,alpha[26]={0,}; string word; cin>>word; //for(cin>>word ; word[i] ;) alpha[ word[i++]-'a']++; // 위에 이렇게도 가능 for(auto c : word)alpha[c-'a']++; for(auto e : alpha) cout
백준 10809 바로가기 문자열을 입력받고 각 문자에 각 알파벳에 대해 문자열에서 처음 나오는 위치를 출력하는 문제다. 위치 찾는 방법을 find 활용해서 풀어보자. 소스코드1 #include using namespace std; int main(){ string w; cin>>w; // 기본 풀이 int a[26]; memset(a,-1,sizeof(a)); for(int i = -1; w[++i] ;) if(a[w[i]-'a'] < 0) a[w[i]-'a'] = i; for(auto e : a) cout