전체 글(334)
-
[BOJ] 1158번 : 요세푸스
1. problem : https://www.acmicpc.net/problem/1158 2. solution 1 :from collections import dequeN,K = map(int,input().split())deq = deque([i+1 for i in range(N)])count = 0 result = []while deq: count += 1 if count == K: result.append(deq.popleft()) count = 0 else: deq.append(deq.popleft())print('')deque을 이용한 풀이 3. solution 2 :#include using namespace std;int main(v..
2024.08.06 -
chatGPT 사람인지 계속 물어보는 오류
1. 비정상적인 traffic 감지 or 네트워크 불안정이 두 가지 이유 때문에 오류가 났던 것 같다. 2. 해결법핫스폿으로 연결했을 때는 정상적으로 작동하여, 와이파이 문제라는 것을 알았다. 와이파이 선을 다시 꼽고, 전원을 off --> on 시켜보니 정상적으로 작동했다. https://help.openai.com/en/articles/9047888-why-am-i-getting-our-systems-have-detected-unusual-acti vity-from-your-system
2024.08.06 -
[BOJ] 5397번 : 키로거
1. problem : https://www.acmicpc.net/problem/5397 2. solution 1 : #include using namespace std;int main(void) { ios::sync_with_stdio(0); cin.tie(0); int testCase; cin >> testCase; while (testCase--) { list L = {}; auto cursor = L.begin(); string init; cin >> init; for (auto c : init) { if (c == '') { if (cursor != L.end..
2024.08.05 -
[BOJ] 1406: 에디터
1. problem :https://www.acmicpc.net/problem/1406 2. solution 1 :import sysinput = sys.stdin.readclass Node: def __init__(self, val): self.val = val self.next = None self.prev = Noneclass DoublyLinkedList: def __init__(self): dummy_node = Node(0) self.head = dummy_node self.tail = dummy_node def erase(self, current_node): if current_no..
2024.08.05 -
[Boj]1919: 애너그램 만들기
1. problem : https://www.acmicpc.net/problem/1919 2. solution 1 :#include using namespace std;int main(void) { ios::sync_with_stdio(0); cin.tie(0); int a[26] = {}; string str1, str2; cin >> str1 >> str2; for (auto c : str1) a[c - 'a']++; for (auto c : str2) a[c - 'a']--; int ans = 0; for (int i : a) { ans += abs(i); } cout
2024.08.04 -
[Boj]11326:Strfry
1. problem : https://www.acmicpc.net/problem/11328 2. solution 1 :#include using namespace std;int main(void) { ios::sync_with_stdio(0); cin.tie(0); int N; cin >> N; while (N--) { int a[26] = {}; string s1, s2; cin >> s1 >> s2; for (auto c : s1) a[c - 'a']++; for (auto c : s2) a[c - 'a']--; bool isPossible = true; for (int i : a) { if (i != 0) { isPossible = false; } } if (isP..
2024.08.04