[알고리즘] 백준 2526 - 싸이클 (C++) [문제 링크] : https://www.acmicpc.net/problem/2526#include using namespace std;int N, P, tmp, cnt=1;int Arr[1001]; int main(){ cin >> N >> P; tmp = N; while(!Arr[tmp]){ Arr[tmp] = cnt++; tmp = tmp * N % P; } cout 알고리즘 2024.10.21