목록Baekjoon (38)
T-coding
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/bOx9hU/btr34byajR2/sQKYTkRGXxTSU1SkT8bNh1/img.png)
https://www.acmicpc.net/problem/4659 4659번: 비밀번호 발음하기 좋은 패스워드를 만드는것은 어려운 일이다. 대부분의 사용자들은 buddy처럼 발음하기 좋고 기억하기 쉬운 패스워드를 원하나, 이런 패스워드들은 보안의 문제가 발생한다. 어떤 사이트들은 xvtp www.acmicpc.net 풀이 더보기 vowel = ['a', 'e', 'i', 'o', 'u'] while True: s = input() if s == "end": break v_cnt = 0 v_repeat, c_repeat = 0, 0 last = '' flag = True for i in s: if i in vowel: if v_repeat == 2 or ((i != 'e' and i != 'o') and ..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/QvKOD/btrqGbI2qAh/2IO7ZhJf8w1WZkuN14VKi0/img.png)
더보기 더보기 #include #include int check[10]; int main() { int n, m,a,ans; scanf("%d%d", &n, &m); ans = 500000; for (int i = 0; i abs(100 - n)) ans = abs(100 - n); printf("%d", ans); }
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/dvpFCf/btrqAV1vL82/7Io7JkMKnR76RqP107hxsk/img.png)
더보기 더보기 #include using namespace std; int n, m; int gcd(int x, int y) { if (x == 0) return y; else return gcd(y % x, x); } int main() { scanf("%d%d", &n, &m); printf("%d", m - gcd(n, m)); }
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/uA8Er/btrqGUmvnTg/jbq7Y6XlD2xMn4t3rBViT1/img.png)
더보기 #include #include #include using namespace std; #define MAX 55 string s; int visited[MAX]; stack st; int func(int start, int end) { int result = 0; for (int i = start; i > s; for (int i = 0; i < s.length(); i++) { i..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/psb4b/btrqGTA7Z6Z/ZfX4Fz7yPwH5CDmU9BdES1/img.png)
더보기 #include #include #include using namespace std; int gcd(int x, int y) { while (y) { int t = x % y; x = y; y = t; } return x; } int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n; cin >> n; vectorarr(n); for (int i = 0; i > arr[i]; sort(arr.begin(), arr.end()); vectortmp; for (int i = 1; i < n; i++) tmp.push_back(arr[i] - arr[i - 1]); int res = tmp[0..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/wboKf/btrqAUhjVS5/ae4K3LeMoAe7GzQBVbRkl0/img.png)
더보기 #include #include #include #include using namespace std; #define INF 1e9 int n,m; int start; vector v[20001]; vector dijkstra(int start) { vectordist(n + 1, INF); priority_queuepq; dist[start] = 0; pq.push({ 0,start }); while (!pq.empty()) { int cost = -pq.top().first; int now = pq.top().second; pq.pop(); if (dist[now] < cost) continue; for (auto& next : v[now]) { int nv = next.first;..