From 1fc881f55a36873a0ad3ce747fb6040f6ebc70fa Mon Sep 17 00:00:00 2001 From: sh0723 Date: Sun, 24 May 2026 17:33:54 +0900 Subject: [PATCH] 4375 : 1 solve --- src/week1/BOJ4375/BOJ4375_V1.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/week1/BOJ4375/BOJ4375_V1.cpp diff --git a/src/week1/BOJ4375/BOJ4375_V1.cpp b/src/week1/BOJ4375/BOJ4375_V1.cpp new file mode 100644 index 0000000..a282972 --- /dev/null +++ b/src/week1/BOJ4375/BOJ4375_V1.cpp @@ -0,0 +1,31 @@ +#include +using namespace std; +typedef long long ll; +int main() { + ios_base::sync_with_stdio(false); + cin.tie(NULL); + cout.tie(NULL); + + int n; + + + while (scanf("%d", &n) != EOF) { + int cnt = 1; + ll ret = 1; + while(true) { + if (ret % n == 0) { + cout << cnt << "\n"; + break; + } else { + ret = (ret * 10) + 1; + ret %= n; + cnt++; + } + } + } + + + + + return 0; +} \ No newline at end of file