๋ฐ์ํ
https://codeforces.com/problemset/problem/1191/A
์ฝ๋
import java.util.Scanner;
public class A1191 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int x = scan.nextInt();
if(x%4 == 0)
System.out.println("1 A");
else if(x%4 == 1)
System.out.println("0 A");
else if(x%4 == 2)
System.out.println("1 B");
else
System.out.println("2 A");
scan.close();
}
}
ํ์ด
๊ฒฝ์ฐ์ ์๊ฐ 4๊ฐ๋ฐ์ ์์ผ๋ฏ๋ก, ๊ฐ๊ฐ์ ์ผ์ด์ค์ ๋ง๊ฒ ์ถ๋ ฅํด์ฃผ๋ฉด ๋๋ค.
A - 4๋ก ๋๋ด์๋ ๋๋จธ์ง 1
B - 4๋ก ๋๋ด์๋ ๋๋จธ์ง 3
C - 4๋ก ๋๋ด์๋ ๋๋จธ์ง 2
D - 4๋ก ๋๋ด์๋ ๋๋จธ์ง 0
HP์ ์ต๋๊ฐ์ A>B>C>D ์ด๋ฏ๋ก A์ ๊ฐ๊น๊ฒ ์ต๋ํ ๋ง์ถฐ์ฃผ๋ฉด ๋๋ค.
๋ฐ์ํ
'Algorithm' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
ํ๋ก๊ทธ๋๋จธ์ค[Java] - (Level2)์ ๋ง๋๊ธฐ(์คํ/ํ) (0) | 2020.03.25 |
---|---|
[๋ฐฑ์ค] 1966๋ฒ: ํ๋ฆฐํฐ ํ(๊ตฌํ, ํ) (0) | 2020.03.24 |
[๋ฐฑ์ค] 13904๋ฒ: ๊ณผ์ (๊ทธ๋ฆฌ๋) (0) | 2020.03.22 |
[Codeforces] 1300A: Non-zero (0) | 2020.03.21 |
ํ๋ก๊ทธ๋๋จธ์ค[Java] - (Level2)๋ ๋งต๊ฒ(Heap) (0) | 2020.03.20 |
๋๊ธ