hihoCoder太阁最新面经算法竞赛6 register

Ended

Participants:104

Verdict:Accepted
Score:100 / 100
Submitted:2016-06-28 22:11:20

Lang:Java

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import java.util.Arrays;
import java.util.Scanner;
public class Main
{
    private static long gcd(long a , long b)
    {
        while (b > 0)
        {
            long t = a;
            a = b;
            b = t % a;
        }
        return a;
    }
    
    private static long lcm(long a , long b)
    {
        return a / gcd(a , b* b;
    }
    
    public static void main(String[] argsthrows Exception
    {
        int[] pattern = new int[200];
        int i , j , n;
        long ans = 1;
        Scanner scan = new Scanner(System.in);
        n = scan.nextInt();
        for (i = 1;i <= n;i ++)
            pattern[i= scan.nextInt();
        for (i = 1;i <= n;i ++)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX