Submission #659145

#TimeUsernameProblemLanguageResultExecution timeMemory
659145zhing_zhouTimovi (COCI18_timovi)Java
Compilation error
0 ms0 KiB
import java.util.*; public class JuniorPrelims1 { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(), k = sc.nextInt(), m = sc.nextInt(); int var1 = m / (2 * n * k); int a[] = new int[n]; for(int i = 0; i < n; i++) { a[i] = (2 * k) * var1; } m -= (2 * n * k) * var1; int dir = 1, pos = 0; while(m != 0) { a[pos] += Math.min(k, m); m -= Math.min(m, k); pos += dir; if(pos == n) { dir = -1; pos += dir; pos += dir; } } for(int i = 0; i < n; i++) { System.out.print(a[i] + " "); } System.out.println(); } }

Compilation message (stderr)

timovi.java:2: error: class JuniorPrelims1 is public, should be declared in a file named JuniorPrelims1.java
public class JuniorPrelims1
       ^
1 error