Submission #1133504

#TimeUsernameProblemLanguageResultExecution timeMemory
1133504chanononJob Scheduling (CEOI12_jobs)Java
Compilation error
0 ms0 KiB
import java.util.Scanner; import java.util.Arrays; public class oi { static int a=0; static int b=0; static int c=0; static int []m; public static void main(String args[]) { Scanner in=new Scanner(System.in); int in1= in.nextInt(); int in2= in.nextInt(); int in3= in.nextInt(); m=new int[in3]; for(int i=0;i<in3;i++){ m[i]=in.nextInt(); } int[] m1 = Arrays.copyOf(m, m.length); Arrays.sort(m1); a=in1; b=in2; c=in3; int []m3=new int[in3]; for(int i=0;i<in3;i++){ m3[i]=sort(m1[i]); } int l=0; int r=in3-1; while(l<r){ int mid=(l+r)/2; if(check(m,mid)==false){ l=1+mid; } else{ r=mid; } } System.out.println(l); } public static boolean check(int []x,int num1){ Arrays.sort(x); for(int i=0;i<c;i++){ x[i]+=b; } for(int i=0;i<c;i++){ x[i]-=(i+num1)/num1; if(i==c-1&&(i+num1)/num1>a){ return false; } } for(int i=0;i<c;i++){ if(x[i]<0){ return false; } } return true; } public static int sort(int o){ for(int i=0;i<c;i++){ if(o==m[i]){ m[i]=-1; return m[i]; } } return 0; } }

Compilation message (stderr)

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

=======