题解 | #俄罗斯方块#

俄罗斯方块

http://www.nowcoder.com/practice/9407e24a70b04fedba4ab3bd3ae29704

import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] arr = new int[n + 1];
        for(int i = 0; i < m; i++) {
            arr[sc.nextInt()]++;
        }
        int min = arr[1];
        for(int i = 2; i <= n; i++) {
            min = Math.min(arr[i], min);
        }
        System.out.println(min);
    }
}
全部评论

相关推荐

野猪不是猪🐗:我assume that你must技术aspect是solid的,temperament也挺good的,however面试不太serious,generally会feel style上不够sharp
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务