[백준 15719번] 중복된 숫자 (C++)
문제링크 : https://www.acmicpc.net/problem/15719#include using namespace std;int arr[10000001];int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N; cin >> N; while(N--) { int n; cin >> n; if(arr[n]) { cout 중복된 값을 체크하는 것이기에 이미 입력받은 값에 대해 처리된 경우가 있다면 바로 해당 n을 출력하고 종료한다.n의 값이 크기 때문에 map으로 할 경우 시간초과가 발생한다. (10000000 * log(10000000))
백준/실버
2025. 7. 5. 19:56