You are viewing a single comment's thread. Return to all comments →
import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int[] file = new int[n]; for(int file_i=0; file_i < n; file_i++){ file[file_i] = in.nextInt(); } int j=0; int count=0; while(j<file.length){ for(int i = file[j];i>=0;i--){ j++; } count++; } System.out.println(count); } }
Seems like cookies are disabled on this browser, please enable them to open this website
Recover the Arrays
You are viewing a single comment's thread. Return to all comments →