MCPcopy Create free account
hub / github.com/E869120/math-algorithm-book / Main

Class Main

editorial/chap5-2/prob5-2-2.java:3–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1import java.util.*;
2
3class Main {
4 public static void main(String[] args) {
5 // 入力
6 Scanner sc = new Scanner(System.in);
7 long N = sc.nextLong();
8
9 // N = 2^k-1 の形で表されるかどうか調べる
10 boolean flag = false;
11 for (int i = 1; i <= 60; i++) {
12 if (N == (1L << i) - 1) {
13 flag = true;
14 }
15 }
16
17 // 出力
18 if (flag == true) System.out.println("Second");
19 else System.out.println("First");
20 }
21}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected