Notice
Recent Posts
Recent Comments
- Today
- Total
01-26 01:17
Tags
- Graph
- ๋ฐ์ดํฐ๋ฒ ์ด์ค
- CS
- database
- ์กธ์ ์ํ
- MST
- ๊ตฌํ
- ๋ฐฑ์ค
- leetcode
- BFS
- spring
- ๋ฒจ๋งํฌ๋
- Algorithm
- ๋ค์ต์คํธ๋ผ
- PS
- OOP
- ๊ทธ๋ฆฌ๋
- dp
- ์์์ ๋ ฌ
- ์๋ฐ์์ ์
- tree
- java
- ์ธํด
- array
- ์๋ฃ๊ตฌ์กฐ
- ๋ฐฑ์๋
- ๋ฌธ๋ฒ
- pytorch
- ์๋ฐ
- ํ๋ก๊ทธ๋๋จธ์ค
Link
Partially Committed
[์๊ฐ ์ฝ๋ ์ฑ๋ฆฐ์ง ์์ฆ3] ๋๋จธ์ง๊ฐ 1์ด ๋๋ ์ ์ฐพ๊ธฐ ๋ณธ๋ฌธ
๐ฅ Algorithm || ๋ฌธ์ ํ์ด/PS
[์๊ฐ ์ฝ๋ ์ฑ๋ฆฐ์ง ์์ฆ3] ๋๋จธ์ง๊ฐ 1์ด ๋๋ ์ ์ฐพ๊ธฐ
WonderJay 2022. 7. 5. 16:42728x90
๋ฐ์ํ
SMALL
https://school.programmers.co.kr/learn/courses/30/lessons/87389
์ฃผ์ด์ง ์์ฐ์๋ฅผ ๋๋์์๋ ๋๋จธ์ง๊ฐ 1์ด ๋๋๋ก ํ๋ ๊ฐ์ฅ ์์ ์ X ๋ฅผ ๋ฐํํ๋ค.
[C++]
#include <bits/stdc++.h>
#define fastio cin.tie(0)->sync_with_stdio(0)
using namespace std;
int solution(int n) {
fastio;
int answer = 0;
for (int i = 1; i <= n; i++)
{
if (n % i == 1)
{
answer = i;
break;
}
}
return answer;
}
728x90
๋ฐ์ํ
LIST
'๐ฅ Algorithm || ๋ฌธ์ ํ์ด > PS' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[2018 KAKAO BLIND RECRUITMENT] (1์ฐจ) ๋น๋ฐ์ง๋ (0) | 2022.07.05 |
---|---|
[์ํด๋ฆฌ ์ฑ๋ฆฐ์ง] ๋ถ์กฑํ ๊ธ์ก ๊ณ์ฐํ๊ธฐ (0) | 2022.07.05 |
[์ํด๋ฆฌ ์ฑ๋ฆฐ์ง] ์ต์์ง์ฌ๊ฐํ (0) | 2022.07.04 |
[ํ๋ก๊ทธ๋๋จธ์ค] 2016๋ (0) | 2022.07.04 |
[์๊ฐ ์ฝ๋ ์ฑ๋ฆฐ์ง ์์ฆ1] ๋ ๊ฐ ๋ฝ์์ ๋ํ๊ธฐ (0) | 2022.07.04 |
Comments