일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 다이나믹 프로그래밍
- 브루트 포스
- heap
- 수학
- 문자열 처리
- 연결리스트
- 포맷스트링버그
- RTL
- tcache
- 완전 탐색
- 에라토스테네스의 체
- House of Orange
- 동적 계획법
- fsb
- DFS
- BFS
- 이진트리
- 스택
- BOF
- 백트래킹
- 이분 탐색
- 투 포인터
- 큐
- off by one
- ROP
- OOB
- 이진 탐색
- 스위핑 알고리즘
- syscall
- 분할 정복
Archives
- Today
- Total
SDJ( 수돈재 아님 ㅎ )
[C++] 17011 - Cold Compress 본문
문제 링크 : https://www.acmicpc.net/problem/17011
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
|
#include<iostream>
#include<algorithm>
#include<cstring>
#define endl '\n'
using namespace std;
int main(void)
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;
char *p = NULL;
int q;
char S[81];
cin >> n;
while(n--)
{
cin >> S;
for(p = S+1, q = 1; p < S + strlen(S)+1; ++p, ++q)
{
if(*p != *(p-1))
{
cout << q << ' ' << *(p-1) << ' ';
q = 0;
}
}
cout << endl;
memset(S, 0, sizeof(S));
}
return 0;
}
|
'알고리즘 > Backjoon' 카테고리의 다른 글
[C++] 17013 - Flipper (0) | 2020.01.09 |
---|---|
[C++] 17014 - Pretty Average Primes (0) | 2020.01.09 |
[C++] 2659 - 십자카드 문제 (0) | 2020.01.09 |
[C++] 1074 - Z (0) | 2020.01.09 |
[C++] 1987 - 알파벳 (0) | 2020.01.07 |
Comments