답안 #124420

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
124420 2019-07-03T10:17:11 Z KhalilBenGamra 이상한 기계 (APIO19_strange_device) Java 11
컴파일 오류
0 ms 0 KB
import java.util.*;
import java.io.*;
public class strangeDevice {

	public static void main(String[] args)  throws IOException
	 { 
		 Scanner scan = new Scanner(System.in);
		 PrintWriter out=new PrintWriter(System.out);
		 int n = scan.nextInt();
		 int a = scan.nextInt();
		 int b = scan.nextInt();
		 int count = 0;
		 Set<String> found = new HashSet<String>();
		 for (int i = 0; i < n; i++) {
			 int f = scan.nextInt();
			 int l = scan.nextInt();
			 for (int j = f; j <= l; j++) {
				String xy = ((j+(int)Math.floor(j/b))%a)+ " " +( j % b);
				//System.out.println("("+x+","+y+")");
				found.add(xy);
				}
			}
		 out.println(found.size());
		 out.close();
	 }
}

Compilation message

strange_device.java:3: error: class strangeDevice is public, should be declared in a file named strangeDevice.java
public class strangeDevice {
       ^
1 error