Created
July 15, 2011 07:58
-
-
Save 6LYTH3/1084281 to your computer and use it in GitHub Desktop.
git clone - FakeTickets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main; | |
import java.io.File; | |
import java.util.Scanner; | |
public class Fake { | |
public static void main(String[] args) throws Throwable { | |
File file = new File("txt"); | |
Scanner scan = new Scanner(file); | |
int N, M, c; | |
while (true) { | |
N = scan.nextInt(); | |
M = scan.nextInt(); | |
if ((N < 1 || N >= 1000) || (M < 1 || M >= 1000)) | |
break; | |
int num[] = new int[N]; | |
for (int i = 0; i < M; i++) | |
num[scan.nextInt() - 1]++; | |
c = 0; | |
for (int i = 0; i < N; i++) | |
if (num[i] > 1) | |
c++; | |
System.out.println(c); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment