ps | |
---|---|
링크 | acmicpc.net/… |
출처 | BOJ |
문제 번호 | 33915 |
문제명 | 불꽃놀이의 아름다움 2 |
레벨 | 골드 4 |
분류 |
그래프 |
시간복잡도 | O(n) |
인풋사이즈 | n<=200000 |
사용한 언어 | Python 3.13 |
제출기록 | 68872KB / 364ms |
최고기록 | 362ms |
해결날짜 | 2025/05/20 |
"""Solution code for "BOJ 33915. 불꽃놀이의 아름다움 2".
- Problem link: https://www.acmicpc.net/problem/33915
- Solution link: http://www.teferi.net/ps/problems/boj/33915
Tags: [bi-coloring]
"""
import sys
from teflib import graph as tgraph
def main():
N = int(sys.stdin.readline())
graph = tgraph.create_graph_from_input(N, N)
print('2' if tgraph.is_bipartite(graph) else '3')
if __name__ == '__main__':
main()