node_ids
listlengths
4
1.4k
edge_index
listlengths
1
2.22k
text
listlengths
4
1.4k
source
stringlengths
14
427k
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 38, 5, 13, 30, 30, 41, 13, 20, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 18, 13, 41, 13, 18, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 13, 18, 13, 13, 0, 13, 2, 13, 18, 13, 13, 14, 2, 18, 13, 13, 13, 0, 13, 18, 13, 13, 4, 18, 13, 13, 4, 18, 13, 4, 18, 13, 23, 13, 6, 13, 41, 13, 2, 17, 17, 41, 13, 41, 13, 41, 13, 41, 13, 12, 13, 30, 0, 13, 20, 0, 13, 20, 13, 0, 13, 0, 13, 17, 12, 13, 30, 0, 13, 20, 0, 13, 20, 13, 0, 13, 0, 13, 17, 23, 13, 12, 13, 30, 41, 13, 20, 17, 41, 13, 17, 41, 13, 42, 2, 0, 13, 4, 13, 40, 17, 30, 14, 2, 13, 17, 3, 0, 18, 13, 40, 13, 13, 29, 20, 12, 13, 30, 41, 13, 17, 41, 13, 4, 13, 42, 2, 13, 17, 0, 13, 4, 13, 41, 13, 2, 13, 17, 14, 13, 0, 13, 4, 13, 42, 2, 2, 0, 13, 4, 13, 17, 2, 13, 17, 30, 0, 13, 2, 2, 2, 13, 17, 13, 17, 14, 13, 29, 40, 13, 29, 13, 12, 13, 30, 41, 13, 17, 41, 13, 4, 13, 42, 2, 13, 17, 0, 13, 4, 13, 41, 13, 2, 13, 17, 14, 13, 0, 13, 4, 13, 42, 2, 2, 0, 13, 4, 13, 17, 2, 13, 17, 30, 0, 13, 2, 2, 2, 13, 17, 13, 17, 14, 13, 29, 40, 13, 29, 13, 12, 13, 30, 41, 13, 17, 41, 13, 17, 41, 13, 4, 13, 42, 2, 13, 17, 0, 13, 4, 13, 41, 13, 2, 13, 17, 14, 13, 0, 13, 4, 13, 42, 2, 2, 0, 13, 4, 13, 17, 2, 13, 17, 30, 0, 13, 2, 2, 2, 13, 17, 13, 17, 14, 2, 13, 17, 30, 42, 2, 2, 0, 13, 4, 13, 17, 2, 13, 17, 30, 0, 13, 2, 2, 13, 17, 0, 13, 17, 14, 13, 29, 40, 13, 29, 13, 12, 13, 30, 0, 13, 4, 18, 13, 13, 0, 13, 17, 13, 14, 2, 13, 40, 17, 0, 18, 13, 17, 40, 17, 12, 13, 30, 14, 2, 13, 13, 4, 13, 29, 18, 13, 40, 13, 12, 13, 30, 14, 2, 13, 17, 29, 4, 18, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 442, 11 ], [ 442, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 16, 17 ], [ 16, 18 ], [ 15, 19 ], [ 19, 20 ], [ 20, 21 ], [ 20, 22 ], [ 19, 23 ], [ 23, 24 ], [ 23, 25 ], [ 19, 26 ], [ 26, 27 ], [ 26, 28 ], [ 28, 29 ], [ 29, 30 ], [ 19, 31 ], [ 31, 32 ], [ 31, 33 ], [ 19, 35 ], [ 35, 36 ], [ 35, 37 ], [ 19, 38 ], [ 38, 39 ], [ 39, 40 ], [ 40, 41 ], [ 40, 42 ], [ 38, 43 ], [ 43, 44 ], [ 43, 45 ], [ 38, 46 ], [ 46, 47 ], [ 47, 48 ], [ 38, 49 ], [ 49, 50 ], [ 50, 51 ], [ 51, 52 ], [ 51, 53 ], [ 50, 54 ], [ 54, 55 ], [ 55, 56 ], [ 19, 57 ], [ 57, 58 ], [ 57, 59 ], [ 59, 60 ], [ 59, 61 ], [ 19, 62 ], [ 62, 63 ], [ 63, 64 ], [ 64, 65 ], [ 64, 66 ], [ 62, 67 ], [ 67, 68 ], [ 67, 69 ], [ 62, 70 ], [ 70, 71 ], [ 71, 72 ], [ 62, 73 ], [ 74, 74 ], [ 74, 75 ], [ 75, 76 ], [ 76, 77 ], [ 76, 78 ], [ 78, 79 ], [ 78, 80 ], [ 75, 81 ], [ 81, 82 ], [ 81, 83 ], [ 83, 84 ], [ 83, 85 ], [ 85, 86 ], [ 85, 87 ], [ 74, 88 ], [ 88, 89 ], [ 89, 90 ], [ 90, 91 ], [ 90, 92 ], [ 89, 93 ], [ 88, 94 ], [ 94, 95 ], [ 94, 96 ], [ 96, 97 ], [ 96, 98 ], [ 19, 99 ], [ 99, 100 ], [ 100, 101 ], [ 99, 102 ], [ 19, 103 ], [ 103, 104 ], [ 104, 105 ], [ 19, 106 ], [ 106, 107 ], [ 107, 108 ], [ 12, 109 ], [ 109, 110 ], [ 442, 111 ], [ 111, 112 ], [ 111, 113 ], [ 113, 114 ], [ 113, 115 ], [ 115, 116 ], [ 115, 117 ], [ 111, 118 ], [ 118, 119 ], [ 111, 120 ], [ 120, 121 ], [ 111, 122 ], [ 122, 123 ], [ 111, 124 ], [ 124, 125 ], [ 111, 126 ], [ 126, 127 ], [ 126, 128 ], [ 128, 129 ], [ 129, 130 ], [ 129, 131 ], [ 128, 132 ], [ 132, 133 ], [ 132, 134 ], [ 128, 136 ], [ 136, 137 ], [ 136, 138 ], [ 138, 139 ], [ 138, 140 ], [ 111, 141 ], [ 141, 142 ], [ 141, 143 ], [ 143, 144 ], [ 144, 145 ], [ 144, 146 ], [ 143, 147 ], [ 147, 148 ], [ 147, 149 ], [ 143, 151 ], [ 151, 152 ], [ 151, 153 ], [ 153, 154 ], [ 153, 155 ], [ 141, 156 ], [ 156, 157 ], [ 111, 158 ], [ 158, 159 ], [ 158, 160 ], [ 160, 161 ], [ 161, 162 ], [ 161, 163 ], [ 160, 165 ], [ 165, 166 ], [ 165, 167 ], [ 160, 168 ], [ 168, 169 ], [ 160, 170 ], [ 170, 171 ], [ 171, 172 ], [ 172, 173 ], [ 172, 174 ], [ 174, 175 ], [ 171, 176 ], [ 176, 177 ], [ 170, 178 ], [ 178, 179 ], [ 179, 180 ], [ 180, 181 ], [ 180, 182 ], [ 179, 183 ], [ 178, 184 ], [ 184, 185 ], [ 185, 186 ], [ 185, 187 ], [ 187, 188 ], [ 184, 189 ], [ 160, 190 ], [ 190, 191 ], [ 111, 192 ], [ 192, 193 ], [ 192, 194 ], [ 194, 195 ], [ 195, 196 ], [ 195, 197 ], [ 194, 198 ], [ 198, 199 ], [ 198, 200 ], [ 200, 201 ], [ 194, 202 ], [ 202, 203 ], [ 203, 204 ], [ 203, 205 ], [ 202, 206 ], [ 206, 207 ], [ 206, 208 ], [ 208, 209 ], [ 194, 210 ], [ 210, 211 ], [ 210, 212 ], [ 212, 213 ], [ 212, 214 ], [ 194, 215 ], [ 215, 216 ], [ 215, 217 ], [ 217, 218 ], [ 217, 219 ], [ 219, 220 ], [ 194, 221 ], [ 221, 222 ], [ 222, 223 ], [ 223, 224 ], [ 224, 225 ], [ 224, 226 ], [ 226, 227 ], [ 223, 228 ], [ 222, 229 ], [ 229, 230 ], [ 229, 231 ], [ 221, 232 ], [ 232, 233 ], [ 233, 234 ], [ 233, 235 ], [ 235, 236 ], [ 236, 237 ], [ 237, 238 ], [ 237, 239 ], [ 236, 240 ], [ 235, 241 ], [ 194, 242 ], [ 242, 243 ], [ 242, 244 ], [ 244, 245 ], [ 245, 246 ], [ 194, 247 ], [ 247, 248 ], [ 111, 249 ], [ 249, 250 ], [ 249, 251 ], [ 251, 252 ], [ 252, 253 ], [ 252, 254 ], [ 251, 255 ], [ 255, 256 ], [ 255, 257 ], [ 257, 258 ], [ 251, 259 ], [ 259, 260 ], [ 260, 261 ], [ 260, 262 ], [ 259, 263 ], [ 263, 264 ], [ 263, 265 ], [ 265, 266 ], [ 251, 267 ], [ 267, 268 ], [ 267, 269 ], [ 269, 270 ], [ 269, 271 ], [ 251, 272 ], [ 272, 273 ], [ 272, 274 ], [ 274, 275 ], [ 274, 276 ], [ 276, 277 ], [ 251, 278 ], [ 278, 279 ], [ 279, 280 ], [ 280, 281 ], [ 281, 282 ], [ 281, 283 ], [ 283, 284 ], [ 280, 285 ], [ 279, 286 ], [ 286, 287 ], [ 286, 288 ], [ 278, 289 ], [ 289, 290 ], [ 290, 291 ], [ 290, 292 ], [ 292, 293 ], [ 293, 294 ], [ 294, 295 ], [ 294, 296 ], [ 293, 297 ], [ 292, 298 ], [ 251, 299 ], [ 299, 300 ], [ 299, 301 ], [ 301, 302 ], [ 302, 303 ], [ 251, 304 ], [ 304, 305 ], [ 111, 306 ], [ 306, 307 ], [ 306, 308 ], [ 308, 309 ], [ 309, 310 ], [ 309, 311 ], [ 308, 312 ], [ 312, 313 ], [ 312, 314 ], [ 308, 315 ], [ 315, 316 ], [ 315, 317 ], [ 317, 318 ], [ 308, 319 ], [ 319, 320 ], [ 320, 321 ], [ 320, 322 ], [ 319, 323 ], [ 323, 324 ], [ 323, 325 ], [ 325, 326 ], [ 308, 327 ], [ 327, 328 ], [ 327, 329 ], [ 329, 330 ], [ 329, 331 ], [ 308, 332 ], [ 332, 333 ], [ 332, 334 ], [ 334, 335 ], [ 334, 336 ], [ 336, 337 ], [ 308, 338 ], [ 338, 339 ], [ 339, 340 ], [ 340, 341 ], [ 341, 342 ], [ 341, 343 ], [ 343, 344 ], [ 340, 345 ], [ 339, 346 ], [ 346, 347 ], [ 346, 348 ], [ 338, 349 ], [ 349, 350 ], [ 350, 351 ], [ 350, 352 ], [ 352, 353 ], [ 353, 354 ], [ 354, 355 ], [ 354, 356 ], [ 353, 357 ], [ 352, 358 ], [ 308, 359 ], [ 359, 360 ], [ 360, 361 ], [ 360, 362 ], [ 359, 363 ], [ 363, 364 ], [ 364, 365 ], [ 365, 366 ], [ 366, 367 ], [ 367, 368 ], [ 367, 369 ], [ 369, 370 ], [ 366, 371 ], [ 365, 372 ], [ 372, 373 ], [ 372, 374 ], [ 364, 375 ], [ 375, 376 ], [ 376, 377 ], [ 376, 378 ], [ 378, 379 ], [ 379, 380 ], [ 379, 381 ], [ 378, 382 ], [ 382, 383 ], [ 382, 384 ], [ 308, 385 ], [ 385, 386 ], [ 385, 387 ], [ 387, 388 ], [ 388, 389 ], [ 308, 390 ], [ 390, 391 ], [ 111, 392 ], [ 392, 393 ], [ 392, 394 ], [ 394, 395 ], [ 395, 396 ], [ 395, 397 ], [ 397, 398 ], [ 398, 399 ], [ 397, 400 ], [ 397, 401 ], [ 401, 402 ], [ 401, 403 ], [ 397, 404 ], [ 394, 405 ], [ 405, 406 ], [ 406, 407 ], [ 406, 408 ], [ 408, 409 ], [ 405, 410 ], [ 410, 411 ], [ 411, 412 ], [ 411, 413 ], [ 410, 414 ], [ 414, 415 ], [ 111, 416 ], [ 416, 417 ], [ 416, 418 ], [ 418, 419 ], [ 419, 420 ], [ 420, 421 ], [ 420, 422 ], [ 419, 423 ], [ 423, 424 ], [ 418, 425 ], [ 425, 426 ], [ 426, 427 ], [ 426, 428 ], [ 428, 429 ], [ 111, 430 ], [ 430, 431 ], [ 430, 432 ], [ 432, 433 ], [ 433, 434 ], [ 434, 435 ], [ 434, 436 ], [ 433, 437 ], [ 432, 438 ], [ 438, 439 ], [ 439, 440 ], [ 0, 441 ], [ 441, 442 ], [ 441, 443 ] ]
[ "/* package codechef; // don't place package name! */\n\nimport java.util.*;\nimport java.lang.*;\nimport java.io.*;\n\n/* Name of the class has to be \"Main\" only if the class is public. */\npublic class Main\n{ \n \n public static void main (String[] args) throws java.lang.Exception\n {\n\ttry{\n\t //long a=Long.parseLong(next());\n\t // int a=sc.nextInt();\n\t Reader sc=new Reader();\n\t PrintWriter out=new PrintWriter(System.out);\n\t\t int n=sc.nextInt();\n\t\t int a[]=new int[n];\n\t\t //int b[]=new int[n];\n\t\t long sum=0;\n\t\t for(int i=0;i<n;i++)\n\t\t a[i]=sc.nextInt();\n\t\t \n\t\t int maxcur=a[0];\n\t\t for(int i=1;i<n;i++)\n\t\t {\n\t\t if(maxcur>a[i])\n\t\t sum+=maxcur-a[i];\n\t\t if(a[i]>maxcur)\n\t\t maxcur=a[i];\n\t\t }\n\t\t \n\t\t out.println(sum); \n\t\t \n\tout.flush();\n\tout.close();\n\t } \n\tcatch(Exception e)\n\t\t {}\n\t}\n\t//Template\n // static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n // static PrintWriter pw = new PrintWriter(System.out);\n // static StringTokenizer st;\n \n // static String next()\n // {\n // while(st==null || !st.hasMoreElements()) \n // {\n // try\n // {\n // st = new StringTokenizer(br.readLine());\n // }\n // catch(IOException e)\n // {\n // e.printStackTrace();\n // }\n // }\n // return st.nextToken();\n // }\n // static int gcd(int a,int b)\n // {\n // if(b==0)\n // return a;\n // else\n // return gcd(b,a%b);\n // }\n \n static class Reader \n { \n final private int BUFFER_SIZE = 1 << 16; \n private DataInputStream din; \n private byte[] buffer; \n private int bufferPointer, bytesRead; \n \n public Reader() \n { \n din = new DataInputStream(System.in); \n buffer = new byte[BUFFER_SIZE]; \n bufferPointer = bytesRead = 0; \n } \n \n public Reader(String file_name) throws IOException \n { \n din = new DataInputStream(new FileInputStream(file_name)); \n buffer = new byte[BUFFER_SIZE]; \n bufferPointer = bytesRead = 0; \n } \n \n public String readLine() throws IOException \n { \n byte[] buf = new byte[64]; // line length \n int cnt = 0, c; \n while ((c = read()) != -1) \n { \n if (c == '\\n') \n break; \n buf[cnt++] = (byte) c; \n } \n return new String(buf, 0, cnt); \n } \n \n public int nextInt() throws IOException \n { \n int ret = 0; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read(); \n do\n { \n ret = ret * 10 + c - '0'; \n } while ((c = read()) >= '0' && c <= '9'); \n \n if (neg) \n return -ret; \n return ret; \n } \n \n public long nextLong() throws IOException \n { \n long ret = 0; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read(); \n do { \n ret = ret * 10 + c - '0'; \n } \n while ((c = read()) >= '0' && c <= '9'); \n if (neg) \n return -ret; \n return ret; \n } \n \n public double nextDouble() throws IOException \n { \n double ret = 0, div = 1; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read(); \n \n do { \n ret = ret * 10 + c - '0'; \n } \n while ((c = read()) >= '0' && c <= '9'); \n \n if (c == '.') \n { \n while ((c = read()) >= '0' && c <= '9') \n { \n ret += (c - '0') / (div *= 10); \n } \n } \n \n if (neg) \n return -ret; \n return ret; \n } \n \n private void fillBuffer() throws IOException \n { \n bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE); \n if (bytesRead == -1) \n buffer[0] = -1; \n } \n \n private byte read() throws IOException \n { \n if (bufferPointer == bytesRead) \n fillBuffer(); \n return buffer[bufferPointer++]; \n } \n \n public void close() throws IOException \n { \n if (din == null) \n return; \n din.close(); \n } \n } \n\n}", "import java.util.*;", "util.*", "java", "import java.lang.*;", "lang.*", "java", "import java.io.*;", "io.*", "java", "public class Main\n{ \n \n public static void main (String[] args) throws java.lang.Exception\n {\n\ttry{\n\t //long a=Long.parseLong(next());\n\t // int a=sc.nextInt();\n\t Reader sc=new Reader();\n\t PrintWriter out=new PrintWriter(System.out);\n\t\t int n=sc.nextInt();\n\t\t int a[]=new int[n];\n\t\t //int b[]=new int[n];\n\t\t long sum=0;\n\t\t for(int i=0;i<n;i++)\n\t\t a[i]=sc.nextInt();\n\t\t \n\t\t int maxcur=a[0];\n\t\t for(int i=1;i<n;i++)\n\t\t {\n\t\t if(maxcur>a[i])\n\t\t sum+=maxcur-a[i];\n\t\t if(a[i]>maxcur)\n\t\t maxcur=a[i];\n\t\t }\n\t\t \n\t\t out.println(sum); \n\t\t \n\tout.flush();\n\tout.close();\n\t } \n\tcatch(Exception e)\n\t\t {}\n\t}\n\t//Template\n // static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n // static PrintWriter pw = new PrintWriter(System.out);\n // static StringTokenizer st;\n \n // static String next()\n // {\n // while(st==null || !st.hasMoreElements()) \n // {\n // try\n // {\n // st = new StringTokenizer(br.readLine());\n // }\n // catch(IOException e)\n // {\n // e.printStackTrace();\n // }\n // }\n // return st.nextToken();\n // }\n // static int gcd(int a,int b)\n // {\n // if(b==0)\n // return a;\n // else\n // return gcd(b,a%b);\n // }\n \n static class Reader \n { \n final private int BUFFER_SIZE = 1 << 16; \n private DataInputStream din; \n private byte[] buffer; \n private int bufferPointer, bytesRead; \n \n public Reader() \n { \n din = new DataInputStream(System.in); \n buffer = new byte[BUFFER_SIZE]; \n bufferPointer = bytesRead = 0; \n } \n \n public Reader(String file_name) throws IOException \n { \n din = new DataInputStream(new FileInputStream(file_name)); \n buffer = new byte[BUFFER_SIZE]; \n bufferPointer = bytesRead = 0; \n } \n \n public String readLine() throws IOException \n { \n byte[] buf = new byte[64]; // line length \n int cnt = 0, c; \n while ((c = read()) != -1) \n { \n if (c == '\\n') \n break; \n buf[cnt++] = (byte) c; \n } \n return new String(buf, 0, cnt); \n } \n \n public int nextInt() throws IOException \n { \n int ret = 0; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read(); \n do\n { \n ret = ret * 10 + c - '0'; \n } while ((c = read()) >= '0' && c <= '9'); \n \n if (neg) \n return -ret; \n return ret; \n } \n \n public long nextLong() throws IOException \n { \n long ret = 0; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read(); \n do { \n ret = ret * 10 + c - '0'; \n } \n while ((c = read()) >= '0' && c <= '9'); \n if (neg) \n return -ret; \n return ret; \n } \n \n public double nextDouble() throws IOException \n { \n double ret = 0, div = 1; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read(); \n \n do { \n ret = ret * 10 + c - '0'; \n } \n while ((c = read()) >= '0' && c <= '9'); \n \n if (c == '.') \n { \n while ((c = read()) >= '0' && c <= '9') \n { \n ret += (c - '0') / (div *= 10); \n } \n } \n \n if (neg) \n return -ret; \n return ret; \n } \n \n private void fillBuffer() throws IOException \n { \n bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE); \n if (bytesRead == -1) \n buffer[0] = -1; \n } \n \n private byte read() throws IOException \n { \n if (bufferPointer == bytesRead) \n fillBuffer(); \n return buffer[bufferPointer++]; \n } \n \n public void close() throws IOException \n { \n if (din == null) \n return; \n din.close(); \n } \n } \n\n}", "Main", "public static void main (String[] args) throws java.lang.Exception\n {\n\ttry{\n\t //long a=Long.parseLong(next());\n\t // int a=sc.nextInt();\n\t Reader sc=new Reader();\n\t PrintWriter out=new PrintWriter(System.out);\n\t\t int n=sc.nextInt();\n\t\t int a[]=new int[n];\n\t\t //int b[]=new int[n];\n\t\t long sum=0;\n\t\t for(int i=0;i<n;i++)\n\t\t a[i]=sc.nextInt();\n\t\t \n\t\t int maxcur=a[0];\n\t\t for(int i=1;i<n;i++)\n\t\t {\n\t\t if(maxcur>a[i])\n\t\t sum+=maxcur-a[i];\n\t\t if(a[i]>maxcur)\n\t\t maxcur=a[i];\n\t\t }\n\t\t \n\t\t out.println(sum); \n\t\t \n\tout.flush();\n\tout.close();\n\t } \n\tcatch(Exception e)\n\t\t {}\n\t}", "main", "{\n\ttry{\n\t //long a=Long.parseLong(next());\n\t // int a=sc.nextInt();\n\t Reader sc=new Reader();\n\t PrintWriter out=new PrintWriter(System.out);\n\t\t int n=sc.nextInt();\n\t\t int a[]=new int[n];\n\t\t //int b[]=new int[n];\n\t\t long sum=0;\n\t\t for(int i=0;i<n;i++)\n\t\t a[i]=sc.nextInt();\n\t\t \n\t\t int maxcur=a[0];\n\t\t for(int i=1;i<n;i++)\n\t\t {\n\t\t if(maxcur>a[i])\n\t\t sum+=maxcur-a[i];\n\t\t if(a[i]>maxcur)\n\t\t maxcur=a[i];\n\t\t }\n\t\t \n\t\t out.println(sum); \n\t\t \n\tout.flush();\n\tout.close();\n\t } \n\tcatch(Exception e)\n\t\t {}\n\t}", "try{\n\t //long a=Long.parseLong(next());\n\t // int a=sc.nextInt();\n\t Reader sc=new Reader();\n\t PrintWriter out=new PrintWriter(System.out);\n\t\t int n=sc.nextInt();\n\t\t int a[]=new int[n];\n\t\t //int b[]=new int[n];\n\t\t long sum=0;\n\t\t for(int i=0;i<n;i++)\n\t\t a[i]=sc.nextInt();\n\t\t \n\t\t int maxcur=a[0];\n\t\t for(int i=1;i<n;i++)\n\t\t {\n\t\t if(maxcur>a[i])\n\t\t sum+=maxcur-a[i];\n\t\t if(a[i]>maxcur)\n\t\t maxcur=a[i];\n\t\t }\n\t\t \n\t\t out.println(sum); \n\t\t \n\tout.flush();\n\tout.close();\n\t } \n\tcatch(Exception e)\n\t\t {}", "catch(Exception e)\n\t\t {}", "Exception e", "{}", "{\n\t //long a=Long.parseLong(next());\n\t // int a=sc.nextInt();\n\t Reader sc=new Reader();\n\t PrintWriter out=new PrintWriter(System.out);\n\t\t int n=sc.nextInt();\n\t\t int a[]=new int[n];\n\t\t //int b[]=new int[n];\n\t\t long sum=0;\n\t\t for(int i=0;i<n;i++)\n\t\t a[i]=sc.nextInt();\n\t\t \n\t\t int maxcur=a[0];\n\t\t for(int i=1;i<n;i++)\n\t\t {\n\t\t if(maxcur>a[i])\n\t\t sum+=maxcur-a[i];\n\t\t if(a[i]>maxcur)\n\t\t maxcur=a[i];\n\t\t }\n\t\t \n\t\t out.println(sum); \n\t\t \n\tout.flush();\n\tout.close();\n\t }", "Reader sc=new Reader();", "sc", "new Reader()", "PrintWriter out=new PrintWriter(System.out);", "out", "new PrintWriter(System.out)", "int n=sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "int a[]=new int[n];", "a", "new int[n]", "n", "long sum=0;", "sum", "0", "for(int i=0;i<n;i++)\n\t\t a[i]=sc.nextInt();", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "a[i]=sc.nextInt();", "a[i]=sc.nextInt()", "a[i]", "a", "i", "sc.nextInt()", "sc.nextInt", "sc", "int maxcur=a[0];", "maxcur", "a[0]", "a", "0", "for(int i=1;i<n;i++)\n\t\t {\n\t\t if(maxcur>a[i])\n\t\t sum+=maxcur-a[i];\n\t\t if(a[i]>maxcur)\n\t\t maxcur=a[i];\n\t\t }", "int i=1;", "int i=1;", "i", "1", "i<n", "i", "n", "i++", "i++", "i", "{\n\t\t if(maxcur>a[i])\n\t\t sum+=maxcur-a[i];\n\t\t if(a[i]>maxcur)\n\t\t maxcur=a[i];\n\t\t }", "{\n\t\t if(maxcur>a[i])\n\t\t sum+=maxcur-a[i];\n\t\t if(a[i]>maxcur)\n\t\t maxcur=a[i];\n\t\t }", "if(maxcur>a[i])\n\t\t sum+=maxcur-a[i];", "maxcur>a[i]", "maxcur", "a[i]", "a", "i", "sum+=maxcur-a[i]", "sum", "maxcur-a[i]", "maxcur", "a[i]", "a", "i", "if(a[i]>maxcur)\n\t\t maxcur=a[i];", "a[i]>maxcur", "a[i]", "a", "i", "maxcur", "maxcur=a[i]", "maxcur", "a[i]", "a", "i", "out.println(sum)", "out.println", "out", "sum", "out.flush()", "out.flush", "out", "out.close()", "out.close", "out", "String[] args", "args", "static class Reader \n { \n final private int BUFFER_SIZE = 1 << 16; \n private DataInputStream din; \n private byte[] buffer; \n private int bufferPointer, bytesRead; \n \n public Reader() \n { \n din = new DataInputStream(System.in); \n buffer = new byte[BUFFER_SIZE]; \n bufferPointer = bytesRead = 0; \n } \n \n public Reader(String file_name) throws IOException \n { \n din = new DataInputStream(new FileInputStream(file_name)); \n buffer = new byte[BUFFER_SIZE]; \n bufferPointer = bytesRead = 0; \n } \n \n public String readLine() throws IOException \n { \n byte[] buf = new byte[64]; // line length \n int cnt = 0, c; \n while ((c = read()) != -1) \n { \n if (c == '\\n') \n break; \n buf[cnt++] = (byte) c; \n } \n return new String(buf, 0, cnt); \n } \n \n public int nextInt() throws IOException \n { \n int ret = 0; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read(); \n do\n { \n ret = ret * 10 + c - '0'; \n } while ((c = read()) >= '0' && c <= '9'); \n \n if (neg) \n return -ret; \n return ret; \n } \n \n public long nextLong() throws IOException \n { \n long ret = 0; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read(); \n do { \n ret = ret * 10 + c - '0'; \n } \n while ((c = read()) >= '0' && c <= '9'); \n if (neg) \n return -ret; \n return ret; \n } \n \n public double nextDouble() throws IOException \n { \n double ret = 0, div = 1; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read(); \n \n do { \n ret = ret * 10 + c - '0'; \n } \n while ((c = read()) >= '0' && c <= '9'); \n \n if (c == '.') \n { \n while ((c = read()) >= '0' && c <= '9') \n { \n ret += (c - '0') / (div *= 10); \n } \n } \n \n if (neg) \n return -ret; \n return ret; \n } \n \n private void fillBuffer() throws IOException \n { \n bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE); \n if (bytesRead == -1) \n buffer[0] = -1; \n } \n \n private byte read() throws IOException \n { \n if (bufferPointer == bytesRead) \n fillBuffer(); \n return buffer[bufferPointer++]; \n } \n \n public void close() throws IOException \n { \n if (din == null) \n return; \n din.close(); \n } \n }", "Reader", "final private int BUFFER_SIZE = 1 << 16;", "BUFFER_SIZE", "1 << 16", "1", "16", "private DataInputStream din;", "din", "private byte[] buffer;", "buffer", "private int bufferPointer", "bufferPointer", "bytesRead;", "bytesRead", "public Reader() \n { \n din = new DataInputStream(System.in); \n buffer = new byte[BUFFER_SIZE]; \n bufferPointer = bytesRead = 0; \n }", "Reader", "{ \n din = new DataInputStream(System.in); \n buffer = new byte[BUFFER_SIZE]; \n bufferPointer = bytesRead = 0; \n }", "din = new DataInputStream(System.in)", "din", "new DataInputStream(System.in)", "buffer = new byte[BUFFER_SIZE]", "buffer", "new byte[BUFFER_SIZE]", "BUFFER_SIZE", "bufferPointer = bytesRead = 0", "bufferPointer", "bytesRead = 0", "bytesRead", "0", "public Reader(String file_name) throws IOException \n { \n din = new DataInputStream(new FileInputStream(file_name)); \n buffer = new byte[BUFFER_SIZE]; \n bufferPointer = bytesRead = 0; \n }", "Reader", "{ \n din = new DataInputStream(new FileInputStream(file_name)); \n buffer = new byte[BUFFER_SIZE]; \n bufferPointer = bytesRead = 0; \n }", "din = new DataInputStream(new FileInputStream(file_name))", "din", "new DataInputStream(new FileInputStream(file_name))", "buffer = new byte[BUFFER_SIZE]", "buffer", "new byte[BUFFER_SIZE]", "BUFFER_SIZE", "bufferPointer = bytesRead = 0", "bufferPointer", "bytesRead = 0", "bytesRead", "0", "String file_name", "file_name", "public String readLine() throws IOException \n { \n byte[] buf = new byte[64]; // line length \n int cnt = 0, c; \n while ((c = read()) != -1) \n { \n if (c == '\\n') \n break; \n buf[cnt++] = (byte) c; \n } \n return new String(buf, 0, cnt); \n }", "readLine", "{ \n byte[] buf = new byte[64]; // line length \n int cnt = 0, c; \n while ((c = read()) != -1) \n { \n if (c == '\\n') \n break; \n buf[cnt++] = (byte) c; \n } \n return new String(buf, 0, cnt); \n }", "byte[] buf = new byte[64];", "buf", "new byte[64]", "64", "int cnt = 0", "cnt", "0", "c;", "c", "while ((c = read()) != -1) \n { \n if (c == '\\n') \n break; \n buf[cnt++] = (byte) c; \n }", "(c = read()) != -1", "(c = read())", "c", "read()", "read", "-1", "1", "{ \n if (c == '\\n') \n break; \n buf[cnt++] = (byte) c; \n }", "if (c == '\\n') \n break;", "c == '\\n'", "c", "'\\n'", "break;", "buf[cnt++] = (byte) c", "buf[cnt++]", "buf", "cnt++", "cnt", "(byte) c", "return new String(buf, 0, cnt);", "new String(buf, 0, cnt)", "public int nextInt() throws IOException \n { \n int ret = 0; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read(); \n do\n { \n ret = ret * 10 + c - '0'; \n } while ((c = read()) >= '0' && c <= '9'); \n \n if (neg) \n return -ret; \n return ret; \n }", "nextInt", "{ \n int ret = 0; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read(); \n do\n { \n ret = ret * 10 + c - '0'; \n } while ((c = read()) >= '0' && c <= '9'); \n \n if (neg) \n return -ret; \n return ret; \n }", "int ret = 0;", "ret", "0", "byte c = read();", "c", "read()", "read", "while (c <= ' ') \n c = read();", "c <= ' '", "c", "' '", "c = read()", "c", "read()", "read", "boolean neg = (c == '-');", "neg", "(c == '-')", "c", "'-'", "if (neg) \n c = read();", "neg", "c = read()", "c", "read()", "read", "do\n { \n ret = ret * 10 + c - '0'; \n } while ((c = read()) >= '0' && c <= '9');", "(c = read()) >= '0' && c <= '9'", "(c = read()) >= '0'", "(c = read())", "c", "read()", "read", "'0'", "c <= '9'", "c", "'9'", "{ \n ret = ret * 10 + c - '0'; \n }", "ret = ret * 10 + c - '0'", "ret", "ret * 10 + c - '0'", "ret * 10 + c", "ret * 10", "ret", "10", "c", "'0'", "if (neg) \n return -ret;", "neg", "return -ret;", "-ret", "ret", "return ret;", "ret", "public long nextLong() throws IOException \n { \n long ret = 0; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read(); \n do { \n ret = ret * 10 + c - '0'; \n } \n while ((c = read()) >= '0' && c <= '9'); \n if (neg) \n return -ret; \n return ret; \n }", "nextLong", "{ \n long ret = 0; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read(); \n do { \n ret = ret * 10 + c - '0'; \n } \n while ((c = read()) >= '0' && c <= '9'); \n if (neg) \n return -ret; \n return ret; \n }", "long ret = 0;", "ret", "0", "byte c = read();", "c", "read()", "read", "while (c <= ' ') \n c = read();", "c <= ' '", "c", "' '", "c = read()", "c", "read()", "read", "boolean neg = (c == '-');", "neg", "(c == '-')", "c", "'-'", "if (neg) \n c = read();", "neg", "c = read()", "c", "read()", "read", "do { \n ret = ret * 10 + c - '0'; \n } \n while ((c = read()) >= '0' && c <= '9');", "(c = read()) >= '0' && c <= '9'", "(c = read()) >= '0'", "(c = read())", "c", "read()", "read", "'0'", "c <= '9'", "c", "'9'", "{ \n ret = ret * 10 + c - '0'; \n }", "ret = ret * 10 + c - '0'", "ret", "ret * 10 + c - '0'", "ret * 10 + c", "ret * 10", "ret", "10", "c", "'0'", "if (neg) \n return -ret;", "neg", "return -ret;", "-ret", "ret", "return ret;", "ret", "public double nextDouble() throws IOException \n { \n double ret = 0, div = 1; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read(); \n \n do { \n ret = ret * 10 + c - '0'; \n } \n while ((c = read()) >= '0' && c <= '9'); \n \n if (c == '.') \n { \n while ((c = read()) >= '0' && c <= '9') \n { \n ret += (c - '0') / (div *= 10); \n } \n } \n \n if (neg) \n return -ret; \n return ret; \n }", "nextDouble", "{ \n double ret = 0, div = 1; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read(); \n \n do { \n ret = ret * 10 + c - '0'; \n } \n while ((c = read()) >= '0' && c <= '9'); \n \n if (c == '.') \n { \n while ((c = read()) >= '0' && c <= '9') \n { \n ret += (c - '0') / (div *= 10); \n } \n } \n \n if (neg) \n return -ret; \n return ret; \n }", "double ret = 0", "ret", "0", "div = 1;", "div", "1", "byte c = read();", "c", "read()", "read", "while (c <= ' ') \n c = read();", "c <= ' '", "c", "' '", "c = read()", "c", "read()", "read", "boolean neg = (c == '-');", "neg", "(c == '-')", "c", "'-'", "if (neg) \n c = read();", "neg", "c = read()", "c", "read()", "read", "do { \n ret = ret * 10 + c - '0'; \n } \n while ((c = read()) >= '0' && c <= '9');", "(c = read()) >= '0' && c <= '9'", "(c = read()) >= '0'", "(c = read())", "c", "read()", "read", "'0'", "c <= '9'", "c", "'9'", "{ \n ret = ret * 10 + c - '0'; \n }", "ret = ret * 10 + c - '0'", "ret", "ret * 10 + c - '0'", "ret * 10 + c", "ret * 10", "ret", "10", "c", "'0'", "if (c == '.') \n { \n while ((c = read()) >= '0' && c <= '9') \n { \n ret += (c - '0') / (div *= 10); \n } \n }", "c == '.'", "c", "'.'", "{ \n while ((c = read()) >= '0' && c <= '9') \n { \n ret += (c - '0') / (div *= 10); \n } \n }", "while ((c = read()) >= '0' && c <= '9') \n { \n ret += (c - '0') / (div *= 10); \n }", "(c = read()) >= '0' && c <= '9'", "(c = read()) >= '0'", "(c = read())", "c", "read()", "read", "'0'", "c <= '9'", "c", "'9'", "{ \n ret += (c - '0') / (div *= 10); \n }", "ret += (c - '0') / (div *= 10)", "ret", "(c - '0') / (div *= 10)", "(c - '0')", "c", "'0'", "(div *= 10)", "div", "10", "if (neg) \n return -ret;", "neg", "return -ret;", "-ret", "ret", "return ret;", "ret", "private void fillBuffer() throws IOException \n { \n bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE); \n if (bytesRead == -1) \n buffer[0] = -1; \n }", "fillBuffer", "{ \n bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE); \n if (bytesRead == -1) \n buffer[0] = -1; \n }", "bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE)", "bytesRead", "din.read(buffer, bufferPointer = 0, BUFFER_SIZE)", "din.read", "din", "buffer", "bufferPointer = 0", "bufferPointer", "0", "BUFFER_SIZE", "if (bytesRead == -1) \n buffer[0] = -1;", "bytesRead == -1", "bytesRead", "-1", "1", "buffer[0] = -1", "buffer[0]", "buffer", "0", "-1", "1", "private byte read() throws IOException \n { \n if (bufferPointer == bytesRead) \n fillBuffer(); \n return buffer[bufferPointer++]; \n }", "read", "{ \n if (bufferPointer == bytesRead) \n fillBuffer(); \n return buffer[bufferPointer++]; \n }", "if (bufferPointer == bytesRead) \n fillBuffer();", "bufferPointer == bytesRead", "bufferPointer", "bytesRead", "fillBuffer()", "fillBuffer", "return buffer[bufferPointer++];", "buffer[bufferPointer++]", "buffer", "bufferPointer++", "bufferPointer", "public void close() throws IOException \n { \n if (din == null) \n return; \n din.close(); \n }", "close", "{ \n if (din == null) \n return; \n din.close(); \n }", "if (din == null) \n return;", "din == null", "din", "null", "return;", "din.close()", "din.close", "din", "public class Main\n{ \n \n public static void main (String[] args) throws java.lang.Exception\n {\n\ttry{\n\t //long a=Long.parseLong(next());\n\t // int a=sc.nextInt();\n\t Reader sc=new Reader();\n\t PrintWriter out=new PrintWriter(System.out);\n\t\t int n=sc.nextInt();\n\t\t int a[]=new int[n];\n\t\t //int b[]=new int[n];\n\t\t long sum=0;\n\t\t for(int i=0;i<n;i++)\n\t\t a[i]=sc.nextInt();\n\t\t \n\t\t int maxcur=a[0];\n\t\t for(int i=1;i<n;i++)\n\t\t {\n\t\t if(maxcur>a[i])\n\t\t sum+=maxcur-a[i];\n\t\t if(a[i]>maxcur)\n\t\t maxcur=a[i];\n\t\t }\n\t\t \n\t\t out.println(sum); \n\t\t \n\tout.flush();\n\tout.close();\n\t } \n\tcatch(Exception e)\n\t\t {}\n\t}\n\t//Template\n // static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n // static PrintWriter pw = new PrintWriter(System.out);\n // static StringTokenizer st;\n \n // static String next()\n // {\n // while(st==null || !st.hasMoreElements()) \n // {\n // try\n // {\n // st = new StringTokenizer(br.readLine());\n // }\n // catch(IOException e)\n // {\n // e.printStackTrace();\n // }\n // }\n // return st.nextToken();\n // }\n // static int gcd(int a,int b)\n // {\n // if(b==0)\n // return a;\n // else\n // return gcd(b,a%b);\n // }\n \n static class Reader \n { \n final private int BUFFER_SIZE = 1 << 16; \n private DataInputStream din; \n private byte[] buffer; \n private int bufferPointer, bytesRead; \n \n public Reader() \n { \n din = new DataInputStream(System.in); \n buffer = new byte[BUFFER_SIZE]; \n bufferPointer = bytesRead = 0; \n } \n \n public Reader(String file_name) throws IOException \n { \n din = new DataInputStream(new FileInputStream(file_name)); \n buffer = new byte[BUFFER_SIZE]; \n bufferPointer = bytesRead = 0; \n } \n \n public String readLine() throws IOException \n { \n byte[] buf = new byte[64]; // line length \n int cnt = 0, c; \n while ((c = read()) != -1) \n { \n if (c == '\\n') \n break; \n buf[cnt++] = (byte) c; \n } \n return new String(buf, 0, cnt); \n } \n \n public int nextInt() throws IOException \n { \n int ret = 0; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read(); \n do\n { \n ret = ret * 10 + c - '0'; \n } while ((c = read()) >= '0' && c <= '9'); \n \n if (neg) \n return -ret; \n return ret; \n } \n \n public long nextLong() throws IOException \n { \n long ret = 0; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read(); \n do { \n ret = ret * 10 + c - '0'; \n } \n while ((c = read()) >= '0' && c <= '9'); \n if (neg) \n return -ret; \n return ret; \n } \n \n public double nextDouble() throws IOException \n { \n double ret = 0, div = 1; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read(); \n \n do { \n ret = ret * 10 + c - '0'; \n } \n while ((c = read()) >= '0' && c <= '9'); \n \n if (c == '.') \n { \n while ((c = read()) >= '0' && c <= '9') \n { \n ret += (c - '0') / (div *= 10); \n } \n } \n \n if (neg) \n return -ret; \n return ret; \n } \n \n private void fillBuffer() throws IOException \n { \n bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE); \n if (bytesRead == -1) \n buffer[0] = -1; \n } \n \n private byte read() throws IOException \n { \n if (bufferPointer == bytesRead) \n fillBuffer(); \n return buffer[bufferPointer++]; \n } \n \n public void close() throws IOException \n { \n if (din == null) \n return; \n din.close(); \n } \n } \n\n}", "public class Main\n{ \n \n public static void main (String[] args) throws java.lang.Exception\n {\n\ttry{\n\t //long a=Long.parseLong(next());\n\t // int a=sc.nextInt();\n\t Reader sc=new Reader();\n\t PrintWriter out=new PrintWriter(System.out);\n\t\t int n=sc.nextInt();\n\t\t int a[]=new int[n];\n\t\t //int b[]=new int[n];\n\t\t long sum=0;\n\t\t for(int i=0;i<n;i++)\n\t\t a[i]=sc.nextInt();\n\t\t \n\t\t int maxcur=a[0];\n\t\t for(int i=1;i<n;i++)\n\t\t {\n\t\t if(maxcur>a[i])\n\t\t sum+=maxcur-a[i];\n\t\t if(a[i]>maxcur)\n\t\t maxcur=a[i];\n\t\t }\n\t\t \n\t\t out.println(sum); \n\t\t \n\tout.flush();\n\tout.close();\n\t } \n\tcatch(Exception e)\n\t\t {}\n\t}\n\t//Template\n // static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n // static PrintWriter pw = new PrintWriter(System.out);\n // static StringTokenizer st;\n \n // static String next()\n // {\n // while(st==null || !st.hasMoreElements()) \n // {\n // try\n // {\n // st = new StringTokenizer(br.readLine());\n // }\n // catch(IOException e)\n // {\n // e.printStackTrace();\n // }\n // }\n // return st.nextToken();\n // }\n // static int gcd(int a,int b)\n // {\n // if(b==0)\n // return a;\n // else\n // return gcd(b,a%b);\n // }\n \n static class Reader \n { \n final private int BUFFER_SIZE = 1 << 16; \n private DataInputStream din; \n private byte[] buffer; \n private int bufferPointer, bytesRead; \n \n public Reader() \n { \n din = new DataInputStream(System.in); \n buffer = new byte[BUFFER_SIZE]; \n bufferPointer = bytesRead = 0; \n } \n \n public Reader(String file_name) throws IOException \n { \n din = new DataInputStream(new FileInputStream(file_name)); \n buffer = new byte[BUFFER_SIZE]; \n bufferPointer = bytesRead = 0; \n } \n \n public String readLine() throws IOException \n { \n byte[] buf = new byte[64]; // line length \n int cnt = 0, c; \n while ((c = read()) != -1) \n { \n if (c == '\\n') \n break; \n buf[cnt++] = (byte) c; \n } \n return new String(buf, 0, cnt); \n } \n \n public int nextInt() throws IOException \n { \n int ret = 0; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read(); \n do\n { \n ret = ret * 10 + c - '0'; \n } while ((c = read()) >= '0' && c <= '9'); \n \n if (neg) \n return -ret; \n return ret; \n } \n \n public long nextLong() throws IOException \n { \n long ret = 0; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read(); \n do { \n ret = ret * 10 + c - '0'; \n } \n while ((c = read()) >= '0' && c <= '9'); \n if (neg) \n return -ret; \n return ret; \n } \n \n public double nextDouble() throws IOException \n { \n double ret = 0, div = 1; \n byte c = read(); \n while (c <= ' ') \n c = read(); \n boolean neg = (c == '-'); \n if (neg) \n c = read(); \n \n do { \n ret = ret * 10 + c - '0'; \n } \n while ((c = read()) >= '0' && c <= '9'); \n \n if (c == '.') \n { \n while ((c = read()) >= '0' && c <= '9') \n { \n ret += (c - '0') / (div *= 10); \n } \n } \n \n if (neg) \n return -ret; \n return ret; \n } \n \n private void fillBuffer() throws IOException \n { \n bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE); \n if (bytesRead == -1) \n buffer[0] = -1; \n } \n \n private byte read() throws IOException \n { \n if (bufferPointer == bytesRead) \n fillBuffer(); \n return buffer[bufferPointer++]; \n } \n \n public void close() throws IOException \n { \n if (din == null) \n return; \n din.close(); \n } \n } \n\n}", "Main" ]
/* package codechef; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ public class Main { public static void main (String[] args) throws java.lang.Exception { try{ //long a=Long.parseLong(next()); // int a=sc.nextInt(); Reader sc=new Reader(); PrintWriter out=new PrintWriter(System.out); int n=sc.nextInt(); int a[]=new int[n]; //int b[]=new int[n]; long sum=0; for(int i=0;i<n;i++) a[i]=sc.nextInt(); int maxcur=a[0]; for(int i=1;i<n;i++) { if(maxcur>a[i]) sum+=maxcur-a[i]; if(a[i]>maxcur) maxcur=a[i]; } out.println(sum); out.flush(); out.close(); } catch(Exception e) {} } //Template // static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); // static PrintWriter pw = new PrintWriter(System.out); // static StringTokenizer st; // static String next() // { // while(st==null || !st.hasMoreElements()) // { // try // { // st = new StringTokenizer(br.readLine()); // } // catch(IOException e) // { // e.printStackTrace(); // } // } // return st.nextToken(); // } // static int gcd(int a,int b) // { // if(b==0) // return a; // else // return gcd(b,a%b); // } static class Reader { final private int BUFFER_SIZE = 1 << 16; private DataInputStream din; private byte[] buffer; private int bufferPointer, bytesRead; public Reader() { din = new DataInputStream(System.in); buffer = new byte[BUFFER_SIZE]; bufferPointer = bytesRead = 0; } public Reader(String file_name) throws IOException { din = new DataInputStream(new FileInputStream(file_name)); buffer = new byte[BUFFER_SIZE]; bufferPointer = bytesRead = 0; } public String readLine() throws IOException { byte[] buf = new byte[64]; // line length int cnt = 0, c; while ((c = read()) != -1) { if (c == '\n') break; buf[cnt++] = (byte) c; } return new String(buf, 0, cnt); } public int nextInt() throws IOException { int ret = 0; byte c = read(); while (c <= ' ') c = read(); boolean neg = (c == '-'); if (neg) c = read(); do { ret = ret * 10 + c - '0'; } while ((c = read()) >= '0' && c <= '9'); if (neg) return -ret; return ret; } public long nextLong() throws IOException { long ret = 0; byte c = read(); while (c <= ' ') c = read(); boolean neg = (c == '-'); if (neg) c = read(); do { ret = ret * 10 + c - '0'; } while ((c = read()) >= '0' && c <= '9'); if (neg) return -ret; return ret; } public double nextDouble() throws IOException { double ret = 0, div = 1; byte c = read(); while (c <= ' ') c = read(); boolean neg = (c == '-'); if (neg) c = read(); do { ret = ret * 10 + c - '0'; } while ((c = read()) >= '0' && c <= '9'); if (c == '.') { while ((c = read()) >= '0' && c <= '9') { ret += (c - '0') / (div *= 10); } } if (neg) return -ret; return ret; } private void fillBuffer() throws IOException { bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE); if (bytesRead == -1) buffer[0] = -1; } private byte read() throws IOException { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } public void close() throws IOException { if (din == null) return; din.close(); } } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 41, 13, 4, 18, 13, 0, 18, 13, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 18, 13, 2, 13, 17, 18, 13, 13, 30, 0, 13, 2, 13, 2, 18, 13, 2, 13, 17, 18, 13, 13, 0, 18, 13, 13, 18, 13, 2, 13, 17, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 102, 5 ], [ 102, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 8, 21 ], [ 21, 22 ], [ 22, 23 ], [ 23, 24 ], [ 23, 25 ], [ 21, 26 ], [ 26, 27 ], [ 26, 28 ], [ 21, 29 ], [ 29, 30 ], [ 30, 31 ], [ 21, 32 ], [ 33, 33 ], [ 33, 34 ], [ 34, 35 ], [ 34, 36 ], [ 36, 37 ], [ 37, 38 ], [ 33, 39 ], [ 39, 40 ], [ 40, 41 ], [ 40, 42 ], [ 39, 43 ], [ 8, 44 ], [ 44, 45 ], [ 44, 46 ], [ 8, 47 ], [ 47, 48 ], [ 48, 49 ], [ 49, 50 ], [ 49, 51 ], [ 47, 52 ], [ 52, 53 ], [ 52, 54 ], [ 47, 55 ], [ 55, 56 ], [ 56, 57 ], [ 47, 58 ], [ 59, 59 ], [ 59, 60 ], [ 60, 61 ], [ 61, 62 ], [ 62, 63 ], [ 62, 64 ], [ 64, 65 ], [ 64, 66 ], [ 61, 67 ], [ 67, 68 ], [ 67, 69 ], [ 60, 70 ], [ 70, 71 ], [ 71, 72 ], [ 71, 73 ], [ 73, 74 ], [ 73, 75 ], [ 75, 76 ], [ 76, 77 ], [ 76, 78 ], [ 78, 79 ], [ 78, 80 ], [ 75, 81 ], [ 81, 82 ], [ 81, 83 ], [ 70, 84 ], [ 84, 85 ], [ 85, 86 ], [ 85, 87 ], [ 84, 88 ], [ 88, 89 ], [ 88, 90 ], [ 90, 91 ], [ 90, 92 ], [ 8, 93 ], [ 93, 94 ], [ 94, 95 ], [ 95, 96 ], [ 95, 97 ], [ 93, 98 ], [ 6, 99 ], [ 99, 100 ], [ 0, 101 ], [ 101, 102 ], [ 101, 103 ] ]
[ "import java.util.Scanner;\npublic class Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int a[] = new int[n];\n for (int i = 0; i < n; i++){\n int A = scan.nextInt();\n a[i] = A;\n }\n long ans = 0;\n for (int i = 1; i < n; i++){\n if (a[i-1] > a[i]){\n ans = ans + (a[i-1]-a[i]);\n a[i] = a[i-1];\n }\n }\n System.out.println(ans);\n }\n}", "import java.util.Scanner;", "Scanner", "java.util", "public class Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int a[] = new int[n];\n for (int i = 0; i < n; i++){\n int A = scan.nextInt();\n a[i] = A;\n }\n long ans = 0;\n for (int i = 1; i < n; i++){\n if (a[i-1] > a[i]){\n ans = ans + (a[i-1]-a[i]);\n a[i] = a[i-1];\n }\n }\n System.out.println(ans);\n }\n}", "Main", "public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int a[] = new int[n];\n for (int i = 0; i < n; i++){\n int A = scan.nextInt();\n a[i] = A;\n }\n long ans = 0;\n for (int i = 1; i < n; i++){\n if (a[i-1] > a[i]){\n ans = ans + (a[i-1]-a[i]);\n a[i] = a[i-1];\n }\n }\n System.out.println(ans);\n }", "main", "{\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int a[] = new int[n];\n for (int i = 0; i < n; i++){\n int A = scan.nextInt();\n a[i] = A;\n }\n long ans = 0;\n for (int i = 1; i < n; i++){\n if (a[i-1] > a[i]){\n ans = ans + (a[i-1]-a[i]);\n a[i] = a[i-1];\n }\n }\n System.out.println(ans);\n }", "Scanner scan = new Scanner(System.in);", "scan", "new Scanner(System.in)", "int n = scan.nextInt();", "n", "scan.nextInt()", "scan.nextInt", "scan", "int a[] = new int[n];", "a", "new int[n]", "n", "for (int i = 0; i < n; i++){\n int A = scan.nextInt();\n a[i] = A;\n }", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n int A = scan.nextInt();\n a[i] = A;\n }", "{\n int A = scan.nextInt();\n a[i] = A;\n }", "int A = scan.nextInt();", "A", "scan.nextInt()", "scan.nextInt", "scan", "a[i] = A", "a[i]", "a", "i", "A", "long ans = 0;", "ans", "0", "for (int i = 1; i < n; i++){\n if (a[i-1] > a[i]){\n ans = ans + (a[i-1]-a[i]);\n a[i] = a[i-1];\n }\n }", "int i = 1;", "int i = 1;", "i", "1", "i < n", "i", "n", "i++", "i++", "i", "{\n if (a[i-1] > a[i]){\n ans = ans + (a[i-1]-a[i]);\n a[i] = a[i-1];\n }\n }", "{\n if (a[i-1] > a[i]){\n ans = ans + (a[i-1]-a[i]);\n a[i] = a[i-1];\n }\n }", "if (a[i-1] > a[i]){\n ans = ans + (a[i-1]-a[i]);\n a[i] = a[i-1];\n }", "a[i-1] > a[i]", "a[i-1]", "a", "i-1", "i", "1", "a[i]", "a", "i", "{\n ans = ans + (a[i-1]-a[i]);\n a[i] = a[i-1];\n }", "ans = ans + (a[i-1]-a[i])", "ans", "ans + (a[i-1]-a[i])", "ans", "(a[i-1]-a[i])", "a[i-1]", "a", "i-1", "i", "1", "a[i]", "a", "i", "a[i] = a[i-1]", "a[i]", "a", "i", "a[i-1]", "a", "i-1", "i", "1", "System.out.println(ans)", "System.out.println", "System.out", "System", "System.out", "ans", "String[] args", "args", "public class Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int a[] = new int[n];\n for (int i = 0; i < n; i++){\n int A = scan.nextInt();\n a[i] = A;\n }\n long ans = 0;\n for (int i = 1; i < n; i++){\n if (a[i-1] > a[i]){\n ans = ans + (a[i-1]-a[i]);\n a[i] = a[i-1];\n }\n }\n System.out.println(ans);\n }\n}", "public class Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int a[] = new int[n];\n for (int i = 0; i < n; i++){\n int A = scan.nextInt();\n a[i] = A;\n }\n long ans = 0;\n for (int i = 1; i < n; i++){\n if (a[i-1] > a[i]){\n ans = ans + (a[i-1]-a[i]);\n a[i] = a[i-1];\n }\n }\n System.out.println(ans);\n }\n}", "Main" ]
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int a[] = new int[n]; for (int i = 0; i < n; i++){ int A = scan.nextInt(); a[i] = A; } long ans = 0; for (int i = 1; i < n; i++){ if (a[i-1] > a[i]){ ans = ans + (a[i-1]-a[i]); a[i] = a[i-1]; } } System.out.println(ans); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 41, 13, 2, 18, 13, 2, 13, 17, 18, 13, 13, 14, 2, 13, 17, 30, 0, 13, 13, 0, 18, 13, 13, 13, 4, 18, 18, 13, 13, 13, 4, 18, 13, 29, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 100, 5 ], [ 100, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 14, 17 ], [ 17, 18 ], [ 18, 19 ], [ 8, 20 ], [ 20, 21 ], [ 20, 22 ], [ 8, 24 ], [ 24, 25 ], [ 25, 26 ], [ 26, 27 ], [ 26, 28 ], [ 24, 29 ], [ 29, 30 ], [ 29, 31 ], [ 24, 32 ], [ 32, 33 ], [ 33, 34 ], [ 24, 35 ], [ 36, 36 ], [ 36, 37 ], [ 37, 38 ], [ 38, 39 ], [ 38, 40 ], [ 37, 41 ], [ 41, 42 ], [ 42, 43 ], [ 41, 44 ], [ 44, 45 ], [ 45, 46 ], [ 8, 47 ], [ 47, 48 ], [ 47, 49 ], [ 8, 50 ], [ 50, 51 ], [ 51, 52 ], [ 52, 53 ], [ 52, 54 ], [ 50, 55 ], [ 55, 56 ], [ 55, 57 ], [ 50, 58 ], [ 58, 59 ], [ 59, 60 ], [ 50, 61 ], [ 62, 62 ], [ 62, 63 ], [ 63, 64 ], [ 63, 65 ], [ 65, 66 ], [ 66, 67 ], [ 66, 68 ], [ 68, 69 ], [ 68, 70 ], [ 65, 71 ], [ 71, 72 ], [ 71, 73 ], [ 62, 74 ], [ 74, 75 ], [ 75, 76 ], [ 75, 77 ], [ 74, 78 ], [ 78, 79 ], [ 79, 80 ], [ 79, 81 ], [ 78, 82 ], [ 82, 83 ], [ 83, 84 ], [ 83, 85 ], [ 82, 86 ], [ 8, 87 ], [ 87, 88 ], [ 88, 89 ], [ 89, 90 ], [ 89, 91 ], [ 87, 92 ], [ 8, 93 ], [ 93, 94 ], [ 94, 95 ], [ 8, 96 ], [ 6, 97 ], [ 97, 98 ], [ 0, 99 ], [ 99, 100 ], [ 99, 101 ] ]
[ "import java.util.*;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = Integer.parseInt(sc.next());\n int[] a = new int[n];\n for(int i=0; i<n; i++){\n a[i] = Integer.parseInt(sc.next());\n }\n\n long sum = 0;\n \n for(int i = 1; i<n; i++){\n int dif = a[i-1] - a[i];\n if(dif > 0){\n sum += dif;\n a[i] += dif;\n }\n }\n\n System.out.println(sum);\n \n sc.close();\n return;\n }\n \n}", "import java.util.*;", "util.*", "java", "public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = Integer.parseInt(sc.next());\n int[] a = new int[n];\n for(int i=0; i<n; i++){\n a[i] = Integer.parseInt(sc.next());\n }\n\n long sum = 0;\n \n for(int i = 1; i<n; i++){\n int dif = a[i-1] - a[i];\n if(dif > 0){\n sum += dif;\n a[i] += dif;\n }\n }\n\n System.out.println(sum);\n \n sc.close();\n return;\n }\n \n}", "Main", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = Integer.parseInt(sc.next());\n int[] a = new int[n];\n for(int i=0; i<n; i++){\n a[i] = Integer.parseInt(sc.next());\n }\n\n long sum = 0;\n \n for(int i = 1; i<n; i++){\n int dif = a[i-1] - a[i];\n if(dif > 0){\n sum += dif;\n a[i] += dif;\n }\n }\n\n System.out.println(sum);\n \n sc.close();\n return;\n }", "main", "{\n Scanner sc = new Scanner(System.in);\n int n = Integer.parseInt(sc.next());\n int[] a = new int[n];\n for(int i=0; i<n; i++){\n a[i] = Integer.parseInt(sc.next());\n }\n\n long sum = 0;\n \n for(int i = 1; i<n; i++){\n int dif = a[i-1] - a[i];\n if(dif > 0){\n sum += dif;\n a[i] += dif;\n }\n }\n\n System.out.println(sum);\n \n sc.close();\n return;\n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n = Integer.parseInt(sc.next());", "n", "Integer.parseInt(sc.next())", "Integer.parseInt", "Integer", "sc.next()", "sc.next", "sc", "int[] a = new int[n];", "a", "new int[n]", "n", "for(int i=0; i<n; i++){\n a[i] = Integer.parseInt(sc.next());\n }", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\n a[i] = Integer.parseInt(sc.next());\n }", "{\n a[i] = Integer.parseInt(sc.next());\n }", "a[i] = Integer.parseInt(sc.next())", "a[i]", "a", "i", "Integer.parseInt(sc.next())", "Integer.parseInt", "Integer", "sc.next()", "sc.next", "sc", "long sum = 0;", "sum", "0", "for(int i = 1; i<n; i++){\n int dif = a[i-1] - a[i];\n if(dif > 0){\n sum += dif;\n a[i] += dif;\n }\n }", "int i = 1;", "int i = 1;", "i", "1", "i<n", "i", "n", "i++", "i++", "i", "{\n int dif = a[i-1] - a[i];\n if(dif > 0){\n sum += dif;\n a[i] += dif;\n }\n }", "{\n int dif = a[i-1] - a[i];\n if(dif > 0){\n sum += dif;\n a[i] += dif;\n }\n }", "int dif = a[i-1] - a[i];", "dif", "a[i-1] - a[i]", "a[i-1]", "a", "i-1", "i", "1", "a[i]", "a", "i", "if(dif > 0){\n sum += dif;\n a[i] += dif;\n }", "dif > 0", "dif", "0", "{\n sum += dif;\n a[i] += dif;\n }", "sum += dif", "sum", "dif", "a[i] += dif", "a[i]", "a", "i", "dif", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "sc.close()", "sc.close", "sc", "return;", "String[] args", "args", "public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = Integer.parseInt(sc.next());\n int[] a = new int[n];\n for(int i=0; i<n; i++){\n a[i] = Integer.parseInt(sc.next());\n }\n\n long sum = 0;\n \n for(int i = 1; i<n; i++){\n int dif = a[i-1] - a[i];\n if(dif > 0){\n sum += dif;\n a[i] += dif;\n }\n }\n\n System.out.println(sum);\n \n sc.close();\n return;\n }\n \n}", "public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = Integer.parseInt(sc.next());\n int[] a = new int[n];\n for(int i=0; i<n; i++){\n a[i] = Integer.parseInt(sc.next());\n }\n\n long sum = 0;\n \n for(int i = 1; i<n; i++){\n int dif = a[i-1] - a[i];\n if(dif > 0){\n sum += dif;\n a[i] += dif;\n }\n }\n\n System.out.println(sum);\n \n sc.close();\n return;\n }\n \n}", "Main" ]
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = Integer.parseInt(sc.next()); int[] a = new int[n]; for(int i=0; i<n; i++){ a[i] = Integer.parseInt(sc.next()); } long sum = 0; for(int i = 1; i<n; i++){ int dif = a[i-1] - a[i]; if(dif > 0){ sum += dif; a[i] += dif; } } System.out.println(sum); sc.close(); return; } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 41, 13, 18, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 13, 18, 13, 13, 30, 41, 13, 2, 13, 18, 13, 13, 0, 13, 13, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 94, 5 ], [ 94, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 8, 21 ], [ 21, 22 ], [ 22, 23 ], [ 23, 24 ], [ 23, 25 ], [ 21, 26 ], [ 26, 27 ], [ 26, 28 ], [ 21, 29 ], [ 29, 30 ], [ 30, 31 ], [ 21, 32 ], [ 33, 33 ], [ 33, 34 ], [ 34, 35 ], [ 35, 36 ], [ 35, 37 ], [ 34, 38 ], [ 38, 39 ], [ 39, 40 ], [ 8, 41 ], [ 41, 42 ], [ 41, 43 ], [ 43, 44 ], [ 43, 45 ], [ 8, 46 ], [ 46, 47 ], [ 46, 48 ], [ 8, 49 ], [ 49, 50 ], [ 50, 51 ], [ 51, 52 ], [ 51, 53 ], [ 49, 54 ], [ 54, 55 ], [ 54, 56 ], [ 49, 57 ], [ 57, 58 ], [ 58, 59 ], [ 49, 60 ], [ 61, 61 ], [ 61, 62 ], [ 62, 63 ], [ 63, 64 ], [ 63, 65 ], [ 65, 66 ], [ 65, 67 ], [ 62, 68 ], [ 68, 69 ], [ 69, 70 ], [ 69, 71 ], [ 71, 72 ], [ 71, 73 ], [ 73, 74 ], [ 73, 75 ], [ 68, 76 ], [ 76, 77 ], [ 76, 78 ], [ 62, 79 ], [ 79, 80 ], [ 80, 81 ], [ 80, 82 ], [ 82, 83 ], [ 82, 84 ], [ 8, 85 ], [ 85, 86 ], [ 86, 87 ], [ 87, 88 ], [ 87, 89 ], [ 85, 90 ], [ 6, 91 ], [ 91, 92 ], [ 0, 93 ], [ 93, 94 ], [ 93, 95 ] ]
[ "import java.util.*;\n\npublic class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n int[] a = new int[n];\n for(int i=0; i<n; i++){\n a[i] = sc.nextInt();\n }\n\n int bigTall = a[0];\n\n long count = 0;\n for(int i = 1; i<n; i++){\n if(bigTall > a[i]){\n int sub = bigTall - a[i];\n count += sub;\n }\n else{\n bigTall = a[i];\n }\n }\n System.out.println(count);\n }\n}", "import java.util.*;", "util.*", "java", "public class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n int[] a = new int[n];\n for(int i=0; i<n; i++){\n a[i] = sc.nextInt();\n }\n\n int bigTall = a[0];\n\n long count = 0;\n for(int i = 1; i<n; i++){\n if(bigTall > a[i]){\n int sub = bigTall - a[i];\n count += sub;\n }\n else{\n bigTall = a[i];\n }\n }\n System.out.println(count);\n }\n}", "Main", "public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n int[] a = new int[n];\n for(int i=0; i<n; i++){\n a[i] = sc.nextInt();\n }\n\n int bigTall = a[0];\n\n long count = 0;\n for(int i = 1; i<n; i++){\n if(bigTall > a[i]){\n int sub = bigTall - a[i];\n count += sub;\n }\n else{\n bigTall = a[i];\n }\n }\n System.out.println(count);\n }", "main", "{\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n int[] a = new int[n];\n for(int i=0; i<n; i++){\n a[i] = sc.nextInt();\n }\n\n int bigTall = a[0];\n\n long count = 0;\n for(int i = 1; i<n; i++){\n if(bigTall > a[i]){\n int sub = bigTall - a[i];\n count += sub;\n }\n else{\n bigTall = a[i];\n }\n }\n System.out.println(count);\n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "int[] a = new int[n];", "a", "new int[n]", "n", "for(int i=0; i<n; i++){\n a[i] = sc.nextInt();\n }", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\n a[i] = sc.nextInt();\n }", "{\n a[i] = sc.nextInt();\n }", "a[i] = sc.nextInt()", "a[i]", "a", "i", "sc.nextInt()", "sc.nextInt", "sc", "int bigTall = a[0];", "bigTall", "a[0]", "a", "0", "long count = 0;", "count", "0", "for(int i = 1; i<n; i++){\n if(bigTall > a[i]){\n int sub = bigTall - a[i];\n count += sub;\n }\n else{\n bigTall = a[i];\n }\n }", "int i = 1;", "int i = 1;", "i", "1", "i<n", "i", "n", "i++", "i++", "i", "{\n if(bigTall > a[i]){\n int sub = bigTall - a[i];\n count += sub;\n }\n else{\n bigTall = a[i];\n }\n }", "{\n if(bigTall > a[i]){\n int sub = bigTall - a[i];\n count += sub;\n }\n else{\n bigTall = a[i];\n }\n }", "if(bigTall > a[i]){\n int sub = bigTall - a[i];\n count += sub;\n }\n else{\n bigTall = a[i];\n }", "bigTall > a[i]", "bigTall", "a[i]", "a", "i", "{\n int sub = bigTall - a[i];\n count += sub;\n }", "int sub = bigTall - a[i];", "sub", "bigTall - a[i]", "bigTall", "a[i]", "a", "i", "count += sub", "count", "sub", "{\n bigTall = a[i];\n }", "bigTall = a[i]", "bigTall", "a[i]", "a", "i", "System.out.println(count)", "System.out.println", "System.out", "System", "System.out", "count", "String[] args", "args", "public class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n int[] a = new int[n];\n for(int i=0; i<n; i++){\n a[i] = sc.nextInt();\n }\n\n int bigTall = a[0];\n\n long count = 0;\n for(int i = 1; i<n; i++){\n if(bigTall > a[i]){\n int sub = bigTall - a[i];\n count += sub;\n }\n else{\n bigTall = a[i];\n }\n }\n System.out.println(count);\n }\n}", "public class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n int[] a = new int[n];\n for(int i=0; i<n; i++){\n a[i] = sc.nextInt();\n }\n\n int bigTall = a[0];\n\n long count = 0;\n for(int i = 1; i<n; i++){\n if(bigTall > a[i]){\n int sub = bigTall - a[i];\n count += sub;\n }\n else{\n bigTall = a[i];\n }\n }\n System.out.println(count);\n }\n}", "Main" ]
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] a = new int[n]; for(int i=0; i<n; i++){ a[i] = sc.nextInt(); } int bigTall = a[0]; long count = 0; for(int i = 1; i<n; i++){ if(bigTall > a[i]){ int sub = bigTall - a[i]; count += sub; } else{ bigTall = a[i]; } } System.out.println(count); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 41, 13, 2, 17, 17, 41, 13, 41, 13, 12, 13, 30, 41, 13, 4, 13, 41, 13, 20, 2, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 13, 41, 13, 18, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 4, 18, 13, 17, 2, 13, 18, 13, 13, 0, 13, 4, 18, 13, 13, 18, 13, 13, 4, 13, 13, 23, 13, 12, 13, 30, 0, 13, 20, 0, 13, 20, 41, 13, 4, 18, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 4, 13, 13, 4, 18, 13, 4, 18, 18, 13, 13, 2, 2, 4, 18, 13, 13, 17, 23, 13, 12, 13, 30, 4, 18, 18, 13, 13, 4, 18, 13, 13, 23, 13, 12, 13, 30, 4, 18, 13, 13, 23, 13, 12, 13, 30, 4, 18, 13, 13, 23, 13, 12, 13, 30, 29, 4, 18, 13, 4, 18, 13, 12, 13, 30, 29, 4, 18, 13, 4, 18, 13, 12, 13, 30, 29, 4, 18, 13, 4, 18, 13, 12, 13, 30, 29, 4, 18, 13, 12, 13, 30, 29, 8, 2, 13, 17, 13, 4, 13, 13, 2, 13, 13, 23, 13, 23, 13, 12, 13, 30, 29, 8, 2, 13, 17, 13, 4, 13, 13, 2, 13, 13, 23, 13, 23, 13, 12, 13, 30, 29, 8, 2, 13, 17, 17, 2, 17, 4, 13, 2, 13, 2, 13, 17, 23, 13, 6, 13, 41, 13, 41, 13, 12, 13, 30, 0, 13, 20, 12, 13, 30, 42, 2, 2, 13, 17, 40, 4, 18, 13, 30, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 20, 29, 4, 18, 13, 12, 13, 30, 41, 13, 17, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 4, 18, 13, 29, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 336, 11 ], [ 336, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 14, 16 ], [ 336, 17 ], [ 17, 18 ], [ 336, 19 ], [ 19, 20 ], [ 336, 21 ], [ 21, 22 ], [ 21, 23 ], [ 23, 24 ], [ 24, 25 ], [ 24, 26 ], [ 26, 27 ], [ 23, 28 ], [ 28, 29 ], [ 28, 30 ], [ 31, 32 ], [ 31, 33 ], [ 23, 34 ], [ 34, 35 ], [ 35, 36 ], [ 36, 37 ], [ 36, 38 ], [ 34, 39 ], [ 39, 40 ], [ 39, 41 ], [ 34, 42 ], [ 42, 43 ], [ 43, 44 ], [ 34, 45 ], [ 45, 46 ], [ 46, 47 ], [ 47, 48 ], [ 47, 49 ], [ 46, 50 ], [ 50, 51 ], [ 23, 52 ], [ 52, 53 ], [ 52, 54 ], [ 54, 55 ], [ 54, 56 ], [ 23, 57 ], [ 57, 58 ], [ 57, 59 ], [ 23, 60 ], [ 60, 61 ], [ 61, 62 ], [ 62, 63 ], [ 62, 64 ], [ 60, 65 ], [ 65, 66 ], [ 65, 67 ], [ 60, 68 ], [ 68, 69 ], [ 69, 70 ], [ 60, 71 ], [ 72, 72 ], [ 72, 73 ], [ 73, 74 ], [ 73, 75 ], [ 75, 76 ], [ 76, 77 ], [ 75, 78 ], [ 75, 79 ], [ 79, 80 ], [ 79, 81 ], [ 81, 82 ], [ 81, 83 ], [ 72, 84 ], [ 84, 85 ], [ 84, 86 ], [ 86, 87 ], [ 87, 88 ], [ 86, 89 ], [ 86, 90 ], [ 90, 91 ], [ 90, 92 ], [ 23, 93 ], [ 93, 94 ], [ 93, 95 ], [ 21, 96 ], [ 96, 97 ], [ 336, 98 ], [ 98, 99 ], [ 98, 100 ], [ 100, 101 ], [ 101, 102 ], [ 101, 103 ], [ 100, 104 ], [ 104, 105 ], [ 104, 106 ], [ 100, 107 ], [ 107, 108 ], [ 107, 109 ], [ 109, 110 ], [ 110, 111 ], [ 100, 112 ], [ 112, 113 ], [ 112, 114 ], [ 100, 115 ], [ 115, 116 ], [ 116, 117 ], [ 117, 118 ], [ 117, 119 ], [ 115, 120 ], [ 120, 121 ], [ 120, 122 ], [ 115, 123 ], [ 123, 124 ], [ 124, 125 ], [ 115, 126 ], [ 126, 127 ], [ 127, 128 ], [ 127, 129 ], [ 100, 130 ], [ 130, 131 ], [ 131, 132 ], [ 100, 133 ], [ 133, 134 ], [ 134, 135 ], [ 135, 136 ], [ 135, 137 ], [ 133, 138 ], [ 138, 139 ], [ 139, 140 ], [ 140, 141 ], [ 141, 142 ], [ 139, 143 ], [ 138, 144 ], [ 98, 145 ], [ 145, 146 ], [ 336, 147 ], [ 147, 148 ], [ 147, 149 ], [ 149, 150 ], [ 150, 151 ], [ 151, 152 ], [ 152, 153 ], [ 152, 154 ], [ 150, 155 ], [ 155, 156 ], [ 156, 157 ], [ 155, 158 ], [ 147, 159 ], [ 159, 160 ], [ 336, 161 ], [ 161, 162 ], [ 161, 163 ], [ 163, 164 ], [ 164, 165 ], [ 165, 166 ], [ 164, 167 ], [ 161, 168 ], [ 168, 169 ], [ 336, 170 ], [ 170, 171 ], [ 170, 172 ], [ 172, 173 ], [ 173, 174 ], [ 174, 175 ], [ 173, 176 ], [ 170, 177 ], [ 177, 178 ], [ 336, 179 ], [ 179, 180 ], [ 179, 181 ], [ 181, 182 ], [ 182, 183 ], [ 183, 184 ], [ 184, 185 ], [ 183, 186 ], [ 186, 187 ], [ 187, 188 ], [ 336, 189 ], [ 189, 190 ], [ 189, 191 ], [ 191, 192 ], [ 192, 193 ], [ 193, 194 ], [ 194, 195 ], [ 193, 196 ], [ 196, 197 ], [ 197, 198 ], [ 336, 199 ], [ 199, 200 ], [ 199, 201 ], [ 201, 202 ], [ 202, 203 ], [ 203, 204 ], [ 204, 205 ], [ 203, 206 ], [ 206, 207 ], [ 207, 208 ], [ 336, 209 ], [ 209, 210 ], [ 209, 211 ], [ 211, 212 ], [ 212, 213 ], [ 213, 214 ], [ 214, 215 ], [ 336, 216 ], [ 216, 217 ], [ 216, 218 ], [ 218, 219 ], [ 219, 220 ], [ 220, 221 ], [ 221, 222 ], [ 221, 223 ], [ 220, 224 ], [ 220, 225 ], [ 225, 226 ], [ 225, 227 ], [ 225, 228 ], [ 228, 229 ], [ 228, 230 ], [ 216, 231 ], [ 231, 232 ], [ 216, 233 ], [ 233, 234 ], [ 336, 235 ], [ 235, 236 ], [ 235, 237 ], [ 237, 238 ], [ 238, 239 ], [ 239, 240 ], [ 240, 241 ], [ 240, 242 ], [ 239, 243 ], [ 239, 244 ], [ 244, 245 ], [ 244, 246 ], [ 244, 247 ], [ 247, 248 ], [ 247, 249 ], [ 235, 250 ], [ 250, 251 ], [ 235, 252 ], [ 252, 253 ], [ 336, 254 ], [ 254, 255 ], [ 254, 256 ], [ 256, 257 ], [ 257, 258 ], [ 258, 259 ], [ 259, 260 ], [ 259, 261 ], [ 258, 262 ], [ 258, 263 ], [ 263, 264 ], [ 263, 265 ], [ 265, 266 ], [ 265, 267 ], [ 267, 268 ], [ 267, 269 ], [ 269, 270 ], [ 269, 271 ], [ 254, 272 ], [ 272, 273 ], [ 336, 274 ], [ 274, 275 ], [ 274, 276 ], [ 276, 277 ], [ 274, 278 ], [ 278, 279 ], [ 274, 280 ], [ 280, 281 ], [ 280, 282 ], [ 282, 283 ], [ 283, 284 ], [ 283, 285 ], [ 274, 286 ], [ 286, 287 ], [ 286, 288 ], [ 288, 289 ], [ 289, 290 ], [ 290, 291 ], [ 291, 292 ], [ 291, 293 ], [ 290, 294 ], [ 294, 295 ], [ 295, 296 ], [ 296, 297 ], [ 289, 298 ], [ 298, 299 ], [ 299, 300 ], [ 300, 301 ], [ 300, 302 ], [ 302, 303 ], [ 303, 304 ], [ 304, 305 ], [ 299, 306 ], [ 306, 307 ], [ 307, 308 ], [ 307, 309 ], [ 288, 310 ], [ 310, 311 ], [ 311, 312 ], [ 312, 313 ], [ 274, 314 ], [ 314, 315 ], [ 314, 316 ], [ 316, 317 ], [ 317, 318 ], [ 317, 319 ], [ 316, 320 ], [ 320, 321 ], [ 321, 322 ], [ 321, 323 ], [ 323, 324 ], [ 324, 325 ], [ 325, 326 ], [ 320, 327 ], [ 327, 328 ], [ 328, 329 ], [ 328, 330 ], [ 330, 331 ], [ 331, 332 ], [ 316, 333 ], [ 333, 334 ], [ 0, 335 ], [ 335, 336 ], [ 335, 337 ] ]
[ "import java.util.*;\nimport java.io.*;\nimport java.math.*;\n \npublic class Main\n{\n public static void process(int test_number)throws IOException\n {\n int n = ni();\n long arr[] = new long[n + 1];\n for(int i = 1; i <= n; i++) arr[i] = ni();\n\n long mx = arr[1], res = 0l;\n for(int i = 2; i <= n; i++){\n res += Math.max(0, mx - arr[i]);\n mx = Math.max(mx, arr[i]);\n }\n pn(res);\n }\n \n static final long mod = (long)1e9+7l;\n \n static FastReader sc;\n static PrintWriter out;\n public static void main(String[]args)throws IOException\n {\n out = new PrintWriter(System.out);\n sc = new FastReader();\n \n long s = System.currentTimeMillis();\n int t = 1;\n // t = ni();\n for(int i = 1; i <= t; i++)\n process(i);\n \n out.flush();\n System.err.println(System.currentTimeMillis()-s+\"ms\");\n }\n\n static void trace(Object... o){ System.err.println(Arrays.deepToString(o)); };\n static void pn(Object o){ out.println(o); }\n static void p(Object o){ out.print(o); }\n static int ni()throws IOException{ return Integer.parseInt(sc.next()); }\n static long nl()throws IOException{ return Long.parseLong(sc.next()); }\n static double nd()throws IOException{ return Double.parseDouble(sc.next()); }\n static String nln()throws IOException{ return sc.nextLine(); }\n static long gcd(long a, long b)throws IOException{ return (b==0)?a:gcd(b,a%b);}\n static int gcd(int a, int b)throws IOException{ return (b==0)?a:gcd(b,a%b); }\n static int bit(long n)throws IOException{ return (n==0)?0:(1+bit(n&(n-1))); }\n \n static class FastReader{ \n BufferedReader br; \n StringTokenizer st; \n \n public FastReader(){ \n br = new BufferedReader(new InputStreamReader(System.in)); \n } \n \n String next(){ \n while (st == null || !st.hasMoreElements()){ \n try{ st = new StringTokenizer(br.readLine()); } catch (IOException e){ e.printStackTrace(); } \n } \n return st.nextToken(); \n } \n \n String nextLine(){ \n String str = \"\"; \n try{ str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } \n return str; \n } \n } \n}", "import java.util.*;", "util.*", "java", "import java.io.*;", "io.*", "java", "import java.math.*;", "math.*", "java", "public class Main\n{\n public static void process(int test_number)throws IOException\n {\n int n = ni();\n long arr[] = new long[n + 1];\n for(int i = 1; i <= n; i++) arr[i] = ni();\n\n long mx = arr[1], res = 0l;\n for(int i = 2; i <= n; i++){\n res += Math.max(0, mx - arr[i]);\n mx = Math.max(mx, arr[i]);\n }\n pn(res);\n }\n \n static final long mod = (long)1e9+7l;\n \n static FastReader sc;\n static PrintWriter out;\n public static void main(String[]args)throws IOException\n {\n out = new PrintWriter(System.out);\n sc = new FastReader();\n \n long s = System.currentTimeMillis();\n int t = 1;\n // t = ni();\n for(int i = 1; i <= t; i++)\n process(i);\n \n out.flush();\n System.err.println(System.currentTimeMillis()-s+\"ms\");\n }\n\n static void trace(Object... o){ System.err.println(Arrays.deepToString(o)); };\n static void pn(Object o){ out.println(o); }\n static void p(Object o){ out.print(o); }\n static int ni()throws IOException{ return Integer.parseInt(sc.next()); }\n static long nl()throws IOException{ return Long.parseLong(sc.next()); }\n static double nd()throws IOException{ return Double.parseDouble(sc.next()); }\n static String nln()throws IOException{ return sc.nextLine(); }\n static long gcd(long a, long b)throws IOException{ return (b==0)?a:gcd(b,a%b);}\n static int gcd(int a, int b)throws IOException{ return (b==0)?a:gcd(b,a%b); }\n static int bit(long n)throws IOException{ return (n==0)?0:(1+bit(n&(n-1))); }\n \n static class FastReader{ \n BufferedReader br; \n StringTokenizer st; \n \n public FastReader(){ \n br = new BufferedReader(new InputStreamReader(System.in)); \n } \n \n String next(){ \n while (st == null || !st.hasMoreElements()){ \n try{ st = new StringTokenizer(br.readLine()); } catch (IOException e){ e.printStackTrace(); } \n } \n return st.nextToken(); \n } \n \n String nextLine(){ \n String str = \"\"; \n try{ str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } \n return str; \n } \n } \n}", "Main", "static final long mod = (long)1e9+7l;", "mod", "(long)1e9+7l", "(long)1e9", "7l", "static FastReader sc;", "sc", "static PrintWriter out;", "out", "public static void process(int test_number)throws IOException\n {\n int n = ni();\n long arr[] = new long[n + 1];\n for(int i = 1; i <= n; i++) arr[i] = ni();\n\n long mx = arr[1], res = 0l;\n for(int i = 2; i <= n; i++){\n res += Math.max(0, mx - arr[i]);\n mx = Math.max(mx, arr[i]);\n }\n pn(res);\n }", "process", "{\n int n = ni();\n long arr[] = new long[n + 1];\n for(int i = 1; i <= n; i++) arr[i] = ni();\n\n long mx = arr[1], res = 0l;\n for(int i = 2; i <= n; i++){\n res += Math.max(0, mx - arr[i]);\n mx = Math.max(mx, arr[i]);\n }\n pn(res);\n }", "int n = ni();", "n", "ni()", "ni", "long arr[] = new long[n + 1];", "arr", "new long[n + 1]", "n + 1", "n", "1", "for(int i = 1; i <= n; i++) arr[i] = ni();", "int i = 1;", "int i = 1;", "i", "1", "i <= n", "i", "n", "i++", "i++", "i", "arr[i] = ni();", "arr[i] = ni()", "arr[i]", "arr", "i", "ni()", "ni", "long mx = arr[1]", "mx", "arr[1]", "arr", "1", "res = 0l;", "res", "0l", "for(int i = 2; i <= n; i++){\n res += Math.max(0, mx - arr[i]);\n mx = Math.max(mx, arr[i]);\n }", "int i = 2;", "int i = 2;", "i", "2", "i <= n", "i", "n", "i++", "i++", "i", "{\n res += Math.max(0, mx - arr[i]);\n mx = Math.max(mx, arr[i]);\n }", "{\n res += Math.max(0, mx - arr[i]);\n mx = Math.max(mx, arr[i]);\n }", "res += Math.max(0, mx - arr[i])", "res", "Math.max(0, mx - arr[i])", "Math.max", "Math", "0", "mx - arr[i]", "mx", "arr[i]", "arr", "i", "mx = Math.max(mx, arr[i])", "mx", "Math.max(mx, arr[i])", "Math.max", "Math", "mx", "arr[i]", "arr", "i", "pn(res)", "pn", "res", "int test_number", "test_number", "public static void main(String[]args)throws IOException\n {\n out = new PrintWriter(System.out);\n sc = new FastReader();\n \n long s = System.currentTimeMillis();\n int t = 1;\n // t = ni();\n for(int i = 1; i <= t; i++)\n process(i);\n \n out.flush();\n System.err.println(System.currentTimeMillis()-s+\"ms\");\n }", "main", "{\n out = new PrintWriter(System.out);\n sc = new FastReader();\n \n long s = System.currentTimeMillis();\n int t = 1;\n // t = ni();\n for(int i = 1; i <= t; i++)\n process(i);\n \n out.flush();\n System.err.println(System.currentTimeMillis()-s+\"ms\");\n }", "out = new PrintWriter(System.out)", "out", "new PrintWriter(System.out)", "sc = new FastReader()", "sc", "new FastReader()", "long s = System.currentTimeMillis();", "s", "System.currentTimeMillis()", "System.currentTimeMillis", "System", "int t = 1;", "t", "1", "for(int i = 1; i <= t; i++)\n process(i);", "int i = 1;", "int i = 1;", "i", "1", "i <= t", "i", "t", "i++", "i++", "i", "process(i);", "process(i)", "process", "i", "out.flush()", "out.flush", "out", "System.err.println(System.currentTimeMillis()-s+\"ms\")", "System.err.println", "System.err", "System", "System.err", "System.currentTimeMillis()-s+\"ms\"", "System.currentTimeMillis()-s", "System.currentTimeMillis()", "System.currentTimeMillis", "System", "s", "\"ms\"", "String[]args", "args", "static void trace(Object... o){ System.err.println(Arrays.deepToString(o)); }", "trace", "{ System.err.println(Arrays.deepToString(o)); }", "System.err.println(Arrays.deepToString(o))", "System.err.println", "System.err", "System", "System.err", "Arrays.deepToString(o)", "Arrays.deepToString", "Arrays", "o", "Object... o", "o", "static void pn(Object o){ out.println(o); }", "pn", "{ out.println(o); }", "out.println(o)", "out.println", "out", "o", "Object o", "o", "static void p(Object o){ out.print(o); }", "p", "{ out.print(o); }", "out.print(o)", "out.print", "out", "o", "Object o", "o", "static int ni()throws IOException{ return Integer.parseInt(sc.next()); }", "ni", "{ return Integer.parseInt(sc.next()); }", "return Integer.parseInt(sc.next());", "Integer.parseInt(sc.next())", "Integer.parseInt", "Integer", "sc.next()", "sc.next", "sc", "static long nl()throws IOException{ return Long.parseLong(sc.next()); }", "nl", "{ return Long.parseLong(sc.next()); }", "return Long.parseLong(sc.next());", "Long.parseLong(sc.next())", "Long.parseLong", "Long", "sc.next()", "sc.next", "sc", "static double nd()throws IOException{ return Double.parseDouble(sc.next()); }", "nd", "{ return Double.parseDouble(sc.next()); }", "return Double.parseDouble(sc.next());", "Double.parseDouble(sc.next())", "Double.parseDouble", "Double", "sc.next()", "sc.next", "sc", "static String nln()throws IOException{ return sc.nextLine(); }", "nln", "{ return sc.nextLine(); }", "return sc.nextLine();", "sc.nextLine()", "sc.nextLine", "sc", "static long gcd(long a, long b)throws IOException{ return (b==0)?a:gcd(b,a%b);}", "gcd", "{ return (b==0)?a:gcd(b,a%b);}", "return (b==0)?a:gcd(b,a%b);", "(b==0)?a:gcd(b,a%b)", "(b==0)", "b", "0", "a", "gcd(b,a%b)", "gcd", "b", "a%b", "a", "b", "long a", "a", "long b", "b", "static int gcd(int a, int b)throws IOException{ return (b==0)?a:gcd(b,a%b); }", "gcd", "{ return (b==0)?a:gcd(b,a%b); }", "return (b==0)?a:gcd(b,a%b);", "(b==0)?a:gcd(b,a%b)", "(b==0)", "b", "0", "a", "gcd(b,a%b)", "gcd", "b", "a%b", "a", "b", "int a", "a", "int b", "b", "static int bit(long n)throws IOException{ return (n==0)?0:(1+bit(n&(n-1))); }", "bit", "{ return (n==0)?0:(1+bit(n&(n-1))); }", "return (n==0)?0:(1+bit(n&(n-1)));", "(n==0)?0:(1+bit(n&(n-1)))", "(n==0)", "n", "0", "0", "(1+bit(n&(n-1)))", "1", "bit(n&(n-1))", "bit", "n&(n-1)", "n", "(n-1)", "n", "1", "long n", "n", "static class FastReader{ \n BufferedReader br; \n StringTokenizer st; \n \n public FastReader(){ \n br = new BufferedReader(new InputStreamReader(System.in)); \n } \n \n String next(){ \n while (st == null || !st.hasMoreElements()){ \n try{ st = new StringTokenizer(br.readLine()); } catch (IOException e){ e.printStackTrace(); } \n } \n return st.nextToken(); \n } \n \n String nextLine(){ \n String str = \"\"; \n try{ str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } \n return str; \n } \n }", "FastReader", "BufferedReader br;", "br", "StringTokenizer st;", "st", "public FastReader(){ \n br = new BufferedReader(new InputStreamReader(System.in)); \n }", "FastReader", "{ \n br = new BufferedReader(new InputStreamReader(System.in)); \n }", "br = new BufferedReader(new InputStreamReader(System.in))", "br", "new BufferedReader(new InputStreamReader(System.in))", "String next(){ \n while (st == null || !st.hasMoreElements()){ \n try{ st = new StringTokenizer(br.readLine()); } catch (IOException e){ e.printStackTrace(); } \n } \n return st.nextToken(); \n }", "next", "{ \n while (st == null || !st.hasMoreElements()){ \n try{ st = new StringTokenizer(br.readLine()); } catch (IOException e){ e.printStackTrace(); } \n } \n return st.nextToken(); \n }", "while (st == null || !st.hasMoreElements()){ \n try{ st = new StringTokenizer(br.readLine()); } catch (IOException e){ e.printStackTrace(); } \n }", "st == null || !st.hasMoreElements()", "st == null", "st", "null", "!st.hasMoreElements()", "st.hasMoreElements()", "st.hasMoreElements", "st", "{ \n try{ st = new StringTokenizer(br.readLine()); } catch (IOException e){ e.printStackTrace(); } \n }", "try{ st = new StringTokenizer(br.readLine()); } catch (IOException e){ e.printStackTrace(); }", "catch (IOException e){ e.printStackTrace(); }", "IOException e", "{ e.printStackTrace(); }", "e.printStackTrace()", "e.printStackTrace", "e", "{ st = new StringTokenizer(br.readLine()); }", "st = new StringTokenizer(br.readLine())", "st", "new StringTokenizer(br.readLine())", "return st.nextToken();", "st.nextToken()", "st.nextToken", "st", "String nextLine(){ \n String str = \"\"; \n try{ str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } \n return str; \n }", "nextLine", "{ \n String str = \"\"; \n try{ str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } \n return str; \n }", "String str = \"\";", "str", "\"\"", "try{ str = br.readLine(); } catch (IOException e) { e.printStackTrace(); }", "catch (IOException e) { e.printStackTrace(); }", "IOException e", "{ e.printStackTrace(); }", "e.printStackTrace()", "e.printStackTrace", "e", "{ str = br.readLine(); }", "str = br.readLine()", "str", "br.readLine()", "br.readLine", "br", "return str;", "str", "public class Main\n{\n public static void process(int test_number)throws IOException\n {\n int n = ni();\n long arr[] = new long[n + 1];\n for(int i = 1; i <= n; i++) arr[i] = ni();\n\n long mx = arr[1], res = 0l;\n for(int i = 2; i <= n; i++){\n res += Math.max(0, mx - arr[i]);\n mx = Math.max(mx, arr[i]);\n }\n pn(res);\n }\n \n static final long mod = (long)1e9+7l;\n \n static FastReader sc;\n static PrintWriter out;\n public static void main(String[]args)throws IOException\n {\n out = new PrintWriter(System.out);\n sc = new FastReader();\n \n long s = System.currentTimeMillis();\n int t = 1;\n // t = ni();\n for(int i = 1; i <= t; i++)\n process(i);\n \n out.flush();\n System.err.println(System.currentTimeMillis()-s+\"ms\");\n }\n\n static void trace(Object... o){ System.err.println(Arrays.deepToString(o)); };\n static void pn(Object o){ out.println(o); }\n static void p(Object o){ out.print(o); }\n static int ni()throws IOException{ return Integer.parseInt(sc.next()); }\n static long nl()throws IOException{ return Long.parseLong(sc.next()); }\n static double nd()throws IOException{ return Double.parseDouble(sc.next()); }\n static String nln()throws IOException{ return sc.nextLine(); }\n static long gcd(long a, long b)throws IOException{ return (b==0)?a:gcd(b,a%b);}\n static int gcd(int a, int b)throws IOException{ return (b==0)?a:gcd(b,a%b); }\n static int bit(long n)throws IOException{ return (n==0)?0:(1+bit(n&(n-1))); }\n \n static class FastReader{ \n BufferedReader br; \n StringTokenizer st; \n \n public FastReader(){ \n br = new BufferedReader(new InputStreamReader(System.in)); \n } \n \n String next(){ \n while (st == null || !st.hasMoreElements()){ \n try{ st = new StringTokenizer(br.readLine()); } catch (IOException e){ e.printStackTrace(); } \n } \n return st.nextToken(); \n } \n \n String nextLine(){ \n String str = \"\"; \n try{ str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } \n return str; \n } \n } \n}", "public class Main\n{\n public static void process(int test_number)throws IOException\n {\n int n = ni();\n long arr[] = new long[n + 1];\n for(int i = 1; i <= n; i++) arr[i] = ni();\n\n long mx = arr[1], res = 0l;\n for(int i = 2; i <= n; i++){\n res += Math.max(0, mx - arr[i]);\n mx = Math.max(mx, arr[i]);\n }\n pn(res);\n }\n \n static final long mod = (long)1e9+7l;\n \n static FastReader sc;\n static PrintWriter out;\n public static void main(String[]args)throws IOException\n {\n out = new PrintWriter(System.out);\n sc = new FastReader();\n \n long s = System.currentTimeMillis();\n int t = 1;\n // t = ni();\n for(int i = 1; i <= t; i++)\n process(i);\n \n out.flush();\n System.err.println(System.currentTimeMillis()-s+\"ms\");\n }\n\n static void trace(Object... o){ System.err.println(Arrays.deepToString(o)); };\n static void pn(Object o){ out.println(o); }\n static void p(Object o){ out.print(o); }\n static int ni()throws IOException{ return Integer.parseInt(sc.next()); }\n static long nl()throws IOException{ return Long.parseLong(sc.next()); }\n static double nd()throws IOException{ return Double.parseDouble(sc.next()); }\n static String nln()throws IOException{ return sc.nextLine(); }\n static long gcd(long a, long b)throws IOException{ return (b==0)?a:gcd(b,a%b);}\n static int gcd(int a, int b)throws IOException{ return (b==0)?a:gcd(b,a%b); }\n static int bit(long n)throws IOException{ return (n==0)?0:(1+bit(n&(n-1))); }\n \n static class FastReader{ \n BufferedReader br; \n StringTokenizer st; \n \n public FastReader(){ \n br = new BufferedReader(new InputStreamReader(System.in)); \n } \n \n String next(){ \n while (st == null || !st.hasMoreElements()){ \n try{ st = new StringTokenizer(br.readLine()); } catch (IOException e){ e.printStackTrace(); } \n } \n return st.nextToken(); \n } \n \n String nextLine(){ \n String str = \"\"; \n try{ str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } \n return str; \n } \n } \n}", "Main" ]
import java.util.*; import java.io.*; import java.math.*; public class Main { public static void process(int test_number)throws IOException { int n = ni(); long arr[] = new long[n + 1]; for(int i = 1; i <= n; i++) arr[i] = ni(); long mx = arr[1], res = 0l; for(int i = 2; i <= n; i++){ res += Math.max(0, mx - arr[i]); mx = Math.max(mx, arr[i]); } pn(res); } static final long mod = (long)1e9+7l; static FastReader sc; static PrintWriter out; public static void main(String[]args)throws IOException { out = new PrintWriter(System.out); sc = new FastReader(); long s = System.currentTimeMillis(); int t = 1; // t = ni(); for(int i = 1; i <= t; i++) process(i); out.flush(); System.err.println(System.currentTimeMillis()-s+"ms"); } static void trace(Object... o){ System.err.println(Arrays.deepToString(o)); }; static void pn(Object o){ out.println(o); } static void p(Object o){ out.print(o); } static int ni()throws IOException{ return Integer.parseInt(sc.next()); } static long nl()throws IOException{ return Long.parseLong(sc.next()); } static double nd()throws IOException{ return Double.parseDouble(sc.next()); } static String nln()throws IOException{ return sc.nextLine(); } static long gcd(long a, long b)throws IOException{ return (b==0)?a:gcd(b,a%b);} static int gcd(int a, int b)throws IOException{ return (b==0)?a:gcd(b,a%b); } static int bit(long n)throws IOException{ return (n==0)?0:(1+bit(n&(n-1))); } static class FastReader{ BufferedReader br; StringTokenizer st; public FastReader(){ br = new BufferedReader(new InputStreamReader(System.in)); } String next(){ while (st == null || !st.hasMoreElements()){ try{ st = new StringTokenizer(br.readLine()); } catch (IOException e){ e.printStackTrace(); } } return st.nextToken(); } String nextLine(){ String str = ""; try{ str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 4, 18, 13, 4, 18, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 4, 18, 13, 2, 13, 17, 4, 18, 13, 13, 30, 9, 30, 0, 13, 2, 4, 18, 13, 2, 13, 17, 4, 18, 13, 13, 4, 18, 13, 13, 4, 18, 13, 2, 13, 17, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 105, 8 ], [ 105, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 11, 23 ], [ 23, 24 ], [ 24, 25 ], [ 25, 26 ], [ 25, 27 ], [ 23, 28 ], [ 28, 29 ], [ 28, 30 ], [ 23, 31 ], [ 31, 32 ], [ 32, 33 ], [ 23, 34 ], [ 35, 35 ], [ 35, 36 ], [ 36, 37 ], [ 37, 38 ], [ 36, 39 ], [ 39, 40 ], [ 40, 41 ], [ 11, 42 ], [ 42, 43 ], [ 42, 44 ], [ 11, 45 ], [ 45, 46 ], [ 46, 47 ], [ 47, 48 ], [ 47, 49 ], [ 45, 50 ], [ 50, 51 ], [ 50, 52 ], [ 45, 53 ], [ 53, 54 ], [ 54, 55 ], [ 45, 56 ], [ 57, 57 ], [ 57, 58 ], [ 58, 59 ], [ 59, 60 ], [ 60, 61 ], [ 61, 62 ], [ 60, 63 ], [ 63, 64 ], [ 63, 65 ], [ 59, 66 ], [ 66, 67 ], [ 67, 68 ], [ 66, 69 ], [ 58, 70 ], [ 70, 71 ], [ 58, 72 ], [ 72, 73 ], [ 73, 74 ], [ 73, 75 ], [ 75, 76 ], [ 76, 77 ], [ 77, 78 ], [ 76, 79 ], [ 79, 80 ], [ 79, 81 ], [ 75, 82 ], [ 82, 83 ], [ 83, 84 ], [ 82, 85 ], [ 72, 86 ], [ 86, 87 ], [ 87, 88 ], [ 86, 89 ], [ 86, 90 ], [ 90, 91 ], [ 91, 92 ], [ 90, 93 ], [ 93, 94 ], [ 93, 95 ], [ 11, 96 ], [ 96, 97 ], [ 97, 98 ], [ 98, 99 ], [ 98, 100 ], [ 96, 101 ], [ 9, 102 ], [ 102, 103 ], [ 0, 104 ], [ 104, 105 ], [ 104, 106 ] ]
[ "import java.util.ArrayList;\nimport java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String args[]) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint N = stdIn.nextInt();\n\t\tArrayList<Integer> A = new ArrayList<Integer>();\n\t\tfor(int i = 0; i < N; i ++) {\n\t\t\tA.add(stdIn.nextInt());\n\t\t}\n\t\t\n\t\tlong stepSum = 0;\n\t\t\n\t\tfor(int i = 1; i < N; i ++) {\n\t\t\tif(A.get(i - 1) <= A.get(i)) {\n\t\t\t\tcontinue;\n\t\t\t}else {\n\t\t\t\tstepSum += A.get(i - 1) - A.get(i);\n\t\t\t\tA.set(i, A.get(i - 1));\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(stepSum);\n\t}\n}", "import java.util.ArrayList;", "ArrayList", "java.util", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\tpublic static void main(String args[]) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint N = stdIn.nextInt();\n\t\tArrayList<Integer> A = new ArrayList<Integer>();\n\t\tfor(int i = 0; i < N; i ++) {\n\t\t\tA.add(stdIn.nextInt());\n\t\t}\n\t\t\n\t\tlong stepSum = 0;\n\t\t\n\t\tfor(int i = 1; i < N; i ++) {\n\t\t\tif(A.get(i - 1) <= A.get(i)) {\n\t\t\t\tcontinue;\n\t\t\t}else {\n\t\t\t\tstepSum += A.get(i - 1) - A.get(i);\n\t\t\t\tA.set(i, A.get(i - 1));\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(stepSum);\n\t}\n}", "Main", "public static void main(String args[]) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint N = stdIn.nextInt();\n\t\tArrayList<Integer> A = new ArrayList<Integer>();\n\t\tfor(int i = 0; i < N; i ++) {\n\t\t\tA.add(stdIn.nextInt());\n\t\t}\n\t\t\n\t\tlong stepSum = 0;\n\t\t\n\t\tfor(int i = 1; i < N; i ++) {\n\t\t\tif(A.get(i - 1) <= A.get(i)) {\n\t\t\t\tcontinue;\n\t\t\t}else {\n\t\t\t\tstepSum += A.get(i - 1) - A.get(i);\n\t\t\t\tA.set(i, A.get(i - 1));\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(stepSum);\n\t}", "main", "{\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint N = stdIn.nextInt();\n\t\tArrayList<Integer> A = new ArrayList<Integer>();\n\t\tfor(int i = 0; i < N; i ++) {\n\t\t\tA.add(stdIn.nextInt());\n\t\t}\n\t\t\n\t\tlong stepSum = 0;\n\t\t\n\t\tfor(int i = 1; i < N; i ++) {\n\t\t\tif(A.get(i - 1) <= A.get(i)) {\n\t\t\t\tcontinue;\n\t\t\t}else {\n\t\t\t\tstepSum += A.get(i - 1) - A.get(i);\n\t\t\t\tA.set(i, A.get(i - 1));\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(stepSum);\n\t}", "Scanner stdIn = new Scanner(System.in);", "stdIn", "new Scanner(System.in)", "int N = stdIn.nextInt();", "N", "stdIn.nextInt()", "stdIn.nextInt", "stdIn", "ArrayList<Integer> A = new ArrayList<Integer>();", "A", "new ArrayList<Integer>()", "for(int i = 0; i < N; i ++) {\n\t\t\tA.add(stdIn.nextInt());\n\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < N", "i", "N", "i ++", "i ++", "i", "{\n\t\t\tA.add(stdIn.nextInt());\n\t\t}", "{\n\t\t\tA.add(stdIn.nextInt());\n\t\t}", "A.add(stdIn.nextInt())", "A.add", "A", "stdIn.nextInt()", "stdIn.nextInt", "stdIn", "long stepSum = 0;", "stepSum", "0", "for(int i = 1; i < N; i ++) {\n\t\t\tif(A.get(i - 1) <= A.get(i)) {\n\t\t\t\tcontinue;\n\t\t\t}else {\n\t\t\t\tstepSum += A.get(i - 1) - A.get(i);\n\t\t\t\tA.set(i, A.get(i - 1));\n\t\t\t}\n\t\t}", "int i = 1;", "int i = 1;", "i", "1", "i < N", "i", "N", "i ++", "i ++", "i", "{\n\t\t\tif(A.get(i - 1) <= A.get(i)) {\n\t\t\t\tcontinue;\n\t\t\t}else {\n\t\t\t\tstepSum += A.get(i - 1) - A.get(i);\n\t\t\t\tA.set(i, A.get(i - 1));\n\t\t\t}\n\t\t}", "{\n\t\t\tif(A.get(i - 1) <= A.get(i)) {\n\t\t\t\tcontinue;\n\t\t\t}else {\n\t\t\t\tstepSum += A.get(i - 1) - A.get(i);\n\t\t\t\tA.set(i, A.get(i - 1));\n\t\t\t}\n\t\t}", "if(A.get(i - 1) <= A.get(i)) {\n\t\t\t\tcontinue;\n\t\t\t}else {\n\t\t\t\tstepSum += A.get(i - 1) - A.get(i);\n\t\t\t\tA.set(i, A.get(i - 1));\n\t\t\t}", "A.get(i - 1) <= A.get(i)", "A.get(i - 1)", "A.get", "A", "i - 1", "i", "1", "A.get(i)", "A.get", "A", "i", "{\n\t\t\t\tcontinue;\n\t\t\t}", "continue;", "{\n\t\t\t\tstepSum += A.get(i - 1) - A.get(i);\n\t\t\t\tA.set(i, A.get(i - 1));\n\t\t\t}", "stepSum += A.get(i - 1) - A.get(i)", "stepSum", "A.get(i - 1) - A.get(i)", "A.get(i - 1)", "A.get", "A", "i - 1", "i", "1", "A.get(i)", "A.get", "A", "i", "A.set(i, A.get(i - 1))", "A.set", "A", "i", "A.get(i - 1)", "A.get", "A", "i - 1", "i", "1", "System.out.println(stepSum)", "System.out.println", "System.out", "System", "System.out", "stepSum", "String args[]", "args", "public class Main {\n\tpublic static void main(String args[]) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint N = stdIn.nextInt();\n\t\tArrayList<Integer> A = new ArrayList<Integer>();\n\t\tfor(int i = 0; i < N; i ++) {\n\t\t\tA.add(stdIn.nextInt());\n\t\t}\n\t\t\n\t\tlong stepSum = 0;\n\t\t\n\t\tfor(int i = 1; i < N; i ++) {\n\t\t\tif(A.get(i - 1) <= A.get(i)) {\n\t\t\t\tcontinue;\n\t\t\t}else {\n\t\t\t\tstepSum += A.get(i - 1) - A.get(i);\n\t\t\t\tA.set(i, A.get(i - 1));\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(stepSum);\n\t}\n}", "public class Main {\n\tpublic static void main(String args[]) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint N = stdIn.nextInt();\n\t\tArrayList<Integer> A = new ArrayList<Integer>();\n\t\tfor(int i = 0; i < N; i ++) {\n\t\t\tA.add(stdIn.nextInt());\n\t\t}\n\t\t\n\t\tlong stepSum = 0;\n\t\t\n\t\tfor(int i = 1; i < N; i ++) {\n\t\t\tif(A.get(i - 1) <= A.get(i)) {\n\t\t\t\tcontinue;\n\t\t\t}else {\n\t\t\t\tstepSum += A.get(i - 1) - A.get(i);\n\t\t\t\tA.set(i, A.get(i - 1));\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(stepSum);\n\t}\n}", "Main" ]
import java.util.ArrayList; import java.util.Scanner; public class Main { public static void main(String args[]) { Scanner stdIn = new Scanner(System.in); int N = stdIn.nextInt(); ArrayList<Integer> A = new ArrayList<Integer>(); for(int i = 0; i < N; i ++) { A.add(stdIn.nextInt()); } long stepSum = 0; for(int i = 1; i < N; i ++) { if(A.get(i - 1) <= A.get(i)) { continue; }else { stepSum += A.get(i - 1) - A.get(i); A.set(i, A.get(i - 1)); } } System.out.println(stepSum); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 4, 18, 13, 41, 13, 20, 41, 13, 40, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 41, 13, 4, 18, 13, 4, 18, 13, 14, 2, 13, 17, 30, 0, 13, 13, 30, 14, 2, 13, 13, 30, 0, 13, 2, 13, 13, 0, 13, 13, 30, 0, 13, 4, 18, 13, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 13, 14 ], [ 13, 15 ], [ 0, 16 ], [ 16, 17 ], [ 16, 18 ], [ 0, 19 ], [ 105, 20 ], [ 105, 21 ], [ 21, 22 ], [ 21, 23 ], [ 23, 24 ], [ 24, 25 ], [ 24, 26 ], [ 23, 27 ], [ 27, 28 ], [ 27, 29 ], [ 29, 30 ], [ 30, 31 ], [ 29, 32 ], [ 32, 33 ], [ 33, 34 ], [ 23, 35 ], [ 35, 36 ], [ 35, 37 ], [ 23, 38 ], [ 38, 39 ], [ 38, 40 ], [ 40, 41 ], [ 23, 42 ], [ 42, 43 ], [ 42, 44 ], [ 23, 45 ], [ 45, 46 ], [ 46, 47 ], [ 47, 48 ], [ 47, 49 ], [ 45, 50 ], [ 50, 51 ], [ 50, 52 ], [ 45, 53 ], [ 53, 54 ], [ 54, 55 ], [ 45, 56 ], [ 57, 57 ], [ 57, 58 ], [ 58, 59 ], [ 58, 60 ], [ 60, 61 ], [ 61, 62 ], [ 60, 63 ], [ 63, 64 ], [ 64, 65 ], [ 57, 66 ], [ 66, 67 ], [ 67, 68 ], [ 67, 69 ], [ 66, 70 ], [ 70, 71 ], [ 71, 72 ], [ 71, 73 ], [ 66, 74 ], [ 74, 75 ], [ 75, 76 ], [ 76, 77 ], [ 76, 78 ], [ 75, 79 ], [ 79, 80 ], [ 80, 81 ], [ 80, 82 ], [ 82, 83 ], [ 82, 84 ], [ 79, 85 ], [ 85, 86 ], [ 85, 87 ], [ 75, 88 ], [ 88, 89 ], [ 89, 90 ], [ 89, 91 ], [ 91, 92 ], [ 92, 93 ], [ 91, 94 ], [ 91, 95 ], [ 23, 96 ], [ 96, 97 ], [ 97, 98 ], [ 98, 99 ], [ 98, 100 ], [ 96, 101 ], [ 21, 102 ], [ 102, 103 ], [ 0, 104 ], [ 104, 105 ], [ 104, 106 ] ]
[ "\n\nimport java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.io.PrintWriter;\nimport java.math.BigInteger;\nimport java.util.Scanner;\nimport java.util.StringTokenizer;\n\npublic class Main {\n\n\tpublic static void main(String[] args)throws Exception {\n//\n//\t\tScanner sc = new Scanner(System.in);\n//\t\tBigInteger n = sc.nextBigInteger();\n//\t boolean flag=solve(n);\n//\t if(flag==true)\n//\t System.out.println(\"Yes\");\n//\t else\n//\t \t System.out.println(\"No\");\n\t\t\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t\tint n = Integer.parseInt(br.readLine());\n StringTokenizer st = new StringTokenizer(br.readLine());\n int max=-1;\n long sum=0;\n for(int i=0; i<n; i++){\n \tint k = Integer.parseInt(st.nextToken());\n \tif(i==0) {\n \t\tmax=k;\n \t}\n \telse {\n \t\tif(max>k) {\n \t\t\tsum+=max-k;\n \t\t\tk=max;\n \t\t}\n \t\telse {\n \t\t\tmax=Math.max(k, max);\n \t\t}\n \t}\n }\n System.out.println(sum);\n \n\t \n\t}\n\n\t\n\n}", "import java.io.BufferedReader;", "BufferedReader", "java.io", "import java.io.InputStreamReader;", "InputStreamReader", "java.io", "import java.io.PrintWriter;", "PrintWriter", "java.io", "import java.math.BigInteger;", "BigInteger", "java.math", "import java.util.Scanner;", "Scanner", "java.util", "import java.util.StringTokenizer;", "StringTokenizer", "java.util", "public class Main {\n\n\tpublic static void main(String[] args)throws Exception {\n//\n//\t\tScanner sc = new Scanner(System.in);\n//\t\tBigInteger n = sc.nextBigInteger();\n//\t boolean flag=solve(n);\n//\t if(flag==true)\n//\t System.out.println(\"Yes\");\n//\t else\n//\t \t System.out.println(\"No\");\n\t\t\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t\tint n = Integer.parseInt(br.readLine());\n StringTokenizer st = new StringTokenizer(br.readLine());\n int max=-1;\n long sum=0;\n for(int i=0; i<n; i++){\n \tint k = Integer.parseInt(st.nextToken());\n \tif(i==0) {\n \t\tmax=k;\n \t}\n \telse {\n \t\tif(max>k) {\n \t\t\tsum+=max-k;\n \t\t\tk=max;\n \t\t}\n \t\telse {\n \t\t\tmax=Math.max(k, max);\n \t\t}\n \t}\n }\n System.out.println(sum);\n \n\t \n\t}\n\n\t\n\n}", "Main", "public static void main(String[] args)throws Exception {\n//\n//\t\tScanner sc = new Scanner(System.in);\n//\t\tBigInteger n = sc.nextBigInteger();\n//\t boolean flag=solve(n);\n//\t if(flag==true)\n//\t System.out.println(\"Yes\");\n//\t else\n//\t \t System.out.println(\"No\");\n\t\t\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t\tint n = Integer.parseInt(br.readLine());\n StringTokenizer st = new StringTokenizer(br.readLine());\n int max=-1;\n long sum=0;\n for(int i=0; i<n; i++){\n \tint k = Integer.parseInt(st.nextToken());\n \tif(i==0) {\n \t\tmax=k;\n \t}\n \telse {\n \t\tif(max>k) {\n \t\t\tsum+=max-k;\n \t\t\tk=max;\n \t\t}\n \t\telse {\n \t\t\tmax=Math.max(k, max);\n \t\t}\n \t}\n }\n System.out.println(sum);\n \n\t \n\t}", "main", "{\n//\n//\t\tScanner sc = new Scanner(System.in);\n//\t\tBigInteger n = sc.nextBigInteger();\n//\t boolean flag=solve(n);\n//\t if(flag==true)\n//\t System.out.println(\"Yes\");\n//\t else\n//\t \t System.out.println(\"No\");\n\t\t\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t\tint n = Integer.parseInt(br.readLine());\n StringTokenizer st = new StringTokenizer(br.readLine());\n int max=-1;\n long sum=0;\n for(int i=0; i<n; i++){\n \tint k = Integer.parseInt(st.nextToken());\n \tif(i==0) {\n \t\tmax=k;\n \t}\n \telse {\n \t\tif(max>k) {\n \t\t\tsum+=max-k;\n \t\t\tk=max;\n \t\t}\n \t\telse {\n \t\t\tmax=Math.max(k, max);\n \t\t}\n \t}\n }\n System.out.println(sum);\n \n\t \n\t}", "BufferedReader br = new BufferedReader(new InputStreamReader(System.in));", "br", "new BufferedReader(new InputStreamReader(System.in))", "int n = Integer.parseInt(br.readLine());", "n", "Integer.parseInt(br.readLine())", "Integer.parseInt", "Integer", "br.readLine()", "br.readLine", "br", "StringTokenizer st = new StringTokenizer(br.readLine());", "st", "new StringTokenizer(br.readLine())", "int max=-1;", "max", "-1", "1", "long sum=0;", "sum", "0", "for(int i=0; i<n; i++){\n \tint k = Integer.parseInt(st.nextToken());\n \tif(i==0) {\n \t\tmax=k;\n \t}\n \telse {\n \t\tif(max>k) {\n \t\t\tsum+=max-k;\n \t\t\tk=max;\n \t\t}\n \t\telse {\n \t\t\tmax=Math.max(k, max);\n \t\t}\n \t}\n }", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\n \tint k = Integer.parseInt(st.nextToken());\n \tif(i==0) {\n \t\tmax=k;\n \t}\n \telse {\n \t\tif(max>k) {\n \t\t\tsum+=max-k;\n \t\t\tk=max;\n \t\t}\n \t\telse {\n \t\t\tmax=Math.max(k, max);\n \t\t}\n \t}\n }", "{\n \tint k = Integer.parseInt(st.nextToken());\n \tif(i==0) {\n \t\tmax=k;\n \t}\n \telse {\n \t\tif(max>k) {\n \t\t\tsum+=max-k;\n \t\t\tk=max;\n \t\t}\n \t\telse {\n \t\t\tmax=Math.max(k, max);\n \t\t}\n \t}\n }", "int k = Integer.parseInt(st.nextToken());", "k", "Integer.parseInt(st.nextToken())", "Integer.parseInt", "Integer", "st.nextToken()", "st.nextToken", "st", "if(i==0) {\n \t\tmax=k;\n \t}\n \telse {\n \t\tif(max>k) {\n \t\t\tsum+=max-k;\n \t\t\tk=max;\n \t\t}\n \t\telse {\n \t\t\tmax=Math.max(k, max);\n \t\t}\n \t}", "i==0", "i", "0", "{\n \t\tmax=k;\n \t}", "max=k", "max", "k", "{\n \t\tif(max>k) {\n \t\t\tsum+=max-k;\n \t\t\tk=max;\n \t\t}\n \t\telse {\n \t\t\tmax=Math.max(k, max);\n \t\t}\n \t}", "if(max>k) {\n \t\t\tsum+=max-k;\n \t\t\tk=max;\n \t\t}\n \t\telse {\n \t\t\tmax=Math.max(k, max);\n \t\t}", "max>k", "max", "k", "{\n \t\t\tsum+=max-k;\n \t\t\tk=max;\n \t\t}", "sum+=max-k", "sum", "max-k", "max", "k", "k=max", "k", "max", "{\n \t\t\tmax=Math.max(k, max);\n \t\t}", "max=Math.max(k, max)", "max", "Math.max(k, max)", "Math.max", "Math", "k", "max", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "String[] args", "args", "public class Main {\n\n\tpublic static void main(String[] args)throws Exception {\n//\n//\t\tScanner sc = new Scanner(System.in);\n//\t\tBigInteger n = sc.nextBigInteger();\n//\t boolean flag=solve(n);\n//\t if(flag==true)\n//\t System.out.println(\"Yes\");\n//\t else\n//\t \t System.out.println(\"No\");\n\t\t\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t\tint n = Integer.parseInt(br.readLine());\n StringTokenizer st = new StringTokenizer(br.readLine());\n int max=-1;\n long sum=0;\n for(int i=0; i<n; i++){\n \tint k = Integer.parseInt(st.nextToken());\n \tif(i==0) {\n \t\tmax=k;\n \t}\n \telse {\n \t\tif(max>k) {\n \t\t\tsum+=max-k;\n \t\t\tk=max;\n \t\t}\n \t\telse {\n \t\t\tmax=Math.max(k, max);\n \t\t}\n \t}\n }\n System.out.println(sum);\n \n\t \n\t}\n\n\t\n\n}", "public class Main {\n\n\tpublic static void main(String[] args)throws Exception {\n//\n//\t\tScanner sc = new Scanner(System.in);\n//\t\tBigInteger n = sc.nextBigInteger();\n//\t boolean flag=solve(n);\n//\t if(flag==true)\n//\t System.out.println(\"Yes\");\n//\t else\n//\t \t System.out.println(\"No\");\n\t\t\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t\tint n = Integer.parseInt(br.readLine());\n StringTokenizer st = new StringTokenizer(br.readLine());\n int max=-1;\n long sum=0;\n for(int i=0; i<n; i++){\n \tint k = Integer.parseInt(st.nextToken());\n \tif(i==0) {\n \t\tmax=k;\n \t}\n \telse {\n \t\tif(max>k) {\n \t\t\tsum+=max-k;\n \t\t\tk=max;\n \t\t}\n \t\telse {\n \t\t\tmax=Math.max(k, max);\n \t\t}\n \t}\n }\n System.out.println(sum);\n \n\t \n\t}\n\n\t\n\n}", "Main" ]
import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.PrintWriter; import java.math.BigInteger; import java.util.Scanner; import java.util.StringTokenizer; public class Main { public static void main(String[] args)throws Exception { // // Scanner sc = new Scanner(System.in); // BigInteger n = sc.nextBigInteger(); // boolean flag=solve(n); // if(flag==true) // System.out.println("Yes"); // else // System.out.println("No"); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); StringTokenizer st = new StringTokenizer(br.readLine()); int max=-1; long sum=0; for(int i=0; i<n; i++){ int k = Integer.parseInt(st.nextToken()); if(i==0) { max=k; } else { if(max>k) { sum+=max-k; k=max; } else { max=Math.max(k, max); } } } System.out.println(sum); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 17, 41, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 13, 0, 13, 4, 18, 13, 41, 13, 2, 13, 13, 14, 2, 13, 17, 30, 0, 13, 13, 0, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 72, 5 ], [ 72, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 8, 20 ], [ 20, 21 ], [ 20, 22 ], [ 8, 23 ], [ 23, 24 ], [ 23, 25 ], [ 8, 26 ], [ 26, 27 ], [ 27, 28 ], [ 28, 29 ], [ 28, 30 ], [ 26, 31 ], [ 31, 32 ], [ 31, 33 ], [ 26, 34 ], [ 34, 35 ], [ 35, 36 ], [ 26, 37 ], [ 38, 38 ], [ 38, 39 ], [ 39, 40 ], [ 39, 41 ], [ 38, 42 ], [ 42, 43 ], [ 42, 44 ], [ 44, 45 ], [ 45, 46 ], [ 38, 47 ], [ 47, 48 ], [ 47, 49 ], [ 49, 50 ], [ 49, 51 ], [ 38, 52 ], [ 52, 53 ], [ 53, 54 ], [ 53, 55 ], [ 52, 56 ], [ 56, 57 ], [ 57, 58 ], [ 57, 59 ], [ 56, 60 ], [ 60, 61 ], [ 60, 62 ], [ 8, 63 ], [ 63, 64 ], [ 64, 65 ], [ 65, 66 ], [ 65, 67 ], [ 63, 68 ], [ 6, 69 ], [ 69, 70 ], [ 0, 71 ], [ 71, 72 ], [ 71, 73 ] ]
[ "import java.util.Scanner;\n\npublic class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n long tmp1 = 0;\n long tmp2 = 0;\n long ans = 0;\n\n for (int i = 0; i < n; i++) {\n tmp1 = tmp2;\n tmp2 = sc.nextInt();\n long x = tmp1 - tmp2;\n if (x > 0) {\n ans += x;\n tmp2 += x;\n }\n }\n System.out.println(ans);\n }\n}", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n long tmp1 = 0;\n long tmp2 = 0;\n long ans = 0;\n\n for (int i = 0; i < n; i++) {\n tmp1 = tmp2;\n tmp2 = sc.nextInt();\n long x = tmp1 - tmp2;\n if (x > 0) {\n ans += x;\n tmp2 += x;\n }\n }\n System.out.println(ans);\n }\n}", "Main", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n long tmp1 = 0;\n long tmp2 = 0;\n long ans = 0;\n\n for (int i = 0; i < n; i++) {\n tmp1 = tmp2;\n tmp2 = sc.nextInt();\n long x = tmp1 - tmp2;\n if (x > 0) {\n ans += x;\n tmp2 += x;\n }\n }\n System.out.println(ans);\n }", "main", "{\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n long tmp1 = 0;\n long tmp2 = 0;\n long ans = 0;\n\n for (int i = 0; i < n; i++) {\n tmp1 = tmp2;\n tmp2 = sc.nextInt();\n long x = tmp1 - tmp2;\n if (x > 0) {\n ans += x;\n tmp2 += x;\n }\n }\n System.out.println(ans);\n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "long tmp1 = 0;", "tmp1", "0", "long tmp2 = 0;", "tmp2", "0", "long ans = 0;", "ans", "0", "for (int i = 0; i < n; i++) {\n tmp1 = tmp2;\n tmp2 = sc.nextInt();\n long x = tmp1 - tmp2;\n if (x > 0) {\n ans += x;\n tmp2 += x;\n }\n }", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n tmp1 = tmp2;\n tmp2 = sc.nextInt();\n long x = tmp1 - tmp2;\n if (x > 0) {\n ans += x;\n tmp2 += x;\n }\n }", "{\n tmp1 = tmp2;\n tmp2 = sc.nextInt();\n long x = tmp1 - tmp2;\n if (x > 0) {\n ans += x;\n tmp2 += x;\n }\n }", "tmp1 = tmp2", "tmp1", "tmp2", "tmp2 = sc.nextInt()", "tmp2", "sc.nextInt()", "sc.nextInt", "sc", "long x = tmp1 - tmp2;", "x", "tmp1 - tmp2", "tmp1", "tmp2", "if (x > 0) {\n ans += x;\n tmp2 += x;\n }", "x > 0", "x", "0", "{\n ans += x;\n tmp2 += x;\n }", "ans += x", "ans", "x", "tmp2 += x", "tmp2", "x", "System.out.println(ans)", "System.out.println", "System.out", "System", "System.out", "ans", "String[] args", "args", "public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n long tmp1 = 0;\n long tmp2 = 0;\n long ans = 0;\n\n for (int i = 0; i < n; i++) {\n tmp1 = tmp2;\n tmp2 = sc.nextInt();\n long x = tmp1 - tmp2;\n if (x > 0) {\n ans += x;\n tmp2 += x;\n }\n }\n System.out.println(ans);\n }\n}", "public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n long tmp1 = 0;\n long tmp2 = 0;\n long ans = 0;\n\n for (int i = 0; i < n; i++) {\n tmp1 = tmp2;\n tmp2 = sc.nextInt();\n long x = tmp1 - tmp2;\n if (x > 0) {\n ans += x;\n tmp2 += x;\n }\n }\n System.out.println(ans);\n }\n}", "Main" ]
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long tmp1 = 0; long tmp2 = 0; long ans = 0; for (int i = 0; i < n; i++) { tmp1 = tmp2; tmp2 = sc.nextInt(); long x = tmp1 - tmp2; if (x > 0) { ans += x; tmp2 += x; } } System.out.println(ans); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 38, 5, 13, 30, 4, 18, 13, 30, 30, 41, 13, 20, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 4, 18, 13, 4, 18, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 4, 18, 13, 13, 4, 18, 13, 2, 13, 17, 30, 0, 13, 2, 4, 18, 13, 2, 13, 17, 4, 18, 13, 13, 4, 18, 13, 13, 2, 2, 4, 18, 13, 13, 4, 18, 13, 2, 13, 17, 4, 18, 13, 13, 4, 18, 13, 13, 4, 18, 13, 4, 18, 13, 23, 13, 6, 13, 41, 13, 41, 13, 12, 13, 30, 0, 13, 20, 12, 13, 30, 42, 2, 2, 13, 17, 40, 4, 18, 13, 30, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 20, 29, 4, 18, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 41, 13, 17, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 4, 18, 13, 29, 13, 6, 13, 41, 13, 2, 17, 17, 41, 13, 41, 13, 41, 13, 41, 13, 12, 13, 30, 0, 13, 20, 0, 13, 20, 13, 0, 13, 0, 13, 17, 12, 13, 30, 0, 13, 20, 0, 13, 20, 13, 0, 13, 0, 13, 17, 23, 13, 12, 13, 30, 41, 13, 20, 17, 41, 13, 17, 41, 13, 42, 2, 0, 13, 4, 13, 40, 17, 30, 14, 2, 13, 17, 3, 0, 18, 13, 40, 13, 13, 29, 20, 12, 13, 30, 41, 13, 17, 41, 13, 4, 13, 42, 2, 13, 17, 0, 13, 4, 13, 41, 13, 2, 13, 17, 14, 13, 0, 13, 4, 13, 42, 2, 2, 0, 13, 4, 13, 17, 2, 13, 17, 30, 0, 13, 2, 2, 2, 13, 17, 13, 17, 14, 13, 29, 40, 13, 29, 13, 12, 13, 30, 41, 13, 17, 41, 13, 4, 13, 42, 2, 13, 17, 0, 13, 4, 13, 41, 13, 2, 13, 17, 14, 13, 0, 13, 4, 13, 42, 2, 2, 0, 13, 4, 13, 17, 2, 13, 17, 30, 0, 13, 2, 2, 2, 13, 17, 13, 17, 14, 13, 29, 40, 13, 29, 13, 12, 13, 30, 41, 13, 17, 41, 13, 17, 41, 13, 4, 13, 42, 2, 13, 17, 0, 13, 4, 13, 41, 13, 2, 13, 17, 14, 13, 0, 13, 4, 13, 42, 2, 2, 0, 13, 4, 13, 17, 2, 13, 17, 30, 0, 13, 2, 2, 2, 13, 17, 13, 17, 14, 2, 13, 17, 30, 42, 2, 2, 0, 13, 4, 13, 17, 2, 13, 17, 30, 0, 13, 2, 2, 13, 17, 0, 13, 17, 14, 13, 29, 40, 13, 29, 13, 12, 13, 30, 0, 13, 4, 18, 13, 13, 0, 13, 17, 13, 14, 2, 13, 40, 17, 0, 18, 13, 17, 40, 17, 12, 13, 30, 14, 2, 13, 13, 4, 13, 29, 18, 13, 40, 13, 12, 13, 30, 14, 2, 13, 17, 29, 4, 18, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 528, 8 ], [ 528, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 13, 14 ], [ 13, 15 ], [ 15, 16 ], [ 16, 17 ], [ 17, 18 ], [ 12, 19 ], [ 12, 20 ], [ 20, 21 ], [ 21, 22 ], [ 21, 23 ], [ 20, 24 ], [ 24, 25 ], [ 24, 26 ], [ 20, 27 ], [ 27, 28 ], [ 27, 29 ], [ 29, 30 ], [ 30, 31 ], [ 20, 32 ], [ 32, 33 ], [ 32, 34 ], [ 20, 35 ], [ 35, 36 ], [ 36, 37 ], [ 37, 38 ], [ 37, 39 ], [ 35, 40 ], [ 40, 41 ], [ 40, 42 ], [ 35, 43 ], [ 43, 44 ], [ 44, 45 ], [ 35, 46 ], [ 46, 47 ], [ 47, 48 ], [ 48, 49 ], [ 47, 50 ], [ 50, 51 ], [ 51, 52 ], [ 20, 53 ], [ 53, 54 ], [ 53, 55 ], [ 20, 56 ], [ 56, 57 ], [ 57, 58 ], [ 58, 59 ], [ 58, 60 ], [ 56, 61 ], [ 61, 62 ], [ 61, 63 ], [ 56, 64 ], [ 64, 65 ], [ 65, 66 ], [ 56, 67 ], [ 68, 68 ], [ 68, 69 ], [ 69, 70 ], [ 70, 71 ], [ 71, 72 ], [ 72, 73 ], [ 71, 74 ], [ 70, 75 ], [ 75, 76 ], [ 76, 77 ], [ 75, 78 ], [ 78, 79 ], [ 78, 80 ], [ 69, 81 ], [ 81, 82 ], [ 82, 83 ], [ 82, 84 ], [ 84, 85 ], [ 85, 86 ], [ 86, 87 ], [ 85, 88 ], [ 88, 89 ], [ 88, 90 ], [ 84, 91 ], [ 91, 92 ], [ 92, 93 ], [ 91, 94 ], [ 81, 95 ], [ 95, 96 ], [ 96, 97 ], [ 95, 98 ], [ 95, 99 ], [ 99, 100 ], [ 100, 101 ], [ 101, 102 ], [ 102, 103 ], [ 101, 104 ], [ 100, 105 ], [ 105, 106 ], [ 106, 107 ], [ 105, 108 ], [ 108, 109 ], [ 108, 110 ], [ 99, 111 ], [ 111, 112 ], [ 112, 113 ], [ 111, 114 ], [ 20, 115 ], [ 115, 116 ], [ 116, 117 ], [ 115, 118 ], [ 20, 119 ], [ 119, 120 ], [ 120, 121 ], [ 20, 122 ], [ 122, 123 ], [ 123, 124 ], [ 9, 125 ], [ 125, 126 ], [ 528, 127 ], [ 127, 128 ], [ 127, 129 ], [ 129, 130 ], [ 127, 131 ], [ 131, 132 ], [ 127, 133 ], [ 133, 134 ], [ 133, 135 ], [ 135, 136 ], [ 136, 137 ], [ 136, 138 ], [ 127, 139 ], [ 139, 140 ], [ 139, 141 ], [ 141, 142 ], [ 142, 143 ], [ 143, 144 ], [ 144, 145 ], [ 144, 146 ], [ 143, 147 ], [ 147, 148 ], [ 148, 149 ], [ 149, 150 ], [ 142, 151 ], [ 151, 152 ], [ 152, 153 ], [ 153, 154 ], [ 153, 155 ], [ 155, 156 ], [ 156, 157 ], [ 157, 158 ], [ 152, 159 ], [ 159, 160 ], [ 160, 161 ], [ 160, 162 ], [ 141, 163 ], [ 163, 164 ], [ 164, 165 ], [ 165, 166 ], [ 127, 167 ], [ 167, 168 ], [ 167, 169 ], [ 169, 170 ], [ 170, 171 ], [ 171, 172 ], [ 172, 173 ], [ 171, 174 ], [ 174, 175 ], [ 127, 176 ], [ 176, 177 ], [ 176, 178 ], [ 178, 179 ], [ 179, 180 ], [ 179, 181 ], [ 178, 182 ], [ 182, 183 ], [ 183, 184 ], [ 183, 185 ], [ 185, 186 ], [ 186, 187 ], [ 187, 188 ], [ 182, 189 ], [ 189, 190 ], [ 190, 191 ], [ 190, 192 ], [ 192, 193 ], [ 193, 194 ], [ 178, 195 ], [ 195, 196 ], [ 528, 197 ], [ 197, 198 ], [ 197, 199 ], [ 199, 200 ], [ 199, 201 ], [ 201, 202 ], [ 201, 203 ], [ 197, 204 ], [ 204, 205 ], [ 197, 206 ], [ 206, 207 ], [ 197, 208 ], [ 208, 209 ], [ 197, 210 ], [ 210, 211 ], [ 197, 212 ], [ 212, 213 ], [ 212, 214 ], [ 214, 215 ], [ 215, 216 ], [ 215, 217 ], [ 214, 218 ], [ 218, 219 ], [ 218, 220 ], [ 214, 222 ], [ 222, 223 ], [ 222, 224 ], [ 224, 225 ], [ 224, 226 ], [ 197, 227 ], [ 227, 228 ], [ 227, 229 ], [ 229, 230 ], [ 230, 231 ], [ 230, 232 ], [ 229, 233 ], [ 233, 234 ], [ 233, 235 ], [ 229, 237 ], [ 237, 238 ], [ 237, 239 ], [ 239, 240 ], [ 239, 241 ], [ 227, 242 ], [ 242, 243 ], [ 197, 244 ], [ 244, 245 ], [ 244, 246 ], [ 246, 247 ], [ 247, 248 ], [ 247, 249 ], [ 246, 251 ], [ 251, 252 ], [ 251, 253 ], [ 246, 254 ], [ 254, 255 ], [ 246, 256 ], [ 256, 257 ], [ 257, 258 ], [ 258, 259 ], [ 258, 260 ], [ 260, 261 ], [ 257, 262 ], [ 262, 263 ], [ 256, 264 ], [ 264, 265 ], [ 265, 266 ], [ 266, 267 ], [ 266, 268 ], [ 265, 269 ], [ 264, 270 ], [ 270, 271 ], [ 271, 272 ], [ 271, 273 ], [ 273, 274 ], [ 270, 275 ], [ 246, 276 ], [ 276, 277 ], [ 197, 278 ], [ 278, 279 ], [ 278, 280 ], [ 280, 281 ], [ 281, 282 ], [ 281, 283 ], [ 280, 284 ], [ 284, 285 ], [ 284, 286 ], [ 286, 287 ], [ 280, 288 ], [ 288, 289 ], [ 289, 290 ], [ 289, 291 ], [ 288, 292 ], [ 292, 293 ], [ 292, 294 ], [ 294, 295 ], [ 280, 296 ], [ 296, 297 ], [ 296, 298 ], [ 298, 299 ], [ 298, 300 ], [ 280, 301 ], [ 301, 302 ], [ 301, 303 ], [ 303, 304 ], [ 303, 305 ], [ 305, 306 ], [ 280, 307 ], [ 307, 308 ], [ 308, 309 ], [ 309, 310 ], [ 310, 311 ], [ 310, 312 ], [ 312, 313 ], [ 309, 314 ], [ 308, 315 ], [ 315, 316 ], [ 315, 317 ], [ 307, 318 ], [ 318, 319 ], [ 319, 320 ], [ 319, 321 ], [ 321, 322 ], [ 322, 323 ], [ 323, 324 ], [ 323, 325 ], [ 322, 326 ], [ 321, 327 ], [ 280, 328 ], [ 328, 329 ], [ 328, 330 ], [ 330, 331 ], [ 331, 332 ], [ 280, 333 ], [ 333, 334 ], [ 197, 335 ], [ 335, 336 ], [ 335, 337 ], [ 337, 338 ], [ 338, 339 ], [ 338, 340 ], [ 337, 341 ], [ 341, 342 ], [ 341, 343 ], [ 343, 344 ], [ 337, 345 ], [ 345, 346 ], [ 346, 347 ], [ 346, 348 ], [ 345, 349 ], [ 349, 350 ], [ 349, 351 ], [ 351, 352 ], [ 337, 353 ], [ 353, 354 ], [ 353, 355 ], [ 355, 356 ], [ 355, 357 ], [ 337, 358 ], [ 358, 359 ], [ 358, 360 ], [ 360, 361 ], [ 360, 362 ], [ 362, 363 ], [ 337, 364 ], [ 364, 365 ], [ 365, 366 ], [ 366, 367 ], [ 367, 368 ], [ 367, 369 ], [ 369, 370 ], [ 366, 371 ], [ 365, 372 ], [ 372, 373 ], [ 372, 374 ], [ 364, 375 ], [ 375, 376 ], [ 376, 377 ], [ 376, 378 ], [ 378, 379 ], [ 379, 380 ], [ 380, 381 ], [ 380, 382 ], [ 379, 383 ], [ 378, 384 ], [ 337, 385 ], [ 385, 386 ], [ 385, 387 ], [ 387, 388 ], [ 388, 389 ], [ 337, 390 ], [ 390, 391 ], [ 197, 392 ], [ 392, 393 ], [ 392, 394 ], [ 394, 395 ], [ 395, 396 ], [ 395, 397 ], [ 394, 398 ], [ 398, 399 ], [ 398, 400 ], [ 394, 401 ], [ 401, 402 ], [ 401, 403 ], [ 403, 404 ], [ 394, 405 ], [ 405, 406 ], [ 406, 407 ], [ 406, 408 ], [ 405, 409 ], [ 409, 410 ], [ 409, 411 ], [ 411, 412 ], [ 394, 413 ], [ 413, 414 ], [ 413, 415 ], [ 415, 416 ], [ 415, 417 ], [ 394, 418 ], [ 418, 419 ], [ 418, 420 ], [ 420, 421 ], [ 420, 422 ], [ 422, 423 ], [ 394, 424 ], [ 424, 425 ], [ 425, 426 ], [ 426, 427 ], [ 427, 428 ], [ 427, 429 ], [ 429, 430 ], [ 426, 431 ], [ 425, 432 ], [ 432, 433 ], [ 432, 434 ], [ 424, 435 ], [ 435, 436 ], [ 436, 437 ], [ 436, 438 ], [ 438, 439 ], [ 439, 440 ], [ 440, 441 ], [ 440, 442 ], [ 439, 443 ], [ 438, 444 ], [ 394, 445 ], [ 445, 446 ], [ 446, 447 ], [ 446, 448 ], [ 445, 449 ], [ 449, 450 ], [ 450, 451 ], [ 451, 452 ], [ 452, 453 ], [ 453, 454 ], [ 453, 455 ], [ 455, 456 ], [ 452, 457 ], [ 451, 458 ], [ 458, 459 ], [ 458, 460 ], [ 450, 461 ], [ 461, 462 ], [ 462, 463 ], [ 462, 464 ], [ 464, 465 ], [ 465, 466 ], [ 465, 467 ], [ 464, 468 ], [ 468, 469 ], [ 468, 470 ], [ 394, 471 ], [ 471, 472 ], [ 471, 473 ], [ 473, 474 ], [ 474, 475 ], [ 394, 476 ], [ 476, 477 ], [ 197, 478 ], [ 478, 479 ], [ 478, 480 ], [ 480, 481 ], [ 481, 482 ], [ 481, 483 ], [ 483, 484 ], [ 484, 485 ], [ 483, 486 ], [ 483, 487 ], [ 487, 488 ], [ 487, 489 ], [ 483, 490 ], [ 480, 491 ], [ 491, 492 ], [ 492, 493 ], [ 492, 494 ], [ 494, 495 ], [ 491, 496 ], [ 496, 497 ], [ 497, 498 ], [ 497, 499 ], [ 496, 500 ], [ 500, 501 ], [ 197, 502 ], [ 502, 503 ], [ 502, 504 ], [ 504, 505 ], [ 505, 506 ], [ 506, 507 ], [ 506, 508 ], [ 505, 509 ], [ 509, 510 ], [ 504, 511 ], [ 511, 512 ], [ 512, 513 ], [ 512, 514 ], [ 514, 515 ], [ 197, 516 ], [ 516, 517 ], [ 516, 518 ], [ 518, 519 ], [ 519, 520 ], [ 520, 521 ], [ 520, 522 ], [ 519, 523 ], [ 518, 524 ], [ 524, 525 ], [ 525, 526 ], [ 0, 527 ], [ 527, 528 ], [ 527, 529 ] ]
[ "import java.util.*;\nimport java.io.*;\n\npublic class Main {\n\n static class FastReader\n {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader()\n {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next()\n {\n while(st==null || !st.hasMoreElements())\n {\n try\n {\n st = new StringTokenizer(br.readLine());\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt()\n {\n return Integer.parseInt(next());\n }\n\n String nextLine()\n {\n String str = \"\";\n\n try\n {\n str = br.readLine();\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n return str;\n }\n }\n\n static class Reader\n {\n final private int BUFFER_SIZE = 1 << 16;\n private DataInputStream din;\n private byte[] buffer;\n private int bufferPointer, bytesRead;\n\n public Reader()\n {\n din = new DataInputStream(System.in);\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n public Reader(String file_name) throws IOException\n {\n din = new DataInputStream(new FileInputStream(file_name));\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n public String readLine() throws IOException\n {\n byte[] buf = new byte[64]; // line length\n int cnt = 0, c;\n while ((c = read()) != -1)\n {\n if (c == '\\n')\n break;\n buf[cnt++] = (byte) c;\n }\n return new String(buf, 0, cnt);\n }\n\n public int nextInt() throws IOException\n {\n int ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do\n {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n\n if (neg)\n return -ret;\n return ret;\n }\n\n public long nextLong() throws IOException\n {\n long ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n }\n while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }\n\n public double nextDouble() throws IOException\n {\n double ret = 0, div = 1;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n\n do {\n ret = ret * 10 + c - '0';\n }\n while ((c = read()) >= '0' && c <= '9');\n\n if (c == '.')\n {\n while ((c = read()) >= '0' && c <= '9')\n {\n ret += (c - '0') / (div *= 10);\n }\n }\n\n if (neg)\n return -ret;\n return ret;\n }\n\n private void fillBuffer() throws IOException\n {\n bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);\n if (bytesRead == -1)\n buffer[0] = -1;\n }\n\n private byte read() throws IOException\n {\n if (bufferPointer == bytesRead)\n fillBuffer();\n return buffer[bufferPointer++];\n }\n\n public void close() throws IOException\n {\n if (din == null)\n return;\n din.close();\n }\n }\n\n public static void main(String[] args) throws java.lang.Exception\n {\n try\n {\n //FastReader fr = new FastReader();\n Reader fr = new Reader();\n PrintWriter out = new PrintWriter(System.out);\n\n int n = fr.nextInt();\n List<Long> list = new ArrayList<>();\n for (int i=0;i<n;i++) list.add(fr.nextLong());\n\n long sum = 0;\n\n for (int i=1;i<n;i++)\n {\n if (list.get(i)<list.get(i-1))\n {\n sum+=list.get(i-1)-list.get(i);\n\n list.set(i,list.get(i)+list.get(i-1)-list.get(i));\n }\n }\n\n out.println(sum);\n\n out.flush();\n out.close();\n }\n\n catch(Exception e){e.printStackTrace();}\n finally{}\n }\n}", "import java.util.*;", "util.*", "java", "import java.io.*;", "io.*", "java", "public class Main {\n\n static class FastReader\n {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader()\n {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next()\n {\n while(st==null || !st.hasMoreElements())\n {\n try\n {\n st = new StringTokenizer(br.readLine());\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt()\n {\n return Integer.parseInt(next());\n }\n\n String nextLine()\n {\n String str = \"\";\n\n try\n {\n str = br.readLine();\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n return str;\n }\n }\n\n static class Reader\n {\n final private int BUFFER_SIZE = 1 << 16;\n private DataInputStream din;\n private byte[] buffer;\n private int bufferPointer, bytesRead;\n\n public Reader()\n {\n din = new DataInputStream(System.in);\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n public Reader(String file_name) throws IOException\n {\n din = new DataInputStream(new FileInputStream(file_name));\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n public String readLine() throws IOException\n {\n byte[] buf = new byte[64]; // line length\n int cnt = 0, c;\n while ((c = read()) != -1)\n {\n if (c == '\\n')\n break;\n buf[cnt++] = (byte) c;\n }\n return new String(buf, 0, cnt);\n }\n\n public int nextInt() throws IOException\n {\n int ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do\n {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n\n if (neg)\n return -ret;\n return ret;\n }\n\n public long nextLong() throws IOException\n {\n long ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n }\n while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }\n\n public double nextDouble() throws IOException\n {\n double ret = 0, div = 1;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n\n do {\n ret = ret * 10 + c - '0';\n }\n while ((c = read()) >= '0' && c <= '9');\n\n if (c == '.')\n {\n while ((c = read()) >= '0' && c <= '9')\n {\n ret += (c - '0') / (div *= 10);\n }\n }\n\n if (neg)\n return -ret;\n return ret;\n }\n\n private void fillBuffer() throws IOException\n {\n bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);\n if (bytesRead == -1)\n buffer[0] = -1;\n }\n\n private byte read() throws IOException\n {\n if (bufferPointer == bytesRead)\n fillBuffer();\n return buffer[bufferPointer++];\n }\n\n public void close() throws IOException\n {\n if (din == null)\n return;\n din.close();\n }\n }\n\n public static void main(String[] args) throws java.lang.Exception\n {\n try\n {\n //FastReader fr = new FastReader();\n Reader fr = new Reader();\n PrintWriter out = new PrintWriter(System.out);\n\n int n = fr.nextInt();\n List<Long> list = new ArrayList<>();\n for (int i=0;i<n;i++) list.add(fr.nextLong());\n\n long sum = 0;\n\n for (int i=1;i<n;i++)\n {\n if (list.get(i)<list.get(i-1))\n {\n sum+=list.get(i-1)-list.get(i);\n\n list.set(i,list.get(i)+list.get(i-1)-list.get(i));\n }\n }\n\n out.println(sum);\n\n out.flush();\n out.close();\n }\n\n catch(Exception e){e.printStackTrace();}\n finally{}\n }\n}", "Main", "public static void main(String[] args) throws java.lang.Exception\n {\n try\n {\n //FastReader fr = new FastReader();\n Reader fr = new Reader();\n PrintWriter out = new PrintWriter(System.out);\n\n int n = fr.nextInt();\n List<Long> list = new ArrayList<>();\n for (int i=0;i<n;i++) list.add(fr.nextLong());\n\n long sum = 0;\n\n for (int i=1;i<n;i++)\n {\n if (list.get(i)<list.get(i-1))\n {\n sum+=list.get(i-1)-list.get(i);\n\n list.set(i,list.get(i)+list.get(i-1)-list.get(i));\n }\n }\n\n out.println(sum);\n\n out.flush();\n out.close();\n }\n\n catch(Exception e){e.printStackTrace();}\n finally{}\n }", "main", "{\n try\n {\n //FastReader fr = new FastReader();\n Reader fr = new Reader();\n PrintWriter out = new PrintWriter(System.out);\n\n int n = fr.nextInt();\n List<Long> list = new ArrayList<>();\n for (int i=0;i<n;i++) list.add(fr.nextLong());\n\n long sum = 0;\n\n for (int i=1;i<n;i++)\n {\n if (list.get(i)<list.get(i-1))\n {\n sum+=list.get(i-1)-list.get(i);\n\n list.set(i,list.get(i)+list.get(i-1)-list.get(i));\n }\n }\n\n out.println(sum);\n\n out.flush();\n out.close();\n }\n\n catch(Exception e){e.printStackTrace();}\n finally{}\n }", "try\n {\n //FastReader fr = new FastReader();\n Reader fr = new Reader();\n PrintWriter out = new PrintWriter(System.out);\n\n int n = fr.nextInt();\n List<Long> list = new ArrayList<>();\n for (int i=0;i<n;i++) list.add(fr.nextLong());\n\n long sum = 0;\n\n for (int i=1;i<n;i++)\n {\n if (list.get(i)<list.get(i-1))\n {\n sum+=list.get(i-1)-list.get(i);\n\n list.set(i,list.get(i)+list.get(i-1)-list.get(i));\n }\n }\n\n out.println(sum);\n\n out.flush();\n out.close();\n }\n\n catch(Exception e){e.printStackTrace();}\n finally{}", "catch(Exception e){e.printStackTrace();}", "Exception e", "{e.printStackTrace();}", "e.printStackTrace()", "e.printStackTrace", "e", "{}", "{\n //FastReader fr = new FastReader();\n Reader fr = new Reader();\n PrintWriter out = new PrintWriter(System.out);\n\n int n = fr.nextInt();\n List<Long> list = new ArrayList<>();\n for (int i=0;i<n;i++) list.add(fr.nextLong());\n\n long sum = 0;\n\n for (int i=1;i<n;i++)\n {\n if (list.get(i)<list.get(i-1))\n {\n sum+=list.get(i-1)-list.get(i);\n\n list.set(i,list.get(i)+list.get(i-1)-list.get(i));\n }\n }\n\n out.println(sum);\n\n out.flush();\n out.close();\n }", "Reader fr = new Reader();", "fr", "new Reader()", "PrintWriter out = new PrintWriter(System.out);", "out", "new PrintWriter(System.out)", "int n = fr.nextInt();", "n", "fr.nextInt()", "fr.nextInt", "fr", "List<Long> list = new ArrayList<>();", "list", "new ArrayList<>()", "for (int i=0;i<n;i++) list.add(fr.nextLong());", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "list.add(fr.nextLong());", "list.add(fr.nextLong())", "list.add", "list", "fr.nextLong()", "fr.nextLong", "fr", "long sum = 0;", "sum", "0", "for (int i=1;i<n;i++)\n {\n if (list.get(i)<list.get(i-1))\n {\n sum+=list.get(i-1)-list.get(i);\n\n list.set(i,list.get(i)+list.get(i-1)-list.get(i));\n }\n }", "int i=1;", "int i=1;", "i", "1", "i<n", "i", "n", "i++", "i++", "i", "{\n if (list.get(i)<list.get(i-1))\n {\n sum+=list.get(i-1)-list.get(i);\n\n list.set(i,list.get(i)+list.get(i-1)-list.get(i));\n }\n }", "{\n if (list.get(i)<list.get(i-1))\n {\n sum+=list.get(i-1)-list.get(i);\n\n list.set(i,list.get(i)+list.get(i-1)-list.get(i));\n }\n }", "if (list.get(i)<list.get(i-1))\n {\n sum+=list.get(i-1)-list.get(i);\n\n list.set(i,list.get(i)+list.get(i-1)-list.get(i));\n }", "list.get(i)<list.get(i-1)", "list.get(i)", "list.get", "list", "i", "list.get(i-1)", "list.get", "list", "i-1", "i", "1", "{\n sum+=list.get(i-1)-list.get(i);\n\n list.set(i,list.get(i)+list.get(i-1)-list.get(i));\n }", "sum+=list.get(i-1)-list.get(i)", "sum", "list.get(i-1)-list.get(i)", "list.get(i-1)", "list.get", "list", "i-1", "i", "1", "list.get(i)", "list.get", "list", "i", "list.set(i,list.get(i)+list.get(i-1)-list.get(i))", "list.set", "list", "i", "list.get(i)+list.get(i-1)-list.get(i)", "list.get(i)+list.get(i-1)", "list.get(i)", "list.get", "list", "i", "list.get(i-1)", "list.get", "list", "i-1", "i", "1", "list.get(i)", "list.get", "list", "i", "out.println(sum)", "out.println", "out", "sum", "out.flush()", "out.flush", "out", "out.close()", "out.close", "out", "String[] args", "args", "static class FastReader\n {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader()\n {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next()\n {\n while(st==null || !st.hasMoreElements())\n {\n try\n {\n st = new StringTokenizer(br.readLine());\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt()\n {\n return Integer.parseInt(next());\n }\n\n String nextLine()\n {\n String str = \"\";\n\n try\n {\n str = br.readLine();\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n return str;\n }\n }", "FastReader", "BufferedReader br;", "br", "StringTokenizer st;", "st", "public FastReader()\n {\n br = new BufferedReader(new InputStreamReader(System.in));\n }", "FastReader", "{\n br = new BufferedReader(new InputStreamReader(System.in));\n }", "br = new BufferedReader(new InputStreamReader(System.in))", "br", "new BufferedReader(new InputStreamReader(System.in))", "String next()\n {\n while(st==null || !st.hasMoreElements())\n {\n try\n {\n st = new StringTokenizer(br.readLine());\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }", "next", "{\n while(st==null || !st.hasMoreElements())\n {\n try\n {\n st = new StringTokenizer(br.readLine());\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }", "while(st==null || !st.hasMoreElements())\n {\n try\n {\n st = new StringTokenizer(br.readLine());\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n }", "st==null || !st.hasMoreElements()", "st==null", "st", "null", "!st.hasMoreElements()", "st.hasMoreElements()", "st.hasMoreElements", "st", "{\n try\n {\n st = new StringTokenizer(br.readLine());\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n }", "try\n {\n st = new StringTokenizer(br.readLine());\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }", "catch(IOException e)\n {\n e.printStackTrace();\n }", "IOException e", "{\n e.printStackTrace();\n }", "e.printStackTrace()", "e.printStackTrace", "e", "{\n st = new StringTokenizer(br.readLine());\n }", "st = new StringTokenizer(br.readLine())", "st", "new StringTokenizer(br.readLine())", "return st.nextToken();", "st.nextToken()", "st.nextToken", "st", "int nextInt()\n {\n return Integer.parseInt(next());\n }", "nextInt", "{\n return Integer.parseInt(next());\n }", "return Integer.parseInt(next());", "Integer.parseInt(next())", "Integer.parseInt", "Integer", "next()", "next", "String nextLine()\n {\n String str = \"\";\n\n try\n {\n str = br.readLine();\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n return str;\n }", "nextLine", "{\n String str = \"\";\n\n try\n {\n str = br.readLine();\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n return str;\n }", "String str = \"\";", "str", "\"\"", "try\n {\n str = br.readLine();\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }", "catch(IOException e)\n {\n e.printStackTrace();\n }", "IOException e", "{\n e.printStackTrace();\n }", "e.printStackTrace()", "e.printStackTrace", "e", "{\n str = br.readLine();\n }", "str = br.readLine()", "str", "br.readLine()", "br.readLine", "br", "return str;", "str", "static class Reader\n {\n final private int BUFFER_SIZE = 1 << 16;\n private DataInputStream din;\n private byte[] buffer;\n private int bufferPointer, bytesRead;\n\n public Reader()\n {\n din = new DataInputStream(System.in);\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n public Reader(String file_name) throws IOException\n {\n din = new DataInputStream(new FileInputStream(file_name));\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n public String readLine() throws IOException\n {\n byte[] buf = new byte[64]; // line length\n int cnt = 0, c;\n while ((c = read()) != -1)\n {\n if (c == '\\n')\n break;\n buf[cnt++] = (byte) c;\n }\n return new String(buf, 0, cnt);\n }\n\n public int nextInt() throws IOException\n {\n int ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do\n {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n\n if (neg)\n return -ret;\n return ret;\n }\n\n public long nextLong() throws IOException\n {\n long ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n }\n while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }\n\n public double nextDouble() throws IOException\n {\n double ret = 0, div = 1;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n\n do {\n ret = ret * 10 + c - '0';\n }\n while ((c = read()) >= '0' && c <= '9');\n\n if (c == '.')\n {\n while ((c = read()) >= '0' && c <= '9')\n {\n ret += (c - '0') / (div *= 10);\n }\n }\n\n if (neg)\n return -ret;\n return ret;\n }\n\n private void fillBuffer() throws IOException\n {\n bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);\n if (bytesRead == -1)\n buffer[0] = -1;\n }\n\n private byte read() throws IOException\n {\n if (bufferPointer == bytesRead)\n fillBuffer();\n return buffer[bufferPointer++];\n }\n\n public void close() throws IOException\n {\n if (din == null)\n return;\n din.close();\n }\n }", "Reader", "final private int BUFFER_SIZE = 1 << 16;", "BUFFER_SIZE", "1 << 16", "1", "16", "private DataInputStream din;", "din", "private byte[] buffer;", "buffer", "private int bufferPointer", "bufferPointer", "bytesRead;", "bytesRead", "public Reader()\n {\n din = new DataInputStream(System.in);\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }", "Reader", "{\n din = new DataInputStream(System.in);\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }", "din = new DataInputStream(System.in)", "din", "new DataInputStream(System.in)", "buffer = new byte[BUFFER_SIZE]", "buffer", "new byte[BUFFER_SIZE]", "BUFFER_SIZE", "bufferPointer = bytesRead = 0", "bufferPointer", "bytesRead = 0", "bytesRead", "0", "public Reader(String file_name) throws IOException\n {\n din = new DataInputStream(new FileInputStream(file_name));\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }", "Reader", "{\n din = new DataInputStream(new FileInputStream(file_name));\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }", "din = new DataInputStream(new FileInputStream(file_name))", "din", "new DataInputStream(new FileInputStream(file_name))", "buffer = new byte[BUFFER_SIZE]", "buffer", "new byte[BUFFER_SIZE]", "BUFFER_SIZE", "bufferPointer = bytesRead = 0", "bufferPointer", "bytesRead = 0", "bytesRead", "0", "String file_name", "file_name", "public String readLine() throws IOException\n {\n byte[] buf = new byte[64]; // line length\n int cnt = 0, c;\n while ((c = read()) != -1)\n {\n if (c == '\\n')\n break;\n buf[cnt++] = (byte) c;\n }\n return new String(buf, 0, cnt);\n }", "readLine", "{\n byte[] buf = new byte[64]; // line length\n int cnt = 0, c;\n while ((c = read()) != -1)\n {\n if (c == '\\n')\n break;\n buf[cnt++] = (byte) c;\n }\n return new String(buf, 0, cnt);\n }", "byte[] buf = new byte[64];", "buf", "new byte[64]", "64", "int cnt = 0", "cnt", "0", "c;", "c", "while ((c = read()) != -1)\n {\n if (c == '\\n')\n break;\n buf[cnt++] = (byte) c;\n }", "(c = read()) != -1", "(c = read())", "c", "read()", "read", "-1", "1", "{\n if (c == '\\n')\n break;\n buf[cnt++] = (byte) c;\n }", "if (c == '\\n')\n break;", "c == '\\n'", "c", "'\\n'", "break;", "buf[cnt++] = (byte) c", "buf[cnt++]", "buf", "cnt++", "cnt", "(byte) c", "return new String(buf, 0, cnt);", "new String(buf, 0, cnt)", "public int nextInt() throws IOException\n {\n int ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do\n {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n\n if (neg)\n return -ret;\n return ret;\n }", "nextInt", "{\n int ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do\n {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n\n if (neg)\n return -ret;\n return ret;\n }", "int ret = 0;", "ret", "0", "byte c = read();", "c", "read()", "read", "while (c <= ' ')\n c = read();", "c <= ' '", "c", "' '", "c = read()", "c", "read()", "read", "boolean neg = (c == '-');", "neg", "(c == '-')", "c", "'-'", "if (neg)\n c = read();", "neg", "c = read()", "c", "read()", "read", "do\n {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');", "(c = read()) >= '0' && c <= '9'", "(c = read()) >= '0'", "(c = read())", "c", "read()", "read", "'0'", "c <= '9'", "c", "'9'", "{\n ret = ret * 10 + c - '0';\n }", "ret = ret * 10 + c - '0'", "ret", "ret * 10 + c - '0'", "ret * 10 + c", "ret * 10", "ret", "10", "c", "'0'", "if (neg)\n return -ret;", "neg", "return -ret;", "-ret", "ret", "return ret;", "ret", "public long nextLong() throws IOException\n {\n long ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n }\n while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }", "nextLong", "{\n long ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n }\n while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }", "long ret = 0;", "ret", "0", "byte c = read();", "c", "read()", "read", "while (c <= ' ')\n c = read();", "c <= ' '", "c", "' '", "c = read()", "c", "read()", "read", "boolean neg = (c == '-');", "neg", "(c == '-')", "c", "'-'", "if (neg)\n c = read();", "neg", "c = read()", "c", "read()", "read", "do {\n ret = ret * 10 + c - '0';\n }\n while ((c = read()) >= '0' && c <= '9');", "(c = read()) >= '0' && c <= '9'", "(c = read()) >= '0'", "(c = read())", "c", "read()", "read", "'0'", "c <= '9'", "c", "'9'", "{\n ret = ret * 10 + c - '0';\n }", "ret = ret * 10 + c - '0'", "ret", "ret * 10 + c - '0'", "ret * 10 + c", "ret * 10", "ret", "10", "c", "'0'", "if (neg)\n return -ret;", "neg", "return -ret;", "-ret", "ret", "return ret;", "ret", "public double nextDouble() throws IOException\n {\n double ret = 0, div = 1;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n\n do {\n ret = ret * 10 + c - '0';\n }\n while ((c = read()) >= '0' && c <= '9');\n\n if (c == '.')\n {\n while ((c = read()) >= '0' && c <= '9')\n {\n ret += (c - '0') / (div *= 10);\n }\n }\n\n if (neg)\n return -ret;\n return ret;\n }", "nextDouble", "{\n double ret = 0, div = 1;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n\n do {\n ret = ret * 10 + c - '0';\n }\n while ((c = read()) >= '0' && c <= '9');\n\n if (c == '.')\n {\n while ((c = read()) >= '0' && c <= '9')\n {\n ret += (c - '0') / (div *= 10);\n }\n }\n\n if (neg)\n return -ret;\n return ret;\n }", "double ret = 0", "ret", "0", "div = 1;", "div", "1", "byte c = read();", "c", "read()", "read", "while (c <= ' ')\n c = read();", "c <= ' '", "c", "' '", "c = read()", "c", "read()", "read", "boolean neg = (c == '-');", "neg", "(c == '-')", "c", "'-'", "if (neg)\n c = read();", "neg", "c = read()", "c", "read()", "read", "do {\n ret = ret * 10 + c - '0';\n }\n while ((c = read()) >= '0' && c <= '9');", "(c = read()) >= '0' && c <= '9'", "(c = read()) >= '0'", "(c = read())", "c", "read()", "read", "'0'", "c <= '9'", "c", "'9'", "{\n ret = ret * 10 + c - '0';\n }", "ret = ret * 10 + c - '0'", "ret", "ret * 10 + c - '0'", "ret * 10 + c", "ret * 10", "ret", "10", "c", "'0'", "if (c == '.')\n {\n while ((c = read()) >= '0' && c <= '9')\n {\n ret += (c - '0') / (div *= 10);\n }\n }", "c == '.'", "c", "'.'", "{\n while ((c = read()) >= '0' && c <= '9')\n {\n ret += (c - '0') / (div *= 10);\n }\n }", "while ((c = read()) >= '0' && c <= '9')\n {\n ret += (c - '0') / (div *= 10);\n }", "(c = read()) >= '0' && c <= '9'", "(c = read()) >= '0'", "(c = read())", "c", "read()", "read", "'0'", "c <= '9'", "c", "'9'", "{\n ret += (c - '0') / (div *= 10);\n }", "ret += (c - '0') / (div *= 10)", "ret", "(c - '0') / (div *= 10)", "(c - '0')", "c", "'0'", "(div *= 10)", "div", "10", "if (neg)\n return -ret;", "neg", "return -ret;", "-ret", "ret", "return ret;", "ret", "private void fillBuffer() throws IOException\n {\n bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);\n if (bytesRead == -1)\n buffer[0] = -1;\n }", "fillBuffer", "{\n bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);\n if (bytesRead == -1)\n buffer[0] = -1;\n }", "bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE)", "bytesRead", "din.read(buffer, bufferPointer = 0, BUFFER_SIZE)", "din.read", "din", "buffer", "bufferPointer = 0", "bufferPointer", "0", "BUFFER_SIZE", "if (bytesRead == -1)\n buffer[0] = -1;", "bytesRead == -1", "bytesRead", "-1", "1", "buffer[0] = -1", "buffer[0]", "buffer", "0", "-1", "1", "private byte read() throws IOException\n {\n if (bufferPointer == bytesRead)\n fillBuffer();\n return buffer[bufferPointer++];\n }", "read", "{\n if (bufferPointer == bytesRead)\n fillBuffer();\n return buffer[bufferPointer++];\n }", "if (bufferPointer == bytesRead)\n fillBuffer();", "bufferPointer == bytesRead", "bufferPointer", "bytesRead", "fillBuffer()", "fillBuffer", "return buffer[bufferPointer++];", "buffer[bufferPointer++]", "buffer", "bufferPointer++", "bufferPointer", "public void close() throws IOException\n {\n if (din == null)\n return;\n din.close();\n }", "close", "{\n if (din == null)\n return;\n din.close();\n }", "if (din == null)\n return;", "din == null", "din", "null", "return;", "din.close()", "din.close", "din", "public class Main {\n\n static class FastReader\n {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader()\n {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next()\n {\n while(st==null || !st.hasMoreElements())\n {\n try\n {\n st = new StringTokenizer(br.readLine());\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt()\n {\n return Integer.parseInt(next());\n }\n\n String nextLine()\n {\n String str = \"\";\n\n try\n {\n str = br.readLine();\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n return str;\n }\n }\n\n static class Reader\n {\n final private int BUFFER_SIZE = 1 << 16;\n private DataInputStream din;\n private byte[] buffer;\n private int bufferPointer, bytesRead;\n\n public Reader()\n {\n din = new DataInputStream(System.in);\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n public Reader(String file_name) throws IOException\n {\n din = new DataInputStream(new FileInputStream(file_name));\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n public String readLine() throws IOException\n {\n byte[] buf = new byte[64]; // line length\n int cnt = 0, c;\n while ((c = read()) != -1)\n {\n if (c == '\\n')\n break;\n buf[cnt++] = (byte) c;\n }\n return new String(buf, 0, cnt);\n }\n\n public int nextInt() throws IOException\n {\n int ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do\n {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n\n if (neg)\n return -ret;\n return ret;\n }\n\n public long nextLong() throws IOException\n {\n long ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n }\n while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }\n\n public double nextDouble() throws IOException\n {\n double ret = 0, div = 1;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n\n do {\n ret = ret * 10 + c - '0';\n }\n while ((c = read()) >= '0' && c <= '9');\n\n if (c == '.')\n {\n while ((c = read()) >= '0' && c <= '9')\n {\n ret += (c - '0') / (div *= 10);\n }\n }\n\n if (neg)\n return -ret;\n return ret;\n }\n\n private void fillBuffer() throws IOException\n {\n bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);\n if (bytesRead == -1)\n buffer[0] = -1;\n }\n\n private byte read() throws IOException\n {\n if (bufferPointer == bytesRead)\n fillBuffer();\n return buffer[bufferPointer++];\n }\n\n public void close() throws IOException\n {\n if (din == null)\n return;\n din.close();\n }\n }\n\n public static void main(String[] args) throws java.lang.Exception\n {\n try\n {\n //FastReader fr = new FastReader();\n Reader fr = new Reader();\n PrintWriter out = new PrintWriter(System.out);\n\n int n = fr.nextInt();\n List<Long> list = new ArrayList<>();\n for (int i=0;i<n;i++) list.add(fr.nextLong());\n\n long sum = 0;\n\n for (int i=1;i<n;i++)\n {\n if (list.get(i)<list.get(i-1))\n {\n sum+=list.get(i-1)-list.get(i);\n\n list.set(i,list.get(i)+list.get(i-1)-list.get(i));\n }\n }\n\n out.println(sum);\n\n out.flush();\n out.close();\n }\n\n catch(Exception e){e.printStackTrace();}\n finally{}\n }\n}", "public class Main {\n\n static class FastReader\n {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader()\n {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next()\n {\n while(st==null || !st.hasMoreElements())\n {\n try\n {\n st = new StringTokenizer(br.readLine());\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt()\n {\n return Integer.parseInt(next());\n }\n\n String nextLine()\n {\n String str = \"\";\n\n try\n {\n str = br.readLine();\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n return str;\n }\n }\n\n static class Reader\n {\n final private int BUFFER_SIZE = 1 << 16;\n private DataInputStream din;\n private byte[] buffer;\n private int bufferPointer, bytesRead;\n\n public Reader()\n {\n din = new DataInputStream(System.in);\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n public Reader(String file_name) throws IOException\n {\n din = new DataInputStream(new FileInputStream(file_name));\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n public String readLine() throws IOException\n {\n byte[] buf = new byte[64]; // line length\n int cnt = 0, c;\n while ((c = read()) != -1)\n {\n if (c == '\\n')\n break;\n buf[cnt++] = (byte) c;\n }\n return new String(buf, 0, cnt);\n }\n\n public int nextInt() throws IOException\n {\n int ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do\n {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n\n if (neg)\n return -ret;\n return ret;\n }\n\n public long nextLong() throws IOException\n {\n long ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n }\n while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }\n\n public double nextDouble() throws IOException\n {\n double ret = 0, div = 1;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n\n do {\n ret = ret * 10 + c - '0';\n }\n while ((c = read()) >= '0' && c <= '9');\n\n if (c == '.')\n {\n while ((c = read()) >= '0' && c <= '9')\n {\n ret += (c - '0') / (div *= 10);\n }\n }\n\n if (neg)\n return -ret;\n return ret;\n }\n\n private void fillBuffer() throws IOException\n {\n bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);\n if (bytesRead == -1)\n buffer[0] = -1;\n }\n\n private byte read() throws IOException\n {\n if (bufferPointer == bytesRead)\n fillBuffer();\n return buffer[bufferPointer++];\n }\n\n public void close() throws IOException\n {\n if (din == null)\n return;\n din.close();\n }\n }\n\n public static void main(String[] args) throws java.lang.Exception\n {\n try\n {\n //FastReader fr = new FastReader();\n Reader fr = new Reader();\n PrintWriter out = new PrintWriter(System.out);\n\n int n = fr.nextInt();\n List<Long> list = new ArrayList<>();\n for (int i=0;i<n;i++) list.add(fr.nextLong());\n\n long sum = 0;\n\n for (int i=1;i<n;i++)\n {\n if (list.get(i)<list.get(i-1))\n {\n sum+=list.get(i-1)-list.get(i);\n\n list.set(i,list.get(i)+list.get(i-1)-list.get(i));\n }\n }\n\n out.println(sum);\n\n out.flush();\n out.close();\n }\n\n catch(Exception e){e.printStackTrace();}\n finally{}\n }\n}", "Main" ]
import java.util.*; import java.io.*; public class Main { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while(st==null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch(IOException e) { e.printStackTrace(); } } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } String nextLine() { String str = ""; try { str = br.readLine(); } catch(IOException e) { e.printStackTrace(); } return str; } } static class Reader { final private int BUFFER_SIZE = 1 << 16; private DataInputStream din; private byte[] buffer; private int bufferPointer, bytesRead; public Reader() { din = new DataInputStream(System.in); buffer = new byte[BUFFER_SIZE]; bufferPointer = bytesRead = 0; } public Reader(String file_name) throws IOException { din = new DataInputStream(new FileInputStream(file_name)); buffer = new byte[BUFFER_SIZE]; bufferPointer = bytesRead = 0; } public String readLine() throws IOException { byte[] buf = new byte[64]; // line length int cnt = 0, c; while ((c = read()) != -1) { if (c == '\n') break; buf[cnt++] = (byte) c; } return new String(buf, 0, cnt); } public int nextInt() throws IOException { int ret = 0; byte c = read(); while (c <= ' ') c = read(); boolean neg = (c == '-'); if (neg) c = read(); do { ret = ret * 10 + c - '0'; } while ((c = read()) >= '0' && c <= '9'); if (neg) return -ret; return ret; } public long nextLong() throws IOException { long ret = 0; byte c = read(); while (c <= ' ') c = read(); boolean neg = (c == '-'); if (neg) c = read(); do { ret = ret * 10 + c - '0'; } while ((c = read()) >= '0' && c <= '9'); if (neg) return -ret; return ret; } public double nextDouble() throws IOException { double ret = 0, div = 1; byte c = read(); while (c <= ' ') c = read(); boolean neg = (c == '-'); if (neg) c = read(); do { ret = ret * 10 + c - '0'; } while ((c = read()) >= '0' && c <= '9'); if (c == '.') { while ((c = read()) >= '0' && c <= '9') { ret += (c - '0') / (div *= 10); } } if (neg) return -ret; return ret; } private void fillBuffer() throws IOException { bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE); if (bytesRead == -1) buffer[0] = -1; } private byte read() throws IOException { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } public void close() throws IOException { if (din == null) return; din.close(); } } public static void main(String[] args) throws java.lang.Exception { try { //FastReader fr = new FastReader(); Reader fr = new Reader(); PrintWriter out = new PrintWriter(System.out); int n = fr.nextInt(); List<Long> list = new ArrayList<>(); for (int i=0;i<n;i++) list.add(fr.nextLong()); long sum = 0; for (int i=1;i<n;i++) { if (list.get(i)<list.get(i-1)) { sum+=list.get(i-1)-list.get(i); list.set(i,list.get(i)+list.get(i-1)-list.get(i)); } } out.println(sum); out.flush(); out.close(); } catch(Exception e){e.printStackTrace();} finally{} } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 41, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 18, 13, 13, 13, 30, 0, 13, 18, 13, 13, 14, 2, 18, 13, 13, 13, 30, 0, 13, 2, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 95, 5 ], [ 95, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 8, 21 ], [ 21, 22 ], [ 22, 23 ], [ 23, 24 ], [ 23, 25 ], [ 21, 26 ], [ 26, 27 ], [ 26, 28 ], [ 21, 29 ], [ 29, 30 ], [ 30, 31 ], [ 21, 32 ], [ 33, 33 ], [ 33, 34 ], [ 34, 35 ], [ 35, 36 ], [ 35, 37 ], [ 34, 38 ], [ 38, 39 ], [ 39, 40 ], [ 8, 41 ], [ 41, 42 ], [ 41, 43 ], [ 8, 44 ], [ 44, 45 ], [ 44, 46 ], [ 8, 47 ], [ 47, 48 ], [ 48, 49 ], [ 49, 50 ], [ 49, 51 ], [ 47, 52 ], [ 52, 53 ], [ 52, 54 ], [ 47, 55 ], [ 55, 56 ], [ 56, 57 ], [ 47, 58 ], [ 59, 59 ], [ 59, 60 ], [ 60, 61 ], [ 61, 62 ], [ 62, 63 ], [ 62, 64 ], [ 61, 65 ], [ 60, 66 ], [ 66, 67 ], [ 67, 68 ], [ 67, 69 ], [ 69, 70 ], [ 69, 71 ], [ 60, 72 ], [ 72, 73 ], [ 73, 74 ], [ 74, 75 ], [ 74, 76 ], [ 73, 77 ], [ 72, 78 ], [ 78, 79 ], [ 79, 80 ], [ 79, 81 ], [ 81, 82 ], [ 81, 83 ], [ 83, 84 ], [ 83, 85 ], [ 8, 86 ], [ 86, 87 ], [ 87, 88 ], [ 88, 89 ], [ 88, 90 ], [ 86, 91 ], [ 6, 92 ], [ 92, 93 ], [ 0, 94 ], [ 94, 95 ], [ 94, 96 ] ]
[ "import java.util.*;\npublic class Main {\n\tpublic static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n long[] A = new long[N];\n for (int i=0; i<N; i++) {\n A[i] = sc.nextInt();\n }\n\n long top = 0;\n long result = 0;\n\n for (int i=0; i<N; i++) {\n if (A[i] > top) {\n top = A[i];\n } else if ((A[i] < top)) {\n result += (top-A[i]);\n }\n }\n \n System.out.println(result);\n }\n}", "import java.util.*;", "util.*", "java", "public class Main {\n\tpublic static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n long[] A = new long[N];\n for (int i=0; i<N; i++) {\n A[i] = sc.nextInt();\n }\n\n long top = 0;\n long result = 0;\n\n for (int i=0; i<N; i++) {\n if (A[i] > top) {\n top = A[i];\n } else if ((A[i] < top)) {\n result += (top-A[i]);\n }\n }\n \n System.out.println(result);\n }\n}", "Main", "public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n long[] A = new long[N];\n for (int i=0; i<N; i++) {\n A[i] = sc.nextInt();\n }\n\n long top = 0;\n long result = 0;\n\n for (int i=0; i<N; i++) {\n if (A[i] > top) {\n top = A[i];\n } else if ((A[i] < top)) {\n result += (top-A[i]);\n }\n }\n \n System.out.println(result);\n }", "main", "{\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n long[] A = new long[N];\n for (int i=0; i<N; i++) {\n A[i] = sc.nextInt();\n }\n\n long top = 0;\n long result = 0;\n\n for (int i=0; i<N; i++) {\n if (A[i] > top) {\n top = A[i];\n } else if ((A[i] < top)) {\n result += (top-A[i]);\n }\n }\n \n System.out.println(result);\n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int N = sc.nextInt();", "N", "sc.nextInt()", "sc.nextInt", "sc", "long[] A = new long[N];", "A", "new long[N]", "N", "for (int i=0; i<N; i++) {\n A[i] = sc.nextInt();\n }", "int i=0;", "int i=0;", "i", "0", "i<N", "i", "N", "i++", "i++", "i", "{\n A[i] = sc.nextInt();\n }", "{\n A[i] = sc.nextInt();\n }", "A[i] = sc.nextInt()", "A[i]", "A", "i", "sc.nextInt()", "sc.nextInt", "sc", "long top = 0;", "top", "0", "long result = 0;", "result", "0", "for (int i=0; i<N; i++) {\n if (A[i] > top) {\n top = A[i];\n } else if ((A[i] < top)) {\n result += (top-A[i]);\n }\n }", "int i=0;", "int i=0;", "i", "0", "i<N", "i", "N", "i++", "i++", "i", "{\n if (A[i] > top) {\n top = A[i];\n } else if ((A[i] < top)) {\n result += (top-A[i]);\n }\n }", "{\n if (A[i] > top) {\n top = A[i];\n } else if ((A[i] < top)) {\n result += (top-A[i]);\n }\n }", "if (A[i] > top) {\n top = A[i];\n } else if ((A[i] < top)) {\n result += (top-A[i]);\n }", "A[i] > top", "A[i]", "A", "i", "top", "{\n top = A[i];\n }", "top = A[i]", "top", "A[i]", "A", "i", "if ((A[i] < top)) {\n result += (top-A[i]);\n }", "(A[i] < top)", "A[i]", "A", "i", "top", "{\n result += (top-A[i]);\n }", "result += (top-A[i])", "result", "(top-A[i])", "top", "A[i]", "A", "i", "System.out.println(result)", "System.out.println", "System.out", "System", "System.out", "result", "String[] args", "args", "public class Main {\n\tpublic static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n long[] A = new long[N];\n for (int i=0; i<N; i++) {\n A[i] = sc.nextInt();\n }\n\n long top = 0;\n long result = 0;\n\n for (int i=0; i<N; i++) {\n if (A[i] > top) {\n top = A[i];\n } else if ((A[i] < top)) {\n result += (top-A[i]);\n }\n }\n \n System.out.println(result);\n }\n}", "public class Main {\n\tpublic static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n long[] A = new long[N];\n for (int i=0; i<N; i++) {\n A[i] = sc.nextInt();\n }\n\n long top = 0;\n long result = 0;\n\n for (int i=0; i<N; i++) {\n if (A[i] > top) {\n top = A[i];\n } else if ((A[i] < top)) {\n result += (top-A[i]);\n }\n }\n \n System.out.println(result);\n }\n}", "Main" ]
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); long[] A = new long[N]; for (int i=0; i<N; i++) { A[i] = sc.nextInt(); } long top = 0; long result = 0; for (int i=0; i<N; i++) { if (A[i] > top) { top = A[i]; } else if ((A[i] < top)) { result += (top-A[i]); } } System.out.println(result); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 41, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 0, 13, 4, 18, 13, 13, 18, 13, 13, 0, 13, 2, 2, 13, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 74, 5 ], [ 74, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 8, 21 ], [ 21, 22 ], [ 21, 23 ], [ 8, 24 ], [ 24, 25 ], [ 24, 26 ], [ 8, 27 ], [ 27, 28 ], [ 28, 29 ], [ 29, 30 ], [ 29, 31 ], [ 27, 32 ], [ 32, 33 ], [ 32, 34 ], [ 27, 35 ], [ 35, 36 ], [ 36, 37 ], [ 27, 38 ], [ 39, 39 ], [ 39, 40 ], [ 40, 41 ], [ 41, 42 ], [ 41, 43 ], [ 40, 44 ], [ 44, 45 ], [ 45, 46 ], [ 39, 47 ], [ 47, 48 ], [ 47, 49 ], [ 49, 50 ], [ 50, 51 ], [ 49, 52 ], [ 49, 53 ], [ 53, 54 ], [ 53, 55 ], [ 39, 56 ], [ 56, 57 ], [ 56, 58 ], [ 58, 59 ], [ 59, 60 ], [ 59, 61 ], [ 58, 62 ], [ 62, 63 ], [ 62, 64 ], [ 8, 65 ], [ 65, 66 ], [ 66, 67 ], [ 67, 68 ], [ 67, 69 ], [ 65, 70 ], [ 6, 71 ], [ 71, 72 ], [ 0, 73 ], [ 73, 74 ], [ 73, 75 ] ]
[ "import java.util.*;\npublic class Main{\n public static void main(String[] args){\n Scanner sc =new Scanner(System.in);\n int N =sc.nextInt();\n long A[] =new long[N];\n long ans =0;\n long t =0;\n for(int i=0;i<N;i++){\n A[i]=sc.nextLong();\n t=Math.max(t,A[i]);\n ans =ans +t-A[i];}\n System.out.println(ans); \n }\n}", "import java.util.*;", "util.*", "java", "public class Main{\n public static void main(String[] args){\n Scanner sc =new Scanner(System.in);\n int N =sc.nextInt();\n long A[] =new long[N];\n long ans =0;\n long t =0;\n for(int i=0;i<N;i++){\n A[i]=sc.nextLong();\n t=Math.max(t,A[i]);\n ans =ans +t-A[i];}\n System.out.println(ans); \n }\n}", "Main", "public static void main(String[] args){\n Scanner sc =new Scanner(System.in);\n int N =sc.nextInt();\n long A[] =new long[N];\n long ans =0;\n long t =0;\n for(int i=0;i<N;i++){\n A[i]=sc.nextLong();\n t=Math.max(t,A[i]);\n ans =ans +t-A[i];}\n System.out.println(ans); \n }", "main", "{\n Scanner sc =new Scanner(System.in);\n int N =sc.nextInt();\n long A[] =new long[N];\n long ans =0;\n long t =0;\n for(int i=0;i<N;i++){\n A[i]=sc.nextLong();\n t=Math.max(t,A[i]);\n ans =ans +t-A[i];}\n System.out.println(ans); \n }", "Scanner sc =new Scanner(System.in);", "sc", "new Scanner(System.in)", "int N =sc.nextInt();", "N", "sc.nextInt()", "sc.nextInt", "sc", "long A[] =new long[N];", "A", "new long[N]", "N", "long ans =0;", "ans", "0", "long t =0;", "t", "0", "for(int i=0;i<N;i++){\n A[i]=sc.nextLong();\n t=Math.max(t,A[i]);\n ans =ans +t-A[i];}", "int i=0;", "int i=0;", "i", "0", "i<N", "i", "N", "i++", "i++", "i", "{\n A[i]=sc.nextLong();\n t=Math.max(t,A[i]);\n ans =ans +t-A[i];}", "{\n A[i]=sc.nextLong();\n t=Math.max(t,A[i]);\n ans =ans +t-A[i];}", "A[i]=sc.nextLong()", "A[i]", "A", "i", "sc.nextLong()", "sc.nextLong", "sc", "t=Math.max(t,A[i])", "t", "Math.max(t,A[i])", "Math.max", "Math", "t", "A[i]", "A", "i", "ans =ans +t-A[i]", "ans", "ans +t-A[i]", "ans +t", "ans", "t", "A[i]", "A", "i", "System.out.println(ans)", "System.out.println", "System.out", "System", "System.out", "ans", "String[] args", "args", "public class Main{\n public static void main(String[] args){\n Scanner sc =new Scanner(System.in);\n int N =sc.nextInt();\n long A[] =new long[N];\n long ans =0;\n long t =0;\n for(int i=0;i<N;i++){\n A[i]=sc.nextLong();\n t=Math.max(t,A[i]);\n ans =ans +t-A[i];}\n System.out.println(ans); \n }\n}", "public class Main{\n public static void main(String[] args){\n Scanner sc =new Scanner(System.in);\n int N =sc.nextInt();\n long A[] =new long[N];\n long ans =0;\n long t =0;\n for(int i=0;i<N;i++){\n A[i]=sc.nextLong();\n t=Math.max(t,A[i]);\n ans =ans +t-A[i];}\n System.out.println(ans); \n }\n}", "Main" ]
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc =new Scanner(System.in); int N =sc.nextInt(); long A[] =new long[N]; long ans =0; long t =0; for(int i=0;i<N;i++){ A[i]=sc.nextLong(); t=Math.max(t,A[i]); ans =ans +t-A[i];} System.out.println(ans); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 41, 13, 4, 18, 13, 41, 13, 14, 2, 13, 13, 30, 0, 13, 2, 13, 13, 0, 13, 13, 30, 0, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 71, 5 ], [ 71, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 19, 20 ], [ 20, 21 ], [ 8, 22 ], [ 22, 23 ], [ 22, 24 ], [ 8, 25 ], [ 25, 26 ], [ 26, 27 ], [ 27, 28 ], [ 27, 29 ], [ 25, 30 ], [ 30, 31 ], [ 30, 32 ], [ 25, 33 ], [ 33, 34 ], [ 34, 35 ], [ 25, 36 ], [ 37, 37 ], [ 37, 38 ], [ 38, 39 ], [ 38, 40 ], [ 40, 41 ], [ 41, 42 ], [ 37, 43 ], [ 43, 44 ], [ 37, 45 ], [ 45, 46 ], [ 46, 47 ], [ 46, 48 ], [ 45, 49 ], [ 49, 50 ], [ 50, 51 ], [ 50, 52 ], [ 52, 53 ], [ 52, 54 ], [ 49, 55 ], [ 55, 56 ], [ 55, 57 ], [ 45, 58 ], [ 58, 59 ], [ 59, 60 ], [ 59, 61 ], [ 8, 62 ], [ 62, 63 ], [ 63, 64 ], [ 64, 65 ], [ 64, 66 ], [ 62, 67 ], [ 6, 68 ], [ 68, 69 ], [ 0, 70 ], [ 70, 71 ], [ 70, 72 ] ]
[ "import java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n\n long max = sc.nextInt();\n long sum = 0;\n for (int i = 1; i < n; i++) {\n long p = sc.nextInt();\n long step;\n if (max > p) {\n step = max - p;\n sum += step;\n } else {\n max = p;\n }\n }\n System.out.println(sum);\n }\n}", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n\n long max = sc.nextInt();\n long sum = 0;\n for (int i = 1; i < n; i++) {\n long p = sc.nextInt();\n long step;\n if (max > p) {\n step = max - p;\n sum += step;\n } else {\n max = p;\n }\n }\n System.out.println(sum);\n }\n}", "Main", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n\n long max = sc.nextInt();\n long sum = 0;\n for (int i = 1; i < n; i++) {\n long p = sc.nextInt();\n long step;\n if (max > p) {\n step = max - p;\n sum += step;\n } else {\n max = p;\n }\n }\n System.out.println(sum);\n }", "main", "{\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n\n long max = sc.nextInt();\n long sum = 0;\n for (int i = 1; i < n; i++) {\n long p = sc.nextInt();\n long step;\n if (max > p) {\n step = max - p;\n sum += step;\n } else {\n max = p;\n }\n }\n System.out.println(sum);\n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "long max = sc.nextInt();", "max", "sc.nextInt()", "sc.nextInt", "sc", "long sum = 0;", "sum", "0", "for (int i = 1; i < n; i++) {\n long p = sc.nextInt();\n long step;\n if (max > p) {\n step = max - p;\n sum += step;\n } else {\n max = p;\n }\n }", "int i = 1;", "int i = 1;", "i", "1", "i < n", "i", "n", "i++", "i++", "i", "{\n long p = sc.nextInt();\n long step;\n if (max > p) {\n step = max - p;\n sum += step;\n } else {\n max = p;\n }\n }", "{\n long p = sc.nextInt();\n long step;\n if (max > p) {\n step = max - p;\n sum += step;\n } else {\n max = p;\n }\n }", "long p = sc.nextInt();", "p", "sc.nextInt()", "sc.nextInt", "sc", "long step;", "step", "if (max > p) {\n step = max - p;\n sum += step;\n } else {\n max = p;\n }", "max > p", "max", "p", "{\n step = max - p;\n sum += step;\n }", "step = max - p", "step", "max - p", "max", "p", "sum += step", "sum", "step", "{\n max = p;\n }", "max = p", "max", "p", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "String[] args", "args", "public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n\n long max = sc.nextInt();\n long sum = 0;\n for (int i = 1; i < n; i++) {\n long p = sc.nextInt();\n long step;\n if (max > p) {\n step = max - p;\n sum += step;\n } else {\n max = p;\n }\n }\n System.out.println(sum);\n }\n}", "public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n\n long max = sc.nextInt();\n long sum = 0;\n for (int i = 1; i < n; i++) {\n long p = sc.nextInt();\n long step;\n if (max > p) {\n step = max - p;\n sum += step;\n } else {\n max = p;\n }\n }\n System.out.println(sum);\n }\n}", "Main" ]
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long max = sc.nextInt(); long sum = 0; for (int i = 1; i < n; i++) { long p = sc.nextInt(); long step; if (max > p) { step = max - p; sum += step; } else { max = p; } } System.out.println(sum); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 41, 13, 41, 13, 41, 13, 2, 17, 17, 12, 13, 30, 41, 13, 17, 42, 2, 4, 18, 13, 17, 30, 0, 13, 4, 18, 13, 9, 29, 13, 12, 13, 30, 29, 4, 18, 13, 13, 23, 13, 12, 13, 30, 29, 4, 18, 13, 13, 23, 13, 12, 13, 30, 41, 13, 4, 18, 4, 13, 17, 41, 13, 20, 18, 13, 13, 11, 1, 41, 13, 17, 2, 13, 18, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 13, 18, 13, 13, 29, 13, 12, 13, 30, 41, 13, 4, 18, 4, 13, 17, 41, 13, 20, 18, 13, 13, 11, 1, 41, 13, 17, 2, 13, 18, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 13, 18, 13, 13, 29, 13, 12, 13, 30, 0, 13, 20, 0, 13, 20, 12, 13, 30, 41, 13, 17, 42, 2, 13, 17, 30, 14, 2, 2, 13, 17, 17, 30, 0, 13, 2, 2, 13, 13, 13, 0, 13, 17, 0, 13, 2, 2, 13, 13, 13, 29, 13, 23, 13, 23, 13, 23, 13, 12, 13, 30, 4, 13, 41, 13, 4, 13, 4, 13, 41, 13, 4, 13, 41, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 13, 18, 13, 13, 30, 0, 13, 2, 13, 18, 13, 13, 30, 0, 13, 18, 13, 13, 4, 18, 13, 2, 13, 17, 4, 18, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 261, 8 ], [ 261, 9 ], [ 9, 10 ], [ 261, 11 ], [ 11, 12 ], [ 261, 13 ], [ 13, 14 ], [ 13, 15 ], [ 15, 16 ], [ 15, 17 ], [ 261, 18 ], [ 18, 19 ], [ 18, 20 ], [ 20, 21 ], [ 21, 22 ], [ 21, 23 ], [ 20, 24 ], [ 24, 25 ], [ 25, 26 ], [ 26, 27 ], [ 27, 28 ], [ 25, 29 ], [ 24, 30 ], [ 30, 31 ], [ 31, 32 ], [ 31, 33 ], [ 33, 34 ], [ 34, 35 ], [ 30, 36 ], [ 20, 37 ], [ 37, 38 ], [ 261, 39 ], [ 39, 40 ], [ 39, 41 ], [ 41, 42 ], [ 42, 43 ], [ 43, 44 ], [ 44, 45 ], [ 43, 46 ], [ 39, 47 ], [ 47, 48 ], [ 261, 49 ], [ 49, 50 ], [ 49, 51 ], [ 51, 52 ], [ 52, 53 ], [ 53, 54 ], [ 54, 55 ], [ 53, 56 ], [ 49, 57 ], [ 57, 58 ], [ 261, 59 ], [ 59, 60 ], [ 59, 61 ], [ 61, 62 ], [ 62, 63 ], [ 62, 64 ], [ 64, 65 ], [ 65, 66 ], [ 66, 67 ], [ 64, 68 ], [ 61, 69 ], [ 69, 70 ], [ 69, 71 ], [ 72, 73 ], [ 72, 74 ], [ 61, 75 ], [ 75, 76 ], [ 76, 77 ], [ 77, 78 ], [ 77, 79 ], [ 75, 80 ], [ 80, 81 ], [ 80, 82 ], [ 82, 83 ], [ 82, 84 ], [ 75, 85 ], [ 85, 86 ], [ 86, 87 ], [ 75, 88 ], [ 89, 89 ], [ 89, 90 ], [ 90, 91 ], [ 91, 92 ], [ 91, 93 ], [ 90, 94 ], [ 94, 95 ], [ 94, 96 ], [ 96, 97 ], [ 96, 98 ], [ 61, 99 ], [ 99, 100 ], [ 261, 101 ], [ 101, 102 ], [ 101, 103 ], [ 103, 104 ], [ 104, 105 ], [ 104, 106 ], [ 106, 107 ], [ 107, 108 ], [ 108, 109 ], [ 106, 110 ], [ 103, 111 ], [ 111, 112 ], [ 111, 113 ], [ 114, 115 ], [ 114, 116 ], [ 103, 117 ], [ 117, 118 ], [ 118, 119 ], [ 119, 120 ], [ 119, 121 ], [ 117, 122 ], [ 122, 123 ], [ 122, 124 ], [ 124, 125 ], [ 124, 126 ], [ 117, 127 ], [ 127, 128 ], [ 128, 129 ], [ 117, 130 ], [ 131, 131 ], [ 131, 132 ], [ 132, 133 ], [ 133, 134 ], [ 133, 135 ], [ 132, 136 ], [ 136, 137 ], [ 136, 138 ], [ 138, 139 ], [ 138, 140 ], [ 103, 141 ], [ 141, 142 ], [ 261, 143 ], [ 143, 144 ], [ 143, 145 ], [ 145, 146 ], [ 146, 147 ], [ 146, 148 ], [ 145, 149 ], [ 149, 150 ], [ 149, 151 ], [ 261, 152 ], [ 152, 153 ], [ 152, 154 ], [ 154, 155 ], [ 155, 156 ], [ 155, 157 ], [ 154, 158 ], [ 158, 159 ], [ 159, 160 ], [ 159, 161 ], [ 158, 162 ], [ 162, 163 ], [ 163, 164 ], [ 164, 165 ], [ 165, 166 ], [ 165, 167 ], [ 164, 168 ], [ 163, 169 ], [ 169, 170 ], [ 170, 171 ], [ 170, 172 ], [ 172, 173 ], [ 173, 174 ], [ 173, 175 ], [ 172, 176 ], [ 162, 177 ], [ 177, 178 ], [ 177, 179 ], [ 162, 180 ], [ 180, 181 ], [ 180, 182 ], [ 182, 183 ], [ 183, 184 ], [ 183, 185 ], [ 182, 186 ], [ 154, 187 ], [ 187, 188 ], [ 152, 189 ], [ 189, 190 ], [ 152, 191 ], [ 191, 192 ], [ 152, 193 ], [ 193, 194 ], [ 261, 195 ], [ 195, 196 ], [ 195, 197 ], [ 197, 198 ], [ 198, 199 ], [ 197, 200 ], [ 200, 201 ], [ 200, 202 ], [ 202, 203 ], [ 202, 204 ], [ 204, 205 ], [ 197, 206 ], [ 206, 207 ], [ 206, 208 ], [ 208, 209 ], [ 197, 210 ], [ 210, 211 ], [ 210, 212 ], [ 197, 213 ], [ 213, 214 ], [ 213, 215 ], [ 197, 216 ], [ 216, 217 ], [ 217, 218 ], [ 218, 219 ], [ 218, 220 ], [ 216, 221 ], [ 221, 222 ], [ 221, 223 ], [ 216, 224 ], [ 224, 225 ], [ 225, 226 ], [ 216, 227 ], [ 228, 228 ], [ 228, 229 ], [ 229, 230 ], [ 230, 231 ], [ 230, 232 ], [ 232, 233 ], [ 232, 234 ], [ 229, 235 ], [ 235, 236 ], [ 236, 237 ], [ 236, 238 ], [ 238, 239 ], [ 238, 240 ], [ 240, 241 ], [ 240, 242 ], [ 229, 243 ], [ 243, 244 ], [ 244, 245 ], [ 244, 246 ], [ 246, 247 ], [ 246, 248 ], [ 197, 249 ], [ 249, 250 ], [ 250, 251 ], [ 249, 252 ], [ 252, 253 ], [ 252, 254 ], [ 197, 255 ], [ 255, 256 ], [ 256, 257 ], [ 195, 258 ], [ 258, 259 ], [ 0, 260 ], [ 260, 261 ], [ 260, 262 ] ]
[ "import java.util.*;\nimport java.io.*;\n\npublic class Main{\n\nstatic BufferedReader s1;\nstatic BufferedWriter out;\nstatic String read() throws IOException{String line=\"\";while(line.length()==0){line=s1.readLine();continue;}return line;}\nstatic int int_v (String s1){return Integer.parseInt(s1);}\nstatic long long_v(String s1){return Long.parseLong(s1);}\nstatic int[] int_arr() throws IOException{String[] a=read().split(\"\\\\s+\");int[] b=new int[a.length];for(int i=0;i<a.length;i++){b[i]=int_v(a[i]);}return b;}\nstatic long[] long_arr() throws IOException{String[] a=read().split(\"\\\\s+\");long[] b=new long[a.length];for(int i=0;i<a.length;i++){b[i]=long_v(a[i]);}return b;}\nstatic void assign(){s1=new BufferedReader(new InputStreamReader(System.in));out=new BufferedWriter(new OutputStreamWriter(System.out));}\nstatic int Modpow(int a,int p,int m){int res=1;while(p>0){if((p&1)!=0){res=(res*a)%m;}p >>=1;a=(a*a)%m;}return res;}\n//......................................@uthor_Alx..............................................\nstatic long mod=(long)1e9+7;\npublic static void main(String[] args) throws IOException{\n assign();\n int n=int_v(read());\n int[] a=int_arr();\n long res=0; int pre=0;\n for(int i=0;i<n;i++){\n \tif(pre>a[i]){\n \t\tres+=pre-a[i];\n \t}\n \telse{\n \t\tpre=a[i];\n \t}\n }\n out.write(res+\"\");\n out.flush();\n\n }\n}", "import java.util.*;", "util.*", "java", "import java.io.*;", "io.*", "java", "public class Main{\n\nstatic BufferedReader s1;\nstatic BufferedWriter out;\nstatic String read() throws IOException{String line=\"\";while(line.length()==0){line=s1.readLine();continue;}return line;}\nstatic int int_v (String s1){return Integer.parseInt(s1);}\nstatic long long_v(String s1){return Long.parseLong(s1);}\nstatic int[] int_arr() throws IOException{String[] a=read().split(\"\\\\s+\");int[] b=new int[a.length];for(int i=0;i<a.length;i++){b[i]=int_v(a[i]);}return b;}\nstatic long[] long_arr() throws IOException{String[] a=read().split(\"\\\\s+\");long[] b=new long[a.length];for(int i=0;i<a.length;i++){b[i]=long_v(a[i]);}return b;}\nstatic void assign(){s1=new BufferedReader(new InputStreamReader(System.in));out=new BufferedWriter(new OutputStreamWriter(System.out));}\nstatic int Modpow(int a,int p,int m){int res=1;while(p>0){if((p&1)!=0){res=(res*a)%m;}p >>=1;a=(a*a)%m;}return res;}\n//......................................@uthor_Alx..............................................\nstatic long mod=(long)1e9+7;\npublic static void main(String[] args) throws IOException{\n assign();\n int n=int_v(read());\n int[] a=int_arr();\n long res=0; int pre=0;\n for(int i=0;i<n;i++){\n \tif(pre>a[i]){\n \t\tres+=pre-a[i];\n \t}\n \telse{\n \t\tpre=a[i];\n \t}\n }\n out.write(res+\"\");\n out.flush();\n\n }\n}", "Main", "static BufferedReader s1;", "s1", "static BufferedWriter out;", "out", "//......................................@uthor_Alx..............................................\nstatic long mod=(long)1e9+7;", "mod", "(long)1e9+7", "(long)1e9", "7", "static String read() throws IOException{String line=\"\";while(line.length()==0){line=s1.readLine();continue;}return line;}", "read", "{String line=\"\";while(line.length()==0){line=s1.readLine();continue;}return line;}", "String line=\"\";", "line", "\"\"", "while(line.length()==0){line=s1.readLine();continue;}", "line.length()==0", "line.length()", "line.length", "line", "0", "{line=s1.readLine();continue;}", "line=s1.readLine()", "line", "s1.readLine()", "s1.readLine", "s1", "continue;", "return line;", "line", "static int int_v (String s1){return Integer.parseInt(s1);}", "int_v", "{return Integer.parseInt(s1);}", "return Integer.parseInt(s1);", "Integer.parseInt(s1)", "Integer.parseInt", "Integer", "s1", "String s1", "s1", "static long long_v(String s1){return Long.parseLong(s1);}", "long_v", "{return Long.parseLong(s1);}", "return Long.parseLong(s1);", "Long.parseLong(s1)", "Long.parseLong", "Long", "s1", "String s1", "s1", "static int[] int_arr() throws IOException{String[] a=read().split(\"\\\\s+\");int[] b=new int[a.length];for(int i=0;i<a.length;i++){b[i]=int_v(a[i]);}return b;}", "int_arr", "{String[] a=read().split(\"\\\\s+\");int[] b=new int[a.length];for(int i=0;i<a.length;i++){b[i]=int_v(a[i]);}return b;}", "String[] a=read().split(\"\\\\s+\");", "a", "read().split(\"\\\\s+\")", "read().split", "read()", "read", "\"\\\\s+\"", "int[] b=new int[a.length];", "b", "new int[a.length]", "a.length", "a", "a.length", "for(int i=0;i<a.length;i++){b[i]=int_v(a[i]);}", "int i=0;", "int i=0;", "i", "0", "i<a.length", "i", "a.length", "a", "a.length", "i++", "i++", "i", "{b[i]=int_v(a[i]);}", "{b[i]=int_v(a[i]);}", "b[i]=int_v(a[i])", "b[i]", "b", "i", "int_v(a[i])", "int_v", "a[i]", "a", "i", "return b;", "b", "static long[] long_arr() throws IOException{String[] a=read().split(\"\\\\s+\");long[] b=new long[a.length];for(int i=0;i<a.length;i++){b[i]=long_v(a[i]);}return b;}", "long_arr", "{String[] a=read().split(\"\\\\s+\");long[] b=new long[a.length];for(int i=0;i<a.length;i++){b[i]=long_v(a[i]);}return b;}", "String[] a=read().split(\"\\\\s+\");", "a", "read().split(\"\\\\s+\")", "read().split", "read()", "read", "\"\\\\s+\"", "long[] b=new long[a.length];", "b", "new long[a.length]", "a.length", "a", "a.length", "for(int i=0;i<a.length;i++){b[i]=long_v(a[i]);}", "int i=0;", "int i=0;", "i", "0", "i<a.length", "i", "a.length", "a", "a.length", "i++", "i++", "i", "{b[i]=long_v(a[i]);}", "{b[i]=long_v(a[i]);}", "b[i]=long_v(a[i])", "b[i]", "b", "i", "long_v(a[i])", "long_v", "a[i]", "a", "i", "return b;", "b", "static void assign(){s1=new BufferedReader(new InputStreamReader(System.in));out=new BufferedWriter(new OutputStreamWriter(System.out));}", "assign", "{s1=new BufferedReader(new InputStreamReader(System.in));out=new BufferedWriter(new OutputStreamWriter(System.out));}", "s1=new BufferedReader(new InputStreamReader(System.in))", "s1", "new BufferedReader(new InputStreamReader(System.in))", "out=new BufferedWriter(new OutputStreamWriter(System.out))", "out", "new BufferedWriter(new OutputStreamWriter(System.out))", "static int Modpow(int a,int p,int m){int res=1;while(p>0){if((p&1)!=0){res=(res*a)%m;}p >>=1;a=(a*a)%m;}return res;}", "Modpow", "{int res=1;while(p>0){if((p&1)!=0){res=(res*a)%m;}p >>=1;a=(a*a)%m;}return res;}", "int res=1;", "res", "1", "while(p>0){if((p&1)!=0){res=(res*a)%m;}p >>=1;a=(a*a)%m;}", "p>0", "p", "0", "{if((p&1)!=0){res=(res*a)%m;}p >>=1;a=(a*a)%m;}", "if((p&1)!=0){res=(res*a)%m;}", "(p&1)!=0", "(p&1)", "p", "1", "0", "{res=(res*a)%m;}", "res=(res*a)%m", "res", "(res*a)%m", "(res*a)", "res", "a", "m", "p >>=1", "p", "1", "a=(a*a)%m", "a", "(a*a)%m", "(a*a)", "a", "a", "m", "return res;", "res", "int a", "a", "int p", "p", "int m", "m", "public static void main(String[] args) throws IOException{\n assign();\n int n=int_v(read());\n int[] a=int_arr();\n long res=0; int pre=0;\n for(int i=0;i<n;i++){\n \tif(pre>a[i]){\n \t\tres+=pre-a[i];\n \t}\n \telse{\n \t\tpre=a[i];\n \t}\n }\n out.write(res+\"\");\n out.flush();\n\n }", "main", "{\n assign();\n int n=int_v(read());\n int[] a=int_arr();\n long res=0; int pre=0;\n for(int i=0;i<n;i++){\n \tif(pre>a[i]){\n \t\tres+=pre-a[i];\n \t}\n \telse{\n \t\tpre=a[i];\n \t}\n }\n out.write(res+\"\");\n out.flush();\n\n }", "assign()", "assign", "int n=int_v(read());", "n", "int_v(read())", "int_v", "read()", "read", "int[] a=int_arr();", "a", "int_arr()", "int_arr", "long res=0;", "res", "0", "int pre=0;", "pre", "0", "for(int i=0;i<n;i++){\n \tif(pre>a[i]){\n \t\tres+=pre-a[i];\n \t}\n \telse{\n \t\tpre=a[i];\n \t}\n }", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\n \tif(pre>a[i]){\n \t\tres+=pre-a[i];\n \t}\n \telse{\n \t\tpre=a[i];\n \t}\n }", "{\n \tif(pre>a[i]){\n \t\tres+=pre-a[i];\n \t}\n \telse{\n \t\tpre=a[i];\n \t}\n }", "if(pre>a[i]){\n \t\tres+=pre-a[i];\n \t}\n \telse{\n \t\tpre=a[i];\n \t}", "pre>a[i]", "pre", "a[i]", "a", "i", "{\n \t\tres+=pre-a[i];\n \t}", "res+=pre-a[i]", "res", "pre-a[i]", "pre", "a[i]", "a", "i", "{\n \t\tpre=a[i];\n \t}", "pre=a[i]", "pre", "a[i]", "a", "i", "out.write(res+\"\")", "out.write", "out", "res+\"\"", "res", "\"\"", "out.flush()", "out.flush", "out", "String[] args", "args", "public class Main{\n\nstatic BufferedReader s1;\nstatic BufferedWriter out;\nstatic String read() throws IOException{String line=\"\";while(line.length()==0){line=s1.readLine();continue;}return line;}\nstatic int int_v (String s1){return Integer.parseInt(s1);}\nstatic long long_v(String s1){return Long.parseLong(s1);}\nstatic int[] int_arr() throws IOException{String[] a=read().split(\"\\\\s+\");int[] b=new int[a.length];for(int i=0;i<a.length;i++){b[i]=int_v(a[i]);}return b;}\nstatic long[] long_arr() throws IOException{String[] a=read().split(\"\\\\s+\");long[] b=new long[a.length];for(int i=0;i<a.length;i++){b[i]=long_v(a[i]);}return b;}\nstatic void assign(){s1=new BufferedReader(new InputStreamReader(System.in));out=new BufferedWriter(new OutputStreamWriter(System.out));}\nstatic int Modpow(int a,int p,int m){int res=1;while(p>0){if((p&1)!=0){res=(res*a)%m;}p >>=1;a=(a*a)%m;}return res;}\n//......................................@uthor_Alx..............................................\nstatic long mod=(long)1e9+7;\npublic static void main(String[] args) throws IOException{\n assign();\n int n=int_v(read());\n int[] a=int_arr();\n long res=0; int pre=0;\n for(int i=0;i<n;i++){\n \tif(pre>a[i]){\n \t\tres+=pre-a[i];\n \t}\n \telse{\n \t\tpre=a[i];\n \t}\n }\n out.write(res+\"\");\n out.flush();\n\n }\n}", "public class Main{\n\nstatic BufferedReader s1;\nstatic BufferedWriter out;\nstatic String read() throws IOException{String line=\"\";while(line.length()==0){line=s1.readLine();continue;}return line;}\nstatic int int_v (String s1){return Integer.parseInt(s1);}\nstatic long long_v(String s1){return Long.parseLong(s1);}\nstatic int[] int_arr() throws IOException{String[] a=read().split(\"\\\\s+\");int[] b=new int[a.length];for(int i=0;i<a.length;i++){b[i]=int_v(a[i]);}return b;}\nstatic long[] long_arr() throws IOException{String[] a=read().split(\"\\\\s+\");long[] b=new long[a.length];for(int i=0;i<a.length;i++){b[i]=long_v(a[i]);}return b;}\nstatic void assign(){s1=new BufferedReader(new InputStreamReader(System.in));out=new BufferedWriter(new OutputStreamWriter(System.out));}\nstatic int Modpow(int a,int p,int m){int res=1;while(p>0){if((p&1)!=0){res=(res*a)%m;}p >>=1;a=(a*a)%m;}return res;}\n//......................................@uthor_Alx..............................................\nstatic long mod=(long)1e9+7;\npublic static void main(String[] args) throws IOException{\n assign();\n int n=int_v(read());\n int[] a=int_arr();\n long res=0; int pre=0;\n for(int i=0;i<n;i++){\n \tif(pre>a[i]){\n \t\tres+=pre-a[i];\n \t}\n \telse{\n \t\tpre=a[i];\n \t}\n }\n out.write(res+\"\");\n out.flush();\n\n }\n}", "Main" ]
import java.util.*; import java.io.*; public class Main{ static BufferedReader s1; static BufferedWriter out; static String read() throws IOException{String line="";while(line.length()==0){line=s1.readLine();continue;}return line;} static int int_v (String s1){return Integer.parseInt(s1);} static long long_v(String s1){return Long.parseLong(s1);} static int[] int_arr() throws IOException{String[] a=read().split("\\s+");int[] b=new int[a.length];for(int i=0;i<a.length;i++){b[i]=int_v(a[i]);}return b;} static long[] long_arr() throws IOException{String[] a=read().split("\\s+");long[] b=new long[a.length];for(int i=0;i<a.length;i++){b[i]=long_v(a[i]);}return b;} static void assign(){s1=new BufferedReader(new InputStreamReader(System.in));out=new BufferedWriter(new OutputStreamWriter(System.out));} static int Modpow(int a,int p,int m){int res=1;while(p>0){if((p&1)!=0){res=(res*a)%m;}p >>=1;a=(a*a)%m;}return res;} //......................................@uthor_Alx.............................................. static long mod=(long)1e9+7; public static void main(String[] args) throws IOException{ assign(); int n=int_v(read()); int[] a=int_arr(); long res=0; int pre=0; for(int i=0;i<n;i++){ if(pre>a[i]){ res+=pre-a[i]; } else{ pre=a[i]; } } out.write(res+""); out.flush(); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 18, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 2, 18, 13, 13, 17, 1, 40, 13, 30, 30, 14, 2, 18, 13, 13, 18, 13, 2, 13, 17, 30, 0, 13, 2, 13, 2, 18, 13, 13, 18, 13, 2, 13, 17, 0, 18, 13, 2, 13, 17, 18, 13, 13, 4, 18, 18, 13, 13, 2, 17, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 107, 5 ], [ 107, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 8, 21 ], [ 21, 22 ], [ 22, 23 ], [ 23, 24 ], [ 23, 25 ], [ 21, 26 ], [ 26, 27 ], [ 26, 28 ], [ 28, 29 ], [ 28, 30 ], [ 21, 31 ], [ 31, 32 ], [ 32, 33 ], [ 21, 34 ], [ 35, 35 ], [ 35, 36 ], [ 36, 37 ], [ 37, 38 ], [ 37, 39 ], [ 36, 40 ], [ 40, 41 ], [ 41, 42 ], [ 8, 43 ], [ 43, 44 ], [ 43, 45 ], [ 8, 46 ], [ 46, 47 ], [ 47, 48 ], [ 48, 49 ], [ 48, 50 ], [ 46, 51 ], [ 51, 52 ], [ 51, 53 ], [ 53, 54 ], [ 54, 55 ], [ 54, 56 ], [ 53, 57 ], [ 46, 58 ], [ 58, 59 ], [ 59, 60 ], [ 46, 61 ], [ 62, 62 ], [ 62, 63 ], [ 63, 64 ], [ 64, 65 ], [ 65, 66 ], [ 65, 67 ], [ 64, 68 ], [ 68, 69 ], [ 68, 70 ], [ 70, 71 ], [ 70, 72 ], [ 63, 73 ], [ 73, 74 ], [ 74, 75 ], [ 74, 76 ], [ 76, 77 ], [ 76, 78 ], [ 78, 79 ], [ 79, 80 ], [ 79, 81 ], [ 78, 82 ], [ 82, 83 ], [ 82, 84 ], [ 84, 85 ], [ 84, 86 ], [ 73, 87 ], [ 87, 88 ], [ 88, 89 ], [ 88, 90 ], [ 90, 91 ], [ 90, 92 ], [ 87, 93 ], [ 93, 94 ], [ 93, 95 ], [ 8, 96 ], [ 96, 97 ], [ 97, 98 ], [ 98, 99 ], [ 98, 100 ], [ 96, 101 ], [ 101, 102 ], [ 101, 103 ], [ 6, 104 ], [ 104, 105 ], [ 0, 106 ], [ 106, 107 ], [ 106, 108 ] ]
[ "import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tint[] a=new int[n];\n\t\tfor (int i = 0; i < a.length; i++) {\n\t\t\ta[i]=sc.nextInt();\n\t\t}\n\t\tlong ans=0;\n\t\tfor (int i = 0; i < a.length-1; i++) {\n\t\t\tif(a[i]>=a[i+1]){ans=ans+(a[i]-a[i+1]);a[i+1]=a[i];}\n\t\t}\n\t\tSystem.out.println(\"\"+ans);\n\t}\n}", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tint[] a=new int[n];\n\t\tfor (int i = 0; i < a.length; i++) {\n\t\t\ta[i]=sc.nextInt();\n\t\t}\n\t\tlong ans=0;\n\t\tfor (int i = 0; i < a.length-1; i++) {\n\t\t\tif(a[i]>=a[i+1]){ans=ans+(a[i]-a[i+1]);a[i+1]=a[i];}\n\t\t}\n\t\tSystem.out.println(\"\"+ans);\n\t}\n}", "Main", "public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tint[] a=new int[n];\n\t\tfor (int i = 0; i < a.length; i++) {\n\t\t\ta[i]=sc.nextInt();\n\t\t}\n\t\tlong ans=0;\n\t\tfor (int i = 0; i < a.length-1; i++) {\n\t\t\tif(a[i]>=a[i+1]){ans=ans+(a[i]-a[i+1]);a[i+1]=a[i];}\n\t\t}\n\t\tSystem.out.println(\"\"+ans);\n\t}", "main", "{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tint[] a=new int[n];\n\t\tfor (int i = 0; i < a.length; i++) {\n\t\t\ta[i]=sc.nextInt();\n\t\t}\n\t\tlong ans=0;\n\t\tfor (int i = 0; i < a.length-1; i++) {\n\t\t\tif(a[i]>=a[i+1]){ans=ans+(a[i]-a[i+1]);a[i+1]=a[i];}\n\t\t}\n\t\tSystem.out.println(\"\"+ans);\n\t}", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n=sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "int[] a=new int[n];", "a", "new int[n]", "n", "for (int i = 0; i < a.length; i++) {\n\t\t\ta[i]=sc.nextInt();\n\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < a.length", "i", "a.length", "a", "a.length", "i++", "i++", "i", "{\n\t\t\ta[i]=sc.nextInt();\n\t\t}", "{\n\t\t\ta[i]=sc.nextInt();\n\t\t}", "a[i]=sc.nextInt()", "a[i]", "a", "i", "sc.nextInt()", "sc.nextInt", "sc", "long ans=0;", "ans", "0", "for (int i = 0; i < a.length-1; i++) {\n\t\t\tif(a[i]>=a[i+1]){ans=ans+(a[i]-a[i+1]);a[i+1]=a[i];}\n\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < a.length-1", "i", "a.length-1", "a.length", "a", "a.length", "1", "i++", "i++", "i", "{\n\t\t\tif(a[i]>=a[i+1]){ans=ans+(a[i]-a[i+1]);a[i+1]=a[i];}\n\t\t}", "{\n\t\t\tif(a[i]>=a[i+1]){ans=ans+(a[i]-a[i+1]);a[i+1]=a[i];}\n\t\t}", "if(a[i]>=a[i+1]){ans=ans+(a[i]-a[i+1]);a[i+1]=a[i];}", "a[i]>=a[i+1]", "a[i]", "a", "i", "a[i+1]", "a", "i+1", "i", "1", "{ans=ans+(a[i]-a[i+1]);a[i+1]=a[i];}", "ans=ans+(a[i]-a[i+1])", "ans", "ans+(a[i]-a[i+1])", "ans", "(a[i]-a[i+1])", "a[i]", "a", "i", "a[i+1]", "a", "i+1", "i", "1", "a[i+1]=a[i]", "a[i+1]", "a", "i+1", "i", "1", "a[i]", "a", "i", "System.out.println(\"\"+ans)", "System.out.println", "System.out", "System", "System.out", "\"\"+ans", "\"\"", "ans", "String[] args", "args", "public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tint[] a=new int[n];\n\t\tfor (int i = 0; i < a.length; i++) {\n\t\t\ta[i]=sc.nextInt();\n\t\t}\n\t\tlong ans=0;\n\t\tfor (int i = 0; i < a.length-1; i++) {\n\t\t\tif(a[i]>=a[i+1]){ans=ans+(a[i]-a[i+1]);a[i+1]=a[i];}\n\t\t}\n\t\tSystem.out.println(\"\"+ans);\n\t}\n}", "public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tint[] a=new int[n];\n\t\tfor (int i = 0; i < a.length; i++) {\n\t\t\ta[i]=sc.nextInt();\n\t\t}\n\t\tlong ans=0;\n\t\tfor (int i = 0; i < a.length-1; i++) {\n\t\t\tif(a[i]>=a[i+1]){ans=ans+(a[i]-a[i+1]);a[i+1]=a[i];}\n\t\t}\n\t\tSystem.out.println(\"\"+ans);\n\t}\n}", "Main" ]
import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n=sc.nextInt(); int[] a=new int[n]; for (int i = 0; i < a.length; i++) { a[i]=sc.nextInt(); } long ans=0; for (int i = 0; i < a.length-1; i++) { if(a[i]>=a[i+1]){ans=ans+(a[i]-a[i+1]);a[i+1]=a[i];} } System.out.println(""+ans); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 41, 13, 17, 41, 13, 41, 13, 12, 13, 30, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 18, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 18, 13, 13, 18, 13, 2, 13, 17, 30, 0, 13, 2, 18, 13, 2, 13, 17, 18, 13, 13, 0, 18, 13, 13, 18, 13, 2, 13, 17, 4, 18, 13, 13, 12, 13, 30, 0, 18, 36, 13, 13, 0, 18, 36, 13, 13, 23, 13, 23, 13, 12, 13, 30, 41, 13, 8, 4, 18, 13, 18, 13, 13, 20, 41, 13, 18, 13, 13, 41, 13, 20, 41, 13, 20, 4, 18, 20, 4, 18, 13, 23, 13, 6, 13, 41, 13, 41, 13, 12, 13, 30, 0, 18, 36, 13, 20, 0, 18, 36, 13, 17, 23, 13, 12, 13, 30, 42, 2, 2, 13, 17, 40, 4, 18, 13, 30, 38, 5, 13, 30, 37, 20, 30, 0, 13, 20, 29, 4, 18, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 13, 14 ], [ 13, 15 ], [ 0, 16 ], [ 16, 17 ], [ 16, 18 ], [ 0, 19 ], [ 19, 20 ], [ 19, 21 ], [ 0, 22 ], [ 22, 23 ], [ 22, 24 ], [ 0, 25 ], [ 25, 26 ], [ 25, 27 ], [ 0, 28 ], [ 244, 29 ], [ 244, 30 ], [ 30, 31 ], [ 30, 32 ], [ 244, 33 ], [ 33, 34 ], [ 244, 35 ], [ 35, 36 ], [ 244, 37 ], [ 37, 38 ], [ 37, 39 ], [ 39, 40 ], [ 40, 41 ], [ 40, 42 ], [ 42, 43 ], [ 43, 44 ], [ 39, 45 ], [ 45, 46 ], [ 45, 47 ], [ 39, 49 ], [ 49, 50 ], [ 50, 51 ], [ 51, 52 ], [ 51, 53 ], [ 49, 54 ], [ 54, 55 ], [ 54, 56 ], [ 49, 57 ], [ 57, 58 ], [ 58, 59 ], [ 49, 60 ], [ 60, 61 ], [ 61, 62 ], [ 62, 63 ], [ 62, 64 ], [ 61, 65 ], [ 65, 66 ], [ 66, 67 ], [ 39, 68 ], [ 68, 69 ], [ 68, 70 ], [ 39, 71 ], [ 71, 72 ], [ 72, 73 ], [ 73, 74 ], [ 73, 75 ], [ 71, 76 ], [ 76, 77 ], [ 76, 78 ], [ 71, 79 ], [ 79, 80 ], [ 80, 81 ], [ 71, 82 ], [ 83, 83 ], [ 83, 84 ], [ 84, 85 ], [ 85, 86 ], [ 86, 87 ], [ 86, 88 ], [ 85, 89 ], [ 89, 90 ], [ 89, 91 ], [ 91, 92 ], [ 91, 93 ], [ 84, 94 ], [ 94, 95 ], [ 95, 96 ], [ 95, 97 ], [ 97, 98 ], [ 98, 99 ], [ 98, 100 ], [ 100, 101 ], [ 100, 102 ], [ 97, 103 ], [ 103, 104 ], [ 103, 105 ], [ 94, 106 ], [ 106, 107 ], [ 107, 108 ], [ 107, 109 ], [ 106, 110 ], [ 110, 111 ], [ 110, 112 ], [ 112, 113 ], [ 112, 114 ], [ 39, 115 ], [ 115, 116 ], [ 116, 117 ], [ 115, 118 ], [ 244, 119 ], [ 119, 120 ], [ 119, 121 ], [ 121, 122 ], [ 122, 123 ], [ 123, 124 ], [ 123, 125 ], [ 122, 126 ], [ 121, 127 ], [ 127, 128 ], [ 128, 129 ], [ 128, 130 ], [ 127, 131 ], [ 119, 132 ], [ 132, 133 ], [ 119, 134 ], [ 134, 135 ], [ 244, 136 ], [ 136, 137 ], [ 136, 138 ], [ 138, 139 ], [ 139, 140 ], [ 139, 141 ], [ 141, 142 ], [ 142, 143 ], [ 143, 144 ], [ 141, 145 ], [ 145, 146 ], [ 145, 147 ], [ 141, 148 ], [ 138, 149 ], [ 149, 150 ], [ 149, 151 ], [ 151, 152 ], [ 151, 153 ], [ 138, 154 ], [ 154, 155 ], [ 154, 156 ], [ 138, 157 ], [ 157, 158 ], [ 157, 159 ], [ 138, 160 ], [ 160, 161 ], [ 161, 162 ], [ 138, 163 ], [ 163, 164 ], [ 164, 165 ], [ 136, 166 ], [ 166, 167 ], [ 244, 168 ], [ 168, 169 ], [ 168, 170 ], [ 170, 171 ], [ 168, 172 ], [ 172, 173 ], [ 168, 174 ], [ 174, 175 ], [ 174, 176 ], [ 176, 177 ], [ 177, 178 ], [ 178, 179 ], [ 178, 180 ], [ 177, 181 ], [ 176, 182 ], [ 182, 183 ], [ 183, 184 ], [ 183, 185 ], [ 182, 186 ], [ 174, 187 ], [ 187, 188 ], [ 168, 189 ], [ 189, 190 ], [ 189, 191 ], [ 191, 192 ], [ 192, 193 ], [ 193, 194 ], [ 194, 195 ], [ 194, 196 ], [ 193, 197 ], [ 197, 198 ], [ 198, 199 ], [ 199, 200 ], [ 192, 201 ], [ 201, 202 ], [ 202, 203 ], [ 203, 204 ], [ 203, 205 ], [ 205, 206 ], [ 206, 207 ], [ 202, 208 ], [ 208, 209 ], [ 209, 210 ], [ 209, 211 ], [ 191, 212 ], [ 212, 213 ], [ 213, 214 ], [ 214, 215 ], [ 168, 216 ], [ 216, 217 ], [ 216, 218 ], [ 218, 219 ], [ 219, 220 ], [ 220, 221 ], [ 221, 222 ], [ 220, 223 ], [ 223, 224 ], [ 168, 225 ], [ 225, 226 ], [ 225, 227 ], [ 227, 228 ], [ 228, 229 ], [ 229, 230 ], [ 230, 231 ], [ 229, 232 ], [ 232, 233 ], [ 168, 234 ], [ 234, 235 ], [ 234, 236 ], [ 236, 237 ], [ 237, 238 ], [ 238, 239 ], [ 239, 240 ], [ 238, 241 ], [ 241, 242 ], [ 0, 243 ], [ 243, 244 ], [ 243, 245 ] ]
[ "\nimport java.io.BufferedReader;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.InputStreamReader;\nimport java.io.OutputStream;\nimport java.io.PrintWriter;\nimport java.util.StringTokenizer;\n\npublic class Main {\n\n private static final String INPUT_FILE_PATH = \"\";\n\n void solve() {\n int n = in.nextInt();\n int[] a = new int[n];\n for (int i = 0; i < n; i++) a[i] = in.nextInt();\n long ans = 0;\n for (int i = 1; i < n; i++) {\n if (a[i] < a[i - 1]) {\n ans += (a[i - 1] - a[i]);\n a[i] = a[i - 1];\n }\n\n }\n out.println(ans);\n }\n\n private final InputReader in;\n private final PrintWriter out;\n\n private Main(InputReader in, PrintWriter out) {\n this.in = in;\n this.out = out;\n }\n\n private static class InputReader {\n private BufferedReader br;\n private StringTokenizer st;\n\n public InputReader(InputStream inputStream) {\n this.br = new BufferedReader(new InputStreamReader(inputStream), 32768);\n this.st = null;\n }\n\n public String nextToken() {\n while (st == null || !st.hasMoreTokens()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return st.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(nextToken());\n }\n\n public long nextLong() {\n return Long.parseLong(nextToken());\n }\n\n public double nextDouble() {\n return Double.parseDouble(nextToken());\n }\n }\n\n public static void main(String[] args) throws Exception {\n InputStream inputStream = INPUT_FILE_PATH.isEmpty()\n ? System.in\n : new FileInputStream(new File(INPUT_FILE_PATH));\n OutputStream outputStream = System.out;\n\n InputReader inputReader = new InputReader(inputStream);\n PrintWriter printWriter = new PrintWriter(outputStream);\n\n new Main(inputReader, printWriter).solve();\n\n printWriter.close();\n }\n\n}", "import java.io.BufferedReader;", "BufferedReader", "java.io", "import java.io.File;", "File", "java.io", "import java.io.FileInputStream;", "FileInputStream", "java.io", "import java.io.IOException;", "IOException", "java.io", "import java.io.InputStream;", "InputStream", "java.io", "import java.io.InputStreamReader;", "InputStreamReader", "java.io", "import java.io.OutputStream;", "OutputStream", "java.io", "import java.io.PrintWriter;", "PrintWriter", "java.io", "import java.util.StringTokenizer;", "StringTokenizer", "java.util", "public class Main {\n\n private static final String INPUT_FILE_PATH = \"\";\n\n void solve() {\n int n = in.nextInt();\n int[] a = new int[n];\n for (int i = 0; i < n; i++) a[i] = in.nextInt();\n long ans = 0;\n for (int i = 1; i < n; i++) {\n if (a[i] < a[i - 1]) {\n ans += (a[i - 1] - a[i]);\n a[i] = a[i - 1];\n }\n\n }\n out.println(ans);\n }\n\n private final InputReader in;\n private final PrintWriter out;\n\n private Main(InputReader in, PrintWriter out) {\n this.in = in;\n this.out = out;\n }\n\n private static class InputReader {\n private BufferedReader br;\n private StringTokenizer st;\n\n public InputReader(InputStream inputStream) {\n this.br = new BufferedReader(new InputStreamReader(inputStream), 32768);\n this.st = null;\n }\n\n public String nextToken() {\n while (st == null || !st.hasMoreTokens()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return st.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(nextToken());\n }\n\n public long nextLong() {\n return Long.parseLong(nextToken());\n }\n\n public double nextDouble() {\n return Double.parseDouble(nextToken());\n }\n }\n\n public static void main(String[] args) throws Exception {\n InputStream inputStream = INPUT_FILE_PATH.isEmpty()\n ? System.in\n : new FileInputStream(new File(INPUT_FILE_PATH));\n OutputStream outputStream = System.out;\n\n InputReader inputReader = new InputReader(inputStream);\n PrintWriter printWriter = new PrintWriter(outputStream);\n\n new Main(inputReader, printWriter).solve();\n\n printWriter.close();\n }\n\n}", "Main", "private static final String INPUT_FILE_PATH = \"\";", "INPUT_FILE_PATH", "\"\"", "private final InputReader in;", "in", "private final PrintWriter out;", "out", "void solve() {\n int n = in.nextInt();\n int[] a = new int[n];\n for (int i = 0; i < n; i++) a[i] = in.nextInt();\n long ans = 0;\n for (int i = 1; i < n; i++) {\n if (a[i] < a[i - 1]) {\n ans += (a[i - 1] - a[i]);\n a[i] = a[i - 1];\n }\n\n }\n out.println(ans);\n }", "solve", "{\n int n = in.nextInt();\n int[] a = new int[n];\n for (int i = 0; i < n; i++) a[i] = in.nextInt();\n long ans = 0;\n for (int i = 1; i < n; i++) {\n if (a[i] < a[i - 1]) {\n ans += (a[i - 1] - a[i]);\n a[i] = a[i - 1];\n }\n\n }\n out.println(ans);\n }", "int n = in.nextInt();", "n", "in.nextInt()", "in.nextInt", "in", "int[] a = new int[n];", "a", "new int[n]", "n", "for (int i = 0; i < n; i++) a[i] = in.nextInt();", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "a[i] = in.nextInt();", "a[i] = in.nextInt()", "a[i]", "a", "i", "in.nextInt()", "in.nextInt", "in", "long ans = 0;", "ans", "0", "for (int i = 1; i < n; i++) {\n if (a[i] < a[i - 1]) {\n ans += (a[i - 1] - a[i]);\n a[i] = a[i - 1];\n }\n\n }", "int i = 1;", "int i = 1;", "i", "1", "i < n", "i", "n", "i++", "i++", "i", "{\n if (a[i] < a[i - 1]) {\n ans += (a[i - 1] - a[i]);\n a[i] = a[i - 1];\n }\n\n }", "{\n if (a[i] < a[i - 1]) {\n ans += (a[i - 1] - a[i]);\n a[i] = a[i - 1];\n }\n\n }", "if (a[i] < a[i - 1]) {\n ans += (a[i - 1] - a[i]);\n a[i] = a[i - 1];\n }", "a[i] < a[i - 1]", "a[i]", "a", "i", "a[i - 1]", "a", "i - 1", "i", "1", "{\n ans += (a[i - 1] - a[i]);\n a[i] = a[i - 1];\n }", "ans += (a[i - 1] - a[i])", "ans", "(a[i - 1] - a[i])", "a[i - 1]", "a", "i - 1", "i", "1", "a[i]", "a", "i", "a[i] = a[i - 1]", "a[i]", "a", "i", "a[i - 1]", "a", "i - 1", "i", "1", "out.println(ans)", "out.println", "out", "ans", "private Main(InputReader in, PrintWriter out) {\n this.in = in;\n this.out = out;\n }", "Main", "{\n this.in = in;\n this.out = out;\n }", "this.in = in", "this.in", "this", "this.in", "in", "this.out = out", "this.out", "this", "this.out", "out", "InputReader in", "in", "PrintWriter out", "out", "public static void main(String[] args) throws Exception {\n InputStream inputStream = INPUT_FILE_PATH.isEmpty()\n ? System.in\n : new FileInputStream(new File(INPUT_FILE_PATH));\n OutputStream outputStream = System.out;\n\n InputReader inputReader = new InputReader(inputStream);\n PrintWriter printWriter = new PrintWriter(outputStream);\n\n new Main(inputReader, printWriter).solve();\n\n printWriter.close();\n }", "main", "{\n InputStream inputStream = INPUT_FILE_PATH.isEmpty()\n ? System.in\n : new FileInputStream(new File(INPUT_FILE_PATH));\n OutputStream outputStream = System.out;\n\n InputReader inputReader = new InputReader(inputStream);\n PrintWriter printWriter = new PrintWriter(outputStream);\n\n new Main(inputReader, printWriter).solve();\n\n printWriter.close();\n }", "InputStream inputStream = INPUT_FILE_PATH.isEmpty()\n ? System.in\n : new FileInputStream(new File(INPUT_FILE_PATH));", "inputStream", "INPUT_FILE_PATH.isEmpty()\n ? System.in\n : new FileInputStream(new File(INPUT_FILE_PATH))", "INPUT_FILE_PATH.isEmpty()", "INPUT_FILE_PATH.isEmpty", "INPUT_FILE_PATH", "System.in", "System", "System.in", "new FileInputStream(new File(INPUT_FILE_PATH))", "OutputStream outputStream = System.out;", "outputStream", "System.out", "System", "System.out", "InputReader inputReader = new InputReader(inputStream);", "inputReader", "new InputReader(inputStream)", "PrintWriter printWriter = new PrintWriter(outputStream);", "printWriter", "new PrintWriter(outputStream)", "new Main(inputReader, printWriter).solve()", "new Main(inputReader, printWriter).solve", "new Main(inputReader, printWriter)", "printWriter.close()", "printWriter.close", "printWriter", "String[] args", "args", "private static class InputReader {\n private BufferedReader br;\n private StringTokenizer st;\n\n public InputReader(InputStream inputStream) {\n this.br = new BufferedReader(new InputStreamReader(inputStream), 32768);\n this.st = null;\n }\n\n public String nextToken() {\n while (st == null || !st.hasMoreTokens()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return st.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(nextToken());\n }\n\n public long nextLong() {\n return Long.parseLong(nextToken());\n }\n\n public double nextDouble() {\n return Double.parseDouble(nextToken());\n }\n }", "InputReader", "private BufferedReader br;", "br", "private StringTokenizer st;", "st", "public InputReader(InputStream inputStream) {\n this.br = new BufferedReader(new InputStreamReader(inputStream), 32768);\n this.st = null;\n }", "InputReader", "{\n this.br = new BufferedReader(new InputStreamReader(inputStream), 32768);\n this.st = null;\n }", "this.br = new BufferedReader(new InputStreamReader(inputStream), 32768)", "this.br", "this", "this.br", "new BufferedReader(new InputStreamReader(inputStream), 32768)", "this.st = null", "this.st", "this", "this.st", "null", "InputStream inputStream", "inputStream", "public String nextToken() {\n while (st == null || !st.hasMoreTokens()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return st.nextToken();\n }", "nextToken", "{\n while (st == null || !st.hasMoreTokens()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return st.nextToken();\n }", "while (st == null || !st.hasMoreTokens()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }", "st == null || !st.hasMoreTokens()", "st == null", "st", "null", "!st.hasMoreTokens()", "st.hasMoreTokens()", "st.hasMoreTokens", "st", "{\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }", "try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }", "catch (IOException e) {\n throw new RuntimeException(e);\n }", "IOException e", "{\n throw new RuntimeException(e);\n }", "throw new RuntimeException(e);", "new RuntimeException(e)", "{\n st = new StringTokenizer(br.readLine());\n }", "st = new StringTokenizer(br.readLine())", "st", "new StringTokenizer(br.readLine())", "return st.nextToken();", "st.nextToken()", "st.nextToken", "st", "public int nextInt() {\n return Integer.parseInt(nextToken());\n }", "nextInt", "{\n return Integer.parseInt(nextToken());\n }", "return Integer.parseInt(nextToken());", "Integer.parseInt(nextToken())", "Integer.parseInt", "Integer", "nextToken()", "nextToken", "public long nextLong() {\n return Long.parseLong(nextToken());\n }", "nextLong", "{\n return Long.parseLong(nextToken());\n }", "return Long.parseLong(nextToken());", "Long.parseLong(nextToken())", "Long.parseLong", "Long", "nextToken()", "nextToken", "public double nextDouble() {\n return Double.parseDouble(nextToken());\n }", "nextDouble", "{\n return Double.parseDouble(nextToken());\n }", "return Double.parseDouble(nextToken());", "Double.parseDouble(nextToken())", "Double.parseDouble", "Double", "nextToken()", "nextToken", "public class Main {\n\n private static final String INPUT_FILE_PATH = \"\";\n\n void solve() {\n int n = in.nextInt();\n int[] a = new int[n];\n for (int i = 0; i < n; i++) a[i] = in.nextInt();\n long ans = 0;\n for (int i = 1; i < n; i++) {\n if (a[i] < a[i - 1]) {\n ans += (a[i - 1] - a[i]);\n a[i] = a[i - 1];\n }\n\n }\n out.println(ans);\n }\n\n private final InputReader in;\n private final PrintWriter out;\n\n private Main(InputReader in, PrintWriter out) {\n this.in = in;\n this.out = out;\n }\n\n private static class InputReader {\n private BufferedReader br;\n private StringTokenizer st;\n\n public InputReader(InputStream inputStream) {\n this.br = new BufferedReader(new InputStreamReader(inputStream), 32768);\n this.st = null;\n }\n\n public String nextToken() {\n while (st == null || !st.hasMoreTokens()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return st.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(nextToken());\n }\n\n public long nextLong() {\n return Long.parseLong(nextToken());\n }\n\n public double nextDouble() {\n return Double.parseDouble(nextToken());\n }\n }\n\n public static void main(String[] args) throws Exception {\n InputStream inputStream = INPUT_FILE_PATH.isEmpty()\n ? System.in\n : new FileInputStream(new File(INPUT_FILE_PATH));\n OutputStream outputStream = System.out;\n\n InputReader inputReader = new InputReader(inputStream);\n PrintWriter printWriter = new PrintWriter(outputStream);\n\n new Main(inputReader, printWriter).solve();\n\n printWriter.close();\n }\n\n}", "public class Main {\n\n private static final String INPUT_FILE_PATH = \"\";\n\n void solve() {\n int n = in.nextInt();\n int[] a = new int[n];\n for (int i = 0; i < n; i++) a[i] = in.nextInt();\n long ans = 0;\n for (int i = 1; i < n; i++) {\n if (a[i] < a[i - 1]) {\n ans += (a[i - 1] - a[i]);\n a[i] = a[i - 1];\n }\n\n }\n out.println(ans);\n }\n\n private final InputReader in;\n private final PrintWriter out;\n\n private Main(InputReader in, PrintWriter out) {\n this.in = in;\n this.out = out;\n }\n\n private static class InputReader {\n private BufferedReader br;\n private StringTokenizer st;\n\n public InputReader(InputStream inputStream) {\n this.br = new BufferedReader(new InputStreamReader(inputStream), 32768);\n this.st = null;\n }\n\n public String nextToken() {\n while (st == null || !st.hasMoreTokens()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return st.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(nextToken());\n }\n\n public long nextLong() {\n return Long.parseLong(nextToken());\n }\n\n public double nextDouble() {\n return Double.parseDouble(nextToken());\n }\n }\n\n public static void main(String[] args) throws Exception {\n InputStream inputStream = INPUT_FILE_PATH.isEmpty()\n ? System.in\n : new FileInputStream(new File(INPUT_FILE_PATH));\n OutputStream outputStream = System.out;\n\n InputReader inputReader = new InputReader(inputStream);\n PrintWriter printWriter = new PrintWriter(outputStream);\n\n new Main(inputReader, printWriter).solve();\n\n printWriter.close();\n }\n\n}", "Main" ]
import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.PrintWriter; import java.util.StringTokenizer; public class Main { private static final String INPUT_FILE_PATH = ""; void solve() { int n = in.nextInt(); int[] a = new int[n]; for (int i = 0; i < n; i++) a[i] = in.nextInt(); long ans = 0; for (int i = 1; i < n; i++) { if (a[i] < a[i - 1]) { ans += (a[i - 1] - a[i]); a[i] = a[i - 1]; } } out.println(ans); } private final InputReader in; private final PrintWriter out; private Main(InputReader in, PrintWriter out) { this.in = in; this.out = out; } private static class InputReader { private BufferedReader br; private StringTokenizer st; public InputReader(InputStream inputStream) { this.br = new BufferedReader(new InputStreamReader(inputStream), 32768); this.st = null; } public String nextToken() { while (st == null || !st.hasMoreTokens()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { throw new RuntimeException(e); } } return st.nextToken(); } public int nextInt() { return Integer.parseInt(nextToken()); } public long nextLong() { return Long.parseLong(nextToken()); } public double nextDouble() { return Double.parseDouble(nextToken()); } } public static void main(String[] args) throws Exception { InputStream inputStream = INPUT_FILE_PATH.isEmpty() ? System.in : new FileInputStream(new File(INPUT_FILE_PATH)); OutputStream outputStream = System.out; InputReader inputReader = new InputReader(inputStream); PrintWriter printWriter = new PrintWriter(outputStream); new Main(inputReader, printWriter).solve(); printWriter.close(); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 41, 13, 4, 18, 13, 14, 2, 13, 13, 30, 0, 13, 13, 14, 2, 13, 13, 0, 13, 2, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 67, 5 ], [ 67, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 8, 20 ], [ 20, 21 ], [ 20, 22 ], [ 8, 23 ], [ 23, 24 ], [ 24, 25 ], [ 25, 26 ], [ 25, 27 ], [ 23, 28 ], [ 28, 29 ], [ 28, 30 ], [ 23, 31 ], [ 31, 32 ], [ 32, 33 ], [ 23, 34 ], [ 35, 35 ], [ 35, 36 ], [ 36, 37 ], [ 36, 38 ], [ 38, 39 ], [ 39, 40 ], [ 35, 41 ], [ 41, 42 ], [ 42, 43 ], [ 42, 44 ], [ 41, 45 ], [ 45, 46 ], [ 46, 47 ], [ 46, 48 ], [ 41, 49 ], [ 49, 50 ], [ 50, 51 ], [ 50, 52 ], [ 49, 53 ], [ 53, 54 ], [ 53, 55 ], [ 55, 56 ], [ 55, 57 ], [ 8, 58 ], [ 58, 59 ], [ 59, 60 ], [ 60, 61 ], [ 60, 62 ], [ 58, 63 ], [ 6, 64 ], [ 64, 65 ], [ 0, 66 ], [ 66, 67 ], [ 66, 68 ] ]
[ "import java.util.Scanner;\n\n// 提出時にclass Main に書き換え\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\t// 標準入力を受け取る\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt(); // int Nを受け取る\n\n\t\tlong sum = 0; // 踏み台の高さの合計\n\t\tlong mhigh = 0; // A[i]より前での、身長の最高値\n\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tlong A = sc.nextLong(); // long Aを受け取る\n\t\t\tif(A > mhigh) {\n\t\t\t\tmhigh = A; // 身長の最高値更新\n\t\t\t} else if(A < mhigh) sum += mhigh - A; // 踏み台の高さ加算\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t}\n\n}", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\tpublic static void main(String[] args) {\n\t\t// 標準入力を受け取る\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt(); // int Nを受け取る\n\n\t\tlong sum = 0; // 踏み台の高さの合計\n\t\tlong mhigh = 0; // A[i]より前での、身長の最高値\n\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tlong A = sc.nextLong(); // long Aを受け取る\n\t\t\tif(A > mhigh) {\n\t\t\t\tmhigh = A; // 身長の最高値更新\n\t\t\t} else if(A < mhigh) sum += mhigh - A; // 踏み台の高さ加算\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t}\n\n}", "Main", "public static void main(String[] args) {\n\t\t// 標準入力を受け取る\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt(); // int Nを受け取る\n\n\t\tlong sum = 0; // 踏み台の高さの合計\n\t\tlong mhigh = 0; // A[i]より前での、身長の最高値\n\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tlong A = sc.nextLong(); // long Aを受け取る\n\t\t\tif(A > mhigh) {\n\t\t\t\tmhigh = A; // 身長の最高値更新\n\t\t\t} else if(A < mhigh) sum += mhigh - A; // 踏み台の高さ加算\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t}", "main", "{\n\t\t// 標準入力を受け取る\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt(); // int Nを受け取る\n\n\t\tlong sum = 0; // 踏み台の高さの合計\n\t\tlong mhigh = 0; // A[i]より前での、身長の最高値\n\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tlong A = sc.nextLong(); // long Aを受け取る\n\t\t\tif(A > mhigh) {\n\t\t\t\tmhigh = A; // 身長の最高値更新\n\t\t\t} else if(A < mhigh) sum += mhigh - A; // 踏み台の高さ加算\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t}", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int N = sc.nextInt();", "N", "sc.nextInt()", "sc.nextInt", "sc", "long sum = 0;", "sum", "0", "long mhigh = 0;", "mhigh", "0", "for(int i = 0; i < N; i++) {\n\t\t\tlong A = sc.nextLong(); // long Aを受け取る\n\t\t\tif(A > mhigh) {\n\t\t\t\tmhigh = A; // 身長の最高値更新\n\t\t\t} else if(A < mhigh) sum += mhigh - A; // 踏み台の高さ加算\n\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < N", "i", "N", "i++", "i++", "i", "{\n\t\t\tlong A = sc.nextLong(); // long Aを受け取る\n\t\t\tif(A > mhigh) {\n\t\t\t\tmhigh = A; // 身長の最高値更新\n\t\t\t} else if(A < mhigh) sum += mhigh - A; // 踏み台の高さ加算\n\t\t}", "{\n\t\t\tlong A = sc.nextLong(); // long Aを受け取る\n\t\t\tif(A > mhigh) {\n\t\t\t\tmhigh = A; // 身長の最高値更新\n\t\t\t} else if(A < mhigh) sum += mhigh - A; // 踏み台の高さ加算\n\t\t}", "long A = sc.nextLong();", "A", "sc.nextLong()", "sc.nextLong", "sc", "if(A > mhigh) {\n\t\t\t\tmhigh = A; // 身長の最高値更新\n\t\t\t} else if(A < mhigh) sum += mhigh - A; // 踏み台の高さ加算", "A > mhigh", "A", "mhigh", "{\n\t\t\t\tmhigh = A; // 身長の最高値更新\n\t\t\t}", "mhigh = A", "mhigh", "A", "if(A < mhigh) sum += mhigh - A; // 踏み台の高さ加算", "A < mhigh", "A", "mhigh", "sum += mhigh - A", "sum", "mhigh - A", "mhigh", "A", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "String[] args", "args", "public class Main {\n\tpublic static void main(String[] args) {\n\t\t// 標準入力を受け取る\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt(); // int Nを受け取る\n\n\t\tlong sum = 0; // 踏み台の高さの合計\n\t\tlong mhigh = 0; // A[i]より前での、身長の最高値\n\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tlong A = sc.nextLong(); // long Aを受け取る\n\t\t\tif(A > mhigh) {\n\t\t\t\tmhigh = A; // 身長の最高値更新\n\t\t\t} else if(A < mhigh) sum += mhigh - A; // 踏み台の高さ加算\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t}\n\n}", "public class Main {\n\tpublic static void main(String[] args) {\n\t\t// 標準入力を受け取る\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt(); // int Nを受け取る\n\n\t\tlong sum = 0; // 踏み台の高さの合計\n\t\tlong mhigh = 0; // A[i]より前での、身長の最高値\n\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tlong A = sc.nextLong(); // long Aを受け取る\n\t\t\tif(A > mhigh) {\n\t\t\t\tmhigh = A; // 身長の最高値更新\n\t\t\t} else if(A < mhigh) sum += mhigh - A; // 踏み台の高さ加算\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t}\n\n}", "Main" ]
import java.util.Scanner; // 提出時にclass Main に書き換え public class Main { public static void main(String[] args) { // 標準入力を受け取る Scanner sc = new Scanner(System.in); int N = sc.nextInt(); // int Nを受け取る long sum = 0; // 踏み台の高さの合計 long mhigh = 0; // A[i]より前での、身長の最高値 for(int i = 0; i < N; i++) { long A = sc.nextLong(); // long Aを受け取る if(A > mhigh) { mhigh = A; // 身長の最高値更新 } else if(A < mhigh) sum += mhigh - A; // 踏み台の高さ加算 } System.out.println(sum); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 2, 13, 17, 1, 40, 13, 30, 30, 41, 13, 4, 18, 13, 14, 2, 13, 13, 30, 0, 13, 2, 13, 13, 14, 2, 13, 13, 30, 0, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 72, 5 ], [ 72, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 19, 20 ], [ 20, 21 ], [ 8, 22 ], [ 22, 23 ], [ 22, 24 ], [ 8, 25 ], [ 25, 26 ], [ 26, 27 ], [ 27, 28 ], [ 27, 29 ], [ 25, 30 ], [ 30, 31 ], [ 30, 32 ], [ 32, 33 ], [ 32, 34 ], [ 25, 35 ], [ 35, 36 ], [ 36, 37 ], [ 25, 38 ], [ 39, 39 ], [ 39, 40 ], [ 40, 41 ], [ 40, 42 ], [ 42, 43 ], [ 43, 44 ], [ 39, 45 ], [ 45, 46 ], [ 46, 47 ], [ 46, 48 ], [ 45, 49 ], [ 49, 50 ], [ 50, 51 ], [ 50, 52 ], [ 52, 53 ], [ 52, 54 ], [ 45, 55 ], [ 55, 56 ], [ 56, 57 ], [ 56, 58 ], [ 55, 59 ], [ 59, 60 ], [ 60, 61 ], [ 60, 62 ], [ 8, 63 ], [ 63, 64 ], [ 64, 65 ], [ 65, 66 ], [ 65, 67 ], [ 63, 68 ], [ 6, 69 ], [ 69, 70 ], [ 0, 71 ], [ 71, 72 ], [ 71, 73 ] ]
[ "import java.util.Scanner;\n\n\npublic class Main {\n\tpublic static void main (String args[]) throws Exception{\n\t\tScanner scan = new Scanner(System.in);\n\t\tlong n = scan.nextLong();\n\t\tlong max = scan.nextLong();\n\t\tlong sum = 0;\n\t\t\n\t\tfor(long i = 0; i < n - 1 ; i++) {\n\t\t\tlong a = scan.nextLong();\n\t\t\tif(a < max) {\n\t\t\t\tsum += max - a;\n\t\t\t} else if(max < a){\n\t\t\t\tmax = a;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.print(sum);\n\t}\n}", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\tpublic static void main (String args[]) throws Exception{\n\t\tScanner scan = new Scanner(System.in);\n\t\tlong n = scan.nextLong();\n\t\tlong max = scan.nextLong();\n\t\tlong sum = 0;\n\t\t\n\t\tfor(long i = 0; i < n - 1 ; i++) {\n\t\t\tlong a = scan.nextLong();\n\t\t\tif(a < max) {\n\t\t\t\tsum += max - a;\n\t\t\t} else if(max < a){\n\t\t\t\tmax = a;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.print(sum);\n\t}\n}", "Main", "public static void main (String args[]) throws Exception{\n\t\tScanner scan = new Scanner(System.in);\n\t\tlong n = scan.nextLong();\n\t\tlong max = scan.nextLong();\n\t\tlong sum = 0;\n\t\t\n\t\tfor(long i = 0; i < n - 1 ; i++) {\n\t\t\tlong a = scan.nextLong();\n\t\t\tif(a < max) {\n\t\t\t\tsum += max - a;\n\t\t\t} else if(max < a){\n\t\t\t\tmax = a;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.print(sum);\n\t}", "main", "{\n\t\tScanner scan = new Scanner(System.in);\n\t\tlong n = scan.nextLong();\n\t\tlong max = scan.nextLong();\n\t\tlong sum = 0;\n\t\t\n\t\tfor(long i = 0; i < n - 1 ; i++) {\n\t\t\tlong a = scan.nextLong();\n\t\t\tif(a < max) {\n\t\t\t\tsum += max - a;\n\t\t\t} else if(max < a){\n\t\t\t\tmax = a;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.print(sum);\n\t}", "Scanner scan = new Scanner(System.in);", "scan", "new Scanner(System.in)", "long n = scan.nextLong();", "n", "scan.nextLong()", "scan.nextLong", "scan", "long max = scan.nextLong();", "max", "scan.nextLong()", "scan.nextLong", "scan", "long sum = 0;", "sum", "0", "for(long i = 0; i < n - 1 ; i++) {\n\t\t\tlong a = scan.nextLong();\n\t\t\tif(a < max) {\n\t\t\t\tsum += max - a;\n\t\t\t} else if(max < a){\n\t\t\t\tmax = a;\n\t\t\t}\n\t\t}", "long i = 0;", "long i = 0;", "i", "0", "i < n - 1", "i", "n - 1", "n", "1", "i++", "i++", "i", "{\n\t\t\tlong a = scan.nextLong();\n\t\t\tif(a < max) {\n\t\t\t\tsum += max - a;\n\t\t\t} else if(max < a){\n\t\t\t\tmax = a;\n\t\t\t}\n\t\t}", "{\n\t\t\tlong a = scan.nextLong();\n\t\t\tif(a < max) {\n\t\t\t\tsum += max - a;\n\t\t\t} else if(max < a){\n\t\t\t\tmax = a;\n\t\t\t}\n\t\t}", "long a = scan.nextLong();", "a", "scan.nextLong()", "scan.nextLong", "scan", "if(a < max) {\n\t\t\t\tsum += max - a;\n\t\t\t} else if(max < a){\n\t\t\t\tmax = a;\n\t\t\t}", "a < max", "a", "max", "{\n\t\t\t\tsum += max - a;\n\t\t\t}", "sum += max - a", "sum", "max - a", "max", "a", "if(max < a){\n\t\t\t\tmax = a;\n\t\t\t}", "max < a", "max", "a", "{\n\t\t\t\tmax = a;\n\t\t\t}", "max = a", "max", "a", "System.out.print(sum)", "System.out.print", "System.out", "System", "System.out", "sum", "String args[]", "args", "public class Main {\n\tpublic static void main (String args[]) throws Exception{\n\t\tScanner scan = new Scanner(System.in);\n\t\tlong n = scan.nextLong();\n\t\tlong max = scan.nextLong();\n\t\tlong sum = 0;\n\t\t\n\t\tfor(long i = 0; i < n - 1 ; i++) {\n\t\t\tlong a = scan.nextLong();\n\t\t\tif(a < max) {\n\t\t\t\tsum += max - a;\n\t\t\t} else if(max < a){\n\t\t\t\tmax = a;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.print(sum);\n\t}\n}", "public class Main {\n\tpublic static void main (String args[]) throws Exception{\n\t\tScanner scan = new Scanner(System.in);\n\t\tlong n = scan.nextLong();\n\t\tlong max = scan.nextLong();\n\t\tlong sum = 0;\n\t\t\n\t\tfor(long i = 0; i < n - 1 ; i++) {\n\t\t\tlong a = scan.nextLong();\n\t\t\tif(a < max) {\n\t\t\t\tsum += max - a;\n\t\t\t} else if(max < a){\n\t\t\t\tmax = a;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.print(sum);\n\t}\n}", "Main" ]
import java.util.Scanner; public class Main { public static void main (String args[]) throws Exception{ Scanner scan = new Scanner(System.in); long n = scan.nextLong(); long max = scan.nextLong(); long sum = 0; for(long i = 0; i < n - 1 ; i++) { long a = scan.nextLong(); if(a < max) { sum += max - a; } else if(max < a){ max = a; } } System.out.print(sum); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 17, 41, 13, 17, 41, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 4, 18, 13, 14, 2, 13, 13, 30, 0, 13, 13, 14, 2, 13, 13, 30, 0, 13, 2, 13, 2, 13, 13, 4, 18, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 79, 5 ], [ 79, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 8, 20 ], [ 20, 21 ], [ 20, 22 ], [ 8, 23 ], [ 23, 24 ], [ 23, 25 ], [ 8, 26 ], [ 26, 27 ], [ 26, 28 ], [ 8, 29 ], [ 29, 30 ], [ 30, 31 ], [ 31, 32 ], [ 31, 33 ], [ 29, 34 ], [ 34, 35 ], [ 34, 36 ], [ 29, 37 ], [ 37, 38 ], [ 38, 39 ], [ 29, 40 ], [ 41, 41 ], [ 41, 42 ], [ 42, 43 ], [ 42, 44 ], [ 44, 45 ], [ 45, 46 ], [ 41, 47 ], [ 47, 48 ], [ 48, 49 ], [ 48, 50 ], [ 47, 51 ], [ 51, 52 ], [ 52, 53 ], [ 52, 54 ], [ 41, 55 ], [ 55, 56 ], [ 56, 57 ], [ 56, 58 ], [ 55, 59 ], [ 59, 60 ], [ 60, 61 ], [ 60, 62 ], [ 62, 63 ], [ 62, 64 ], [ 64, 65 ], [ 64, 66 ], [ 8, 67 ], [ 67, 68 ], [ 68, 69 ], [ 8, 70 ], [ 70, 71 ], [ 71, 72 ], [ 72, 73 ], [ 72, 74 ], [ 70, 75 ], [ 6, 76 ], [ 76, 77 ], [ 0, 78 ], [ 78, 79 ], [ 78, 80 ] ]
[ "import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\n\t\tlong tmp = 0;\n\t\tlong max = 0;\n\t\tlong now = 0;\n\t\tlong result = 0;\n\t\tfor(int i=0;i < N;i++) {\n\t\t\tnow = sc.nextLong();\n\t\t\tif(now > max) {\n\t\t\t\tmax = now;\n\t\t\t}\n\n\t\t\tif(now < max) {\n\t\t\t\tresult = result + (max - now);\n\t\t\t}\n\t\t}\n\n\t\tsc.close();\n\t\tSystem.out.println(result);\n\n\t}\n\n}", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\n\t\tlong tmp = 0;\n\t\tlong max = 0;\n\t\tlong now = 0;\n\t\tlong result = 0;\n\t\tfor(int i=0;i < N;i++) {\n\t\t\tnow = sc.nextLong();\n\t\t\tif(now > max) {\n\t\t\t\tmax = now;\n\t\t\t}\n\n\t\t\tif(now < max) {\n\t\t\t\tresult = result + (max - now);\n\t\t\t}\n\t\t}\n\n\t\tsc.close();\n\t\tSystem.out.println(result);\n\n\t}\n\n}", "Main", "public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\n\t\tlong tmp = 0;\n\t\tlong max = 0;\n\t\tlong now = 0;\n\t\tlong result = 0;\n\t\tfor(int i=0;i < N;i++) {\n\t\t\tnow = sc.nextLong();\n\t\t\tif(now > max) {\n\t\t\t\tmax = now;\n\t\t\t}\n\n\t\t\tif(now < max) {\n\t\t\t\tresult = result + (max - now);\n\t\t\t}\n\t\t}\n\n\t\tsc.close();\n\t\tSystem.out.println(result);\n\n\t}", "main", "{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\n\t\tlong tmp = 0;\n\t\tlong max = 0;\n\t\tlong now = 0;\n\t\tlong result = 0;\n\t\tfor(int i=0;i < N;i++) {\n\t\t\tnow = sc.nextLong();\n\t\t\tif(now > max) {\n\t\t\t\tmax = now;\n\t\t\t}\n\n\t\t\tif(now < max) {\n\t\t\t\tresult = result + (max - now);\n\t\t\t}\n\t\t}\n\n\t\tsc.close();\n\t\tSystem.out.println(result);\n\n\t}", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int N = sc.nextInt();", "N", "sc.nextInt()", "sc.nextInt", "sc", "long tmp = 0;", "tmp", "0", "long max = 0;", "max", "0", "long now = 0;", "now", "0", "long result = 0;", "result", "0", "for(int i=0;i < N;i++) {\n\t\t\tnow = sc.nextLong();\n\t\t\tif(now > max) {\n\t\t\t\tmax = now;\n\t\t\t}\n\n\t\t\tif(now < max) {\n\t\t\t\tresult = result + (max - now);\n\t\t\t}\n\t\t}", "int i=0;", "int i=0;", "i", "0", "i < N", "i", "N", "i++", "i++", "i", "{\n\t\t\tnow = sc.nextLong();\n\t\t\tif(now > max) {\n\t\t\t\tmax = now;\n\t\t\t}\n\n\t\t\tif(now < max) {\n\t\t\t\tresult = result + (max - now);\n\t\t\t}\n\t\t}", "{\n\t\t\tnow = sc.nextLong();\n\t\t\tif(now > max) {\n\t\t\t\tmax = now;\n\t\t\t}\n\n\t\t\tif(now < max) {\n\t\t\t\tresult = result + (max - now);\n\t\t\t}\n\t\t}", "now = sc.nextLong()", "now", "sc.nextLong()", "sc.nextLong", "sc", "if(now > max) {\n\t\t\t\tmax = now;\n\t\t\t}", "now > max", "now", "max", "{\n\t\t\t\tmax = now;\n\t\t\t}", "max = now", "max", "now", "if(now < max) {\n\t\t\t\tresult = result + (max - now);\n\t\t\t}", "now < max", "now", "max", "{\n\t\t\t\tresult = result + (max - now);\n\t\t\t}", "result = result + (max - now)", "result", "result + (max - now)", "result", "(max - now)", "max", "now", "sc.close()", "sc.close", "sc", "System.out.println(result)", "System.out.println", "System.out", "System", "System.out", "result", "String[] args", "args", "public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\n\t\tlong tmp = 0;\n\t\tlong max = 0;\n\t\tlong now = 0;\n\t\tlong result = 0;\n\t\tfor(int i=0;i < N;i++) {\n\t\t\tnow = sc.nextLong();\n\t\t\tif(now > max) {\n\t\t\t\tmax = now;\n\t\t\t}\n\n\t\t\tif(now < max) {\n\t\t\t\tresult = result + (max - now);\n\t\t\t}\n\t\t}\n\n\t\tsc.close();\n\t\tSystem.out.println(result);\n\n\t}\n\n}", "public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\n\t\tlong tmp = 0;\n\t\tlong max = 0;\n\t\tlong now = 0;\n\t\tlong result = 0;\n\t\tfor(int i=0;i < N;i++) {\n\t\t\tnow = sc.nextLong();\n\t\t\tif(now > max) {\n\t\t\t\tmax = now;\n\t\t\t}\n\n\t\t\tif(now < max) {\n\t\t\t\tresult = result + (max - now);\n\t\t\t}\n\t\t}\n\n\t\tsc.close();\n\t\tSystem.out.println(result);\n\n\t}\n\n}", "Main" ]
import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); long tmp = 0; long max = 0; long now = 0; long result = 0; for(int i=0;i < N;i++) { now = sc.nextLong(); if(now > max) { max = now; } if(now < max) { result = result + (max - now); } } sc.close(); System.out.println(result); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 38, 30, 30, 41, 13, 20, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 18, 13, 13, 18, 13, 2, 13, 17, 30, 0, 13, 2, 18, 13, 2, 13, 17, 18, 13, 13, 0, 18, 13, 13, 18, 13, 2, 13, 17, 4, 18, 13, 13, 23, 13, 6, 13, 41, 13, 41, 13, 12, 13, 30, 0, 13, 20, 23, 13, 12, 13, 30, 42, 2, 2, 13, 17, 40, 4, 18, 13, 30, 38, 5, 13, 30, 37, 20, 30, 0, 13, 20, 29, 4, 18, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 41, 13, 20, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 41, 13, 4, 13, 4, 18, 13, 13, 29, 13, 23, 13, 12, 13, 30, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 13, 29, 13, 23, 13, 12, 13, 30, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 13, 29, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 13, 14 ], [ 13, 15 ], [ 0, 16 ], [ 16, 17 ], [ 16, 18 ], [ 0, 19 ], [ 19, 20 ], [ 19, 21 ], [ 0, 22 ], [ 22, 23 ], [ 22, 24 ], [ 0, 25 ], [ 25, 26 ], [ 25, 27 ], [ 0, 28 ], [ 28, 29 ], [ 28, 30 ], [ 0, 31 ], [ 31, 32 ], [ 31, 33 ], [ 0, 34 ], [ 272, 35 ], [ 272, 36 ], [ 36, 37 ], [ 36, 38 ], [ 38, 39 ], [ 39, 40 ], [ 39, 41 ], [ 41, 42 ], [ 42, 43 ], [ 42, 44 ], [ 41, 45 ], [ 45, 46 ], [ 45, 47 ], [ 41, 48 ], [ 48, 49 ], [ 48, 50 ], [ 50, 51 ], [ 51, 52 ], [ 41, 53 ], [ 53, 54 ], [ 53, 55 ], [ 55, 56 ], [ 56, 57 ], [ 55, 58 ], [ 41, 59 ], [ 59, 60 ], [ 59, 61 ], [ 41, 62 ], [ 62, 63 ], [ 63, 64 ], [ 64, 65 ], [ 64, 66 ], [ 62, 67 ], [ 67, 68 ], [ 67, 69 ], [ 62, 70 ], [ 70, 71 ], [ 71, 72 ], [ 62, 73 ], [ 74, 74 ], [ 74, 75 ], [ 75, 76 ], [ 76, 77 ], [ 77, 78 ], [ 77, 79 ], [ 76, 80 ], [ 80, 81 ], [ 80, 82 ], [ 82, 83 ], [ 82, 84 ], [ 75, 85 ], [ 85, 86 ], [ 86, 87 ], [ 86, 88 ], [ 88, 89 ], [ 89, 90 ], [ 89, 91 ], [ 91, 92 ], [ 91, 93 ], [ 88, 94 ], [ 94, 95 ], [ 94, 96 ], [ 85, 97 ], [ 97, 98 ], [ 98, 99 ], [ 98, 100 ], [ 97, 101 ], [ 101, 102 ], [ 101, 103 ], [ 103, 104 ], [ 103, 105 ], [ 41, 106 ], [ 106, 107 ], [ 107, 108 ], [ 106, 109 ], [ 36, 110 ], [ 110, 111 ], [ 0, 112 ], [ 112, 113 ], [ 112, 114 ], [ 114, 115 ], [ 112, 116 ], [ 116, 117 ], [ 112, 118 ], [ 118, 119 ], [ 118, 120 ], [ 120, 121 ], [ 121, 122 ], [ 121, 123 ], [ 118, 124 ], [ 124, 125 ], [ 112, 126 ], [ 126, 127 ], [ 126, 128 ], [ 128, 129 ], [ 129, 130 ], [ 130, 131 ], [ 131, 132 ], [ 131, 133 ], [ 130, 134 ], [ 134, 135 ], [ 135, 136 ], [ 136, 137 ], [ 129, 138 ], [ 138, 139 ], [ 139, 140 ], [ 140, 141 ], [ 140, 142 ], [ 142, 143 ], [ 143, 144 ], [ 139, 145 ], [ 145, 146 ], [ 146, 147 ], [ 146, 148 ], [ 128, 149 ], [ 149, 150 ], [ 150, 151 ], [ 151, 152 ], [ 112, 153 ], [ 153, 154 ], [ 153, 155 ], [ 155, 156 ], [ 156, 157 ], [ 157, 158 ], [ 158, 159 ], [ 157, 160 ], [ 160, 161 ], [ 112, 162 ], [ 162, 163 ], [ 162, 164 ], [ 164, 165 ], [ 165, 166 ], [ 166, 167 ], [ 167, 168 ], [ 166, 169 ], [ 169, 170 ], [ 112, 171 ], [ 171, 172 ], [ 171, 173 ], [ 173, 174 ], [ 174, 175 ], [ 175, 176 ], [ 176, 177 ], [ 175, 178 ], [ 178, 179 ], [ 112, 180 ], [ 180, 181 ], [ 180, 182 ], [ 182, 183 ], [ 183, 184 ], [ 183, 185 ], [ 182, 186 ], [ 186, 187 ], [ 187, 188 ], [ 188, 189 ], [ 188, 190 ], [ 186, 191 ], [ 191, 192 ], [ 191, 193 ], [ 186, 194 ], [ 194, 195 ], [ 195, 196 ], [ 186, 197 ], [ 198, 198 ], [ 198, 199 ], [ 199, 200 ], [ 199, 201 ], [ 201, 202 ], [ 198, 203 ], [ 203, 204 ], [ 204, 205 ], [ 203, 206 ], [ 182, 207 ], [ 207, 208 ], [ 180, 209 ], [ 209, 210 ], [ 112, 211 ], [ 211, 212 ], [ 211, 213 ], [ 213, 214 ], [ 214, 215 ], [ 214, 216 ], [ 213, 218 ], [ 218, 219 ], [ 219, 220 ], [ 220, 221 ], [ 220, 222 ], [ 218, 223 ], [ 223, 224 ], [ 223, 225 ], [ 218, 226 ], [ 226, 227 ], [ 227, 228 ], [ 218, 229 ], [ 230, 230 ], [ 230, 231 ], [ 231, 232 ], [ 232, 233 ], [ 232, 234 ], [ 231, 235 ], [ 235, 236 ], [ 213, 237 ], [ 237, 238 ], [ 211, 239 ], [ 239, 240 ], [ 112, 241 ], [ 241, 242 ], [ 241, 243 ], [ 243, 244 ], [ 244, 245 ], [ 244, 246 ], [ 243, 248 ], [ 248, 249 ], [ 249, 250 ], [ 250, 251 ], [ 250, 252 ], [ 248, 253 ], [ 253, 254 ], [ 253, 255 ], [ 248, 256 ], [ 256, 257 ], [ 257, 258 ], [ 248, 259 ], [ 260, 260 ], [ 260, 261 ], [ 261, 262 ], [ 262, 263 ], [ 262, 264 ], [ 261, 265 ], [ 265, 266 ], [ 243, 267 ], [ 267, 268 ], [ 241, 269 ], [ 269, 270 ], [ 0, 271 ], [ 271, 272 ], [ 271, 273 ] ]
[ "import java.util.*;\nimport java.io.*;\nimport java.util.Arrays; \nimport java.util.ArrayList; \nimport java.util.Collections; \nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.io.InputStream;\nimport java.util.StringTokenizer;\nimport java.math.BigInteger;\n\npublic class Main {\n \n\n\n\n public static void main(String[] args) {\n try (PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {\n FastScanner in = new FastScanner(System.in);\n int n = in.nextInt();\n long[] array = in.nextLongArray(n);\n long count = 0;\n\n for(int i = 1; i < n; i++) {\n if(array[i] < array[i-1]) {\n count += array[i-1] - array[i];\n array[i] = array[i-1];\n }\n }\n\n out.println(count);\n\n\n\n } finally {\n //out.close();\n }\n \n \n }\n}\n\n\n\n\nclass FastScanner {\n private final BufferedReader br;\n private StringTokenizer st;\n \n FastScanner(InputStream InputStream) {\n br = new BufferedReader(new InputStreamReader(InputStream));\n }\n \n String next() {\n while (st == null || !st.hasMoreTokens()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return st.nextToken();\n }\n \n int nextInt() {\n return Integer.parseInt(next());\n }\n \n long nextLong() {\n return Long.parseLong(next());\n }\n \n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n\n \n ArrayList<Integer> nextIntList(int count) {\n ArrayList<Integer> array = new ArrayList<>();\n for (int n = 0; n < count; n++) {\n int number = nextInt();\n array.add(number);\n }\n return array;\n }\n \n int[] nextIntArray(int count) {\n int[] array = new int[count];\n for (int n = 0; n < count; n++) {\n array[n] = nextInt();\n }\n return array;\n }\n\n long[] nextLongArray(int count) {\n long[] array = new long[count];\n for (int n = 0; n < count; n++) {\n array[n] = nextLong();\n }\n return array;\n }\n}", "import java.util.*;", "util.*", "java", "import java.io.*;", "io.*", "java", "import java.util.Arrays;", "Arrays", "java.util", "import java.util.ArrayList;", "ArrayList", "java.util", "import java.util.Collections;", "Collections", "java.util", "import java.io.BufferedReader;", "BufferedReader", "java.io", "import java.io.IOException;", "IOException", "java.io", "import java.io.InputStreamReader;", "InputStreamReader", "java.io", "import java.io.InputStream;", "InputStream", "java.io", "import java.util.StringTokenizer;", "StringTokenizer", "java.util", "import java.math.BigInteger;", "BigInteger", "java.math", "public class Main {\n \n\n\n\n public static void main(String[] args) {\n try (PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {\n FastScanner in = new FastScanner(System.in);\n int n = in.nextInt();\n long[] array = in.nextLongArray(n);\n long count = 0;\n\n for(int i = 1; i < n; i++) {\n if(array[i] < array[i-1]) {\n count += array[i-1] - array[i];\n array[i] = array[i-1];\n }\n }\n\n out.println(count);\n\n\n\n } finally {\n //out.close();\n }\n \n \n }\n}", "Main", "public static void main(String[] args) {\n try (PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {\n FastScanner in = new FastScanner(System.in);\n int n = in.nextInt();\n long[] array = in.nextLongArray(n);\n long count = 0;\n\n for(int i = 1; i < n; i++) {\n if(array[i] < array[i-1]) {\n count += array[i-1] - array[i];\n array[i] = array[i-1];\n }\n }\n\n out.println(count);\n\n\n\n } finally {\n //out.close();\n }\n \n \n }", "main", "{\n try (PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {\n FastScanner in = new FastScanner(System.in);\n int n = in.nextInt();\n long[] array = in.nextLongArray(n);\n long count = 0;\n\n for(int i = 1; i < n; i++) {\n if(array[i] < array[i-1]) {\n count += array[i-1] - array[i];\n array[i] = array[i-1];\n }\n }\n\n out.println(count);\n\n\n\n } finally {\n //out.close();\n }\n \n \n }", "try (PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {\n FastScanner in = new FastScanner(System.in);\n int n = in.nextInt();\n long[] array = in.nextLongArray(n);\n long count = 0;\n\n for(int i = 1; i < n; i++) {\n if(array[i] < array[i-1]) {\n count += array[i-1] - array[i];\n array[i] = array[i-1];\n }\n }\n\n out.println(count);\n\n\n\n } finally {\n //out.close();\n }", "{\n //out.close();\n }", "{\n FastScanner in = new FastScanner(System.in);\n int n = in.nextInt();\n long[] array = in.nextLongArray(n);\n long count = 0;\n\n for(int i = 1; i < n; i++) {\n if(array[i] < array[i-1]) {\n count += array[i-1] - array[i];\n array[i] = array[i-1];\n }\n }\n\n out.println(count);\n\n\n\n }", "PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))", "PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))", "new PrintWriter(new BufferedOutputStream(System.out))", "FastScanner in = new FastScanner(System.in);", "in", "new FastScanner(System.in)", "int n = in.nextInt();", "n", "in.nextInt()", "in.nextInt", "in", "long[] array = in.nextLongArray(n);", "array", "in.nextLongArray(n)", "in.nextLongArray", "in", "n", "long count = 0;", "count", "0", "for(int i = 1; i < n; i++) {\n if(array[i] < array[i-1]) {\n count += array[i-1] - array[i];\n array[i] = array[i-1];\n }\n }", "int i = 1;", "int i = 1;", "i", "1", "i < n", "i", "n", "i++", "i++", "i", "{\n if(array[i] < array[i-1]) {\n count += array[i-1] - array[i];\n array[i] = array[i-1];\n }\n }", "{\n if(array[i] < array[i-1]) {\n count += array[i-1] - array[i];\n array[i] = array[i-1];\n }\n }", "if(array[i] < array[i-1]) {\n count += array[i-1] - array[i];\n array[i] = array[i-1];\n }", "array[i] < array[i-1]", "array[i]", "array", "i", "array[i-1]", "array", "i-1", "i", "1", "{\n count += array[i-1] - array[i];\n array[i] = array[i-1];\n }", "count += array[i-1] - array[i]", "count", "array[i-1] - array[i]", "array[i-1]", "array", "i-1", "i", "1", "array[i]", "array", "i", "array[i] = array[i-1]", "array[i]", "array", "i", "array[i-1]", "array", "i-1", "i", "1", "out.println(count)", "out.println", "out", "count", "String[] args", "args", "class FastScanner {\n private final BufferedReader br;\n private StringTokenizer st;\n \n FastScanner(InputStream InputStream) {\n br = new BufferedReader(new InputStreamReader(InputStream));\n }\n \n String next() {\n while (st == null || !st.hasMoreTokens()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return st.nextToken();\n }\n \n int nextInt() {\n return Integer.parseInt(next());\n }\n \n long nextLong() {\n return Long.parseLong(next());\n }\n \n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n\n \n ArrayList<Integer> nextIntList(int count) {\n ArrayList<Integer> array = new ArrayList<>();\n for (int n = 0; n < count; n++) {\n int number = nextInt();\n array.add(number);\n }\n return array;\n }\n \n int[] nextIntArray(int count) {\n int[] array = new int[count];\n for (int n = 0; n < count; n++) {\n array[n] = nextInt();\n }\n return array;\n }\n\n long[] nextLongArray(int count) {\n long[] array = new long[count];\n for (int n = 0; n < count; n++) {\n array[n] = nextLong();\n }\n return array;\n }\n}", "FastScanner", "private final BufferedReader br;", "br", "private StringTokenizer st;", "st", "FastScanner(InputStream InputStream) {\n br = new BufferedReader(new InputStreamReader(InputStream));\n }", "FastScanner", "{\n br = new BufferedReader(new InputStreamReader(InputStream));\n }", "br = new BufferedReader(new InputStreamReader(InputStream))", "br", "new BufferedReader(new InputStreamReader(InputStream))", "InputStream InputStream", "InputStream", "String next() {\n while (st == null || !st.hasMoreTokens()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return st.nextToken();\n }", "next", "{\n while (st == null || !st.hasMoreTokens()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return st.nextToken();\n }", "while (st == null || !st.hasMoreTokens()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }", "st == null || !st.hasMoreTokens()", "st == null", "st", "null", "!st.hasMoreTokens()", "st.hasMoreTokens()", "st.hasMoreTokens", "st", "{\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }", "try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }", "catch (IOException e) {\n throw new RuntimeException(e);\n }", "IOException e", "{\n throw new RuntimeException(e);\n }", "throw new RuntimeException(e);", "new RuntimeException(e)", "{\n st = new StringTokenizer(br.readLine());\n }", "st = new StringTokenizer(br.readLine())", "st", "new StringTokenizer(br.readLine())", "return st.nextToken();", "st.nextToken()", "st.nextToken", "st", "int nextInt() {\n return Integer.parseInt(next());\n }", "nextInt", "{\n return Integer.parseInt(next());\n }", "return Integer.parseInt(next());", "Integer.parseInt(next())", "Integer.parseInt", "Integer", "next()", "next", "long nextLong() {\n return Long.parseLong(next());\n }", "nextLong", "{\n return Long.parseLong(next());\n }", "return Long.parseLong(next());", "Long.parseLong(next())", "Long.parseLong", "Long", "next()", "next", "double nextDouble() {\n return Double.parseDouble(next());\n }", "nextDouble", "{\n return Double.parseDouble(next());\n }", "return Double.parseDouble(next());", "Double.parseDouble(next())", "Double.parseDouble", "Double", "next()", "next", "ArrayList<Integer> nextIntList(int count) {\n ArrayList<Integer> array = new ArrayList<>();\n for (int n = 0; n < count; n++) {\n int number = nextInt();\n array.add(number);\n }\n return array;\n }", "nextIntList", "{\n ArrayList<Integer> array = new ArrayList<>();\n for (int n = 0; n < count; n++) {\n int number = nextInt();\n array.add(number);\n }\n return array;\n }", "ArrayList<Integer> array = new ArrayList<>();", "array", "new ArrayList<>()", "for (int n = 0; n < count; n++) {\n int number = nextInt();\n array.add(number);\n }", "int n = 0;", "int n = 0;", "n", "0", "n < count", "n", "count", "n++", "n++", "n", "{\n int number = nextInt();\n array.add(number);\n }", "{\n int number = nextInt();\n array.add(number);\n }", "int number = nextInt();", "number", "nextInt()", "nextInt", "array.add(number)", "array.add", "array", "number", "return array;", "array", "int count", "count", "int[] nextIntArray(int count) {\n int[] array = new int[count];\n for (int n = 0; n < count; n++) {\n array[n] = nextInt();\n }\n return array;\n }", "nextIntArray", "{\n int[] array = new int[count];\n for (int n = 0; n < count; n++) {\n array[n] = nextInt();\n }\n return array;\n }", "int[] array = new int[count];", "array", "new int[count]", "count", "for (int n = 0; n < count; n++) {\n array[n] = nextInt();\n }", "int n = 0;", "int n = 0;", "n", "0", "n < count", "n", "count", "n++", "n++", "n", "{\n array[n] = nextInt();\n }", "{\n array[n] = nextInt();\n }", "array[n] = nextInt()", "array[n]", "array", "n", "nextInt()", "nextInt", "return array;", "array", "int count", "count", "long[] nextLongArray(int count) {\n long[] array = new long[count];\n for (int n = 0; n < count; n++) {\n array[n] = nextLong();\n }\n return array;\n }", "nextLongArray", "{\n long[] array = new long[count];\n for (int n = 0; n < count; n++) {\n array[n] = nextLong();\n }\n return array;\n }", "long[] array = new long[count];", "array", "new long[count]", "count", "for (int n = 0; n < count; n++) {\n array[n] = nextLong();\n }", "int n = 0;", "int n = 0;", "n", "0", "n < count", "n", "count", "n++", "n++", "n", "{\n array[n] = nextLong();\n }", "{\n array[n] = nextLong();\n }", "array[n] = nextLong()", "array[n]", "array", "n", "nextLong()", "nextLong", "return array;", "array", "int count", "count", "public class Main {\n \n\n\n\n public static void main(String[] args) {\n try (PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {\n FastScanner in = new FastScanner(System.in);\n int n = in.nextInt();\n long[] array = in.nextLongArray(n);\n long count = 0;\n\n for(int i = 1; i < n; i++) {\n if(array[i] < array[i-1]) {\n count += array[i-1] - array[i];\n array[i] = array[i-1];\n }\n }\n\n out.println(count);\n\n\n\n } finally {\n //out.close();\n }\n \n \n }\n}", "public class Main {\n \n\n\n\n public static void main(String[] args) {\n try (PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {\n FastScanner in = new FastScanner(System.in);\n int n = in.nextInt();\n long[] array = in.nextLongArray(n);\n long count = 0;\n\n for(int i = 1; i < n; i++) {\n if(array[i] < array[i-1]) {\n count += array[i-1] - array[i];\n array[i] = array[i-1];\n }\n }\n\n out.println(count);\n\n\n\n } finally {\n //out.close();\n }\n \n \n }\n}", "Main" ]
import java.util.*; import java.io.*; import java.util.Arrays; import java.util.ArrayList; import java.util.Collections; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.InputStream; import java.util.StringTokenizer; import java.math.BigInteger; public class Main { public static void main(String[] args) { try (PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) { FastScanner in = new FastScanner(System.in); int n = in.nextInt(); long[] array = in.nextLongArray(n); long count = 0; for(int i = 1; i < n; i++) { if(array[i] < array[i-1]) { count += array[i-1] - array[i]; array[i] = array[i-1]; } } out.println(count); } finally { //out.close(); } } } class FastScanner { private final BufferedReader br; private StringTokenizer st; FastScanner(InputStream InputStream) { br = new BufferedReader(new InputStreamReader(InputStream)); } String next() { while (st == null || !st.hasMoreTokens()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { throw new RuntimeException(e); } } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } ArrayList<Integer> nextIntList(int count) { ArrayList<Integer> array = new ArrayList<>(); for (int n = 0; n < count; n++) { int number = nextInt(); array.add(number); } return array; } int[] nextIntArray(int count) { int[] array = new int[count]; for (int n = 0; n < count; n++) { array[n] = nextInt(); } return array; } long[] nextLongArray(int count) { long[] array = new long[count]; for (int n = 0; n < count; n++) { array[n] = nextLong(); } return array; } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 41, 13, 20, 41, 13, 20, 12, 13, 30, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 41, 13, 18, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 18, 13, 13, 1, 40, 13, 30, 30, 41, 13, 2, 13, 18, 13, 13, 14, 2, 13, 17, 30, 0, 13, 13, 14, 2, 13, 18, 13, 13, 30, 0, 13, 18, 13, 13, 4, 18, 13, 13, 4, 18, 13, 23, 13, 12, 13, 30, 14, 2, 13, 17, 30, 29, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 2, 13, 13, 29, 13, 23, 13, 12, 13, 30, 14, 2, 13, 17, 29, 13, 29, 4, 13, 13, 2, 13, 13, 23, 13, 23, 13, 6, 13, 12, 13, 30, 6, 13, 41, 13, 2, 17, 17, 41, 13, 41, 13, 41, 13, 41, 13, 12, 13, 30, 0, 13, 20, 0, 13, 20, 13, 0, 13, 0, 13, 17, 12, 13, 30, 38, 5, 13, 30, 37, 20, 30, 0, 13, 20, 0, 13, 20, 13, 0, 13, 0, 13, 17, 23, 13, 12, 13, 30, 41, 13, 42, 2, 2, 0, 13, 4, 13, 40, 17, 2, 2, 2, 13, 17, 2, 13, 17, 2, 13, 17, 41, 13, 20, 42, 2, 13, 40, 17, 30, 14, 2, 2, 2, 13, 17, 2, 13, 17, 2, 13, 17, 3, 4, 18, 13, 13, 0, 13, 4, 13, 29, 4, 18, 13, 12, 13, 30, 41, 13, 42, 2, 2, 0, 13, 4, 13, 40, 17, 2, 2, 2, 13, 17, 2, 13, 17, 2, 13, 17, 41, 13, 20, 42, 2, 13, 40, 17, 30, 14, 2, 2, 13, 17, 2, 13, 17, 3, 4, 18, 13, 13, 0, 13, 4, 13, 29, 4, 18, 13, 12, 13, 30, 41, 13, 17, 41, 13, 4, 13, 42, 2, 13, 17, 0, 13, 4, 13, 41, 13, 2, 13, 17, 14, 13, 0, 13, 4, 13, 42, 2, 2, 0, 13, 4, 13, 17, 2, 13, 17, 0, 13, 2, 2, 2, 13, 17, 13, 17, 14, 13, 29, 40, 13, 29, 13, 12, 13, 30, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 2, 4, 13, 13, 29, 13, 23, 13, 23, 13, 12, 13, 30, 41, 13, 17, 41, 13, 4, 13, 42, 2, 13, 17, 0, 13, 4, 13, 41, 13, 2, 13, 17, 14, 13, 0, 13, 4, 13, 42, 2, 2, 0, 13, 4, 13, 17, 2, 13, 17, 0, 13, 2, 2, 2, 13, 17, 13, 17, 14, 13, 29, 40, 13, 29, 13, 12, 13, 30, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 2, 4, 13, 13, 29, 13, 23, 13, 23, 13, 12, 13, 30, 41, 13, 17, 41, 13, 17, 41, 13, 4, 13, 42, 2, 13, 17, 0, 13, 4, 13, 41, 13, 2, 13, 17, 14, 13, 0, 13, 4, 13, 42, 2, 2, 0, 13, 4, 13, 17, 2, 13, 17, 0, 13, 2, 2, 2, 13, 17, 13, 17, 14, 2, 13, 17, 42, 2, 2, 0, 13, 4, 13, 17, 2, 13, 17, 0, 13, 2, 2, 13, 17, 0, 13, 17, 14, 13, 29, 40, 13, 29, 13, 12, 13, 30, 0, 13, 4, 18, 13, 13, 0, 13, 17, 13, 14, 2, 13, 40, 17, 0, 18, 13, 17, 40, 17, 12, 13, 30, 38, 5, 13, 30, 37, 20, 30, 14, 2, 13, 13, 4, 13, 29, 18, 13, 40, 13, 12, 13, 30, 14, 2, 13, 17, 29, 4, 18, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 652, 8 ], [ 652, 9 ], [ 9, 10 ], [ 9, 11 ], [ 652, 12 ], [ 12, 13 ], [ 12, 14 ], [ 652, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 18, 20 ], [ 20, 21 ], [ 21, 22 ], [ 17, 23 ], [ 23, 24 ], [ 23, 25 ], [ 17, 27 ], [ 27, 28 ], [ 28, 29 ], [ 29, 30 ], [ 29, 31 ], [ 27, 32 ], [ 32, 33 ], [ 32, 34 ], [ 27, 35 ], [ 35, 36 ], [ 36, 37 ], [ 27, 38 ], [ 39, 39 ], [ 39, 40 ], [ 40, 41 ], [ 41, 42 ], [ 41, 43 ], [ 40, 44 ], [ 44, 45 ], [ 45, 46 ], [ 17, 47 ], [ 47, 48 ], [ 47, 49 ], [ 49, 50 ], [ 49, 51 ], [ 17, 52 ], [ 52, 53 ], [ 52, 54 ], [ 17, 55 ], [ 55, 56 ], [ 56, 57 ], [ 57, 58 ], [ 57, 59 ], [ 55, 60 ], [ 60, 61 ], [ 60, 62 ], [ 62, 63 ], [ 62, 64 ], [ 55, 65 ], [ 65, 66 ], [ 66, 67 ], [ 55, 68 ], [ 69, 69 ], [ 69, 70 ], [ 70, 71 ], [ 70, 72 ], [ 72, 73 ], [ 72, 74 ], [ 74, 75 ], [ 74, 76 ], [ 69, 77 ], [ 77, 78 ], [ 78, 79 ], [ 78, 80 ], [ 77, 81 ], [ 81, 82 ], [ 82, 83 ], [ 82, 84 ], [ 69, 85 ], [ 85, 86 ], [ 86, 87 ], [ 86, 88 ], [ 88, 89 ], [ 88, 90 ], [ 85, 91 ], [ 91, 92 ], [ 92, 93 ], [ 92, 94 ], [ 94, 95 ], [ 94, 96 ], [ 17, 97 ], [ 97, 98 ], [ 98, 99 ], [ 97, 100 ], [ 17, 101 ], [ 101, 102 ], [ 102, 103 ], [ 15, 104 ], [ 104, 105 ], [ 652, 106 ], [ 106, 107 ], [ 106, 108 ], [ 108, 109 ], [ 109, 110 ], [ 110, 111 ], [ 110, 112 ], [ 109, 113 ], [ 113, 114 ], [ 114, 115 ], [ 108, 116 ], [ 116, 117 ], [ 116, 118 ], [ 108, 119 ], [ 119, 120 ], [ 120, 121 ], [ 121, 122 ], [ 121, 123 ], [ 119, 124 ], [ 124, 125 ], [ 124, 126 ], [ 119, 127 ], [ 127, 128 ], [ 128, 129 ], [ 119, 130 ], [ 131, 131 ], [ 131, 132 ], [ 132, 133 ], [ 132, 134 ], [ 134, 135 ], [ 134, 136 ], [ 108, 137 ], [ 137, 138 ], [ 106, 139 ], [ 139, 140 ], [ 652, 141 ], [ 141, 142 ], [ 141, 143 ], [ 143, 144 ], [ 144, 145 ], [ 145, 146 ], [ 145, 147 ], [ 144, 148 ], [ 148, 149 ], [ 143, 150 ], [ 150, 151 ], [ 151, 152 ], [ 151, 153 ], [ 151, 154 ], [ 154, 155 ], [ 154, 156 ], [ 141, 157 ], [ 157, 158 ], [ 141, 159 ], [ 159, 160 ], [ 652, 161 ], [ 161, 162 ], [ 161, 163 ], [ 163, 164 ], [ 163, 165 ], [ 652, 166 ], [ 166, 167 ], [ 166, 168 ], [ 168, 169 ], [ 168, 170 ], [ 170, 171 ], [ 170, 172 ], [ 166, 173 ], [ 173, 174 ], [ 166, 175 ], [ 175, 176 ], [ 166, 177 ], [ 177, 178 ], [ 166, 179 ], [ 179, 180 ], [ 166, 181 ], [ 181, 182 ], [ 181, 183 ], [ 183, 184 ], [ 184, 185 ], [ 184, 186 ], [ 183, 187 ], [ 187, 188 ], [ 187, 189 ], [ 183, 191 ], [ 191, 192 ], [ 191, 193 ], [ 193, 194 ], [ 193, 195 ], [ 166, 196 ], [ 196, 197 ], [ 196, 198 ], [ 198, 199 ], [ 199, 200 ], [ 200, 201 ], [ 200, 202 ], [ 202, 203 ], [ 203, 204 ], [ 199, 205 ], [ 205, 206 ], [ 206, 207 ], [ 206, 208 ], [ 198, 209 ], [ 209, 210 ], [ 209, 211 ], [ 198, 213 ], [ 213, 214 ], [ 213, 215 ], [ 215, 216 ], [ 215, 217 ], [ 196, 218 ], [ 218, 219 ], [ 166, 220 ], [ 220, 221 ], [ 220, 222 ], [ 222, 223 ], [ 223, 224 ], [ 222, 225 ], [ 225, 226 ], [ 226, 227 ], [ 227, 228 ], [ 228, 229 ], [ 228, 230 ], [ 230, 231 ], [ 227, 232 ], [ 232, 233 ], [ 226, 234 ], [ 234, 235 ], [ 235, 236 ], [ 236, 237 ], [ 236, 238 ], [ 235, 239 ], [ 239, 240 ], [ 239, 241 ], [ 234, 242 ], [ 242, 243 ], [ 242, 244 ], [ 222, 245 ], [ 245, 246 ], [ 245, 247 ], [ 222, 248 ], [ 248, 249 ], [ 249, 250 ], [ 249, 251 ], [ 251, 252 ], [ 248, 253 ], [ 253, 254 ], [ 254, 255 ], [ 256, 256 ], [ 256, 257 ], [ 257, 258 ], [ 257, 259 ], [ 256, 260 ], [ 260, 261 ], [ 260, 262 ], [ 256, 263 ], [ 263, 264 ], [ 263, 265 ], [ 254, 266 ], [ 253, 267 ], [ 267, 268 ], [ 268, 269 ], [ 267, 270 ], [ 253, 271 ], [ 271, 272 ], [ 271, 273 ], [ 273, 274 ], [ 222, 275 ], [ 275, 276 ], [ 276, 277 ], [ 277, 278 ], [ 166, 279 ], [ 279, 280 ], [ 279, 281 ], [ 281, 282 ], [ 282, 283 ], [ 281, 284 ], [ 284, 285 ], [ 285, 286 ], [ 286, 287 ], [ 287, 288 ], [ 287, 289 ], [ 289, 290 ], [ 286, 291 ], [ 291, 292 ], [ 285, 293 ], [ 293, 294 ], [ 294, 295 ], [ 295, 296 ], [ 295, 297 ], [ 294, 298 ], [ 298, 299 ], [ 298, 300 ], [ 293, 301 ], [ 301, 302 ], [ 301, 303 ], [ 281, 304 ], [ 304, 305 ], [ 304, 306 ], [ 281, 307 ], [ 307, 308 ], [ 308, 309 ], [ 308, 310 ], [ 310, 311 ], [ 307, 312 ], [ 312, 313 ], [ 313, 314 ], [ 314, 315 ], [ 315, 316 ], [ 315, 317 ], [ 314, 318 ], [ 318, 319 ], [ 318, 320 ], [ 313, 321 ], [ 312, 322 ], [ 322, 323 ], [ 323, 324 ], [ 322, 325 ], [ 312, 326 ], [ 326, 327 ], [ 326, 328 ], [ 328, 329 ], [ 281, 330 ], [ 330, 331 ], [ 331, 332 ], [ 332, 333 ], [ 166, 334 ], [ 334, 335 ], [ 334, 336 ], [ 336, 337 ], [ 337, 338 ], [ 337, 339 ], [ 336, 340 ], [ 340, 341 ], [ 340, 342 ], [ 342, 343 ], [ 336, 344 ], [ 344, 345 ], [ 345, 346 ], [ 345, 347 ], [ 344, 348 ], [ 348, 349 ], [ 348, 350 ], [ 350, 351 ], [ 336, 352 ], [ 352, 353 ], [ 352, 354 ], [ 354, 355 ], [ 354, 356 ], [ 336, 357 ], [ 357, 358 ], [ 357, 359 ], [ 359, 360 ], [ 359, 361 ], [ 361, 362 ], [ 336, 363 ], [ 363, 364 ], [ 364, 365 ], [ 365, 366 ], [ 366, 367 ], [ 366, 368 ], [ 368, 369 ], [ 365, 370 ], [ 364, 371 ], [ 371, 372 ], [ 371, 373 ], [ 363, 374 ], [ 374, 375 ], [ 374, 376 ], [ 376, 377 ], [ 377, 378 ], [ 378, 379 ], [ 378, 380 ], [ 377, 381 ], [ 376, 382 ], [ 336, 383 ], [ 383, 384 ], [ 383, 385 ], [ 385, 386 ], [ 386, 387 ], [ 336, 388 ], [ 388, 389 ], [ 166, 390 ], [ 390, 391 ], [ 390, 392 ], [ 392, 393 ], [ 393, 394 ], [ 393, 395 ], [ 392, 397 ], [ 397, 398 ], [ 398, 399 ], [ 399, 400 ], [ 399, 401 ], [ 397, 402 ], [ 402, 403 ], [ 402, 404 ], [ 397, 405 ], [ 405, 406 ], [ 406, 407 ], [ 397, 408 ], [ 408, 409 ], [ 409, 410 ], [ 410, 411 ], [ 410, 412 ], [ 409, 413 ], [ 413, 414 ], [ 414, 415 ], [ 413, 416 ], [ 392, 417 ], [ 417, 418 ], [ 390, 419 ], [ 419, 420 ], [ 390, 421 ], [ 421, 422 ], [ 166, 423 ], [ 423, 424 ], [ 423, 425 ], [ 425, 426 ], [ 426, 427 ], [ 426, 428 ], [ 425, 429 ], [ 429, 430 ], [ 429, 431 ], [ 431, 432 ], [ 425, 433 ], [ 433, 434 ], [ 434, 435 ], [ 434, 436 ], [ 433, 437 ], [ 437, 438 ], [ 437, 439 ], [ 439, 440 ], [ 425, 441 ], [ 441, 442 ], [ 441, 443 ], [ 443, 444 ], [ 443, 445 ], [ 425, 446 ], [ 446, 447 ], [ 446, 448 ], [ 448, 449 ], [ 448, 450 ], [ 450, 451 ], [ 425, 452 ], [ 452, 453 ], [ 453, 454 ], [ 454, 455 ], [ 455, 456 ], [ 455, 457 ], [ 457, 458 ], [ 454, 459 ], [ 453, 460 ], [ 460, 461 ], [ 460, 462 ], [ 452, 463 ], [ 463, 464 ], [ 463, 465 ], [ 465, 466 ], [ 466, 467 ], [ 467, 468 ], [ 467, 469 ], [ 466, 470 ], [ 465, 471 ], [ 425, 472 ], [ 472, 473 ], [ 472, 474 ], [ 474, 475 ], [ 475, 476 ], [ 425, 477 ], [ 477, 478 ], [ 166, 479 ], [ 479, 480 ], [ 479, 481 ], [ 481, 482 ], [ 482, 483 ], [ 482, 484 ], [ 481, 486 ], [ 486, 487 ], [ 487, 488 ], [ 488, 489 ], [ 488, 490 ], [ 486, 491 ], [ 491, 492 ], [ 491, 493 ], [ 486, 494 ], [ 494, 495 ], [ 495, 496 ], [ 486, 497 ], [ 497, 498 ], [ 498, 499 ], [ 499, 500 ], [ 499, 501 ], [ 498, 502 ], [ 502, 503 ], [ 503, 504 ], [ 502, 505 ], [ 481, 506 ], [ 506, 507 ], [ 479, 508 ], [ 508, 509 ], [ 479, 510 ], [ 510, 511 ], [ 166, 512 ], [ 512, 513 ], [ 512, 514 ], [ 514, 515 ], [ 515, 516 ], [ 515, 517 ], [ 514, 518 ], [ 518, 519 ], [ 518, 520 ], [ 514, 521 ], [ 521, 522 ], [ 521, 523 ], [ 523, 524 ], [ 514, 525 ], [ 525, 526 ], [ 526, 527 ], [ 526, 528 ], [ 525, 529 ], [ 529, 530 ], [ 529, 531 ], [ 531, 532 ], [ 514, 533 ], [ 533, 534 ], [ 533, 535 ], [ 535, 536 ], [ 535, 537 ], [ 514, 538 ], [ 538, 539 ], [ 538, 540 ], [ 540, 541 ], [ 540, 542 ], [ 542, 543 ], [ 514, 544 ], [ 544, 545 ], [ 545, 546 ], [ 546, 547 ], [ 547, 548 ], [ 547, 549 ], [ 549, 550 ], [ 546, 551 ], [ 545, 552 ], [ 552, 553 ], [ 552, 554 ], [ 544, 555 ], [ 555, 556 ], [ 555, 557 ], [ 557, 558 ], [ 558, 559 ], [ 559, 560 ], [ 559, 561 ], [ 558, 562 ], [ 557, 563 ], [ 514, 564 ], [ 564, 565 ], [ 565, 566 ], [ 565, 567 ], [ 564, 568 ], [ 568, 569 ], [ 569, 570 ], [ 570, 571 ], [ 571, 572 ], [ 571, 573 ], [ 573, 574 ], [ 570, 575 ], [ 569, 576 ], [ 576, 577 ], [ 576, 578 ], [ 568, 579 ], [ 579, 580 ], [ 579, 581 ], [ 581, 582 ], [ 582, 583 ], [ 582, 584 ], [ 581, 585 ], [ 585, 586 ], [ 585, 587 ], [ 514, 588 ], [ 588, 589 ], [ 588, 590 ], [ 590, 591 ], [ 591, 592 ], [ 514, 593 ], [ 593, 594 ], [ 166, 595 ], [ 595, 596 ], [ 595, 597 ], [ 597, 598 ], [ 598, 599 ], [ 598, 600 ], [ 600, 601 ], [ 601, 602 ], [ 600, 603 ], [ 600, 604 ], [ 604, 605 ], [ 604, 606 ], [ 600, 607 ], [ 597, 608 ], [ 608, 609 ], [ 609, 610 ], [ 609, 611 ], [ 611, 612 ], [ 608, 613 ], [ 613, 614 ], [ 614, 615 ], [ 614, 616 ], [ 613, 617 ], [ 617, 618 ], [ 166, 619 ], [ 619, 620 ], [ 619, 621 ], [ 621, 622 ], [ 622, 623 ], [ 623, 624 ], [ 623, 625 ], [ 625, 626 ], [ 626, 627 ], [ 622, 628 ], [ 628, 629 ], [ 629, 630 ], [ 630, 631 ], [ 630, 632 ], [ 629, 633 ], [ 633, 634 ], [ 628, 635 ], [ 635, 636 ], [ 636, 637 ], [ 636, 638 ], [ 638, 639 ], [ 166, 640 ], [ 640, 641 ], [ 640, 642 ], [ 642, 643 ], [ 643, 644 ], [ 644, 645 ], [ 644, 646 ], [ 643, 647 ], [ 642, 648 ], [ 648, 649 ], [ 649, 650 ], [ 0, 651 ], [ 651, 652 ], [ 651, 653 ] ]
[ "import java.io.*;\nimport java.util.*;\n\npublic class Main {\n\tstatic final StdIn in = new StdIn();\n\tstatic final PrintWriter out = new PrintWriter(System.out);\n\n\tpublic static void main(String[] args) {\n int N = in.nextInt();\n\n long arr[] = new long[N];\n for (int i = 0; i < N; i++) {\n arr[i] = in.nextLong();\n }\n\n long first = arr[0];\n long res = 0;\n\n for (int i = 1; i < arr.length; i++) {\n long diff = first - arr[i];\n if(diff > 0) {\n res += diff; \n }\n if(first < arr[i]) {\n first = arr[i];\n }\n }\n out.println(res);\n // long res = 0;\n\n // while(N >= 0) {\n // long d = N % 10;\n // res += d;\n // N = N/10;\n // }\n\n // if(res%9 == 0) {\n // out.println(\"Yes\");\n // } else { \n // out.println(\"No\");\n // }\n\t\tout.close();\n }\n\n static class Solver {\n\t\tSolver() {\n\t\t\t\n }\n \n }\n\n static long factorial(long x) {\n if(x <= 1) {\n return 1;\n }\n long res = 2;\n for (int i = 3; i <= x; i++) {\n res = res * i;\n }\n return res;\n }\n \n static long gcdOfFactorial(long a, long b) { \n if (b == 0) \n return a; \n return gcdOfFactorial(b, a % b);\n } \n\t\n\tstatic class StdIn {\n\t\tfinal private int BUFFER_SIZE = 1 << 16;\n\t\tprivate DataInputStream din;\n\t\tprivate byte[] buffer;\n\t\tprivate int bufferPointer, bytesRead;\n\t\tpublic StdIn() {\n\t\t\tdin = new DataInputStream(System.in);\n\t\t\tbuffer = new byte[BUFFER_SIZE];\n\t\t\tbufferPointer = bytesRead = 0;\n\t\t}\n\t\tpublic StdIn(InputStream in) {\n\t\t\ttry{\n\t\t\t\tdin = new DataInputStream(in);\n\t\t\t} catch(Exception e) {\n\t\t\t\tthrow new RuntimeException();\n\t\t\t}\n\t\t\tbuffer = new byte[BUFFER_SIZE];\n\t\t\tbufferPointer = bytesRead = 0;\n\t\t}\n\t\tpublic String next() {\n\t\t\tint c;\n\t\t\twhile((c=read())!=-1&&(c==' '||c=='\\n'||c=='\\r'));\n\t\t\tStringBuilder s = new StringBuilder();\n\t\t\twhile (c != -1)\n\t\t\t{\n\t\t\t\tif (c == ' ' || c == '\\n'||c=='\\r')\n\t\t\t\t\tbreak;\n\t\t\t\ts.append((char)c);\n\t\t\t\tc=read();\n\t\t\t}\n\t\t\treturn s.toString();\n\t\t}\n\t\tpublic String nextLine() {\n\t\t\tint c;\n\t\t\twhile((c=read())!=-1&&(c==' '||c=='\\n'||c=='\\r'));\n\t\t\tStringBuilder s = new StringBuilder();\n\t\t\twhile (c != -1)\n\t\t\t{\n\t\t\t\tif (c == '\\n'||c=='\\r')\n\t\t\t\t\tbreak;\n\t\t\t\ts.append((char)c);\n\t\t\t\tc = read();\n\t\t\t}\n\t\t\treturn s.toString();\n\t\t}\n\t\tpublic int nextInt() {\n\t\t\tint ret = 0;\n\t\t\tbyte c = read();\n\t\t\twhile (c <= ' ')\n\t\t\t\tc = read();\n\t\t\tboolean neg = (c == '-');\n\t\t\tif (neg)\n\t\t\t\tc = read();\n\t\t\tdo\n\t\t\t\tret = ret * 10 + c - '0';\n\t\t\twhile ((c = read()) >= '0' && c <= '9');\n\n\t\t\tif (neg)\n\t\t\t\treturn -ret;\n\t\t\treturn ret;\n\t\t}\n\t\tpublic int[] readIntArray(int n, int os) {\n\t\t\tint[] ar = new int[n];\n\t\t\tfor(int i=0; i<n; ++i)\n\t\t\t\tar[i]=nextInt()+os;\n\t\t\treturn ar;\n\t\t}\n\t\tpublic long nextLong() {\n\t\t\tlong ret = 0;\n\t\t\tbyte c = read();\n\t\t\twhile (c <= ' ')\n\t\t\t\tc = read();\n\t\t\tboolean neg = (c == '-');\n\t\t\tif (neg)\n\t\t\t\tc = read();\n\t\t\tdo\n\t\t\t\tret = ret * 10 + c - '0';\n\t\t\twhile ((c = read()) >= '0' && c <= '9');\n\t\t\tif (neg)\n\t\t\t\treturn -ret;\n\t\t\treturn ret;\n\t\t}\n\t\tpublic long[] readLongArray(int n, long os) {\n\t\t\tlong[] ar = new long[n];\n\t\t\tfor(int i=0; i<n; ++i)\n\t\t\t\tar[i]=nextLong()+os;\n\t\t\treturn ar;\n\t\t}\n\t\tpublic double nextDouble() {\n\t\t\tdouble ret = 0, div = 1;\n\t\t\tbyte c = read();\n\t\t\twhile (c <= ' ')\n\t\t\t\tc = read();\n\t\t\tboolean neg = (c == '-');\n\t\t\tif (neg)\n\t\t\t\tc = read();\n\t\t\tdo\n\t\t\t\tret = ret * 10 + c - '0';\n\t\t\twhile ((c = read()) >= '0' && c <= '9');\n\t\t\tif (c == '.')\n\t\t\t\twhile ((c = read()) >= '0' && c <= '9')\n\t\t\t\t\tret += (c - '0') / (div *= 10);\n\t\t\tif (neg)\n\t\t\t\treturn -ret;\n\t\t\treturn ret;\n\t\t}\n\t\tprivate void fillBuffer() throws IOException {\n\t\t\tbytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);\n\t\t\tif (bytesRead == -1)\n\t\t\t\tbuffer[0] = -1;\n\t\t}\n\t\tprivate byte read() {\n\t\t\ttry{\n\t\t\t\tif (bufferPointer == bytesRead)\n\t\t\t\t\tfillBuffer();\n\t\t\t\treturn buffer[bufferPointer++];\n\t\t\t} catch(IOException e) {\n\t\t\t\tthrow new RuntimeException();\n\t\t\t}\n\t\t}\n\t\tpublic void close() throws IOException {\n\t\t\tif (din == null)\n\t\t\t\treturn;\n\t\t\tdin.close();\n\t\t}\n\t}\n}", "import java.io.*;", "io.*", "java", "import java.util.*;", "util.*", "java", "public class Main {\n\tstatic final StdIn in = new StdIn();\n\tstatic final PrintWriter out = new PrintWriter(System.out);\n\n\tpublic static void main(String[] args) {\n int N = in.nextInt();\n\n long arr[] = new long[N];\n for (int i = 0; i < N; i++) {\n arr[i] = in.nextLong();\n }\n\n long first = arr[0];\n long res = 0;\n\n for (int i = 1; i < arr.length; i++) {\n long diff = first - arr[i];\n if(diff > 0) {\n res += diff; \n }\n if(first < arr[i]) {\n first = arr[i];\n }\n }\n out.println(res);\n // long res = 0;\n\n // while(N >= 0) {\n // long d = N % 10;\n // res += d;\n // N = N/10;\n // }\n\n // if(res%9 == 0) {\n // out.println(\"Yes\");\n // } else { \n // out.println(\"No\");\n // }\n\t\tout.close();\n }\n\n static class Solver {\n\t\tSolver() {\n\t\t\t\n }\n \n }\n\n static long factorial(long x) {\n if(x <= 1) {\n return 1;\n }\n long res = 2;\n for (int i = 3; i <= x; i++) {\n res = res * i;\n }\n return res;\n }\n \n static long gcdOfFactorial(long a, long b) { \n if (b == 0) \n return a; \n return gcdOfFactorial(b, a % b);\n } \n\t\n\tstatic class StdIn {\n\t\tfinal private int BUFFER_SIZE = 1 << 16;\n\t\tprivate DataInputStream din;\n\t\tprivate byte[] buffer;\n\t\tprivate int bufferPointer, bytesRead;\n\t\tpublic StdIn() {\n\t\t\tdin = new DataInputStream(System.in);\n\t\t\tbuffer = new byte[BUFFER_SIZE];\n\t\t\tbufferPointer = bytesRead = 0;\n\t\t}\n\t\tpublic StdIn(InputStream in) {\n\t\t\ttry{\n\t\t\t\tdin = new DataInputStream(in);\n\t\t\t} catch(Exception e) {\n\t\t\t\tthrow new RuntimeException();\n\t\t\t}\n\t\t\tbuffer = new byte[BUFFER_SIZE];\n\t\t\tbufferPointer = bytesRead = 0;\n\t\t}\n\t\tpublic String next() {\n\t\t\tint c;\n\t\t\twhile((c=read())!=-1&&(c==' '||c=='\\n'||c=='\\r'));\n\t\t\tStringBuilder s = new StringBuilder();\n\t\t\twhile (c != -1)\n\t\t\t{\n\t\t\t\tif (c == ' ' || c == '\\n'||c=='\\r')\n\t\t\t\t\tbreak;\n\t\t\t\ts.append((char)c);\n\t\t\t\tc=read();\n\t\t\t}\n\t\t\treturn s.toString();\n\t\t}\n\t\tpublic String nextLine() {\n\t\t\tint c;\n\t\t\twhile((c=read())!=-1&&(c==' '||c=='\\n'||c=='\\r'));\n\t\t\tStringBuilder s = new StringBuilder();\n\t\t\twhile (c != -1)\n\t\t\t{\n\t\t\t\tif (c == '\\n'||c=='\\r')\n\t\t\t\t\tbreak;\n\t\t\t\ts.append((char)c);\n\t\t\t\tc = read();\n\t\t\t}\n\t\t\treturn s.toString();\n\t\t}\n\t\tpublic int nextInt() {\n\t\t\tint ret = 0;\n\t\t\tbyte c = read();\n\t\t\twhile (c <= ' ')\n\t\t\t\tc = read();\n\t\t\tboolean neg = (c == '-');\n\t\t\tif (neg)\n\t\t\t\tc = read();\n\t\t\tdo\n\t\t\t\tret = ret * 10 + c - '0';\n\t\t\twhile ((c = read()) >= '0' && c <= '9');\n\n\t\t\tif (neg)\n\t\t\t\treturn -ret;\n\t\t\treturn ret;\n\t\t}\n\t\tpublic int[] readIntArray(int n, int os) {\n\t\t\tint[] ar = new int[n];\n\t\t\tfor(int i=0; i<n; ++i)\n\t\t\t\tar[i]=nextInt()+os;\n\t\t\treturn ar;\n\t\t}\n\t\tpublic long nextLong() {\n\t\t\tlong ret = 0;\n\t\t\tbyte c = read();\n\t\t\twhile (c <= ' ')\n\t\t\t\tc = read();\n\t\t\tboolean neg = (c == '-');\n\t\t\tif (neg)\n\t\t\t\tc = read();\n\t\t\tdo\n\t\t\t\tret = ret * 10 + c - '0';\n\t\t\twhile ((c = read()) >= '0' && c <= '9');\n\t\t\tif (neg)\n\t\t\t\treturn -ret;\n\t\t\treturn ret;\n\t\t}\n\t\tpublic long[] readLongArray(int n, long os) {\n\t\t\tlong[] ar = new long[n];\n\t\t\tfor(int i=0; i<n; ++i)\n\t\t\t\tar[i]=nextLong()+os;\n\t\t\treturn ar;\n\t\t}\n\t\tpublic double nextDouble() {\n\t\t\tdouble ret = 0, div = 1;\n\t\t\tbyte c = read();\n\t\t\twhile (c <= ' ')\n\t\t\t\tc = read();\n\t\t\tboolean neg = (c == '-');\n\t\t\tif (neg)\n\t\t\t\tc = read();\n\t\t\tdo\n\t\t\t\tret = ret * 10 + c - '0';\n\t\t\twhile ((c = read()) >= '0' && c <= '9');\n\t\t\tif (c == '.')\n\t\t\t\twhile ((c = read()) >= '0' && c <= '9')\n\t\t\t\t\tret += (c - '0') / (div *= 10);\n\t\t\tif (neg)\n\t\t\t\treturn -ret;\n\t\t\treturn ret;\n\t\t}\n\t\tprivate void fillBuffer() throws IOException {\n\t\t\tbytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);\n\t\t\tif (bytesRead == -1)\n\t\t\t\tbuffer[0] = -1;\n\t\t}\n\t\tprivate byte read() {\n\t\t\ttry{\n\t\t\t\tif (bufferPointer == bytesRead)\n\t\t\t\t\tfillBuffer();\n\t\t\t\treturn buffer[bufferPointer++];\n\t\t\t} catch(IOException e) {\n\t\t\t\tthrow new RuntimeException();\n\t\t\t}\n\t\t}\n\t\tpublic void close() throws IOException {\n\t\t\tif (din == null)\n\t\t\t\treturn;\n\t\t\tdin.close();\n\t\t}\n\t}\n}", "Main", "static final StdIn in = new StdIn();", "in", "new StdIn()", "static final PrintWriter out = new PrintWriter(System.out);", "out", "new PrintWriter(System.out)", "public static void main(String[] args) {\n int N = in.nextInt();\n\n long arr[] = new long[N];\n for (int i = 0; i < N; i++) {\n arr[i] = in.nextLong();\n }\n\n long first = arr[0];\n long res = 0;\n\n for (int i = 1; i < arr.length; i++) {\n long diff = first - arr[i];\n if(diff > 0) {\n res += diff; \n }\n if(first < arr[i]) {\n first = arr[i];\n }\n }\n out.println(res);\n // long res = 0;\n\n // while(N >= 0) {\n // long d = N % 10;\n // res += d;\n // N = N/10;\n // }\n\n // if(res%9 == 0) {\n // out.println(\"Yes\");\n // } else { \n // out.println(\"No\");\n // }\n\t\tout.close();\n }", "main", "{\n int N = in.nextInt();\n\n long arr[] = new long[N];\n for (int i = 0; i < N; i++) {\n arr[i] = in.nextLong();\n }\n\n long first = arr[0];\n long res = 0;\n\n for (int i = 1; i < arr.length; i++) {\n long diff = first - arr[i];\n if(diff > 0) {\n res += diff; \n }\n if(first < arr[i]) {\n first = arr[i];\n }\n }\n out.println(res);\n // long res = 0;\n\n // while(N >= 0) {\n // long d = N % 10;\n // res += d;\n // N = N/10;\n // }\n\n // if(res%9 == 0) {\n // out.println(\"Yes\");\n // } else { \n // out.println(\"No\");\n // }\n\t\tout.close();\n }", "int N = in.nextInt();", "N", "in.nextInt()", "in.nextInt", "in", "long arr[] = new long[N];", "arr", "new long[N]", "N", "for (int i = 0; i < N; i++) {\n arr[i] = in.nextLong();\n }", "int i = 0;", "int i = 0;", "i", "0", "i < N", "i", "N", "i++", "i++", "i", "{\n arr[i] = in.nextLong();\n }", "{\n arr[i] = in.nextLong();\n }", "arr[i] = in.nextLong()", "arr[i]", "arr", "i", "in.nextLong()", "in.nextLong", "in", "long first = arr[0];", "first", "arr[0]", "arr", "0", "long res = 0;", "res", "0", "for (int i = 1; i < arr.length; i++) {\n long diff = first - arr[i];\n if(diff > 0) {\n res += diff; \n }\n if(first < arr[i]) {\n first = arr[i];\n }\n }", "int i = 1;", "int i = 1;", "i", "1", "i < arr.length", "i", "arr.length", "arr", "arr.length", "i++", "i++", "i", "{\n long diff = first - arr[i];\n if(diff > 0) {\n res += diff; \n }\n if(first < arr[i]) {\n first = arr[i];\n }\n }", "{\n long diff = first - arr[i];\n if(diff > 0) {\n res += diff; \n }\n if(first < arr[i]) {\n first = arr[i];\n }\n }", "long diff = first - arr[i];", "diff", "first - arr[i]", "first", "arr[i]", "arr", "i", "if(diff > 0) {\n res += diff; \n }", "diff > 0", "diff", "0", "{\n res += diff; \n }", "res += diff", "res", "diff", "if(first < arr[i]) {\n first = arr[i];\n }", "first < arr[i]", "first", "arr[i]", "arr", "i", "{\n first = arr[i];\n }", "first = arr[i]", "first", "arr[i]", "arr", "i", "out.println(res)", "out.println", "out", "res", "out.close()", "out.close", "out", "String[] args", "args", "static long factorial(long x) {\n if(x <= 1) {\n return 1;\n }\n long res = 2;\n for (int i = 3; i <= x; i++) {\n res = res * i;\n }\n return res;\n }", "factorial", "{\n if(x <= 1) {\n return 1;\n }\n long res = 2;\n for (int i = 3; i <= x; i++) {\n res = res * i;\n }\n return res;\n }", "if(x <= 1) {\n return 1;\n }", "x <= 1", "x", "1", "{\n return 1;\n }", "return 1;", "1", "long res = 2;", "res", "2", "for (int i = 3; i <= x; i++) {\n res = res * i;\n }", "int i = 3;", "int i = 3;", "i", "3", "i <= x", "i", "x", "i++", "i++", "i", "{\n res = res * i;\n }", "{\n res = res * i;\n }", "res = res * i", "res", "res * i", "res", "i", "return res;", "res", "long x", "x", "static long gcdOfFactorial(long a, long b) { \n if (b == 0) \n return a; \n return gcdOfFactorial(b, a % b);\n }", "gcdOfFactorial", "{ \n if (b == 0) \n return a; \n return gcdOfFactorial(b, a % b);\n }", "if (b == 0) \n return a;", "b == 0", "b", "0", "return a;", "a", "return gcdOfFactorial(b, a % b);", "gcdOfFactorial(b, a % b)", "gcdOfFactorial", "b", "a % b", "a", "b", "long a", "a", "long b", "b", "static class Solver {\n\t\tSolver() {\n\t\t\t\n }\n \n }", "Solver", "Solver() {\n\t\t\t\n }", "Solver", "{\n\t\t\t\n }", "static class StdIn {\n\t\tfinal private int BUFFER_SIZE = 1 << 16;\n\t\tprivate DataInputStream din;\n\t\tprivate byte[] buffer;\n\t\tprivate int bufferPointer, bytesRead;\n\t\tpublic StdIn() {\n\t\t\tdin = new DataInputStream(System.in);\n\t\t\tbuffer = new byte[BUFFER_SIZE];\n\t\t\tbufferPointer = bytesRead = 0;\n\t\t}\n\t\tpublic StdIn(InputStream in) {\n\t\t\ttry{\n\t\t\t\tdin = new DataInputStream(in);\n\t\t\t} catch(Exception e) {\n\t\t\t\tthrow new RuntimeException();\n\t\t\t}\n\t\t\tbuffer = new byte[BUFFER_SIZE];\n\t\t\tbufferPointer = bytesRead = 0;\n\t\t}\n\t\tpublic String next() {\n\t\t\tint c;\n\t\t\twhile((c=read())!=-1&&(c==' '||c=='\\n'||c=='\\r'));\n\t\t\tStringBuilder s = new StringBuilder();\n\t\t\twhile (c != -1)\n\t\t\t{\n\t\t\t\tif (c == ' ' || c == '\\n'||c=='\\r')\n\t\t\t\t\tbreak;\n\t\t\t\ts.append((char)c);\n\t\t\t\tc=read();\n\t\t\t}\n\t\t\treturn s.toString();\n\t\t}\n\t\tpublic String nextLine() {\n\t\t\tint c;\n\t\t\twhile((c=read())!=-1&&(c==' '||c=='\\n'||c=='\\r'));\n\t\t\tStringBuilder s = new StringBuilder();\n\t\t\twhile (c != -1)\n\t\t\t{\n\t\t\t\tif (c == '\\n'||c=='\\r')\n\t\t\t\t\tbreak;\n\t\t\t\ts.append((char)c);\n\t\t\t\tc = read();\n\t\t\t}\n\t\t\treturn s.toString();\n\t\t}\n\t\tpublic int nextInt() {\n\t\t\tint ret = 0;\n\t\t\tbyte c = read();\n\t\t\twhile (c <= ' ')\n\t\t\t\tc = read();\n\t\t\tboolean neg = (c == '-');\n\t\t\tif (neg)\n\t\t\t\tc = read();\n\t\t\tdo\n\t\t\t\tret = ret * 10 + c - '0';\n\t\t\twhile ((c = read()) >= '0' && c <= '9');\n\n\t\t\tif (neg)\n\t\t\t\treturn -ret;\n\t\t\treturn ret;\n\t\t}\n\t\tpublic int[] readIntArray(int n, int os) {\n\t\t\tint[] ar = new int[n];\n\t\t\tfor(int i=0; i<n; ++i)\n\t\t\t\tar[i]=nextInt()+os;\n\t\t\treturn ar;\n\t\t}\n\t\tpublic long nextLong() {\n\t\t\tlong ret = 0;\n\t\t\tbyte c = read();\n\t\t\twhile (c <= ' ')\n\t\t\t\tc = read();\n\t\t\tboolean neg = (c == '-');\n\t\t\tif (neg)\n\t\t\t\tc = read();\n\t\t\tdo\n\t\t\t\tret = ret * 10 + c - '0';\n\t\t\twhile ((c = read()) >= '0' && c <= '9');\n\t\t\tif (neg)\n\t\t\t\treturn -ret;\n\t\t\treturn ret;\n\t\t}\n\t\tpublic long[] readLongArray(int n, long os) {\n\t\t\tlong[] ar = new long[n];\n\t\t\tfor(int i=0; i<n; ++i)\n\t\t\t\tar[i]=nextLong()+os;\n\t\t\treturn ar;\n\t\t}\n\t\tpublic double nextDouble() {\n\t\t\tdouble ret = 0, div = 1;\n\t\t\tbyte c = read();\n\t\t\twhile (c <= ' ')\n\t\t\t\tc = read();\n\t\t\tboolean neg = (c == '-');\n\t\t\tif (neg)\n\t\t\t\tc = read();\n\t\t\tdo\n\t\t\t\tret = ret * 10 + c - '0';\n\t\t\twhile ((c = read()) >= '0' && c <= '9');\n\t\t\tif (c == '.')\n\t\t\t\twhile ((c = read()) >= '0' && c <= '9')\n\t\t\t\t\tret += (c - '0') / (div *= 10);\n\t\t\tif (neg)\n\t\t\t\treturn -ret;\n\t\t\treturn ret;\n\t\t}\n\t\tprivate void fillBuffer() throws IOException {\n\t\t\tbytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);\n\t\t\tif (bytesRead == -1)\n\t\t\t\tbuffer[0] = -1;\n\t\t}\n\t\tprivate byte read() {\n\t\t\ttry{\n\t\t\t\tif (bufferPointer == bytesRead)\n\t\t\t\t\tfillBuffer();\n\t\t\t\treturn buffer[bufferPointer++];\n\t\t\t} catch(IOException e) {\n\t\t\t\tthrow new RuntimeException();\n\t\t\t}\n\t\t}\n\t\tpublic void close() throws IOException {\n\t\t\tif (din == null)\n\t\t\t\treturn;\n\t\t\tdin.close();\n\t\t}\n\t}", "StdIn", "final private int BUFFER_SIZE = 1 << 16;", "BUFFER_SIZE", "1 << 16", "1", "16", "private DataInputStream din;", "din", "private byte[] buffer;", "buffer", "private int bufferPointer", "bufferPointer", "bytesRead;", "bytesRead", "public StdIn() {\n\t\t\tdin = new DataInputStream(System.in);\n\t\t\tbuffer = new byte[BUFFER_SIZE];\n\t\t\tbufferPointer = bytesRead = 0;\n\t\t}", "StdIn", "{\n\t\t\tdin = new DataInputStream(System.in);\n\t\t\tbuffer = new byte[BUFFER_SIZE];\n\t\t\tbufferPointer = bytesRead = 0;\n\t\t}", "din = new DataInputStream(System.in)", "din", "new DataInputStream(System.in)", "buffer = new byte[BUFFER_SIZE]", "buffer", "new byte[BUFFER_SIZE]", "BUFFER_SIZE", "bufferPointer = bytesRead = 0", "bufferPointer", "bytesRead = 0", "bytesRead", "0", "public StdIn(InputStream in) {\n\t\t\ttry{\n\t\t\t\tdin = new DataInputStream(in);\n\t\t\t} catch(Exception e) {\n\t\t\t\tthrow new RuntimeException();\n\t\t\t}\n\t\t\tbuffer = new byte[BUFFER_SIZE];\n\t\t\tbufferPointer = bytesRead = 0;\n\t\t}", "StdIn", "{\n\t\t\ttry{\n\t\t\t\tdin = new DataInputStream(in);\n\t\t\t} catch(Exception e) {\n\t\t\t\tthrow new RuntimeException();\n\t\t\t}\n\t\t\tbuffer = new byte[BUFFER_SIZE];\n\t\t\tbufferPointer = bytesRead = 0;\n\t\t}", "try{\n\t\t\t\tdin = new DataInputStream(in);\n\t\t\t} catch(Exception e) {\n\t\t\t\tthrow new RuntimeException();\n\t\t\t}", "catch(Exception e) {\n\t\t\t\tthrow new RuntimeException();\n\t\t\t}", "Exception e", "{\n\t\t\t\tthrow new RuntimeException();\n\t\t\t}", "throw new RuntimeException();", "new RuntimeException()", "{\n\t\t\t\tdin = new DataInputStream(in);\n\t\t\t}", "din = new DataInputStream(in)", "din", "new DataInputStream(in)", "buffer = new byte[BUFFER_SIZE]", "buffer", "new byte[BUFFER_SIZE]", "BUFFER_SIZE", "bufferPointer = bytesRead = 0", "bufferPointer", "bytesRead = 0", "bytesRead", "0", "InputStream in", "in", "public String next() {\n\t\t\tint c;\n\t\t\twhile((c=read())!=-1&&(c==' '||c=='\\n'||c=='\\r'));\n\t\t\tStringBuilder s = new StringBuilder();\n\t\t\twhile (c != -1)\n\t\t\t{\n\t\t\t\tif (c == ' ' || c == '\\n'||c=='\\r')\n\t\t\t\t\tbreak;\n\t\t\t\ts.append((char)c);\n\t\t\t\tc=read();\n\t\t\t}\n\t\t\treturn s.toString();\n\t\t}", "next", "{\n\t\t\tint c;\n\t\t\twhile((c=read())!=-1&&(c==' '||c=='\\n'||c=='\\r'));\n\t\t\tStringBuilder s = new StringBuilder();\n\t\t\twhile (c != -1)\n\t\t\t{\n\t\t\t\tif (c == ' ' || c == '\\n'||c=='\\r')\n\t\t\t\t\tbreak;\n\t\t\t\ts.append((char)c);\n\t\t\t\tc=read();\n\t\t\t}\n\t\t\treturn s.toString();\n\t\t}", "int c;", "c", "while((c=read())!=-1&&(c==' '||c=='\\n'||c=='\\r'));", "(c=read())!=-1&&(c==' '||c=='\\n'||c=='\\r')", "(c=read())!=-1", "(c=read())", "c", "read()", "read", "-1", "1", "(c==' '||c=='\\n'||c=='\\r')", "c==' '||c=='\\n'||c=='\\r'", "c==' '", "c", "' '", "c=='\\n'", "c", "'\\n'", "c=='\\r'", "c", "'\\r'", "StringBuilder s = new StringBuilder();", "s", "new StringBuilder()", "while (c != -1)\n\t\t\t{\n\t\t\t\tif (c == ' ' || c == '\\n'||c=='\\r')\n\t\t\t\t\tbreak;\n\t\t\t\ts.append((char)c);\n\t\t\t\tc=read();\n\t\t\t}", "c != -1", "c", "-1", "1", "{\n\t\t\t\tif (c == ' ' || c == '\\n'||c=='\\r')\n\t\t\t\t\tbreak;\n\t\t\t\ts.append((char)c);\n\t\t\t\tc=read();\n\t\t\t}", "if (c == ' ' || c == '\\n'||c=='\\r')\n\t\t\t\t\tbreak;", "c == ' ' || c == '\\n'||c=='\\r'", "c == ' ' || c == '\\n'||c=='\\r'", "c == ' '", "c", "' '", "c == '\\n'", "c", "'\\n'", "c=='\\r'", "c", "'\\r'", "break;", "s.append((char)c)", "s.append", "s", "(char)c", "c=read()", "c", "read()", "read", "return s.toString();", "s.toString()", "s.toString", "s", "public String nextLine() {\n\t\t\tint c;\n\t\t\twhile((c=read())!=-1&&(c==' '||c=='\\n'||c=='\\r'));\n\t\t\tStringBuilder s = new StringBuilder();\n\t\t\twhile (c != -1)\n\t\t\t{\n\t\t\t\tif (c == '\\n'||c=='\\r')\n\t\t\t\t\tbreak;\n\t\t\t\ts.append((char)c);\n\t\t\t\tc = read();\n\t\t\t}\n\t\t\treturn s.toString();\n\t\t}", "nextLine", "{\n\t\t\tint c;\n\t\t\twhile((c=read())!=-1&&(c==' '||c=='\\n'||c=='\\r'));\n\t\t\tStringBuilder s = new StringBuilder();\n\t\t\twhile (c != -1)\n\t\t\t{\n\t\t\t\tif (c == '\\n'||c=='\\r')\n\t\t\t\t\tbreak;\n\t\t\t\ts.append((char)c);\n\t\t\t\tc = read();\n\t\t\t}\n\t\t\treturn s.toString();\n\t\t}", "int c;", "c", "while((c=read())!=-1&&(c==' '||c=='\\n'||c=='\\r'));", "(c=read())!=-1&&(c==' '||c=='\\n'||c=='\\r')", "(c=read())!=-1", "(c=read())", "c", "read()", "read", "-1", "1", "(c==' '||c=='\\n'||c=='\\r')", "c==' '||c=='\\n'||c=='\\r'", "c==' '", "c", "' '", "c=='\\n'", "c", "'\\n'", "c=='\\r'", "c", "'\\r'", "StringBuilder s = new StringBuilder();", "s", "new StringBuilder()", "while (c != -1)\n\t\t\t{\n\t\t\t\tif (c == '\\n'||c=='\\r')\n\t\t\t\t\tbreak;\n\t\t\t\ts.append((char)c);\n\t\t\t\tc = read();\n\t\t\t}", "c != -1", "c", "-1", "1", "{\n\t\t\t\tif (c == '\\n'||c=='\\r')\n\t\t\t\t\tbreak;\n\t\t\t\ts.append((char)c);\n\t\t\t\tc = read();\n\t\t\t}", "if (c == '\\n'||c=='\\r')\n\t\t\t\t\tbreak;", "c == '\\n'||c=='\\r'", "c == '\\n'", "c", "'\\n'", "c=='\\r'", "c", "'\\r'", "break;", "s.append((char)c)", "s.append", "s", "(char)c", "c = read()", "c", "read()", "read", "return s.toString();", "s.toString()", "s.toString", "s", "public int nextInt() {\n\t\t\tint ret = 0;\n\t\t\tbyte c = read();\n\t\t\twhile (c <= ' ')\n\t\t\t\tc = read();\n\t\t\tboolean neg = (c == '-');\n\t\t\tif (neg)\n\t\t\t\tc = read();\n\t\t\tdo\n\t\t\t\tret = ret * 10 + c - '0';\n\t\t\twhile ((c = read()) >= '0' && c <= '9');\n\n\t\t\tif (neg)\n\t\t\t\treturn -ret;\n\t\t\treturn ret;\n\t\t}", "nextInt", "{\n\t\t\tint ret = 0;\n\t\t\tbyte c = read();\n\t\t\twhile (c <= ' ')\n\t\t\t\tc = read();\n\t\t\tboolean neg = (c == '-');\n\t\t\tif (neg)\n\t\t\t\tc = read();\n\t\t\tdo\n\t\t\t\tret = ret * 10 + c - '0';\n\t\t\twhile ((c = read()) >= '0' && c <= '9');\n\n\t\t\tif (neg)\n\t\t\t\treturn -ret;\n\t\t\treturn ret;\n\t\t}", "int ret = 0;", "ret", "0", "byte c = read();", "c", "read()", "read", "while (c <= ' ')\n\t\t\t\tc = read();", "c <= ' '", "c", "' '", "c = read()", "c", "read()", "read", "boolean neg = (c == '-');", "neg", "(c == '-')", "c", "'-'", "if (neg)\n\t\t\t\tc = read();", "neg", "c = read()", "c", "read()", "read", "do\n\t\t\t\tret = ret * 10 + c - '0';\n\t\t\twhile ((c = read()) >= '0' && c <= '9');", "(c = read()) >= '0' && c <= '9'", "(c = read()) >= '0'", "(c = read())", "c", "read()", "read", "'0'", "c <= '9'", "c", "'9'", "ret = ret * 10 + c - '0'", "ret", "ret * 10 + c - '0'", "ret * 10 + c", "ret * 10", "ret", "10", "c", "'0'", "if (neg)\n\t\t\t\treturn -ret;", "neg", "return -ret;", "-ret", "ret", "return ret;", "ret", "public int[] readIntArray(int n, int os) {\n\t\t\tint[] ar = new int[n];\n\t\t\tfor(int i=0; i<n; ++i)\n\t\t\t\tar[i]=nextInt()+os;\n\t\t\treturn ar;\n\t\t}", "readIntArray", "{\n\t\t\tint[] ar = new int[n];\n\t\t\tfor(int i=0; i<n; ++i)\n\t\t\t\tar[i]=nextInt()+os;\n\t\t\treturn ar;\n\t\t}", "int[] ar = new int[n];", "ar", "new int[n]", "n", "for(int i=0; i<n; ++i)\n\t\t\t\tar[i]=nextInt()+os;", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "++i", "++i", "i", "ar[i]=nextInt()+os;", "ar[i]=nextInt()+os", "ar[i]", "ar", "i", "nextInt()+os", "nextInt()", "nextInt", "os", "return ar;", "ar", "int n", "n", "int os", "os", "public long nextLong() {\n\t\t\tlong ret = 0;\n\t\t\tbyte c = read();\n\t\t\twhile (c <= ' ')\n\t\t\t\tc = read();\n\t\t\tboolean neg = (c == '-');\n\t\t\tif (neg)\n\t\t\t\tc = read();\n\t\t\tdo\n\t\t\t\tret = ret * 10 + c - '0';\n\t\t\twhile ((c = read()) >= '0' && c <= '9');\n\t\t\tif (neg)\n\t\t\t\treturn -ret;\n\t\t\treturn ret;\n\t\t}", "nextLong", "{\n\t\t\tlong ret = 0;\n\t\t\tbyte c = read();\n\t\t\twhile (c <= ' ')\n\t\t\t\tc = read();\n\t\t\tboolean neg = (c == '-');\n\t\t\tif (neg)\n\t\t\t\tc = read();\n\t\t\tdo\n\t\t\t\tret = ret * 10 + c - '0';\n\t\t\twhile ((c = read()) >= '0' && c <= '9');\n\t\t\tif (neg)\n\t\t\t\treturn -ret;\n\t\t\treturn ret;\n\t\t}", "long ret = 0;", "ret", "0", "byte c = read();", "c", "read()", "read", "while (c <= ' ')\n\t\t\t\tc = read();", "c <= ' '", "c", "' '", "c = read()", "c", "read()", "read", "boolean neg = (c == '-');", "neg", "(c == '-')", "c", "'-'", "if (neg)\n\t\t\t\tc = read();", "neg", "c = read()", "c", "read()", "read", "do\n\t\t\t\tret = ret * 10 + c - '0';\n\t\t\twhile ((c = read()) >= '0' && c <= '9');", "(c = read()) >= '0' && c <= '9'", "(c = read()) >= '0'", "(c = read())", "c", "read()", "read", "'0'", "c <= '9'", "c", "'9'", "ret = ret * 10 + c - '0'", "ret", "ret * 10 + c - '0'", "ret * 10 + c", "ret * 10", "ret", "10", "c", "'0'", "if (neg)\n\t\t\t\treturn -ret;", "neg", "return -ret;", "-ret", "ret", "return ret;", "ret", "public long[] readLongArray(int n, long os) {\n\t\t\tlong[] ar = new long[n];\n\t\t\tfor(int i=0; i<n; ++i)\n\t\t\t\tar[i]=nextLong()+os;\n\t\t\treturn ar;\n\t\t}", "readLongArray", "{\n\t\t\tlong[] ar = new long[n];\n\t\t\tfor(int i=0; i<n; ++i)\n\t\t\t\tar[i]=nextLong()+os;\n\t\t\treturn ar;\n\t\t}", "long[] ar = new long[n];", "ar", "new long[n]", "n", "for(int i=0; i<n; ++i)\n\t\t\t\tar[i]=nextLong()+os;", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "++i", "++i", "i", "ar[i]=nextLong()+os;", "ar[i]=nextLong()+os", "ar[i]", "ar", "i", "nextLong()+os", "nextLong()", "nextLong", "os", "return ar;", "ar", "int n", "n", "long os", "os", "public double nextDouble() {\n\t\t\tdouble ret = 0, div = 1;\n\t\t\tbyte c = read();\n\t\t\twhile (c <= ' ')\n\t\t\t\tc = read();\n\t\t\tboolean neg = (c == '-');\n\t\t\tif (neg)\n\t\t\t\tc = read();\n\t\t\tdo\n\t\t\t\tret = ret * 10 + c - '0';\n\t\t\twhile ((c = read()) >= '0' && c <= '9');\n\t\t\tif (c == '.')\n\t\t\t\twhile ((c = read()) >= '0' && c <= '9')\n\t\t\t\t\tret += (c - '0') / (div *= 10);\n\t\t\tif (neg)\n\t\t\t\treturn -ret;\n\t\t\treturn ret;\n\t\t}", "nextDouble", "{\n\t\t\tdouble ret = 0, div = 1;\n\t\t\tbyte c = read();\n\t\t\twhile (c <= ' ')\n\t\t\t\tc = read();\n\t\t\tboolean neg = (c == '-');\n\t\t\tif (neg)\n\t\t\t\tc = read();\n\t\t\tdo\n\t\t\t\tret = ret * 10 + c - '0';\n\t\t\twhile ((c = read()) >= '0' && c <= '9');\n\t\t\tif (c == '.')\n\t\t\t\twhile ((c = read()) >= '0' && c <= '9')\n\t\t\t\t\tret += (c - '0') / (div *= 10);\n\t\t\tif (neg)\n\t\t\t\treturn -ret;\n\t\t\treturn ret;\n\t\t}", "double ret = 0", "ret", "0", "div = 1;", "div", "1", "byte c = read();", "c", "read()", "read", "while (c <= ' ')\n\t\t\t\tc = read();", "c <= ' '", "c", "' '", "c = read()", "c", "read()", "read", "boolean neg = (c == '-');", "neg", "(c == '-')", "c", "'-'", "if (neg)\n\t\t\t\tc = read();", "neg", "c = read()", "c", "read()", "read", "do\n\t\t\t\tret = ret * 10 + c - '0';\n\t\t\twhile ((c = read()) >= '0' && c <= '9');", "(c = read()) >= '0' && c <= '9'", "(c = read()) >= '0'", "(c = read())", "c", "read()", "read", "'0'", "c <= '9'", "c", "'9'", "ret = ret * 10 + c - '0'", "ret", "ret * 10 + c - '0'", "ret * 10 + c", "ret * 10", "ret", "10", "c", "'0'", "if (c == '.')\n\t\t\t\twhile ((c = read()) >= '0' && c <= '9')\n\t\t\t\t\tret += (c - '0') / (div *= 10);", "c == '.'", "c", "'.'", "while ((c = read()) >= '0' && c <= '9')\n\t\t\t\t\tret += (c - '0') / (div *= 10);", "(c = read()) >= '0' && c <= '9'", "(c = read()) >= '0'", "(c = read())", "c", "read()", "read", "'0'", "c <= '9'", "c", "'9'", "ret += (c - '0') / (div *= 10)", "ret", "(c - '0') / (div *= 10)", "(c - '0')", "c", "'0'", "(div *= 10)", "div", "10", "if (neg)\n\t\t\t\treturn -ret;", "neg", "return -ret;", "-ret", "ret", "return ret;", "ret", "private void fillBuffer() throws IOException {\n\t\t\tbytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);\n\t\t\tif (bytesRead == -1)\n\t\t\t\tbuffer[0] = -1;\n\t\t}", "fillBuffer", "{\n\t\t\tbytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);\n\t\t\tif (bytesRead == -1)\n\t\t\t\tbuffer[0] = -1;\n\t\t}", "bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE)", "bytesRead", "din.read(buffer, bufferPointer = 0, BUFFER_SIZE)", "din.read", "din", "buffer", "bufferPointer = 0", "bufferPointer", "0", "BUFFER_SIZE", "if (bytesRead == -1)\n\t\t\t\tbuffer[0] = -1;", "bytesRead == -1", "bytesRead", "-1", "1", "buffer[0] = -1", "buffer[0]", "buffer", "0", "-1", "1", "private byte read() {\n\t\t\ttry{\n\t\t\t\tif (bufferPointer == bytesRead)\n\t\t\t\t\tfillBuffer();\n\t\t\t\treturn buffer[bufferPointer++];\n\t\t\t} catch(IOException e) {\n\t\t\t\tthrow new RuntimeException();\n\t\t\t}\n\t\t}", "read", "{\n\t\t\ttry{\n\t\t\t\tif (bufferPointer == bytesRead)\n\t\t\t\t\tfillBuffer();\n\t\t\t\treturn buffer[bufferPointer++];\n\t\t\t} catch(IOException e) {\n\t\t\t\tthrow new RuntimeException();\n\t\t\t}\n\t\t}", "try{\n\t\t\t\tif (bufferPointer == bytesRead)\n\t\t\t\t\tfillBuffer();\n\t\t\t\treturn buffer[bufferPointer++];\n\t\t\t} catch(IOException e) {\n\t\t\t\tthrow new RuntimeException();\n\t\t\t}", "catch(IOException e) {\n\t\t\t\tthrow new RuntimeException();\n\t\t\t}", "IOException e", "{\n\t\t\t\tthrow new RuntimeException();\n\t\t\t}", "throw new RuntimeException();", "new RuntimeException()", "{\n\t\t\t\tif (bufferPointer == bytesRead)\n\t\t\t\t\tfillBuffer();\n\t\t\t\treturn buffer[bufferPointer++];\n\t\t\t}", "if (bufferPointer == bytesRead)\n\t\t\t\t\tfillBuffer();", "bufferPointer == bytesRead", "bufferPointer", "bytesRead", "fillBuffer()", "fillBuffer", "return buffer[bufferPointer++];", "buffer[bufferPointer++]", "buffer", "bufferPointer++", "bufferPointer", "public void close() throws IOException {\n\t\t\tif (din == null)\n\t\t\t\treturn;\n\t\t\tdin.close();\n\t\t}", "close", "{\n\t\t\tif (din == null)\n\t\t\t\treturn;\n\t\t\tdin.close();\n\t\t}", "if (din == null)\n\t\t\t\treturn;", "din == null", "din", "null", "return;", "din.close()", "din.close", "din", "public class Main {\n\tstatic final StdIn in = new StdIn();\n\tstatic final PrintWriter out = new PrintWriter(System.out);\n\n\tpublic static void main(String[] args) {\n int N = in.nextInt();\n\n long arr[] = new long[N];\n for (int i = 0; i < N; i++) {\n arr[i] = in.nextLong();\n }\n\n long first = arr[0];\n long res = 0;\n\n for (int i = 1; i < arr.length; i++) {\n long diff = first - arr[i];\n if(diff > 0) {\n res += diff; \n }\n if(first < arr[i]) {\n first = arr[i];\n }\n }\n out.println(res);\n // long res = 0;\n\n // while(N >= 0) {\n // long d = N % 10;\n // res += d;\n // N = N/10;\n // }\n\n // if(res%9 == 0) {\n // out.println(\"Yes\");\n // } else { \n // out.println(\"No\");\n // }\n\t\tout.close();\n }\n\n static class Solver {\n\t\tSolver() {\n\t\t\t\n }\n \n }\n\n static long factorial(long x) {\n if(x <= 1) {\n return 1;\n }\n long res = 2;\n for (int i = 3; i <= x; i++) {\n res = res * i;\n }\n return res;\n }\n \n static long gcdOfFactorial(long a, long b) { \n if (b == 0) \n return a; \n return gcdOfFactorial(b, a % b);\n } \n\t\n\tstatic class StdIn {\n\t\tfinal private int BUFFER_SIZE = 1 << 16;\n\t\tprivate DataInputStream din;\n\t\tprivate byte[] buffer;\n\t\tprivate int bufferPointer, bytesRead;\n\t\tpublic StdIn() {\n\t\t\tdin = new DataInputStream(System.in);\n\t\t\tbuffer = new byte[BUFFER_SIZE];\n\t\t\tbufferPointer = bytesRead = 0;\n\t\t}\n\t\tpublic StdIn(InputStream in) {\n\t\t\ttry{\n\t\t\t\tdin = new DataInputStream(in);\n\t\t\t} catch(Exception e) {\n\t\t\t\tthrow new RuntimeException();\n\t\t\t}\n\t\t\tbuffer = new byte[BUFFER_SIZE];\n\t\t\tbufferPointer = bytesRead = 0;\n\t\t}\n\t\tpublic String next() {\n\t\t\tint c;\n\t\t\twhile((c=read())!=-1&&(c==' '||c=='\\n'||c=='\\r'));\n\t\t\tStringBuilder s = new StringBuilder();\n\t\t\twhile (c != -1)\n\t\t\t{\n\t\t\t\tif (c == ' ' || c == '\\n'||c=='\\r')\n\t\t\t\t\tbreak;\n\t\t\t\ts.append((char)c);\n\t\t\t\tc=read();\n\t\t\t}\n\t\t\treturn s.toString();\n\t\t}\n\t\tpublic String nextLine() {\n\t\t\tint c;\n\t\t\twhile((c=read())!=-1&&(c==' '||c=='\\n'||c=='\\r'));\n\t\t\tStringBuilder s = new StringBuilder();\n\t\t\twhile (c != -1)\n\t\t\t{\n\t\t\t\tif (c == '\\n'||c=='\\r')\n\t\t\t\t\tbreak;\n\t\t\t\ts.append((char)c);\n\t\t\t\tc = read();\n\t\t\t}\n\t\t\treturn s.toString();\n\t\t}\n\t\tpublic int nextInt() {\n\t\t\tint ret = 0;\n\t\t\tbyte c = read();\n\t\t\twhile (c <= ' ')\n\t\t\t\tc = read();\n\t\t\tboolean neg = (c == '-');\n\t\t\tif (neg)\n\t\t\t\tc = read();\n\t\t\tdo\n\t\t\t\tret = ret * 10 + c - '0';\n\t\t\twhile ((c = read()) >= '0' && c <= '9');\n\n\t\t\tif (neg)\n\t\t\t\treturn -ret;\n\t\t\treturn ret;\n\t\t}\n\t\tpublic int[] readIntArray(int n, int os) {\n\t\t\tint[] ar = new int[n];\n\t\t\tfor(int i=0; i<n; ++i)\n\t\t\t\tar[i]=nextInt()+os;\n\t\t\treturn ar;\n\t\t}\n\t\tpublic long nextLong() {\n\t\t\tlong ret = 0;\n\t\t\tbyte c = read();\n\t\t\twhile (c <= ' ')\n\t\t\t\tc = read();\n\t\t\tboolean neg = (c == '-');\n\t\t\tif (neg)\n\t\t\t\tc = read();\n\t\t\tdo\n\t\t\t\tret = ret * 10 + c - '0';\n\t\t\twhile ((c = read()) >= '0' && c <= '9');\n\t\t\tif (neg)\n\t\t\t\treturn -ret;\n\t\t\treturn ret;\n\t\t}\n\t\tpublic long[] readLongArray(int n, long os) {\n\t\t\tlong[] ar = new long[n];\n\t\t\tfor(int i=0; i<n; ++i)\n\t\t\t\tar[i]=nextLong()+os;\n\t\t\treturn ar;\n\t\t}\n\t\tpublic double nextDouble() {\n\t\t\tdouble ret = 0, div = 1;\n\t\t\tbyte c = read();\n\t\t\twhile (c <= ' ')\n\t\t\t\tc = read();\n\t\t\tboolean neg = (c == '-');\n\t\t\tif (neg)\n\t\t\t\tc = read();\n\t\t\tdo\n\t\t\t\tret = ret * 10 + c - '0';\n\t\t\twhile ((c = read()) >= '0' && c <= '9');\n\t\t\tif (c == '.')\n\t\t\t\twhile ((c = read()) >= '0' && c <= '9')\n\t\t\t\t\tret += (c - '0') / (div *= 10);\n\t\t\tif (neg)\n\t\t\t\treturn -ret;\n\t\t\treturn ret;\n\t\t}\n\t\tprivate void fillBuffer() throws IOException {\n\t\t\tbytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);\n\t\t\tif (bytesRead == -1)\n\t\t\t\tbuffer[0] = -1;\n\t\t}\n\t\tprivate byte read() {\n\t\t\ttry{\n\t\t\t\tif (bufferPointer == bytesRead)\n\t\t\t\t\tfillBuffer();\n\t\t\t\treturn buffer[bufferPointer++];\n\t\t\t} catch(IOException e) {\n\t\t\t\tthrow new RuntimeException();\n\t\t\t}\n\t\t}\n\t\tpublic void close() throws IOException {\n\t\t\tif (din == null)\n\t\t\t\treturn;\n\t\t\tdin.close();\n\t\t}\n\t}\n}", "public class Main {\n\tstatic final StdIn in = new StdIn();\n\tstatic final PrintWriter out = new PrintWriter(System.out);\n\n\tpublic static void main(String[] args) {\n int N = in.nextInt();\n\n long arr[] = new long[N];\n for (int i = 0; i < N; i++) {\n arr[i] = in.nextLong();\n }\n\n long first = arr[0];\n long res = 0;\n\n for (int i = 1; i < arr.length; i++) {\n long diff = first - arr[i];\n if(diff > 0) {\n res += diff; \n }\n if(first < arr[i]) {\n first = arr[i];\n }\n }\n out.println(res);\n // long res = 0;\n\n // while(N >= 0) {\n // long d = N % 10;\n // res += d;\n // N = N/10;\n // }\n\n // if(res%9 == 0) {\n // out.println(\"Yes\");\n // } else { \n // out.println(\"No\");\n // }\n\t\tout.close();\n }\n\n static class Solver {\n\t\tSolver() {\n\t\t\t\n }\n \n }\n\n static long factorial(long x) {\n if(x <= 1) {\n return 1;\n }\n long res = 2;\n for (int i = 3; i <= x; i++) {\n res = res * i;\n }\n return res;\n }\n \n static long gcdOfFactorial(long a, long b) { \n if (b == 0) \n return a; \n return gcdOfFactorial(b, a % b);\n } \n\t\n\tstatic class StdIn {\n\t\tfinal private int BUFFER_SIZE = 1 << 16;\n\t\tprivate DataInputStream din;\n\t\tprivate byte[] buffer;\n\t\tprivate int bufferPointer, bytesRead;\n\t\tpublic StdIn() {\n\t\t\tdin = new DataInputStream(System.in);\n\t\t\tbuffer = new byte[BUFFER_SIZE];\n\t\t\tbufferPointer = bytesRead = 0;\n\t\t}\n\t\tpublic StdIn(InputStream in) {\n\t\t\ttry{\n\t\t\t\tdin = new DataInputStream(in);\n\t\t\t} catch(Exception e) {\n\t\t\t\tthrow new RuntimeException();\n\t\t\t}\n\t\t\tbuffer = new byte[BUFFER_SIZE];\n\t\t\tbufferPointer = bytesRead = 0;\n\t\t}\n\t\tpublic String next() {\n\t\t\tint c;\n\t\t\twhile((c=read())!=-1&&(c==' '||c=='\\n'||c=='\\r'));\n\t\t\tStringBuilder s = new StringBuilder();\n\t\t\twhile (c != -1)\n\t\t\t{\n\t\t\t\tif (c == ' ' || c == '\\n'||c=='\\r')\n\t\t\t\t\tbreak;\n\t\t\t\ts.append((char)c);\n\t\t\t\tc=read();\n\t\t\t}\n\t\t\treturn s.toString();\n\t\t}\n\t\tpublic String nextLine() {\n\t\t\tint c;\n\t\t\twhile((c=read())!=-1&&(c==' '||c=='\\n'||c=='\\r'));\n\t\t\tStringBuilder s = new StringBuilder();\n\t\t\twhile (c != -1)\n\t\t\t{\n\t\t\t\tif (c == '\\n'||c=='\\r')\n\t\t\t\t\tbreak;\n\t\t\t\ts.append((char)c);\n\t\t\t\tc = read();\n\t\t\t}\n\t\t\treturn s.toString();\n\t\t}\n\t\tpublic int nextInt() {\n\t\t\tint ret = 0;\n\t\t\tbyte c = read();\n\t\t\twhile (c <= ' ')\n\t\t\t\tc = read();\n\t\t\tboolean neg = (c == '-');\n\t\t\tif (neg)\n\t\t\t\tc = read();\n\t\t\tdo\n\t\t\t\tret = ret * 10 + c - '0';\n\t\t\twhile ((c = read()) >= '0' && c <= '9');\n\n\t\t\tif (neg)\n\t\t\t\treturn -ret;\n\t\t\treturn ret;\n\t\t}\n\t\tpublic int[] readIntArray(int n, int os) {\n\t\t\tint[] ar = new int[n];\n\t\t\tfor(int i=0; i<n; ++i)\n\t\t\t\tar[i]=nextInt()+os;\n\t\t\treturn ar;\n\t\t}\n\t\tpublic long nextLong() {\n\t\t\tlong ret = 0;\n\t\t\tbyte c = read();\n\t\t\twhile (c <= ' ')\n\t\t\t\tc = read();\n\t\t\tboolean neg = (c == '-');\n\t\t\tif (neg)\n\t\t\t\tc = read();\n\t\t\tdo\n\t\t\t\tret = ret * 10 + c - '0';\n\t\t\twhile ((c = read()) >= '0' && c <= '9');\n\t\t\tif (neg)\n\t\t\t\treturn -ret;\n\t\t\treturn ret;\n\t\t}\n\t\tpublic long[] readLongArray(int n, long os) {\n\t\t\tlong[] ar = new long[n];\n\t\t\tfor(int i=0; i<n; ++i)\n\t\t\t\tar[i]=nextLong()+os;\n\t\t\treturn ar;\n\t\t}\n\t\tpublic double nextDouble() {\n\t\t\tdouble ret = 0, div = 1;\n\t\t\tbyte c = read();\n\t\t\twhile (c <= ' ')\n\t\t\t\tc = read();\n\t\t\tboolean neg = (c == '-');\n\t\t\tif (neg)\n\t\t\t\tc = read();\n\t\t\tdo\n\t\t\t\tret = ret * 10 + c - '0';\n\t\t\twhile ((c = read()) >= '0' && c <= '9');\n\t\t\tif (c == '.')\n\t\t\t\twhile ((c = read()) >= '0' && c <= '9')\n\t\t\t\t\tret += (c - '0') / (div *= 10);\n\t\t\tif (neg)\n\t\t\t\treturn -ret;\n\t\t\treturn ret;\n\t\t}\n\t\tprivate void fillBuffer() throws IOException {\n\t\t\tbytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);\n\t\t\tif (bytesRead == -1)\n\t\t\t\tbuffer[0] = -1;\n\t\t}\n\t\tprivate byte read() {\n\t\t\ttry{\n\t\t\t\tif (bufferPointer == bytesRead)\n\t\t\t\t\tfillBuffer();\n\t\t\t\treturn buffer[bufferPointer++];\n\t\t\t} catch(IOException e) {\n\t\t\t\tthrow new RuntimeException();\n\t\t\t}\n\t\t}\n\t\tpublic void close() throws IOException {\n\t\t\tif (din == null)\n\t\t\t\treturn;\n\t\t\tdin.close();\n\t\t}\n\t}\n}", "Main" ]
import java.io.*; import java.util.*; public class Main { static final StdIn in = new StdIn(); static final PrintWriter out = new PrintWriter(System.out); public static void main(String[] args) { int N = in.nextInt(); long arr[] = new long[N]; for (int i = 0; i < N; i++) { arr[i] = in.nextLong(); } long first = arr[0]; long res = 0; for (int i = 1; i < arr.length; i++) { long diff = first - arr[i]; if(diff > 0) { res += diff; } if(first < arr[i]) { first = arr[i]; } } out.println(res); // long res = 0; // while(N >= 0) { // long d = N % 10; // res += d; // N = N/10; // } // if(res%9 == 0) { // out.println("Yes"); // } else { // out.println("No"); // } out.close(); } static class Solver { Solver() { } } static long factorial(long x) { if(x <= 1) { return 1; } long res = 2; for (int i = 3; i <= x; i++) { res = res * i; } return res; } static long gcdOfFactorial(long a, long b) { if (b == 0) return a; return gcdOfFactorial(b, a % b); } static class StdIn { final private int BUFFER_SIZE = 1 << 16; private DataInputStream din; private byte[] buffer; private int bufferPointer, bytesRead; public StdIn() { din = new DataInputStream(System.in); buffer = new byte[BUFFER_SIZE]; bufferPointer = bytesRead = 0; } public StdIn(InputStream in) { try{ din = new DataInputStream(in); } catch(Exception e) { throw new RuntimeException(); } buffer = new byte[BUFFER_SIZE]; bufferPointer = bytesRead = 0; } public String next() { int c; while((c=read())!=-1&&(c==' '||c=='\n'||c=='\r')); StringBuilder s = new StringBuilder(); while (c != -1) { if (c == ' ' || c == '\n'||c=='\r') break; s.append((char)c); c=read(); } return s.toString(); } public String nextLine() { int c; while((c=read())!=-1&&(c==' '||c=='\n'||c=='\r')); StringBuilder s = new StringBuilder(); while (c != -1) { if (c == '\n'||c=='\r') break; s.append((char)c); c = read(); } return s.toString(); } public int nextInt() { int ret = 0; byte c = read(); while (c <= ' ') c = read(); boolean neg = (c == '-'); if (neg) c = read(); do ret = ret * 10 + c - '0'; while ((c = read()) >= '0' && c <= '9'); if (neg) return -ret; return ret; } public int[] readIntArray(int n, int os) { int[] ar = new int[n]; for(int i=0; i<n; ++i) ar[i]=nextInt()+os; return ar; } public long nextLong() { long ret = 0; byte c = read(); while (c <= ' ') c = read(); boolean neg = (c == '-'); if (neg) c = read(); do ret = ret * 10 + c - '0'; while ((c = read()) >= '0' && c <= '9'); if (neg) return -ret; return ret; } public long[] readLongArray(int n, long os) { long[] ar = new long[n]; for(int i=0; i<n; ++i) ar[i]=nextLong()+os; return ar; } public double nextDouble() { double ret = 0, div = 1; byte c = read(); while (c <= ' ') c = read(); boolean neg = (c == '-'); if (neg) c = read(); do ret = ret * 10 + c - '0'; while ((c = read()) >= '0' && c <= '9'); if (c == '.') while ((c = read()) >= '0' && c <= '9') ret += (c - '0') / (div *= 10); if (neg) return -ret; return ret; } private void fillBuffer() throws IOException { bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE); if (bytesRead == -1) buffer[0] = -1; } private byte read() { try{ if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } catch(IOException e) { throw new RuntimeException(); } } public void close() throws IOException { if (din == null) return; din.close(); } } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 41, 13, 20, 41, 13, 41, 13, 20, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 18, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 2, 13, 17, 1, 40, 13, 30, 30, 14, 2, 18, 13, 13, 18, 13, 2, 13, 17, 30, 0, 13, 2, 18, 13, 13, 18, 13, 2, 13, 17, 0, 18, 13, 2, 13, 17, 2, 18, 13, 2, 13, 17, 2, 18, 13, 13, 18, 13, 2, 13, 17, 4, 18, 18, 13, 13, 13, 23, 13, 12, 13, 30, 41, 13, 17, 42, 2, 13, 13, 30, 14, 2, 18, 13, 13, 17, 30, 40, 13, 9, 41, 13, 2, 18, 13, 13, 17, 14, 2, 18, 13, 13, 17, 30, 0, 18, 13, 13, 18, 13, 13, 0, 18, 13, 13, 40, 17, 30, 40, 18, 13, 13, 0, 18, 13, 13, 17, 40, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 4, 18, 13, 18, 13, 13, 17, 40, 13, 29, 13, 23, 13, 23, 13, 6, 13, 41, 13, 41, 13, 12, 13, 30, 0, 13, 20, 12, 13, 30, 42, 2, 2, 13, 17, 40, 4, 18, 13, 30, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 20, 29, 4, 18, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 41, 13, 17, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 4, 18, 13, 29, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 308, 14 ], [ 308, 15 ], [ 15, 16 ], [ 15, 17 ], [ 308, 18 ], [ 18, 19 ], [ 308, 20 ], [ 20, 21 ], [ 20, 22 ], [ 308, 23 ], [ 23, 24 ], [ 23, 25 ], [ 25, 26 ], [ 26, 27 ], [ 26, 28 ], [ 25, 29 ], [ 29, 30 ], [ 29, 31 ], [ 31, 32 ], [ 32, 33 ], [ 25, 34 ], [ 34, 35 ], [ 34, 36 ], [ 25, 38 ], [ 38, 39 ], [ 39, 40 ], [ 40, 41 ], [ 40, 42 ], [ 38, 43 ], [ 43, 44 ], [ 43, 45 ], [ 38, 46 ], [ 46, 47 ], [ 47, 48 ], [ 38, 49 ], [ 49, 50 ], [ 50, 51 ], [ 51, 52 ], [ 51, 53 ], [ 50, 54 ], [ 54, 55 ], [ 55, 56 ], [ 25, 57 ], [ 57, 58 ], [ 57, 59 ], [ 25, 60 ], [ 60, 61 ], [ 61, 62 ], [ 62, 63 ], [ 62, 64 ], [ 60, 65 ], [ 65, 66 ], [ 65, 67 ], [ 67, 68 ], [ 67, 69 ], [ 60, 70 ], [ 70, 71 ], [ 71, 72 ], [ 60, 73 ], [ 74, 74 ], [ 74, 75 ], [ 75, 76 ], [ 76, 77 ], [ 77, 78 ], [ 77, 79 ], [ 76, 80 ], [ 80, 81 ], [ 80, 82 ], [ 82, 83 ], [ 82, 84 ], [ 75, 85 ], [ 85, 86 ], [ 86, 87 ], [ 86, 88 ], [ 88, 89 ], [ 89, 90 ], [ 89, 91 ], [ 88, 92 ], [ 92, 93 ], [ 92, 94 ], [ 94, 95 ], [ 94, 96 ], [ 85, 97 ], [ 97, 98 ], [ 98, 99 ], [ 98, 100 ], [ 100, 101 ], [ 100, 102 ], [ 97, 103 ], [ 103, 104 ], [ 104, 105 ], [ 104, 106 ], [ 106, 107 ], [ 106, 108 ], [ 103, 109 ], [ 109, 110 ], [ 110, 111 ], [ 110, 112 ], [ 109, 113 ], [ 113, 114 ], [ 113, 115 ], [ 115, 116 ], [ 115, 117 ], [ 25, 118 ], [ 118, 119 ], [ 119, 120 ], [ 120, 121 ], [ 120, 122 ], [ 118, 123 ], [ 23, 124 ], [ 124, 125 ], [ 308, 126 ], [ 126, 127 ], [ 126, 128 ], [ 128, 129 ], [ 129, 130 ], [ 129, 131 ], [ 128, 132 ], [ 132, 133 ], [ 133, 134 ], [ 133, 135 ], [ 132, 136 ], [ 136, 137 ], [ 137, 138 ], [ 138, 139 ], [ 139, 140 ], [ 139, 141 ], [ 138, 142 ], [ 137, 143 ], [ 143, 144 ], [ 144, 145 ], [ 143, 146 ], [ 136, 147 ], [ 147, 148 ], [ 147, 149 ], [ 149, 150 ], [ 150, 151 ], [ 150, 152 ], [ 149, 153 ], [ 136, 154 ], [ 154, 155 ], [ 155, 156 ], [ 156, 157 ], [ 156, 158 ], [ 155, 159 ], [ 154, 160 ], [ 160, 161 ], [ 161, 162 ], [ 162, 163 ], [ 162, 164 ], [ 161, 165 ], [ 165, 166 ], [ 165, 167 ], [ 160, 168 ], [ 168, 169 ], [ 169, 170 ], [ 169, 171 ], [ 168, 172 ], [ 172, 173 ], [ 154, 174 ], [ 174, 175 ], [ 175, 176 ], [ 176, 177 ], [ 176, 178 ], [ 174, 179 ], [ 179, 180 ], [ 180, 181 ], [ 180, 182 ], [ 179, 183 ], [ 174, 184 ], [ 184, 185 ], [ 128, 186 ], [ 186, 187 ], [ 186, 188 ], [ 128, 189 ], [ 189, 190 ], [ 190, 191 ], [ 191, 192 ], [ 191, 193 ], [ 189, 194 ], [ 194, 195 ], [ 194, 196 ], [ 189, 197 ], [ 197, 198 ], [ 198, 199 ], [ 189, 200 ], [ 201, 201 ], [ 201, 202 ], [ 202, 203 ], [ 203, 204 ], [ 204, 205 ], [ 205, 206 ], [ 204, 207 ], [ 207, 208 ], [ 207, 209 ], [ 203, 210 ], [ 202, 211 ], [ 211, 212 ], [ 128, 213 ], [ 213, 214 ], [ 126, 215 ], [ 215, 216 ], [ 126, 217 ], [ 217, 218 ], [ 308, 219 ], [ 219, 220 ], [ 219, 221 ], [ 221, 222 ], [ 219, 223 ], [ 223, 224 ], [ 219, 225 ], [ 225, 226 ], [ 225, 227 ], [ 227, 228 ], [ 228, 229 ], [ 228, 230 ], [ 219, 231 ], [ 231, 232 ], [ 231, 233 ], [ 233, 234 ], [ 234, 235 ], [ 235, 236 ], [ 236, 237 ], [ 236, 238 ], [ 235, 239 ], [ 239, 240 ], [ 240, 241 ], [ 241, 242 ], [ 234, 243 ], [ 243, 244 ], [ 244, 245 ], [ 245, 246 ], [ 245, 247 ], [ 247, 248 ], [ 248, 249 ], [ 249, 250 ], [ 244, 251 ], [ 251, 252 ], [ 252, 253 ], [ 252, 254 ], [ 233, 255 ], [ 255, 256 ], [ 256, 257 ], [ 257, 258 ], [ 219, 259 ], [ 259, 260 ], [ 259, 261 ], [ 261, 262 ], [ 262, 263 ], [ 263, 264 ], [ 264, 265 ], [ 263, 266 ], [ 266, 267 ], [ 219, 268 ], [ 268, 269 ], [ 268, 270 ], [ 270, 271 ], [ 271, 272 ], [ 272, 273 ], [ 273, 274 ], [ 272, 275 ], [ 275, 276 ], [ 219, 277 ], [ 277, 278 ], [ 277, 279 ], [ 279, 280 ], [ 280, 281 ], [ 281, 282 ], [ 282, 283 ], [ 281, 284 ], [ 284, 285 ], [ 219, 286 ], [ 286, 287 ], [ 286, 288 ], [ 288, 289 ], [ 289, 290 ], [ 289, 291 ], [ 288, 292 ], [ 292, 293 ], [ 293, 294 ], [ 293, 295 ], [ 295, 296 ], [ 296, 297 ], [ 297, 298 ], [ 292, 299 ], [ 299, 300 ], [ 300, 301 ], [ 300, 302 ], [ 302, 303 ], [ 303, 304 ], [ 288, 305 ], [ 305, 306 ], [ 0, 307 ], [ 307, 308 ], [ 307, 309 ] ]
[ "\n// import java.lang.*;\nimport java.util.*;\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n static List<Integer> al = new ArrayList<>();\n static int[] a;\n\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n\n static Set<String> se = new HashSet<>();\n\n public static void main(String[] args) {\n FastReader sc = new FastReader();\n // StringBuffer sb = new StringBuffer();\n // ArrayList<Integer> al=new ArrayList<>();\n \n // String s=sc.nextLine();\n\n\n\n // int n=sc.nextInt();\n // int x=sc.nextInt();\n // int t=sc.nextInt();\n\n // if(n>x)\n // {\n // if(n%x==0)\n // System.out.println((n/x)*t);\n // else\n // {\n // n /=x;\n // System.out.println((n+1)*t);\n // }\n\n // }\n // else\n // System.out.println(t);\n\n\n int n=sc.nextInt();\n long[] a=new long[n];\n for(int i=0;i<n;i++)\n a[i]=sc.nextLong();\n long c=0;\n for(int i=0;i<n-1;i++)\n {\n if(a[i]>a[i+1])\n {\n c += a[i]-a[i+1];\n a[i+1]=a[i+1]+(a[i]-a[i+1]);\n \n }\n\n }\n System.out.println(c);\n }\n \n\n \n static int findCounts(int arr[], int n) {\n // Traverse all array elements\n int i = 0;\n while (i < n) {\n // If this element is already processed,\n // then nothing to do\n if (arr[i] <= 0) {\n i++;\n continue;\n }\n\n // Find index corresponding to this element\n // For example, index for 5 is 4\n int elementIndex = arr[i] - 1;\n\n // If the elementIndex has an element that is not\n // processed yet, then first store that element\n // to arr[i] so that we don't lose anything.\n if (arr[elementIndex] > 0) {\n arr[i] = arr[elementIndex];\n\n // After storing arr[elementIndex], change it\n // to store initial count of 'arr[i]'\n arr[elementIndex] = -1;\n } else {\n // If this is NOT first occurrence of arr[i],\n // then decrement its count.\n arr[elementIndex]--;\n\n // And initialize arr[i] as 0 means the element\n // 'i+1' is not seen so far\n arr[i] = 0;\n i++;\n }\n }\n int sum = 0;\n\n for (int j = 1; j < n; j++) {\n if (Math.abs(arr[j]) > 1)\n sum++;\n }\n return sum;\n }\n\n // public static String sortString(String inputString)\n // {\n // // convert input string to Character array\n // Character tempArray[] = new Character[inputString.length()];\n // for (int i = 0; i < inputString.length(); i++) {\n // tempArray[i] = inputString.charAt(i);\n // }\n\n // // Sort, ignoring case during sorting\n // Arrays.sort(tempArray, new Comparator<Character>(){\n\n // @Override\n // public int compare(Character c1, Character c2)\n // {\n // // ignoring case\n // return Character.compare(Character.toLowerCase(c1),\n // Character.toLowerCase(c2));\n // }\n // });\n\n // // using StringBuilder to convert Character array to String\n // StringBuilder sb = new StringBuilder(tempArray.length);\n // for (Character c : tempArray)\n // sb.append(c.charValue());\n\n // return sb.toString();\n // }\n\n}", "import java.util.*;", "util.*", "java", "import java.io.BufferedReader;", "BufferedReader", "java.io", "import java.io.IOException;", "IOException", "java.io", "import java.io.InputStreamReader;", "InputStreamReader", "java.io", "public class Main {\n static List<Integer> al = new ArrayList<>();\n static int[] a;\n\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n\n static Set<String> se = new HashSet<>();\n\n public static void main(String[] args) {\n FastReader sc = new FastReader();\n // StringBuffer sb = new StringBuffer();\n // ArrayList<Integer> al=new ArrayList<>();\n \n // String s=sc.nextLine();\n\n\n\n // int n=sc.nextInt();\n // int x=sc.nextInt();\n // int t=sc.nextInt();\n\n // if(n>x)\n // {\n // if(n%x==0)\n // System.out.println((n/x)*t);\n // else\n // {\n // n /=x;\n // System.out.println((n+1)*t);\n // }\n\n // }\n // else\n // System.out.println(t);\n\n\n int n=sc.nextInt();\n long[] a=new long[n];\n for(int i=0;i<n;i++)\n a[i]=sc.nextLong();\n long c=0;\n for(int i=0;i<n-1;i++)\n {\n if(a[i]>a[i+1])\n {\n c += a[i]-a[i+1];\n a[i+1]=a[i+1]+(a[i]-a[i+1]);\n \n }\n\n }\n System.out.println(c);\n }\n \n\n \n static int findCounts(int arr[], int n) {\n // Traverse all array elements\n int i = 0;\n while (i < n) {\n // If this element is already processed,\n // then nothing to do\n if (arr[i] <= 0) {\n i++;\n continue;\n }\n\n // Find index corresponding to this element\n // For example, index for 5 is 4\n int elementIndex = arr[i] - 1;\n\n // If the elementIndex has an element that is not\n // processed yet, then first store that element\n // to arr[i] so that we don't lose anything.\n if (arr[elementIndex] > 0) {\n arr[i] = arr[elementIndex];\n\n // After storing arr[elementIndex], change it\n // to store initial count of 'arr[i]'\n arr[elementIndex] = -1;\n } else {\n // If this is NOT first occurrence of arr[i],\n // then decrement its count.\n arr[elementIndex]--;\n\n // And initialize arr[i] as 0 means the element\n // 'i+1' is not seen so far\n arr[i] = 0;\n i++;\n }\n }\n int sum = 0;\n\n for (int j = 1; j < n; j++) {\n if (Math.abs(arr[j]) > 1)\n sum++;\n }\n return sum;\n }\n\n // public static String sortString(String inputString)\n // {\n // // convert input string to Character array\n // Character tempArray[] = new Character[inputString.length()];\n // for (int i = 0; i < inputString.length(); i++) {\n // tempArray[i] = inputString.charAt(i);\n // }\n\n // // Sort, ignoring case during sorting\n // Arrays.sort(tempArray, new Comparator<Character>(){\n\n // @Override\n // public int compare(Character c1, Character c2)\n // {\n // // ignoring case\n // return Character.compare(Character.toLowerCase(c1),\n // Character.toLowerCase(c2));\n // }\n // });\n\n // // using StringBuilder to convert Character array to String\n // StringBuilder sb = new StringBuilder(tempArray.length);\n // for (Character c : tempArray)\n // sb.append(c.charValue());\n\n // return sb.toString();\n // }\n\n}", "Main", "static List<Integer> al = new ArrayList<>();", "al", "new ArrayList<>()", "static int[] a;", "a", "static Set<String> se = new HashSet<>();", "se", "new HashSet<>()", "public static void main(String[] args) {\n FastReader sc = new FastReader();\n // StringBuffer sb = new StringBuffer();\n // ArrayList<Integer> al=new ArrayList<>();\n \n // String s=sc.nextLine();\n\n\n\n // int n=sc.nextInt();\n // int x=sc.nextInt();\n // int t=sc.nextInt();\n\n // if(n>x)\n // {\n // if(n%x==0)\n // System.out.println((n/x)*t);\n // else\n // {\n // n /=x;\n // System.out.println((n+1)*t);\n // }\n\n // }\n // else\n // System.out.println(t);\n\n\n int n=sc.nextInt();\n long[] a=new long[n];\n for(int i=0;i<n;i++)\n a[i]=sc.nextLong();\n long c=0;\n for(int i=0;i<n-1;i++)\n {\n if(a[i]>a[i+1])\n {\n c += a[i]-a[i+1];\n a[i+1]=a[i+1]+(a[i]-a[i+1]);\n \n }\n\n }\n System.out.println(c);\n }", "main", "{\n FastReader sc = new FastReader();\n // StringBuffer sb = new StringBuffer();\n // ArrayList<Integer> al=new ArrayList<>();\n \n // String s=sc.nextLine();\n\n\n\n // int n=sc.nextInt();\n // int x=sc.nextInt();\n // int t=sc.nextInt();\n\n // if(n>x)\n // {\n // if(n%x==0)\n // System.out.println((n/x)*t);\n // else\n // {\n // n /=x;\n // System.out.println((n+1)*t);\n // }\n\n // }\n // else\n // System.out.println(t);\n\n\n int n=sc.nextInt();\n long[] a=new long[n];\n for(int i=0;i<n;i++)\n a[i]=sc.nextLong();\n long c=0;\n for(int i=0;i<n-1;i++)\n {\n if(a[i]>a[i+1])\n {\n c += a[i]-a[i+1];\n a[i+1]=a[i+1]+(a[i]-a[i+1]);\n \n }\n\n }\n System.out.println(c);\n }", "FastReader sc = new FastReader();", "sc", "new FastReader()", "int n=sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "long[] a=new long[n];", "a", "new long[n]", "n", "for(int i=0;i<n;i++)\n a[i]=sc.nextLong();", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "a[i]=sc.nextLong();", "a[i]=sc.nextLong()", "a[i]", "a", "i", "sc.nextLong()", "sc.nextLong", "sc", "long c=0;", "c", "0", "for(int i=0;i<n-1;i++)\n {\n if(a[i]>a[i+1])\n {\n c += a[i]-a[i+1];\n a[i+1]=a[i+1]+(a[i]-a[i+1]);\n \n }\n\n }", "int i=0;", "int i=0;", "i", "0", "i<n-1", "i", "n-1", "n", "1", "i++", "i++", "i", "{\n if(a[i]>a[i+1])\n {\n c += a[i]-a[i+1];\n a[i+1]=a[i+1]+(a[i]-a[i+1]);\n \n }\n\n }", "{\n if(a[i]>a[i+1])\n {\n c += a[i]-a[i+1];\n a[i+1]=a[i+1]+(a[i]-a[i+1]);\n \n }\n\n }", "if(a[i]>a[i+1])\n {\n c += a[i]-a[i+1];\n a[i+1]=a[i+1]+(a[i]-a[i+1]);\n \n }", "a[i]>a[i+1]", "a[i]", "a", "i", "a[i+1]", "a", "i+1", "i", "1", "{\n c += a[i]-a[i+1];\n a[i+1]=a[i+1]+(a[i]-a[i+1]);\n \n }", "c += a[i]-a[i+1]", "c", "a[i]-a[i+1]", "a[i]", "a", "i", "a[i+1]", "a", "i+1", "i", "1", "a[i+1]=a[i+1]+(a[i]-a[i+1])", "a[i+1]", "a", "i+1", "i", "1", "a[i+1]+(a[i]-a[i+1])", "a[i+1]", "a", "i+1", "i", "1", "(a[i]-a[i+1])", "a[i]", "a", "i", "a[i+1]", "a", "i+1", "i", "1", "System.out.println(c)", "System.out.println", "System.out", "System", "System.out", "c", "String[] args", "args", "static int findCounts(int arr[], int n) {\n // Traverse all array elements\n int i = 0;\n while (i < n) {\n // If this element is already processed,\n // then nothing to do\n if (arr[i] <= 0) {\n i++;\n continue;\n }\n\n // Find index corresponding to this element\n // For example, index for 5 is 4\n int elementIndex = arr[i] - 1;\n\n // If the elementIndex has an element that is not\n // processed yet, then first store that element\n // to arr[i] so that we don't lose anything.\n if (arr[elementIndex] > 0) {\n arr[i] = arr[elementIndex];\n\n // After storing arr[elementIndex], change it\n // to store initial count of 'arr[i]'\n arr[elementIndex] = -1;\n } else {\n // If this is NOT first occurrence of arr[i],\n // then decrement its count.\n arr[elementIndex]--;\n\n // And initialize arr[i] as 0 means the element\n // 'i+1' is not seen so far\n arr[i] = 0;\n i++;\n }\n }\n int sum = 0;\n\n for (int j = 1; j < n; j++) {\n if (Math.abs(arr[j]) > 1)\n sum++;\n }\n return sum;\n }", "findCounts", "{\n // Traverse all array elements\n int i = 0;\n while (i < n) {\n // If this element is already processed,\n // then nothing to do\n if (arr[i] <= 0) {\n i++;\n continue;\n }\n\n // Find index corresponding to this element\n // For example, index for 5 is 4\n int elementIndex = arr[i] - 1;\n\n // If the elementIndex has an element that is not\n // processed yet, then first store that element\n // to arr[i] so that we don't lose anything.\n if (arr[elementIndex] > 0) {\n arr[i] = arr[elementIndex];\n\n // After storing arr[elementIndex], change it\n // to store initial count of 'arr[i]'\n arr[elementIndex] = -1;\n } else {\n // If this is NOT first occurrence of arr[i],\n // then decrement its count.\n arr[elementIndex]--;\n\n // And initialize arr[i] as 0 means the element\n // 'i+1' is not seen so far\n arr[i] = 0;\n i++;\n }\n }\n int sum = 0;\n\n for (int j = 1; j < n; j++) {\n if (Math.abs(arr[j]) > 1)\n sum++;\n }\n return sum;\n }", "int i = 0;", "i", "0", "while (i < n) {\n // If this element is already processed,\n // then nothing to do\n if (arr[i] <= 0) {\n i++;\n continue;\n }\n\n // Find index corresponding to this element\n // For example, index for 5 is 4\n int elementIndex = arr[i] - 1;\n\n // If the elementIndex has an element that is not\n // processed yet, then first store that element\n // to arr[i] so that we don't lose anything.\n if (arr[elementIndex] > 0) {\n arr[i] = arr[elementIndex];\n\n // After storing arr[elementIndex], change it\n // to store initial count of 'arr[i]'\n arr[elementIndex] = -1;\n } else {\n // If this is NOT first occurrence of arr[i],\n // then decrement its count.\n arr[elementIndex]--;\n\n // And initialize arr[i] as 0 means the element\n // 'i+1' is not seen so far\n arr[i] = 0;\n i++;\n }\n }", "i < n", "i", "n", "{\n // If this element is already processed,\n // then nothing to do\n if (arr[i] <= 0) {\n i++;\n continue;\n }\n\n // Find index corresponding to this element\n // For example, index for 5 is 4\n int elementIndex = arr[i] - 1;\n\n // If the elementIndex has an element that is not\n // processed yet, then first store that element\n // to arr[i] so that we don't lose anything.\n if (arr[elementIndex] > 0) {\n arr[i] = arr[elementIndex];\n\n // After storing arr[elementIndex], change it\n // to store initial count of 'arr[i]'\n arr[elementIndex] = -1;\n } else {\n // If this is NOT first occurrence of arr[i],\n // then decrement its count.\n arr[elementIndex]--;\n\n // And initialize arr[i] as 0 means the element\n // 'i+1' is not seen so far\n arr[i] = 0;\n i++;\n }\n }", "if (arr[i] <= 0) {\n i++;\n continue;\n }", "arr[i] <= 0", "arr[i]", "arr", "i", "0", "{\n i++;\n continue;\n }", "i++", "i", "continue;", "int elementIndex = arr[i] - 1;", "elementIndex", "arr[i] - 1", "arr[i]", "arr", "i", "1", "if (arr[elementIndex] > 0) {\n arr[i] = arr[elementIndex];\n\n // After storing arr[elementIndex], change it\n // to store initial count of 'arr[i]'\n arr[elementIndex] = -1;\n } else {\n // If this is NOT first occurrence of arr[i],\n // then decrement its count.\n arr[elementIndex]--;\n\n // And initialize arr[i] as 0 means the element\n // 'i+1' is not seen so far\n arr[i] = 0;\n i++;\n }", "arr[elementIndex] > 0", "arr[elementIndex]", "arr", "elementIndex", "0", "{\n arr[i] = arr[elementIndex];\n\n // After storing arr[elementIndex], change it\n // to store initial count of 'arr[i]'\n arr[elementIndex] = -1;\n }", "arr[i] = arr[elementIndex]", "arr[i]", "arr", "i", "arr[elementIndex]", "arr", "elementIndex", "arr[elementIndex] = -1", "arr[elementIndex]", "arr", "elementIndex", "-1", "1", "{\n // If this is NOT first occurrence of arr[i],\n // then decrement its count.\n arr[elementIndex]--;\n\n // And initialize arr[i] as 0 means the element\n // 'i+1' is not seen so far\n arr[i] = 0;\n i++;\n }", "arr[elementIndex]--", "arr[elementIndex]", "arr", "elementIndex", "arr[i] = 0", "arr[i]", "arr", "i", "0", "i++", "i", "int sum = 0;", "sum", "0", "for (int j = 1; j < n; j++) {\n if (Math.abs(arr[j]) > 1)\n sum++;\n }", "int j = 1;", "int j = 1;", "j", "1", "j < n", "j", "n", "j++", "j++", "j", "{\n if (Math.abs(arr[j]) > 1)\n sum++;\n }", "{\n if (Math.abs(arr[j]) > 1)\n sum++;\n }", "if (Math.abs(arr[j]) > 1)\n sum++;", "Math.abs(arr[j]) > 1", "Math.abs(arr[j])", "Math.abs", "Math", "arr[j]", "arr", "j", "1", "sum++", "sum", "return sum;", "sum", "int arr[]", "arr", "int n", "n", "static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }", "FastReader", "BufferedReader br;", "br", "StringTokenizer st;", "st", "public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }", "FastReader", "{\n br = new BufferedReader(new InputStreamReader(System.in));\n }", "br = new BufferedReader(new InputStreamReader(System.in))", "br", "new BufferedReader(new InputStreamReader(System.in))", "String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }", "next", "{\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }", "while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "st == null || !st.hasMoreElements()", "st == null", "st", "null", "!st.hasMoreElements()", "st.hasMoreElements()", "st.hasMoreElements", "st", "{\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }", "catch (IOException e) {\n e.printStackTrace();\n }", "IOException e", "{\n e.printStackTrace();\n }", "e.printStackTrace()", "e.printStackTrace", "e", "{\n st = new StringTokenizer(br.readLine());\n }", "st = new StringTokenizer(br.readLine())", "st", "new StringTokenizer(br.readLine())", "return st.nextToken();", "st.nextToken()", "st.nextToken", "st", "int nextInt() {\n return Integer.parseInt(next());\n }", "nextInt", "{\n return Integer.parseInt(next());\n }", "return Integer.parseInt(next());", "Integer.parseInt(next())", "Integer.parseInt", "Integer", "next()", "next", "long nextLong() {\n return Long.parseLong(next());\n }", "nextLong", "{\n return Long.parseLong(next());\n }", "return Long.parseLong(next());", "Long.parseLong(next())", "Long.parseLong", "Long", "next()", "next", "double nextDouble() {\n return Double.parseDouble(next());\n }", "nextDouble", "{\n return Double.parseDouble(next());\n }", "return Double.parseDouble(next());", "Double.parseDouble(next())", "Double.parseDouble", "Double", "next()", "next", "String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }", "nextLine", "{\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }", "String str = \"\";", "str", "\"\"", "try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }", "catch (IOException e) {\n e.printStackTrace();\n }", "IOException e", "{\n e.printStackTrace();\n }", "e.printStackTrace()", "e.printStackTrace", "e", "{\n str = br.readLine();\n }", "str = br.readLine()", "str", "br.readLine()", "br.readLine", "br", "return str;", "str", "public class Main {\n static List<Integer> al = new ArrayList<>();\n static int[] a;\n\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n\n static Set<String> se = new HashSet<>();\n\n public static void main(String[] args) {\n FastReader sc = new FastReader();\n // StringBuffer sb = new StringBuffer();\n // ArrayList<Integer> al=new ArrayList<>();\n \n // String s=sc.nextLine();\n\n\n\n // int n=sc.nextInt();\n // int x=sc.nextInt();\n // int t=sc.nextInt();\n\n // if(n>x)\n // {\n // if(n%x==0)\n // System.out.println((n/x)*t);\n // else\n // {\n // n /=x;\n // System.out.println((n+1)*t);\n // }\n\n // }\n // else\n // System.out.println(t);\n\n\n int n=sc.nextInt();\n long[] a=new long[n];\n for(int i=0;i<n;i++)\n a[i]=sc.nextLong();\n long c=0;\n for(int i=0;i<n-1;i++)\n {\n if(a[i]>a[i+1])\n {\n c += a[i]-a[i+1];\n a[i+1]=a[i+1]+(a[i]-a[i+1]);\n \n }\n\n }\n System.out.println(c);\n }\n \n\n \n static int findCounts(int arr[], int n) {\n // Traverse all array elements\n int i = 0;\n while (i < n) {\n // If this element is already processed,\n // then nothing to do\n if (arr[i] <= 0) {\n i++;\n continue;\n }\n\n // Find index corresponding to this element\n // For example, index for 5 is 4\n int elementIndex = arr[i] - 1;\n\n // If the elementIndex has an element that is not\n // processed yet, then first store that element\n // to arr[i] so that we don't lose anything.\n if (arr[elementIndex] > 0) {\n arr[i] = arr[elementIndex];\n\n // After storing arr[elementIndex], change it\n // to store initial count of 'arr[i]'\n arr[elementIndex] = -1;\n } else {\n // If this is NOT first occurrence of arr[i],\n // then decrement its count.\n arr[elementIndex]--;\n\n // And initialize arr[i] as 0 means the element\n // 'i+1' is not seen so far\n arr[i] = 0;\n i++;\n }\n }\n int sum = 0;\n\n for (int j = 1; j < n; j++) {\n if (Math.abs(arr[j]) > 1)\n sum++;\n }\n return sum;\n }\n\n // public static String sortString(String inputString)\n // {\n // // convert input string to Character array\n // Character tempArray[] = new Character[inputString.length()];\n // for (int i = 0; i < inputString.length(); i++) {\n // tempArray[i] = inputString.charAt(i);\n // }\n\n // // Sort, ignoring case during sorting\n // Arrays.sort(tempArray, new Comparator<Character>(){\n\n // @Override\n // public int compare(Character c1, Character c2)\n // {\n // // ignoring case\n // return Character.compare(Character.toLowerCase(c1),\n // Character.toLowerCase(c2));\n // }\n // });\n\n // // using StringBuilder to convert Character array to String\n // StringBuilder sb = new StringBuilder(tempArray.length);\n // for (Character c : tempArray)\n // sb.append(c.charValue());\n\n // return sb.toString();\n // }\n\n}", "public class Main {\n static List<Integer> al = new ArrayList<>();\n static int[] a;\n\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n\n static Set<String> se = new HashSet<>();\n\n public static void main(String[] args) {\n FastReader sc = new FastReader();\n // StringBuffer sb = new StringBuffer();\n // ArrayList<Integer> al=new ArrayList<>();\n \n // String s=sc.nextLine();\n\n\n\n // int n=sc.nextInt();\n // int x=sc.nextInt();\n // int t=sc.nextInt();\n\n // if(n>x)\n // {\n // if(n%x==0)\n // System.out.println((n/x)*t);\n // else\n // {\n // n /=x;\n // System.out.println((n+1)*t);\n // }\n\n // }\n // else\n // System.out.println(t);\n\n\n int n=sc.nextInt();\n long[] a=new long[n];\n for(int i=0;i<n;i++)\n a[i]=sc.nextLong();\n long c=0;\n for(int i=0;i<n-1;i++)\n {\n if(a[i]>a[i+1])\n {\n c += a[i]-a[i+1];\n a[i+1]=a[i+1]+(a[i]-a[i+1]);\n \n }\n\n }\n System.out.println(c);\n }\n \n\n \n static int findCounts(int arr[], int n) {\n // Traverse all array elements\n int i = 0;\n while (i < n) {\n // If this element is already processed,\n // then nothing to do\n if (arr[i] <= 0) {\n i++;\n continue;\n }\n\n // Find index corresponding to this element\n // For example, index for 5 is 4\n int elementIndex = arr[i] - 1;\n\n // If the elementIndex has an element that is not\n // processed yet, then first store that element\n // to arr[i] so that we don't lose anything.\n if (arr[elementIndex] > 0) {\n arr[i] = arr[elementIndex];\n\n // After storing arr[elementIndex], change it\n // to store initial count of 'arr[i]'\n arr[elementIndex] = -1;\n } else {\n // If this is NOT first occurrence of arr[i],\n // then decrement its count.\n arr[elementIndex]--;\n\n // And initialize arr[i] as 0 means the element\n // 'i+1' is not seen so far\n arr[i] = 0;\n i++;\n }\n }\n int sum = 0;\n\n for (int j = 1; j < n; j++) {\n if (Math.abs(arr[j]) > 1)\n sum++;\n }\n return sum;\n }\n\n // public static String sortString(String inputString)\n // {\n // // convert input string to Character array\n // Character tempArray[] = new Character[inputString.length()];\n // for (int i = 0; i < inputString.length(); i++) {\n // tempArray[i] = inputString.charAt(i);\n // }\n\n // // Sort, ignoring case during sorting\n // Arrays.sort(tempArray, new Comparator<Character>(){\n\n // @Override\n // public int compare(Character c1, Character c2)\n // {\n // // ignoring case\n // return Character.compare(Character.toLowerCase(c1),\n // Character.toLowerCase(c2));\n // }\n // });\n\n // // using StringBuilder to convert Character array to String\n // StringBuilder sb = new StringBuilder(tempArray.length);\n // for (Character c : tempArray)\n // sb.append(c.charValue());\n\n // return sb.toString();\n // }\n\n}", "Main" ]
// import java.lang.*; import java.util.*; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { static List<Integer> al = new ArrayList<>(); static int[] a; static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while (st == null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } String nextLine() { String str = ""; try { str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } } static Set<String> se = new HashSet<>(); public static void main(String[] args) { FastReader sc = new FastReader(); // StringBuffer sb = new StringBuffer(); // ArrayList<Integer> al=new ArrayList<>(); // String s=sc.nextLine(); // int n=sc.nextInt(); // int x=sc.nextInt(); // int t=sc.nextInt(); // if(n>x) // { // if(n%x==0) // System.out.println((n/x)*t); // else // { // n /=x; // System.out.println((n+1)*t); // } // } // else // System.out.println(t); int n=sc.nextInt(); long[] a=new long[n]; for(int i=0;i<n;i++) a[i]=sc.nextLong(); long c=0; for(int i=0;i<n-1;i++) { if(a[i]>a[i+1]) { c += a[i]-a[i+1]; a[i+1]=a[i+1]+(a[i]-a[i+1]); } } System.out.println(c); } static int findCounts(int arr[], int n) { // Traverse all array elements int i = 0; while (i < n) { // If this element is already processed, // then nothing to do if (arr[i] <= 0) { i++; continue; } // Find index corresponding to this element // For example, index for 5 is 4 int elementIndex = arr[i] - 1; // If the elementIndex has an element that is not // processed yet, then first store that element // to arr[i] so that we don't lose anything. if (arr[elementIndex] > 0) { arr[i] = arr[elementIndex]; // After storing arr[elementIndex], change it // to store initial count of 'arr[i]' arr[elementIndex] = -1; } else { // If this is NOT first occurrence of arr[i], // then decrement its count. arr[elementIndex]--; // And initialize arr[i] as 0 means the element // 'i+1' is not seen so far arr[i] = 0; i++; } } int sum = 0; for (int j = 1; j < n; j++) { if (Math.abs(arr[j]) > 1) sum++; } return sum; } // public static String sortString(String inputString) // { // // convert input string to Character array // Character tempArray[] = new Character[inputString.length()]; // for (int i = 0; i < inputString.length(); i++) { // tempArray[i] = inputString.charAt(i); // } // // Sort, ignoring case during sorting // Arrays.sort(tempArray, new Comparator<Character>(){ // @Override // public int compare(Character c1, Character c2) // { // // ignoring case // return Character.compare(Character.toLowerCase(c1), // Character.toLowerCase(c2)); // } // }); // // using StringBuilder to convert Character array to String // StringBuilder sb = new StringBuilder(tempArray.length); // for (Character c : tempArray) // sb.append(c.charValue()); // return sb.toString(); // } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 41, 13, 18, 13, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 18, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 4, 18, 18, 13, 13, 18, 13, 2, 13, 17, 40, 17, 30, 41, 13, 4, 18, 18, 13, 2, 13, 17, 18, 13, 13, 0, 13, 4, 18, 13, 13, 0, 18, 13, 13, 18, 13, 2, 13, 17, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 112, 8 ], [ 112, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 11, 24 ], [ 24, 25 ], [ 24, 26 ], [ 26, 27 ], [ 26, 28 ], [ 11, 29 ], [ 29, 30 ], [ 30, 31 ], [ 31, 32 ], [ 31, 33 ], [ 29, 34 ], [ 34, 35 ], [ 34, 36 ], [ 29, 37 ], [ 37, 38 ], [ 38, 39 ], [ 29, 40 ], [ 40, 41 ], [ 41, 42 ], [ 42, 43 ], [ 42, 44 ], [ 41, 45 ], [ 45, 46 ], [ 46, 47 ], [ 11, 48 ], [ 48, 49 ], [ 49, 50 ], [ 50, 51 ], [ 50, 52 ], [ 48, 53 ], [ 53, 54 ], [ 53, 55 ], [ 48, 56 ], [ 56, 57 ], [ 57, 58 ], [ 48, 59 ], [ 60, 60 ], [ 60, 61 ], [ 61, 62 ], [ 62, 63 ], [ 63, 64 ], [ 64, 65 ], [ 65, 66 ], [ 65, 67 ], [ 63, 68 ], [ 68, 69 ], [ 68, 70 ], [ 70, 71 ], [ 70, 72 ], [ 62, 73 ], [ 73, 74 ], [ 61, 75 ], [ 75, 76 ], [ 76, 77 ], [ 76, 78 ], [ 78, 79 ], [ 79, 80 ], [ 80, 81 ], [ 80, 82 ], [ 82, 83 ], [ 82, 84 ], [ 78, 85 ], [ 85, 86 ], [ 85, 87 ], [ 75, 88 ], [ 88, 89 ], [ 88, 90 ], [ 90, 91 ], [ 91, 92 ], [ 90, 93 ], [ 75, 94 ], [ 94, 95 ], [ 95, 96 ], [ 95, 97 ], [ 94, 98 ], [ 98, 99 ], [ 98, 100 ], [ 100, 101 ], [ 100, 102 ], [ 11, 103 ], [ 103, 104 ], [ 104, 105 ], [ 105, 106 ], [ 105, 107 ], [ 103, 108 ], [ 9, 109 ], [ 109, 110 ], [ 0, 111 ], [ 111, 112 ], [ 111, 113 ] ]
[ "import java.math.BigInteger;\nimport java.util.*;\npublic class Main{\n\tpublic static void main(String[] args){\n Scanner sc= new Scanner(System.in);\n int n = sc.nextInt();\n BigInteger a[] = new BigInteger[n];\n BigInteger stool = BigInteger.ZERO;\n for(int i=0;i<n;i++)\n a[i] = sc.nextBigInteger();\n\n for(int i=1;i<n;i++){\n \tif(a[i].compareTo(a[i-1])==-1){\n \t\tBigInteger x = (a[i-1].subtract(a[i]));\n \t\tstool = stool.add(x);\n \t\ta[i] = a[i-1];\n \t}\n }\n System.out.println(stool);\n\n \t}\n}\n", "import java.math.BigInteger;", "BigInteger", "java.math", "import java.util.*;", "util.*", "java", "public class Main{\n\tpublic static void main(String[] args){\n Scanner sc= new Scanner(System.in);\n int n = sc.nextInt();\n BigInteger a[] = new BigInteger[n];\n BigInteger stool = BigInteger.ZERO;\n for(int i=0;i<n;i++)\n a[i] = sc.nextBigInteger();\n\n for(int i=1;i<n;i++){\n \tif(a[i].compareTo(a[i-1])==-1){\n \t\tBigInteger x = (a[i-1].subtract(a[i]));\n \t\tstool = stool.add(x);\n \t\ta[i] = a[i-1];\n \t}\n }\n System.out.println(stool);\n\n \t}\n}", "Main", "public static void main(String[] args){\n Scanner sc= new Scanner(System.in);\n int n = sc.nextInt();\n BigInteger a[] = new BigInteger[n];\n BigInteger stool = BigInteger.ZERO;\n for(int i=0;i<n;i++)\n a[i] = sc.nextBigInteger();\n\n for(int i=1;i<n;i++){\n \tif(a[i].compareTo(a[i-1])==-1){\n \t\tBigInteger x = (a[i-1].subtract(a[i]));\n \t\tstool = stool.add(x);\n \t\ta[i] = a[i-1];\n \t}\n }\n System.out.println(stool);\n\n \t}", "main", "{\n Scanner sc= new Scanner(System.in);\n int n = sc.nextInt();\n BigInteger a[] = new BigInteger[n];\n BigInteger stool = BigInteger.ZERO;\n for(int i=0;i<n;i++)\n a[i] = sc.nextBigInteger();\n\n for(int i=1;i<n;i++){\n \tif(a[i].compareTo(a[i-1])==-1){\n \t\tBigInteger x = (a[i-1].subtract(a[i]));\n \t\tstool = stool.add(x);\n \t\ta[i] = a[i-1];\n \t}\n }\n System.out.println(stool);\n\n \t}", "Scanner sc= new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "BigInteger a[] = new BigInteger[n];", "a", "new BigInteger[n]", "n", "BigInteger stool = BigInteger.ZERO;", "stool", "BigInteger.ZERO", "BigInteger", "BigInteger.ZERO", "for(int i=0;i<n;i++)\n a[i] = sc.nextBigInteger();", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "a[i] = sc.nextBigInteger();", "a[i] = sc.nextBigInteger()", "a[i]", "a", "i", "sc.nextBigInteger()", "sc.nextBigInteger", "sc", "for(int i=1;i<n;i++){\n \tif(a[i].compareTo(a[i-1])==-1){\n \t\tBigInteger x = (a[i-1].subtract(a[i]));\n \t\tstool = stool.add(x);\n \t\ta[i] = a[i-1];\n \t}\n }", "int i=1;", "int i=1;", "i", "1", "i<n", "i", "n", "i++", "i++", "i", "{\n \tif(a[i].compareTo(a[i-1])==-1){\n \t\tBigInteger x = (a[i-1].subtract(a[i]));\n \t\tstool = stool.add(x);\n \t\ta[i] = a[i-1];\n \t}\n }", "{\n \tif(a[i].compareTo(a[i-1])==-1){\n \t\tBigInteger x = (a[i-1].subtract(a[i]));\n \t\tstool = stool.add(x);\n \t\ta[i] = a[i-1];\n \t}\n }", "if(a[i].compareTo(a[i-1])==-1){\n \t\tBigInteger x = (a[i-1].subtract(a[i]));\n \t\tstool = stool.add(x);\n \t\ta[i] = a[i-1];\n \t}", "a[i].compareTo(a[i-1])==-1", "a[i].compareTo(a[i-1])", "a[i].compareTo", "a[i]", "a", "i", "a[i-1]", "a", "i-1", "i", "1", "-1", "1", "{\n \t\tBigInteger x = (a[i-1].subtract(a[i]));\n \t\tstool = stool.add(x);\n \t\ta[i] = a[i-1];\n \t}", "BigInteger x = (a[i-1].subtract(a[i]));", "x", "(a[i-1].subtract(a[i]))", "a[i-1].subtract", "a[i-1]", "a", "i-1", "i", "1", "a[i]", "a", "i", "stool = stool.add(x)", "stool", "stool.add(x)", "stool.add", "stool", "x", "a[i] = a[i-1]", "a[i]", "a", "i", "a[i-1]", "a", "i-1", "i", "1", "System.out.println(stool)", "System.out.println", "System.out", "System", "System.out", "stool", "String[] args", "args", "public class Main{\n\tpublic static void main(String[] args){\n Scanner sc= new Scanner(System.in);\n int n = sc.nextInt();\n BigInteger a[] = new BigInteger[n];\n BigInteger stool = BigInteger.ZERO;\n for(int i=0;i<n;i++)\n a[i] = sc.nextBigInteger();\n\n for(int i=1;i<n;i++){\n \tif(a[i].compareTo(a[i-1])==-1){\n \t\tBigInteger x = (a[i-1].subtract(a[i]));\n \t\tstool = stool.add(x);\n \t\ta[i] = a[i-1];\n \t}\n }\n System.out.println(stool);\n\n \t}\n}", "public class Main{\n\tpublic static void main(String[] args){\n Scanner sc= new Scanner(System.in);\n int n = sc.nextInt();\n BigInteger a[] = new BigInteger[n];\n BigInteger stool = BigInteger.ZERO;\n for(int i=0;i<n;i++)\n a[i] = sc.nextBigInteger();\n\n for(int i=1;i<n;i++){\n \tif(a[i].compareTo(a[i-1])==-1){\n \t\tBigInteger x = (a[i-1].subtract(a[i]));\n \t\tstool = stool.add(x);\n \t\ta[i] = a[i-1];\n \t}\n }\n System.out.println(stool);\n\n \t}\n}", "Main" ]
import java.math.BigInteger; import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc= new Scanner(System.in); int n = sc.nextInt(); BigInteger a[] = new BigInteger[n]; BigInteger stool = BigInteger.ZERO; for(int i=0;i<n;i++) a[i] = sc.nextBigInteger(); for(int i=1;i<n;i++){ if(a[i].compareTo(a[i-1])==-1){ BigInteger x = (a[i-1].subtract(a[i])); stool = stool.add(x); a[i] = a[i-1]; } } System.out.println(stool); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 18, 13, 2, 13, 17, 18, 13, 13, 30, 0, 13, 2, 18, 13, 2, 13, 17, 18, 13, 13, 0, 18, 13, 13, 18, 13, 2, 13, 17, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 97, 5 ], [ 97, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 8, 21 ], [ 21, 22 ], [ 22, 23 ], [ 23, 24 ], [ 23, 25 ], [ 21, 26 ], [ 26, 27 ], [ 26, 28 ], [ 21, 29 ], [ 29, 30 ], [ 30, 31 ], [ 21, 32 ], [ 33, 33 ], [ 33, 34 ], [ 34, 35 ], [ 35, 36 ], [ 35, 37 ], [ 34, 38 ], [ 38, 39 ], [ 39, 40 ], [ 8, 41 ], [ 41, 42 ], [ 41, 43 ], [ 8, 44 ], [ 44, 45 ], [ 45, 46 ], [ 46, 47 ], [ 46, 48 ], [ 44, 49 ], [ 49, 50 ], [ 49, 51 ], [ 44, 52 ], [ 52, 53 ], [ 53, 54 ], [ 44, 55 ], [ 56, 56 ], [ 56, 57 ], [ 57, 58 ], [ 58, 59 ], [ 59, 60 ], [ 59, 61 ], [ 61, 62 ], [ 61, 63 ], [ 58, 64 ], [ 64, 65 ], [ 64, 66 ], [ 57, 67 ], [ 67, 68 ], [ 68, 69 ], [ 68, 70 ], [ 70, 71 ], [ 71, 72 ], [ 71, 73 ], [ 73, 74 ], [ 73, 75 ], [ 70, 76 ], [ 76, 77 ], [ 76, 78 ], [ 67, 79 ], [ 79, 80 ], [ 80, 81 ], [ 80, 82 ], [ 79, 83 ], [ 83, 84 ], [ 83, 85 ], [ 85, 86 ], [ 85, 87 ], [ 8, 88 ], [ 88, 89 ], [ 89, 90 ], [ 90, 91 ], [ 90, 92 ], [ 88, 93 ], [ 6, 94 ], [ 94, 95 ], [ 0, 96 ], [ 96, 97 ], [ 96, 98 ] ]
[ "import java.util.Scanner;\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner stdIn = new Scanner(System.in);\n\t\t\n\t\tint n = stdIn.nextInt();\n\t\tint[] a = new int[n];\n\t\t\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\ta[i] = stdIn.nextInt();\n\t\t}\n\t\tlong ans = 0;\n\t\t\n\t\tfor(int i = 1; i < n; i++) {\n\t\t\tif(a[i-1] > a[i]) {\n\t\t\t\tans += a[i-1] - a[i];\n\t\t\t\ta[i] = a[i-1];\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(ans);\n\t\t\n\n\t}\n\n}", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner stdIn = new Scanner(System.in);\n\t\t\n\t\tint n = stdIn.nextInt();\n\t\tint[] a = new int[n];\n\t\t\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\ta[i] = stdIn.nextInt();\n\t\t}\n\t\tlong ans = 0;\n\t\t\n\t\tfor(int i = 1; i < n; i++) {\n\t\t\tif(a[i-1] > a[i]) {\n\t\t\t\tans += a[i-1] - a[i];\n\t\t\t\ta[i] = a[i-1];\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(ans);\n\t\t\n\n\t}\n\n}", "Main", "public static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner stdIn = new Scanner(System.in);\n\t\t\n\t\tint n = stdIn.nextInt();\n\t\tint[] a = new int[n];\n\t\t\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\ta[i] = stdIn.nextInt();\n\t\t}\n\t\tlong ans = 0;\n\t\t\n\t\tfor(int i = 1; i < n; i++) {\n\t\t\tif(a[i-1] > a[i]) {\n\t\t\t\tans += a[i-1] - a[i];\n\t\t\t\ta[i] = a[i-1];\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(ans);\n\t\t\n\n\t}", "main", "{\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner stdIn = new Scanner(System.in);\n\t\t\n\t\tint n = stdIn.nextInt();\n\t\tint[] a = new int[n];\n\t\t\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\ta[i] = stdIn.nextInt();\n\t\t}\n\t\tlong ans = 0;\n\t\t\n\t\tfor(int i = 1; i < n; i++) {\n\t\t\tif(a[i-1] > a[i]) {\n\t\t\t\tans += a[i-1] - a[i];\n\t\t\t\ta[i] = a[i-1];\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(ans);\n\t\t\n\n\t}", "Scanner stdIn = new Scanner(System.in);", "stdIn", "new Scanner(System.in)", "int n = stdIn.nextInt();", "n", "stdIn.nextInt()", "stdIn.nextInt", "stdIn", "int[] a = new int[n];", "a", "new int[n]", "n", "for(int i = 0; i < n; i++) {\n\t\t\ta[i] = stdIn.nextInt();\n\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n\t\t\ta[i] = stdIn.nextInt();\n\t\t}", "{\n\t\t\ta[i] = stdIn.nextInt();\n\t\t}", "a[i] = stdIn.nextInt()", "a[i]", "a", "i", "stdIn.nextInt()", "stdIn.nextInt", "stdIn", "long ans = 0;", "ans", "0", "for(int i = 1; i < n; i++) {\n\t\t\tif(a[i-1] > a[i]) {\n\t\t\t\tans += a[i-1] - a[i];\n\t\t\t\ta[i] = a[i-1];\n\t\t\t}\n\t\t}", "int i = 1;", "int i = 1;", "i", "1", "i < n", "i", "n", "i++", "i++", "i", "{\n\t\t\tif(a[i-1] > a[i]) {\n\t\t\t\tans += a[i-1] - a[i];\n\t\t\t\ta[i] = a[i-1];\n\t\t\t}\n\t\t}", "{\n\t\t\tif(a[i-1] > a[i]) {\n\t\t\t\tans += a[i-1] - a[i];\n\t\t\t\ta[i] = a[i-1];\n\t\t\t}\n\t\t}", "if(a[i-1] > a[i]) {\n\t\t\t\tans += a[i-1] - a[i];\n\t\t\t\ta[i] = a[i-1];\n\t\t\t}", "a[i-1] > a[i]", "a[i-1]", "a", "i-1", "i", "1", "a[i]", "a", "i", "{\n\t\t\t\tans += a[i-1] - a[i];\n\t\t\t\ta[i] = a[i-1];\n\t\t\t}", "ans += a[i-1] - a[i]", "ans", "a[i-1] - a[i]", "a[i-1]", "a", "i-1", "i", "1", "a[i]", "a", "i", "a[i] = a[i-1]", "a[i]", "a", "i", "a[i-1]", "a", "i-1", "i", "1", "System.out.println(ans)", "System.out.println", "System.out", "System", "System.out", "ans", "String[] args", "args", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner stdIn = new Scanner(System.in);\n\t\t\n\t\tint n = stdIn.nextInt();\n\t\tint[] a = new int[n];\n\t\t\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\ta[i] = stdIn.nextInt();\n\t\t}\n\t\tlong ans = 0;\n\t\t\n\t\tfor(int i = 1; i < n; i++) {\n\t\t\tif(a[i-1] > a[i]) {\n\t\t\t\tans += a[i-1] - a[i];\n\t\t\t\ta[i] = a[i-1];\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(ans);\n\t\t\n\n\t}\n\n}", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner stdIn = new Scanner(System.in);\n\t\t\n\t\tint n = stdIn.nextInt();\n\t\tint[] a = new int[n];\n\t\t\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\ta[i] = stdIn.nextInt();\n\t\t}\n\t\tlong ans = 0;\n\t\t\n\t\tfor(int i = 1; i < n; i++) {\n\t\t\tif(a[i-1] > a[i]) {\n\t\t\t\tans += a[i-1] - a[i];\n\t\t\t\ta[i] = a[i-1];\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(ans);\n\t\t\n\n\t}\n\n}", "Main" ]
import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner stdIn = new Scanner(System.in); int n = stdIn.nextInt(); int[] a = new int[n]; for(int i = 0; i < n; i++) { a[i] = stdIn.nextInt(); } long ans = 0; for(int i = 1; i < n; i++) { if(a[i-1] > a[i]) { ans += a[i-1] - a[i]; a[i] = a[i-1]; } } System.out.println(ans); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 38, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 41, 13, 4, 18, 13, 14, 2, 13, 13, 30, 0, 13, 2, 13, 13, 30, 0, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 66, 5 ], [ 66, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 10, 11 ], [ 11, 12 ], [ 11, 13 ], [ 10, 14 ], [ 14, 15 ], [ 14, 16 ], [ 16, 17 ], [ 17, 18 ], [ 10, 19 ], [ 19, 20 ], [ 19, 21 ], [ 10, 22 ], [ 22, 23 ], [ 22, 24 ], [ 10, 25 ], [ 25, 26 ], [ 26, 27 ], [ 27, 28 ], [ 27, 29 ], [ 25, 30 ], [ 30, 31 ], [ 30, 32 ], [ 25, 33 ], [ 33, 34 ], [ 34, 35 ], [ 25, 36 ], [ 37, 37 ], [ 37, 38 ], [ 38, 39 ], [ 38, 40 ], [ 40, 41 ], [ 41, 42 ], [ 37, 43 ], [ 43, 44 ], [ 44, 45 ], [ 44, 46 ], [ 43, 47 ], [ 47, 48 ], [ 48, 49 ], [ 48, 50 ], [ 50, 51 ], [ 50, 52 ], [ 43, 53 ], [ 53, 54 ], [ 54, 55 ], [ 54, 56 ], [ 10, 57 ], [ 57, 58 ], [ 58, 59 ], [ 59, 60 ], [ 59, 61 ], [ 57, 62 ], [ 6, 63 ], [ 63, 64 ], [ 0, 65 ], [ 65, 66 ], [ 65, 67 ] ]
[ "\nimport java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args){\n\t\ttry(Scanner sc = new Scanner(System.in)) {\n\t\t\t\n\t\t\tint n = sc.nextInt();\n\t\t\t\n\t\t\tlong sum = 0;\n\t\t\tlong prev = 0;\n\t\t\t\n\t\t\tfor(int i = 0 ; i < n ; i++ ) {\n\t\t\t\tlong current = sc.nextLong();\n\t\t\t\t\n\t\t\t\tif ( current < prev ) {\n\t\t\t\t\tsum += prev - current;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tprev = current;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(sum);\n\t\t}\n\t}\n\n}", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\tpublic static void main(String[] args){\n\t\ttry(Scanner sc = new Scanner(System.in)) {\n\t\t\t\n\t\t\tint n = sc.nextInt();\n\t\t\t\n\t\t\tlong sum = 0;\n\t\t\tlong prev = 0;\n\t\t\t\n\t\t\tfor(int i = 0 ; i < n ; i++ ) {\n\t\t\t\tlong current = sc.nextLong();\n\t\t\t\t\n\t\t\t\tif ( current < prev ) {\n\t\t\t\t\tsum += prev - current;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tprev = current;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(sum);\n\t\t}\n\t}\n\n}", "Main", "public static void main(String[] args){\n\t\ttry(Scanner sc = new Scanner(System.in)) {\n\t\t\t\n\t\t\tint n = sc.nextInt();\n\t\t\t\n\t\t\tlong sum = 0;\n\t\t\tlong prev = 0;\n\t\t\t\n\t\t\tfor(int i = 0 ; i < n ; i++ ) {\n\t\t\t\tlong current = sc.nextLong();\n\t\t\t\t\n\t\t\t\tif ( current < prev ) {\n\t\t\t\t\tsum += prev - current;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tprev = current;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(sum);\n\t\t}\n\t}", "main", "{\n\t\ttry(Scanner sc = new Scanner(System.in)) {\n\t\t\t\n\t\t\tint n = sc.nextInt();\n\t\t\t\n\t\t\tlong sum = 0;\n\t\t\tlong prev = 0;\n\t\t\t\n\t\t\tfor(int i = 0 ; i < n ; i++ ) {\n\t\t\t\tlong current = sc.nextLong();\n\t\t\t\t\n\t\t\t\tif ( current < prev ) {\n\t\t\t\t\tsum += prev - current;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tprev = current;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(sum);\n\t\t}\n\t}", "try(Scanner sc = new Scanner(System.in)) {\n\t\t\t\n\t\t\tint n = sc.nextInt();\n\t\t\t\n\t\t\tlong sum = 0;\n\t\t\tlong prev = 0;\n\t\t\t\n\t\t\tfor(int i = 0 ; i < n ; i++ ) {\n\t\t\t\tlong current = sc.nextLong();\n\t\t\t\t\n\t\t\t\tif ( current < prev ) {\n\t\t\t\t\tsum += prev - current;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tprev = current;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(sum);\n\t\t}", "{\n\t\t\t\n\t\t\tint n = sc.nextInt();\n\t\t\t\n\t\t\tlong sum = 0;\n\t\t\tlong prev = 0;\n\t\t\t\n\t\t\tfor(int i = 0 ; i < n ; i++ ) {\n\t\t\t\tlong current = sc.nextLong();\n\t\t\t\t\n\t\t\t\tif ( current < prev ) {\n\t\t\t\t\tsum += prev - current;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tprev = current;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(sum);\n\t\t}", "Scanner sc = new Scanner(System.in)", "Scanner sc = new Scanner(System.in)", "new Scanner(System.in)", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "long sum = 0;", "sum", "0", "long prev = 0;", "prev", "0", "for(int i = 0 ; i < n ; i++ ) {\n\t\t\t\tlong current = sc.nextLong();\n\t\t\t\t\n\t\t\t\tif ( current < prev ) {\n\t\t\t\t\tsum += prev - current;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tprev = current;\n\t\t\t\t}\n\t\t\t}", "int i = 0 ;", "int i = 0 ;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n\t\t\t\tlong current = sc.nextLong();\n\t\t\t\t\n\t\t\t\tif ( current < prev ) {\n\t\t\t\t\tsum += prev - current;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tprev = current;\n\t\t\t\t}\n\t\t\t}", "{\n\t\t\t\tlong current = sc.nextLong();\n\t\t\t\t\n\t\t\t\tif ( current < prev ) {\n\t\t\t\t\tsum += prev - current;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tprev = current;\n\t\t\t\t}\n\t\t\t}", "long current = sc.nextLong();", "current", "sc.nextLong()", "sc.nextLong", "sc", "if ( current < prev ) {\n\t\t\t\t\tsum += prev - current;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tprev = current;\n\t\t\t\t}", "current < prev", "current", "prev", "{\n\t\t\t\t\tsum += prev - current;\n\t\t\t\t}", "sum += prev - current", "sum", "prev - current", "prev", "current", "{\n\t\t\t\t\tprev = current;\n\t\t\t\t}", "prev = current", "prev", "current", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "String[] args", "args", "public class Main {\n\tpublic static void main(String[] args){\n\t\ttry(Scanner sc = new Scanner(System.in)) {\n\t\t\t\n\t\t\tint n = sc.nextInt();\n\t\t\t\n\t\t\tlong sum = 0;\n\t\t\tlong prev = 0;\n\t\t\t\n\t\t\tfor(int i = 0 ; i < n ; i++ ) {\n\t\t\t\tlong current = sc.nextLong();\n\t\t\t\t\n\t\t\t\tif ( current < prev ) {\n\t\t\t\t\tsum += prev - current;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tprev = current;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(sum);\n\t\t}\n\t}\n\n}", "public class Main {\n\tpublic static void main(String[] args){\n\t\ttry(Scanner sc = new Scanner(System.in)) {\n\t\t\t\n\t\t\tint n = sc.nextInt();\n\t\t\t\n\t\t\tlong sum = 0;\n\t\t\tlong prev = 0;\n\t\t\t\n\t\t\tfor(int i = 0 ; i < n ; i++ ) {\n\t\t\t\tlong current = sc.nextLong();\n\t\t\t\t\n\t\t\t\tif ( current < prev ) {\n\t\t\t\t\tsum += prev - current;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tprev = current;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(sum);\n\t\t}\n\t}\n\n}", "Main" ]
import java.util.Scanner; public class Main { public static void main(String[] args){ try(Scanner sc = new Scanner(System.in)) { int n = sc.nextInt(); long sum = 0; long prev = 0; for(int i = 0 ; i < n ; i++ ) { long current = sc.nextLong(); if ( current < prev ) { sum += prev - current; } else { prev = current; } } System.out.println(sum); } } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 41, 13, 18, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 18, 13, 13, 13, 30, 0, 13, 18, 13, 13, 9, 30, 0, 13, 2, 13, 18, 13, 13, 0, 18, 13, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 11, 24 ], [ 24, 25 ], [ 25, 26 ], [ 26, 27 ], [ 26, 28 ], [ 24, 29 ], [ 29, 30 ], [ 29, 31 ], [ 24, 32 ], [ 32, 33 ], [ 33, 34 ], [ 24, 35 ], [ 36, 36 ], [ 36, 37 ], [ 37, 38 ], [ 38, 39 ], [ 38, 40 ], [ 37, 41 ], [ 41, 42 ], [ 42, 43 ], [ 11, 44 ], [ 44, 45 ], [ 44, 46 ], [ 46, 47 ], [ 46, 48 ], [ 11, 49 ], [ 49, 50 ], [ 49, 51 ], [ 11, 52 ], [ 52, 53 ], [ 53, 54 ], [ 54, 55 ], [ 54, 56 ], [ 52, 57 ], [ 57, 58 ], [ 57, 59 ], [ 52, 60 ], [ 60, 61 ], [ 61, 62 ], [ 52, 63 ], [ 64, 64 ], [ 64, 65 ], [ 65, 66 ], [ 66, 67 ], [ 67, 68 ], [ 67, 69 ], [ 66, 70 ], [ 65, 71 ], [ 71, 72 ], [ 72, 73 ], [ 72, 74 ], [ 74, 75 ], [ 74, 76 ], [ 71, 77 ], [ 65, 78 ], [ 78, 79 ], [ 79, 80 ], [ 79, 81 ], [ 81, 82 ], [ 81, 83 ], [ 83, 84 ], [ 83, 85 ], [ 78, 86 ], [ 86, 87 ], [ 87, 88 ], [ 87, 89 ], [ 86, 90 ], [ 11, 91 ], [ 91, 92 ], [ 92, 93 ], [ 93, 94 ], [ 93, 95 ], [ 91, 96 ], [ 9, 97 ], [ 97, 98 ] ]
[ "\n/*\n * \n * Date: 07 September 2019\n * Time: 01:03:00\n*/\nimport java.io.*; \nimport java.util.*;\n\n\n \n class Main\n{ \n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n=sc.nextInt();\n long arr[]=new long[n];\n for(int i=0;i<n;i++){\n \tarr[i]=sc.nextLong();\n }\n long max=arr[0];\n long diff=0;\n for(int i=1;i<n;i++){\n \tif(arr[i]>=max){\n \t\t \t\tmax=arr[i];\n\n \t\tcontinue;\n \t}else{\n \t\tdiff+=max-arr[i];\n \t\tarr[i]=max;;\n \t}\n }\n \n System.out.println(diff);\n \n \n \n\n \n } \n} \n \n \n ", "import java.io.*;", "io.*", "java", "import java.util.*;", "util.*", "java", "class Main\n{ \n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n=sc.nextInt();\n long arr[]=new long[n];\n for(int i=0;i<n;i++){\n \tarr[i]=sc.nextLong();\n }\n long max=arr[0];\n long diff=0;\n for(int i=1;i<n;i++){\n \tif(arr[i]>=max){\n \t\t \t\tmax=arr[i];\n\n \t\tcontinue;\n \t}else{\n \t\tdiff+=max-arr[i];\n \t\tarr[i]=max;;\n \t}\n }\n \n System.out.println(diff);\n \n \n \n\n \n } \n}", "Main", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n=sc.nextInt();\n long arr[]=new long[n];\n for(int i=0;i<n;i++){\n \tarr[i]=sc.nextLong();\n }\n long max=arr[0];\n long diff=0;\n for(int i=1;i<n;i++){\n \tif(arr[i]>=max){\n \t\t \t\tmax=arr[i];\n\n \t\tcontinue;\n \t}else{\n \t\tdiff+=max-arr[i];\n \t\tarr[i]=max;;\n \t}\n }\n \n System.out.println(diff);\n \n \n \n\n \n }", "main", "{\n Scanner sc = new Scanner(System.in);\n int n=sc.nextInt();\n long arr[]=new long[n];\n for(int i=0;i<n;i++){\n \tarr[i]=sc.nextLong();\n }\n long max=arr[0];\n long diff=0;\n for(int i=1;i<n;i++){\n \tif(arr[i]>=max){\n \t\t \t\tmax=arr[i];\n\n \t\tcontinue;\n \t}else{\n \t\tdiff+=max-arr[i];\n \t\tarr[i]=max;;\n \t}\n }\n \n System.out.println(diff);\n \n \n \n\n \n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n=sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "long arr[]=new long[n];", "arr", "new long[n]", "n", "for(int i=0;i<n;i++){\n \tarr[i]=sc.nextLong();\n }", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\n \tarr[i]=sc.nextLong();\n }", "{\n \tarr[i]=sc.nextLong();\n }", "arr[i]=sc.nextLong()", "arr[i]", "arr", "i", "sc.nextLong()", "sc.nextLong", "sc", "long max=arr[0];", "max", "arr[0]", "arr", "0", "long diff=0;", "diff", "0", "for(int i=1;i<n;i++){\n \tif(arr[i]>=max){\n \t\t \t\tmax=arr[i];\n\n \t\tcontinue;\n \t}else{\n \t\tdiff+=max-arr[i];\n \t\tarr[i]=max;;\n \t}\n }", "int i=1;", "int i=1;", "i", "1", "i<n", "i", "n", "i++", "i++", "i", "{\n \tif(arr[i]>=max){\n \t\t \t\tmax=arr[i];\n\n \t\tcontinue;\n \t}else{\n \t\tdiff+=max-arr[i];\n \t\tarr[i]=max;;\n \t}\n }", "{\n \tif(arr[i]>=max){\n \t\t \t\tmax=arr[i];\n\n \t\tcontinue;\n \t}else{\n \t\tdiff+=max-arr[i];\n \t\tarr[i]=max;;\n \t}\n }", "if(arr[i]>=max){\n \t\t \t\tmax=arr[i];\n\n \t\tcontinue;\n \t}else{\n \t\tdiff+=max-arr[i];\n \t\tarr[i]=max;;\n \t}", "arr[i]>=max", "arr[i]", "arr", "i", "max", "{\n \t\t \t\tmax=arr[i];\n\n \t\tcontinue;\n \t}", "max=arr[i]", "max", "arr[i]", "arr", "i", "continue;", "{\n \t\tdiff+=max-arr[i];\n \t\tarr[i]=max;;\n \t}", "diff+=max-arr[i]", "diff", "max-arr[i]", "max", "arr[i]", "arr", "i", "arr[i]=max", "arr[i]", "arr", "i", "max", "System.out.println(diff)", "System.out.println", "System.out", "System", "System.out", "diff", "String[] args", "args" ]
/* * * Date: 07 September 2019 * Time: 01:03:00 */ import java.io.*; import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n=sc.nextInt(); long arr[]=new long[n]; for(int i=0;i<n;i++){ arr[i]=sc.nextLong(); } long max=arr[0]; long diff=0; for(int i=1;i<n;i++){ if(arr[i]>=max){ max=arr[i]; continue; }else{ diff+=max-arr[i]; arr[i]=max;; } } System.out.println(diff); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 41, 13, 18, 13, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 4, 18, 18, 13, 2, 13, 17, 18, 13, 13, 17, 30, 41, 13, 4, 18, 18, 13, 2, 13, 17, 18, 13, 13, 0, 13, 4, 18, 13, 13, 0, 18, 13, 13, 4, 18, 18, 13, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 113, 8 ], [ 113, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 11, 24 ], [ 24, 25 ], [ 25, 26 ], [ 26, 27 ], [ 26, 28 ], [ 24, 29 ], [ 29, 30 ], [ 29, 31 ], [ 24, 32 ], [ 32, 33 ], [ 33, 34 ], [ 24, 35 ], [ 36, 36 ], [ 36, 37 ], [ 37, 38 ], [ 38, 39 ], [ 38, 40 ], [ 37, 41 ], [ 41, 42 ], [ 42, 43 ], [ 11, 44 ], [ 44, 45 ], [ 44, 46 ], [ 46, 47 ], [ 46, 48 ], [ 11, 49 ], [ 49, 50 ], [ 50, 51 ], [ 51, 52 ], [ 51, 53 ], [ 49, 54 ], [ 54, 55 ], [ 54, 56 ], [ 49, 57 ], [ 57, 58 ], [ 58, 59 ], [ 49, 60 ], [ 61, 61 ], [ 61, 62 ], [ 62, 63 ], [ 63, 64 ], [ 64, 65 ], [ 65, 66 ], [ 66, 67 ], [ 66, 68 ], [ 68, 69 ], [ 68, 70 ], [ 64, 71 ], [ 71, 72 ], [ 71, 73 ], [ 63, 74 ], [ 62, 75 ], [ 75, 76 ], [ 76, 77 ], [ 76, 78 ], [ 78, 79 ], [ 79, 80 ], [ 80, 81 ], [ 80, 82 ], [ 82, 83 ], [ 82, 84 ], [ 78, 85 ], [ 85, 86 ], [ 85, 87 ], [ 75, 88 ], [ 88, 89 ], [ 88, 90 ], [ 90, 91 ], [ 91, 92 ], [ 90, 93 ], [ 75, 94 ], [ 94, 95 ], [ 95, 96 ], [ 95, 97 ], [ 94, 98 ], [ 98, 99 ], [ 99, 100 ], [ 100, 101 ], [ 100, 102 ], [ 98, 103 ], [ 11, 104 ], [ 104, 105 ], [ 105, 106 ], [ 106, 107 ], [ 106, 108 ], [ 104, 109 ], [ 9, 110 ], [ 110, 111 ], [ 0, 112 ], [ 112, 113 ], [ 112, 114 ] ]
[ "import java.math.BigInteger;\nimport java.util.Scanner;\n\npublic class Main {\n\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n BigInteger[] nums = new BigInteger[N];\n\n\n for (int i = 0; i < N; i++) {\n nums[i] = sc.nextBigInteger();\n }\n\n BigInteger sum = BigInteger.ZERO;\n for (int i = 1; i < N; i++) {\n if (nums[i-1].compareTo(nums[i]) > 0) {\n BigInteger b = nums[i - 1].subtract(nums[i]);\n\n sum = sum.add(b);\n nums[i] =nums[i].add(b);\n }\n }\n\n System.out.println(sum);\n\n }\n}", "import java.math.BigInteger;", "BigInteger", "java.math", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n BigInteger[] nums = new BigInteger[N];\n\n\n for (int i = 0; i < N; i++) {\n nums[i] = sc.nextBigInteger();\n }\n\n BigInteger sum = BigInteger.ZERO;\n for (int i = 1; i < N; i++) {\n if (nums[i-1].compareTo(nums[i]) > 0) {\n BigInteger b = nums[i - 1].subtract(nums[i]);\n\n sum = sum.add(b);\n nums[i] =nums[i].add(b);\n }\n }\n\n System.out.println(sum);\n\n }\n}", "Main", "public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n BigInteger[] nums = new BigInteger[N];\n\n\n for (int i = 0; i < N; i++) {\n nums[i] = sc.nextBigInteger();\n }\n\n BigInteger sum = BigInteger.ZERO;\n for (int i = 1; i < N; i++) {\n if (nums[i-1].compareTo(nums[i]) > 0) {\n BigInteger b = nums[i - 1].subtract(nums[i]);\n\n sum = sum.add(b);\n nums[i] =nums[i].add(b);\n }\n }\n\n System.out.println(sum);\n\n }", "main", "{\n\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n BigInteger[] nums = new BigInteger[N];\n\n\n for (int i = 0; i < N; i++) {\n nums[i] = sc.nextBigInteger();\n }\n\n BigInteger sum = BigInteger.ZERO;\n for (int i = 1; i < N; i++) {\n if (nums[i-1].compareTo(nums[i]) > 0) {\n BigInteger b = nums[i - 1].subtract(nums[i]);\n\n sum = sum.add(b);\n nums[i] =nums[i].add(b);\n }\n }\n\n System.out.println(sum);\n\n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int N = sc.nextInt();", "N", "sc.nextInt()", "sc.nextInt", "sc", "BigInteger[] nums = new BigInteger[N];", "nums", "new BigInteger[N]", "N", "for (int i = 0; i < N; i++) {\n nums[i] = sc.nextBigInteger();\n }", "int i = 0;", "int i = 0;", "i", "0", "i < N", "i", "N", "i++", "i++", "i", "{\n nums[i] = sc.nextBigInteger();\n }", "{\n nums[i] = sc.nextBigInteger();\n }", "nums[i] = sc.nextBigInteger()", "nums[i]", "nums", "i", "sc.nextBigInteger()", "sc.nextBigInteger", "sc", "BigInteger sum = BigInteger.ZERO;", "sum", "BigInteger.ZERO", "BigInteger", "BigInteger.ZERO", "for (int i = 1; i < N; i++) {\n if (nums[i-1].compareTo(nums[i]) > 0) {\n BigInteger b = nums[i - 1].subtract(nums[i]);\n\n sum = sum.add(b);\n nums[i] =nums[i].add(b);\n }\n }", "int i = 1;", "int i = 1;", "i", "1", "i < N", "i", "N", "i++", "i++", "i", "{\n if (nums[i-1].compareTo(nums[i]) > 0) {\n BigInteger b = nums[i - 1].subtract(nums[i]);\n\n sum = sum.add(b);\n nums[i] =nums[i].add(b);\n }\n }", "{\n if (nums[i-1].compareTo(nums[i]) > 0) {\n BigInteger b = nums[i - 1].subtract(nums[i]);\n\n sum = sum.add(b);\n nums[i] =nums[i].add(b);\n }\n }", "if (nums[i-1].compareTo(nums[i]) > 0) {\n BigInteger b = nums[i - 1].subtract(nums[i]);\n\n sum = sum.add(b);\n nums[i] =nums[i].add(b);\n }", "nums[i-1].compareTo(nums[i]) > 0", "nums[i-1].compareTo(nums[i])", "nums[i-1].compareTo", "nums[i-1]", "nums", "i-1", "i", "1", "nums[i]", "nums", "i", "0", "{\n BigInteger b = nums[i - 1].subtract(nums[i]);\n\n sum = sum.add(b);\n nums[i] =nums[i].add(b);\n }", "BigInteger b = nums[i - 1].subtract(nums[i]);", "b", "nums[i - 1].subtract(nums[i])", "nums[i - 1].subtract", "nums[i - 1]", "nums", "i - 1", "i", "1", "nums[i]", "nums", "i", "sum = sum.add(b)", "sum", "sum.add(b)", "sum.add", "sum", "b", "nums[i] =nums[i].add(b)", "nums[i]", "nums", "i", "nums[i].add(b)", "nums[i].add", "nums[i]", "nums", "i", "b", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "String[] args", "args", "public class Main {\n\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n BigInteger[] nums = new BigInteger[N];\n\n\n for (int i = 0; i < N; i++) {\n nums[i] = sc.nextBigInteger();\n }\n\n BigInteger sum = BigInteger.ZERO;\n for (int i = 1; i < N; i++) {\n if (nums[i-1].compareTo(nums[i]) > 0) {\n BigInteger b = nums[i - 1].subtract(nums[i]);\n\n sum = sum.add(b);\n nums[i] =nums[i].add(b);\n }\n }\n\n System.out.println(sum);\n\n }\n}", "public class Main {\n\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n BigInteger[] nums = new BigInteger[N];\n\n\n for (int i = 0; i < N; i++) {\n nums[i] = sc.nextBigInteger();\n }\n\n BigInteger sum = BigInteger.ZERO;\n for (int i = 1; i < N; i++) {\n if (nums[i-1].compareTo(nums[i]) > 0) {\n BigInteger b = nums[i - 1].subtract(nums[i]);\n\n sum = sum.add(b);\n nums[i] =nums[i].add(b);\n }\n }\n\n System.out.println(sum);\n\n }\n}", "Main" ]
import java.math.BigInteger; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); BigInteger[] nums = new BigInteger[N]; for (int i = 0; i < N; i++) { nums[i] = sc.nextBigInteger(); } BigInteger sum = BigInteger.ZERO; for (int i = 1; i < N; i++) { if (nums[i-1].compareTo(nums[i]) > 0) { BigInteger b = nums[i - 1].subtract(nums[i]); sum = sum.add(b); nums[i] =nums[i].add(b); } } System.out.println(sum); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 41, 13, 20, 41, 13, 20, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 2, 13, 17, 1, 40, 13, 30, 30, 14, 2, 18, 13, 13, 18, 13, 2, 13, 17, 30, 0, 13, 2, 18, 13, 13, 18, 13, 2, 13, 17, 0, 18, 13, 2, 13, 17, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 12, 13, 30, 41, 13, 18, 13, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 41, 13, 4, 18, 13, 13, 41, 13, 18, 13, 13, 0, 18, 13, 13, 18, 13, 13, 0, 18, 13, 13, 13, 4, 18, 13, 13, 23, 13, 6, 13, 41, 13, 20, 41, 13, 20, 12, 13, 30, 42, 40, 4, 18, 13, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 20, 29, 4, 18, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 13, 29, 13, 23, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 13, 14 ], [ 13, 15 ], [ 0, 16 ], [ 16, 17 ], [ 16, 18 ], [ 0, 19 ], [ 19, 20 ], [ 19, 21 ], [ 0, 22 ], [ 233, 23 ], [ 233, 24 ], [ 24, 25 ], [ 24, 26 ], [ 233, 27 ], [ 27, 28 ], [ 27, 29 ], [ 233, 30 ], [ 30, 31 ], [ 30, 32 ], [ 32, 33 ], [ 33, 34 ], [ 33, 35 ], [ 32, 36 ], [ 36, 37 ], [ 36, 38 ], [ 38, 39 ], [ 39, 40 ], [ 32, 41 ], [ 41, 42 ], [ 41, 43 ], [ 43, 44 ], [ 44, 45 ], [ 43, 46 ], [ 32, 47 ], [ 47, 48 ], [ 47, 49 ], [ 32, 50 ], [ 50, 51 ], [ 51, 52 ], [ 52, 53 ], [ 52, 54 ], [ 50, 55 ], [ 55, 56 ], [ 55, 57 ], [ 57, 58 ], [ 57, 59 ], [ 50, 60 ], [ 60, 61 ], [ 61, 62 ], [ 50, 63 ], [ 64, 64 ], [ 64, 65 ], [ 65, 66 ], [ 66, 67 ], [ 67, 68 ], [ 67, 69 ], [ 66, 70 ], [ 70, 71 ], [ 70, 72 ], [ 72, 73 ], [ 72, 74 ], [ 65, 75 ], [ 75, 76 ], [ 76, 77 ], [ 76, 78 ], [ 78, 79 ], [ 79, 80 ], [ 79, 81 ], [ 78, 82 ], [ 82, 83 ], [ 82, 84 ], [ 84, 85 ], [ 84, 86 ], [ 75, 87 ], [ 87, 88 ], [ 88, 89 ], [ 88, 90 ], [ 90, 91 ], [ 90, 92 ], [ 87, 93 ], [ 93, 94 ], [ 93, 95 ], [ 32, 96 ], [ 96, 97 ], [ 97, 98 ], [ 98, 99 ], [ 98, 100 ], [ 96, 101 ], [ 30, 102 ], [ 102, 103 ], [ 233, 104 ], [ 104, 105 ], [ 104, 106 ], [ 106, 107 ], [ 107, 108 ], [ 107, 109 ], [ 109, 110 ], [ 109, 111 ], [ 106, 112 ], [ 112, 113 ], [ 113, 114 ], [ 114, 115 ], [ 114, 116 ], [ 112, 117 ], [ 117, 118 ], [ 117, 119 ], [ 112, 120 ], [ 120, 121 ], [ 121, 122 ], [ 112, 123 ], [ 124, 124 ], [ 124, 125 ], [ 125, 126 ], [ 125, 127 ], [ 127, 128 ], [ 128, 129 ], [ 127, 130 ], [ 124, 131 ], [ 131, 132 ], [ 131, 133 ], [ 133, 134 ], [ 133, 135 ], [ 124, 136 ], [ 136, 137 ], [ 137, 138 ], [ 137, 139 ], [ 136, 140 ], [ 140, 141 ], [ 140, 142 ], [ 124, 143 ], [ 143, 144 ], [ 144, 145 ], [ 144, 146 ], [ 143, 147 ], [ 106, 148 ], [ 148, 149 ], [ 149, 150 ], [ 148, 151 ], [ 104, 152 ], [ 152, 153 ], [ 233, 154 ], [ 154, 155 ], [ 154, 156 ], [ 156, 157 ], [ 156, 158 ], [ 154, 159 ], [ 159, 160 ], [ 159, 161 ], [ 154, 162 ], [ 162, 163 ], [ 162, 164 ], [ 164, 165 ], [ 165, 166 ], [ 166, 167 ], [ 167, 168 ], [ 168, 169 ], [ 165, 170 ], [ 170, 171 ], [ 171, 172 ], [ 171, 173 ], [ 173, 174 ], [ 174, 175 ], [ 175, 176 ], [ 170, 177 ], [ 177, 178 ], [ 178, 179 ], [ 178, 180 ], [ 164, 181 ], [ 181, 182 ], [ 182, 183 ], [ 183, 184 ], [ 154, 185 ], [ 185, 186 ], [ 185, 187 ], [ 187, 188 ], [ 188, 189 ], [ 189, 190 ], [ 190, 191 ], [ 189, 192 ], [ 192, 193 ], [ 154, 194 ], [ 194, 195 ], [ 194, 196 ], [ 196, 197 ], [ 197, 198 ], [ 197, 199 ], [ 196, 201 ], [ 201, 202 ], [ 202, 203 ], [ 203, 204 ], [ 203, 205 ], [ 201, 206 ], [ 206, 207 ], [ 206, 208 ], [ 201, 209 ], [ 209, 210 ], [ 210, 211 ], [ 201, 212 ], [ 212, 213 ], [ 213, 214 ], [ 214, 215 ], [ 214, 216 ], [ 213, 217 ], [ 217, 218 ], [ 196, 219 ], [ 219, 220 ], [ 194, 221 ], [ 221, 222 ], [ 154, 223 ], [ 223, 224 ], [ 223, 225 ], [ 225, 226 ], [ 226, 227 ], [ 227, 228 ], [ 228, 229 ], [ 227, 230 ], [ 230, 231 ], [ 0, 232 ], [ 232, 233 ], [ 232, 234 ] ]
[ "import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.Random;\nimport java.util.StringTokenizer;\n\npublic class Main\n{\n\t\n\tpublic static ArrayList<String> AL = new ArrayList<String>();\n\t\n\t\n\tpublic static void main(String[] args) {\n\t\tFastScanner fs=new FastScanner();\n\t\tint n = fs.nextInt();\n\t\tlong a[] = fs.readArray(n);\n\t\tlong count =0 ;\n\t\tfor(int i =0 ;i<n-1;i++) {\n\t\t\t\n\t\t\tif(a[i]>a[i+1]) {\n\t\t\t\tcount+=a[i]-a[i+1];\n\t\t\t\ta[i+1] = a[i];\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(count);\n\t}\n\t\t\n\t\n\t \n\tstatic final Random random=new Random();\n\t\n\tstatic void ruffleSort(int[] a) {\n\t\tint n=a.length;//shuffle, then sort \n\t\tfor (int i=0; i<n; i++) {\n\t\t\tint oi=random.nextInt(n), temp=a[oi];\n\t\t\ta[oi]=a[i]; a[i]=temp;\n\t\t}\n\t\tArrays.sort(a);\n\t}\n\t\n\tstatic class FastScanner {\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tStringTokenizer st=new StringTokenizer(\"\");\n\t\tString next() {\n\t\t\twhile (!st.hasMoreTokens())\n\t\t\t\ttry {\n\t\t\t\t\tst=new StringTokenizer(br.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\treturn st.nextToken();\n\t\t}\n\t\t\n\t\tint nextInt() {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n\t\tlong[] readArray(int n) {\n\t\t\tlong[] a=new long[n];\n\t\t\tfor (int i=0; i<n; i++) a[i]=nextInt();\n\t\t\treturn a;\n\t\t}\n\t\tlong nextLong() {\n\t\t\treturn Long.parseLong(next());\n\t\t}\n\t}\n\n\t\n}", "import java.io.BufferedReader;", "BufferedReader", "java.io", "import java.io.IOException;", "IOException", "java.io", "import java.io.InputStreamReader;", "InputStreamReader", "java.io", "import java.util.ArrayList;", "ArrayList", "java.util", "import java.util.Arrays;", "Arrays", "java.util", "import java.util.Random;", "Random", "java.util", "import java.util.StringTokenizer;", "StringTokenizer", "java.util", "public class Main\n{\n\t\n\tpublic static ArrayList<String> AL = new ArrayList<String>();\n\t\n\t\n\tpublic static void main(String[] args) {\n\t\tFastScanner fs=new FastScanner();\n\t\tint n = fs.nextInt();\n\t\tlong a[] = fs.readArray(n);\n\t\tlong count =0 ;\n\t\tfor(int i =0 ;i<n-1;i++) {\n\t\t\t\n\t\t\tif(a[i]>a[i+1]) {\n\t\t\t\tcount+=a[i]-a[i+1];\n\t\t\t\ta[i+1] = a[i];\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(count);\n\t}\n\t\t\n\t\n\t \n\tstatic final Random random=new Random();\n\t\n\tstatic void ruffleSort(int[] a) {\n\t\tint n=a.length;//shuffle, then sort \n\t\tfor (int i=0; i<n; i++) {\n\t\t\tint oi=random.nextInt(n), temp=a[oi];\n\t\t\ta[oi]=a[i]; a[i]=temp;\n\t\t}\n\t\tArrays.sort(a);\n\t}\n\t\n\tstatic class FastScanner {\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tStringTokenizer st=new StringTokenizer(\"\");\n\t\tString next() {\n\t\t\twhile (!st.hasMoreTokens())\n\t\t\t\ttry {\n\t\t\t\t\tst=new StringTokenizer(br.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\treturn st.nextToken();\n\t\t}\n\t\t\n\t\tint nextInt() {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n\t\tlong[] readArray(int n) {\n\t\t\tlong[] a=new long[n];\n\t\t\tfor (int i=0; i<n; i++) a[i]=nextInt();\n\t\t\treturn a;\n\t\t}\n\t\tlong nextLong() {\n\t\t\treturn Long.parseLong(next());\n\t\t}\n\t}\n\n\t\n}", "Main", "public static ArrayList<String> AL = new ArrayList<String>();", "AL", "new ArrayList<String>()", "static final Random random=new Random();", "random", "new Random()", "public static void main(String[] args) {\n\t\tFastScanner fs=new FastScanner();\n\t\tint n = fs.nextInt();\n\t\tlong a[] = fs.readArray(n);\n\t\tlong count =0 ;\n\t\tfor(int i =0 ;i<n-1;i++) {\n\t\t\t\n\t\t\tif(a[i]>a[i+1]) {\n\t\t\t\tcount+=a[i]-a[i+1];\n\t\t\t\ta[i+1] = a[i];\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(count);\n\t}", "main", "{\n\t\tFastScanner fs=new FastScanner();\n\t\tint n = fs.nextInt();\n\t\tlong a[] = fs.readArray(n);\n\t\tlong count =0 ;\n\t\tfor(int i =0 ;i<n-1;i++) {\n\t\t\t\n\t\t\tif(a[i]>a[i+1]) {\n\t\t\t\tcount+=a[i]-a[i+1];\n\t\t\t\ta[i+1] = a[i];\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(count);\n\t}", "FastScanner fs=new FastScanner();", "fs", "new FastScanner()", "int n = fs.nextInt();", "n", "fs.nextInt()", "fs.nextInt", "fs", "long a[] = fs.readArray(n);", "a", "fs.readArray(n)", "fs.readArray", "fs", "n", "long count =0 ;", "count", "0", "for(int i =0 ;i<n-1;i++) {\n\t\t\t\n\t\t\tif(a[i]>a[i+1]) {\n\t\t\t\tcount+=a[i]-a[i+1];\n\t\t\t\ta[i+1] = a[i];\n\t\t\t}\n\t\t}", "int i =0 ;", "int i =0 ;", "i", "0", "i<n-1", "i", "n-1", "n", "1", "i++", "i++", "i", "{\n\t\t\t\n\t\t\tif(a[i]>a[i+1]) {\n\t\t\t\tcount+=a[i]-a[i+1];\n\t\t\t\ta[i+1] = a[i];\n\t\t\t}\n\t\t}", "{\n\t\t\t\n\t\t\tif(a[i]>a[i+1]) {\n\t\t\t\tcount+=a[i]-a[i+1];\n\t\t\t\ta[i+1] = a[i];\n\t\t\t}\n\t\t}", "if(a[i]>a[i+1]) {\n\t\t\t\tcount+=a[i]-a[i+1];\n\t\t\t\ta[i+1] = a[i];\n\t\t\t}", "a[i]>a[i+1]", "a[i]", "a", "i", "a[i+1]", "a", "i+1", "i", "1", "{\n\t\t\t\tcount+=a[i]-a[i+1];\n\t\t\t\ta[i+1] = a[i];\n\t\t\t}", "count+=a[i]-a[i+1]", "count", "a[i]-a[i+1]", "a[i]", "a", "i", "a[i+1]", "a", "i+1", "i", "1", "a[i+1] = a[i]", "a[i+1]", "a", "i+1", "i", "1", "a[i]", "a", "i", "System.out.println(count)", "System.out.println", "System.out", "System", "System.out", "count", "String[] args", "args", "static void ruffleSort(int[] a) {\n\t\tint n=a.length;//shuffle, then sort \n\t\tfor (int i=0; i<n; i++) {\n\t\t\tint oi=random.nextInt(n), temp=a[oi];\n\t\t\ta[oi]=a[i]; a[i]=temp;\n\t\t}\n\t\tArrays.sort(a);\n\t}", "ruffleSort", "{\n\t\tint n=a.length;//shuffle, then sort \n\t\tfor (int i=0; i<n; i++) {\n\t\t\tint oi=random.nextInt(n), temp=a[oi];\n\t\t\ta[oi]=a[i]; a[i]=temp;\n\t\t}\n\t\tArrays.sort(a);\n\t}", "int n=a.length;", "n", "a.length", "a", "a.length", "for (int i=0; i<n; i++) {\n\t\t\tint oi=random.nextInt(n), temp=a[oi];\n\t\t\ta[oi]=a[i]; a[i]=temp;\n\t\t}", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\n\t\t\tint oi=random.nextInt(n), temp=a[oi];\n\t\t\ta[oi]=a[i]; a[i]=temp;\n\t\t}", "{\n\t\t\tint oi=random.nextInt(n), temp=a[oi];\n\t\t\ta[oi]=a[i]; a[i]=temp;\n\t\t}", "int oi=random.nextInt(n)", "oi", "random.nextInt(n)", "random.nextInt", "random", "n", "temp=a[oi];", "temp", "a[oi]", "a", "oi", "a[oi]=a[i]", "a[oi]", "a", "oi", "a[i]", "a", "i", "a[i]=temp", "a[i]", "a", "i", "temp", "Arrays.sort(a)", "Arrays.sort", "Arrays", "a", "int[] a", "a", "static class FastScanner {\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tStringTokenizer st=new StringTokenizer(\"\");\n\t\tString next() {\n\t\t\twhile (!st.hasMoreTokens())\n\t\t\t\ttry {\n\t\t\t\t\tst=new StringTokenizer(br.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\treturn st.nextToken();\n\t\t}\n\t\t\n\t\tint nextInt() {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n\t\tlong[] readArray(int n) {\n\t\t\tlong[] a=new long[n];\n\t\t\tfor (int i=0; i<n; i++) a[i]=nextInt();\n\t\t\treturn a;\n\t\t}\n\t\tlong nextLong() {\n\t\t\treturn Long.parseLong(next());\n\t\t}\n\t}", "FastScanner", "BufferedReader br=new BufferedReader(new InputStreamReader(System.in));", "br", "new BufferedReader(new InputStreamReader(System.in))", "StringTokenizer st=new StringTokenizer(\"\");", "st", "new StringTokenizer(\"\")", "String next() {\n\t\t\twhile (!st.hasMoreTokens())\n\t\t\t\ttry {\n\t\t\t\t\tst=new StringTokenizer(br.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\treturn st.nextToken();\n\t\t}", "next", "{\n\t\t\twhile (!st.hasMoreTokens())\n\t\t\t\ttry {\n\t\t\t\t\tst=new StringTokenizer(br.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\treturn st.nextToken();\n\t\t}", "while (!st.hasMoreTokens())\n\t\t\t\ttry {\n\t\t\t\t\tst=new StringTokenizer(br.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}", "!st.hasMoreTokens()", "st.hasMoreTokens()", "st.hasMoreTokens", "st", "try {\n\t\t\t\t\tst=new StringTokenizer(br.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}", "catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}", "IOException e", "{\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}", "e.printStackTrace()", "e.printStackTrace", "e", "{\n\t\t\t\t\tst=new StringTokenizer(br.readLine());\n\t\t\t\t}", "st=new StringTokenizer(br.readLine())", "st", "new StringTokenizer(br.readLine())", "return st.nextToken();", "st.nextToken()", "st.nextToken", "st", "int nextInt() {\n\t\t\treturn Integer.parseInt(next());\n\t\t}", "nextInt", "{\n\t\t\treturn Integer.parseInt(next());\n\t\t}", "return Integer.parseInt(next());", "Integer.parseInt(next())", "Integer.parseInt", "Integer", "next()", "next", "long[] readArray(int n) {\n\t\t\tlong[] a=new long[n];\n\t\t\tfor (int i=0; i<n; i++) a[i]=nextInt();\n\t\t\treturn a;\n\t\t}", "readArray", "{\n\t\t\tlong[] a=new long[n];\n\t\t\tfor (int i=0; i<n; i++) a[i]=nextInt();\n\t\t\treturn a;\n\t\t}", "long[] a=new long[n];", "a", "new long[n]", "n", "for (int i=0; i<n; i++) a[i]=nextInt();", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "a[i]=nextInt();", "a[i]=nextInt()", "a[i]", "a", "i", "nextInt()", "nextInt", "return a;", "a", "int n", "n", "long nextLong() {\n\t\t\treturn Long.parseLong(next());\n\t\t}", "nextLong", "{\n\t\t\treturn Long.parseLong(next());\n\t\t}", "return Long.parseLong(next());", "Long.parseLong(next())", "Long.parseLong", "Long", "next()", "next", "public class Main\n{\n\t\n\tpublic static ArrayList<String> AL = new ArrayList<String>();\n\t\n\t\n\tpublic static void main(String[] args) {\n\t\tFastScanner fs=new FastScanner();\n\t\tint n = fs.nextInt();\n\t\tlong a[] = fs.readArray(n);\n\t\tlong count =0 ;\n\t\tfor(int i =0 ;i<n-1;i++) {\n\t\t\t\n\t\t\tif(a[i]>a[i+1]) {\n\t\t\t\tcount+=a[i]-a[i+1];\n\t\t\t\ta[i+1] = a[i];\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(count);\n\t}\n\t\t\n\t\n\t \n\tstatic final Random random=new Random();\n\t\n\tstatic void ruffleSort(int[] a) {\n\t\tint n=a.length;//shuffle, then sort \n\t\tfor (int i=0; i<n; i++) {\n\t\t\tint oi=random.nextInt(n), temp=a[oi];\n\t\t\ta[oi]=a[i]; a[i]=temp;\n\t\t}\n\t\tArrays.sort(a);\n\t}\n\t\n\tstatic class FastScanner {\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tStringTokenizer st=new StringTokenizer(\"\");\n\t\tString next() {\n\t\t\twhile (!st.hasMoreTokens())\n\t\t\t\ttry {\n\t\t\t\t\tst=new StringTokenizer(br.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\treturn st.nextToken();\n\t\t}\n\t\t\n\t\tint nextInt() {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n\t\tlong[] readArray(int n) {\n\t\t\tlong[] a=new long[n];\n\t\t\tfor (int i=0; i<n; i++) a[i]=nextInt();\n\t\t\treturn a;\n\t\t}\n\t\tlong nextLong() {\n\t\t\treturn Long.parseLong(next());\n\t\t}\n\t}\n\n\t\n}", "public class Main\n{\n\t\n\tpublic static ArrayList<String> AL = new ArrayList<String>();\n\t\n\t\n\tpublic static void main(String[] args) {\n\t\tFastScanner fs=new FastScanner();\n\t\tint n = fs.nextInt();\n\t\tlong a[] = fs.readArray(n);\n\t\tlong count =0 ;\n\t\tfor(int i =0 ;i<n-1;i++) {\n\t\t\t\n\t\t\tif(a[i]>a[i+1]) {\n\t\t\t\tcount+=a[i]-a[i+1];\n\t\t\t\ta[i+1] = a[i];\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(count);\n\t}\n\t\t\n\t\n\t \n\tstatic final Random random=new Random();\n\t\n\tstatic void ruffleSort(int[] a) {\n\t\tint n=a.length;//shuffle, then sort \n\t\tfor (int i=0; i<n; i++) {\n\t\t\tint oi=random.nextInt(n), temp=a[oi];\n\t\t\ta[oi]=a[i]; a[i]=temp;\n\t\t}\n\t\tArrays.sort(a);\n\t}\n\t\n\tstatic class FastScanner {\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tStringTokenizer st=new StringTokenizer(\"\");\n\t\tString next() {\n\t\t\twhile (!st.hasMoreTokens())\n\t\t\t\ttry {\n\t\t\t\t\tst=new StringTokenizer(br.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\treturn st.nextToken();\n\t\t}\n\t\t\n\t\tint nextInt() {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n\t\tlong[] readArray(int n) {\n\t\t\tlong[] a=new long[n];\n\t\t\tfor (int i=0; i<n; i++) a[i]=nextInt();\n\t\t\treturn a;\n\t\t}\n\t\tlong nextLong() {\n\t\t\treturn Long.parseLong(next());\n\t\t}\n\t}\n\n\t\n}", "Main" ]
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Arrays; import java.util.Random; import java.util.StringTokenizer; public class Main { public static ArrayList<String> AL = new ArrayList<String>(); public static void main(String[] args) { FastScanner fs=new FastScanner(); int n = fs.nextInt(); long a[] = fs.readArray(n); long count =0 ; for(int i =0 ;i<n-1;i++) { if(a[i]>a[i+1]) { count+=a[i]-a[i+1]; a[i+1] = a[i]; } } System.out.println(count); } static final Random random=new Random(); static void ruffleSort(int[] a) { int n=a.length;//shuffle, then sort for (int i=0; i<n; i++) { int oi=random.nextInt(n), temp=a[oi]; a[oi]=a[i]; a[i]=temp; } Arrays.sort(a); } static class FastScanner { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st=new StringTokenizer(""); String next() { while (!st.hasMoreTokens()) try { st=new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } long[] readArray(int n) { long[] a=new long[n]; for (int i=0; i<n; i++) a[i]=nextInt(); return a; } long nextLong() { return Long.parseLong(next()); } } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 18, 13, 41, 13, 18, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 18, 13, 13, 13, 0, 13, 18, 13, 13, 30, 0, 13, 2, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 13, 14 ], [ 13, 15 ], [ 0, 16 ], [ 16, 17 ], [ 16, 18 ], [ 0, 19 ], [ 19, 20 ], [ 19, 21 ], [ 0, 22 ], [ 22, 23 ], [ 22, 24 ], [ 0, 25 ], [ 25, 26 ], [ 25, 27 ], [ 0, 28 ], [ 28, 29 ], [ 28, 30 ], [ 0, 31 ], [ 31, 32 ], [ 31, 33 ], [ 0, 34 ], [ 119, 35 ], [ 119, 36 ], [ 36, 37 ], [ 36, 38 ], [ 38, 39 ], [ 39, 40 ], [ 39, 41 ], [ 38, 42 ], [ 42, 43 ], [ 42, 44 ], [ 44, 45 ], [ 45, 46 ], [ 38, 47 ], [ 47, 48 ], [ 47, 49 ], [ 38, 51 ], [ 51, 52 ], [ 52, 53 ], [ 53, 54 ], [ 53, 55 ], [ 51, 56 ], [ 56, 57 ], [ 56, 58 ], [ 51, 59 ], [ 59, 60 ], [ 60, 61 ], [ 51, 62 ], [ 62, 63 ], [ 63, 64 ], [ 64, 65 ], [ 64, 66 ], [ 63, 67 ], [ 67, 68 ], [ 68, 69 ], [ 38, 70 ], [ 70, 71 ], [ 70, 72 ], [ 72, 73 ], [ 72, 74 ], [ 38, 75 ], [ 75, 76 ], [ 75, 77 ], [ 38, 78 ], [ 78, 79 ], [ 79, 80 ], [ 80, 81 ], [ 80, 82 ], [ 78, 83 ], [ 83, 84 ], [ 83, 85 ], [ 78, 86 ], [ 86, 87 ], [ 87, 88 ], [ 78, 89 ], [ 90, 90 ], [ 90, 91 ], [ 91, 92 ], [ 92, 93 ], [ 93, 94 ], [ 93, 95 ], [ 92, 96 ], [ 91, 97 ], [ 97, 98 ], [ 97, 99 ], [ 99, 100 ], [ 99, 101 ], [ 91, 102 ], [ 102, 103 ], [ 103, 104 ], [ 103, 105 ], [ 105, 106 ], [ 105, 107 ], [ 107, 108 ], [ 107, 109 ], [ 38, 110 ], [ 110, 111 ], [ 111, 112 ], [ 112, 113 ], [ 112, 114 ], [ 110, 115 ], [ 36, 116 ], [ 116, 117 ], [ 0, 118 ], [ 118, 119 ], [ 118, 120 ] ]
[ "import java.io.*;\nimport java.math.*;\nimport java.security.*;\nimport java.text.*;\nimport java.util.*;\nimport java.util.concurrent.*;\nimport java.util.function.*;\nimport java.util.regex.*;\nimport java.util.stream.*;\nimport static java.util.stream.Collectors.joining;\nimport static java.util.stream.Collectors.toList;\n \npublic class Main\n{\n public static void main(String[] args)\n {\n Scanner in=new Scanner(System.in);\n int n=in.nextInt();\n long[] a=new long[n];\n for(int i=0;i<n;i++)\n a[i]=in.nextLong();\n long curr=a[0];\n long total=0;\n for(int i=1;i<n;i++)\n {\n if(a[i]>=curr)\n curr=a[i];\n else\n {\n total+=(curr-a[i]);\n }\n }\n System.out.println(total);\n\n }\n}", "import java.io.*;", "io.*", "java", "import java.math.*;", "math.*", "java", "import java.security.*;", "security.*", "java", "import java.text.*;", "text.*", "java", "import java.util.*;", "util.*", "java", "import java.util.concurrent.*;", "concurrent.*", "java.util", "import java.util.function.*;", "function.*", "java.util", "import java.util.regex.*;", "regex.*", "java.util", "import java.util.stream.*;", "stream.*", "java.util", "import static java.util.stream.Collectors.joining;", "import static java.util.stream.Collectors.joining;", "import static java.util.stream.Collectors.joining;", "import static java.util.stream.Collectors.toList;", "import static java.util.stream.Collectors.toList;", "import static java.util.stream.Collectors.toList;", "public class Main\n{\n public static void main(String[] args)\n {\n Scanner in=new Scanner(System.in);\n int n=in.nextInt();\n long[] a=new long[n];\n for(int i=0;i<n;i++)\n a[i]=in.nextLong();\n long curr=a[0];\n long total=0;\n for(int i=1;i<n;i++)\n {\n if(a[i]>=curr)\n curr=a[i];\n else\n {\n total+=(curr-a[i]);\n }\n }\n System.out.println(total);\n\n }\n}", "Main", "public static void main(String[] args)\n {\n Scanner in=new Scanner(System.in);\n int n=in.nextInt();\n long[] a=new long[n];\n for(int i=0;i<n;i++)\n a[i]=in.nextLong();\n long curr=a[0];\n long total=0;\n for(int i=1;i<n;i++)\n {\n if(a[i]>=curr)\n curr=a[i];\n else\n {\n total+=(curr-a[i]);\n }\n }\n System.out.println(total);\n\n }", "main", "{\n Scanner in=new Scanner(System.in);\n int n=in.nextInt();\n long[] a=new long[n];\n for(int i=0;i<n;i++)\n a[i]=in.nextLong();\n long curr=a[0];\n long total=0;\n for(int i=1;i<n;i++)\n {\n if(a[i]>=curr)\n curr=a[i];\n else\n {\n total+=(curr-a[i]);\n }\n }\n System.out.println(total);\n\n }", "Scanner in=new Scanner(System.in);", "in", "new Scanner(System.in)", "int n=in.nextInt();", "n", "in.nextInt()", "in.nextInt", "in", "long[] a=new long[n];", "a", "new long[n]", "n", "for(int i=0;i<n;i++)\n a[i]=in.nextLong();", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "a[i]=in.nextLong();", "a[i]=in.nextLong()", "a[i]", "a", "i", "in.nextLong()", "in.nextLong", "in", "long curr=a[0];", "curr", "a[0]", "a", "0", "long total=0;", "total", "0", "for(int i=1;i<n;i++)\n {\n if(a[i]>=curr)\n curr=a[i];\n else\n {\n total+=(curr-a[i]);\n }\n }", "int i=1;", "int i=1;", "i", "1", "i<n", "i", "n", "i++", "i++", "i", "{\n if(a[i]>=curr)\n curr=a[i];\n else\n {\n total+=(curr-a[i]);\n }\n }", "{\n if(a[i]>=curr)\n curr=a[i];\n else\n {\n total+=(curr-a[i]);\n }\n }", "if(a[i]>=curr)\n curr=a[i];\n else\n {\n total+=(curr-a[i]);\n }", "a[i]>=curr", "a[i]", "a", "i", "curr", "curr=a[i]", "curr", "a[i]", "a", "i", "{\n total+=(curr-a[i]);\n }", "total+=(curr-a[i])", "total", "(curr-a[i])", "curr", "a[i]", "a", "i", "System.out.println(total)", "System.out.println", "System.out", "System", "System.out", "total", "String[] args", "args", "public class Main\n{\n public static void main(String[] args)\n {\n Scanner in=new Scanner(System.in);\n int n=in.nextInt();\n long[] a=new long[n];\n for(int i=0;i<n;i++)\n a[i]=in.nextLong();\n long curr=a[0];\n long total=0;\n for(int i=1;i<n;i++)\n {\n if(a[i]>=curr)\n curr=a[i];\n else\n {\n total+=(curr-a[i]);\n }\n }\n System.out.println(total);\n\n }\n}", "public class Main\n{\n public static void main(String[] args)\n {\n Scanner in=new Scanner(System.in);\n int n=in.nextInt();\n long[] a=new long[n];\n for(int i=0;i<n;i++)\n a[i]=in.nextLong();\n long curr=a[0];\n long total=0;\n for(int i=1;i<n;i++)\n {\n if(a[i]>=curr)\n curr=a[i];\n else\n {\n total+=(curr-a[i]);\n }\n }\n System.out.println(total);\n\n }\n}", "Main" ]
import java.io.*; import java.math.*; import java.security.*; import java.text.*; import java.util.*; import java.util.concurrent.*; import java.util.function.*; import java.util.regex.*; import java.util.stream.*; import static java.util.stream.Collectors.joining; import static java.util.stream.Collectors.toList; public class Main { public static void main(String[] args) { Scanner in=new Scanner(System.in); int n=in.nextInt(); long[] a=new long[n]; for(int i=0;i<n;i++) a[i]=in.nextLong(); long curr=a[0]; long total=0; for(int i=1;i<n;i++) { if(a[i]>=curr) curr=a[i]; else { total+=(curr-a[i]); } } System.out.println(total); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 41, 13, 20, 41, 13, 20, 12, 13, 30, 41, 13, 20, 4, 18, 13, 4, 18, 13, 23, 13, 12, 13, 30, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 18, 13, 41, 13, 17, 41, 13, 18, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 18, 13, 13, 13, 30, 0, 13, 2, 13, 18, 13, 13, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 108, 8 ], [ 108, 9 ], [ 9, 10 ], [ 9, 11 ], [ 108, 12 ], [ 12, 13 ], [ 12, 14 ], [ 108, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 18, 20 ], [ 17, 21 ], [ 21, 22 ], [ 22, 23 ], [ 17, 24 ], [ 24, 25 ], [ 25, 26 ], [ 15, 27 ], [ 27, 28 ], [ 108, 29 ], [ 29, 30 ], [ 29, 31 ], [ 31, 32 ], [ 32, 33 ], [ 32, 34 ], [ 34, 35 ], [ 35, 36 ], [ 31, 37 ], [ 37, 38 ], [ 37, 39 ], [ 31, 41 ], [ 41, 42 ], [ 42, 43 ], [ 43, 44 ], [ 43, 45 ], [ 41, 46 ], [ 46, 47 ], [ 46, 48 ], [ 41, 49 ], [ 49, 50 ], [ 50, 51 ], [ 41, 52 ], [ 52, 53 ], [ 53, 54 ], [ 54, 55 ], [ 54, 56 ], [ 53, 57 ], [ 57, 58 ], [ 58, 59 ], [ 31, 60 ], [ 60, 61 ], [ 60, 62 ], [ 31, 63 ], [ 63, 64 ], [ 63, 65 ], [ 65, 66 ], [ 65, 67 ], [ 31, 68 ], [ 68, 69 ], [ 69, 70 ], [ 70, 71 ], [ 70, 72 ], [ 68, 73 ], [ 73, 74 ], [ 73, 75 ], [ 68, 76 ], [ 76, 77 ], [ 77, 78 ], [ 68, 79 ], [ 80, 80 ], [ 80, 81 ], [ 81, 82 ], [ 82, 83 ], [ 83, 84 ], [ 83, 85 ], [ 82, 86 ], [ 81, 87 ], [ 87, 88 ], [ 88, 89 ], [ 88, 90 ], [ 90, 91 ], [ 90, 92 ], [ 92, 93 ], [ 92, 94 ], [ 81, 95 ], [ 95, 96 ], [ 96, 97 ], [ 96, 98 ], [ 98, 99 ], [ 98, 100 ], [ 31, 101 ], [ 101, 102 ], [ 102, 103 ], [ 103, 104 ], [ 103, 105 ], [ 101, 106 ], [ 0, 107 ], [ 107, 108 ], [ 107, 109 ] ]
[ "import java.util.*;\nimport java.io.*;\npublic class Main {\n\n\tstatic Scanner inp= new Scanner(System.in);\n\tstatic PrintWriter out= new PrintWriter(System.out);\n\tpublic static void main(String args[]) {\t\t \t\n\t \tMain g=new Main();\n\t \tg.main();\n\t \tout.close();\n\t}\n\n\t\n\t\n\t//Main\n\tvoid main() {\n\t\t\n\t\tint n=inp.nextInt();\n\t\tlong a[]=new long[n];\n\t\tfor(int i=0;i<n;i++) a[i]=inp.nextLong();\n\t\tlong gg=0;\n\t\tlong max=a[0];\n\t\tfor(int i=1;i<n;i++) {\n\t\t\tif(a[i]<max) {\n\t\t\t\tgg+=max-a[i];\n\t\t\t}else {\n\t\t\t\tmax=a[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(gg);\n\t}\n \n \n\t\t\n}", "import java.util.*;", "util.*", "java", "import java.io.*;", "io.*", "java", "public class Main {\n\n\tstatic Scanner inp= new Scanner(System.in);\n\tstatic PrintWriter out= new PrintWriter(System.out);\n\tpublic static void main(String args[]) {\t\t \t\n\t \tMain g=new Main();\n\t \tg.main();\n\t \tout.close();\n\t}\n\n\t\n\t\n\t//Main\n\tvoid main() {\n\t\t\n\t\tint n=inp.nextInt();\n\t\tlong a[]=new long[n];\n\t\tfor(int i=0;i<n;i++) a[i]=inp.nextLong();\n\t\tlong gg=0;\n\t\tlong max=a[0];\n\t\tfor(int i=1;i<n;i++) {\n\t\t\tif(a[i]<max) {\n\t\t\t\tgg+=max-a[i];\n\t\t\t}else {\n\t\t\t\tmax=a[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(gg);\n\t}\n \n \n\t\t\n}", "Main", "static Scanner inp= new Scanner(System.in);", "inp", "new Scanner(System.in)", "static PrintWriter out= new PrintWriter(System.out);", "out", "new PrintWriter(System.out)", "public static void main(String args[]) {\t\t \t\n\t \tMain g=new Main();\n\t \tg.main();\n\t \tout.close();\n\t}", "main", "{\t\t \t\n\t \tMain g=new Main();\n\t \tg.main();\n\t \tout.close();\n\t}", "Main g=new Main();", "g", "new Main()", "g.main()", "g.main", "g", "out.close()", "out.close", "out", "String args[]", "args", "//Main\n\tvoid main() {\n\t\t\n\t\tint n=inp.nextInt();\n\t\tlong a[]=new long[n];\n\t\tfor(int i=0;i<n;i++) a[i]=inp.nextLong();\n\t\tlong gg=0;\n\t\tlong max=a[0];\n\t\tfor(int i=1;i<n;i++) {\n\t\t\tif(a[i]<max) {\n\t\t\t\tgg+=max-a[i];\n\t\t\t}else {\n\t\t\t\tmax=a[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(gg);\n\t}", "main", "{\n\t\t\n\t\tint n=inp.nextInt();\n\t\tlong a[]=new long[n];\n\t\tfor(int i=0;i<n;i++) a[i]=inp.nextLong();\n\t\tlong gg=0;\n\t\tlong max=a[0];\n\t\tfor(int i=1;i<n;i++) {\n\t\t\tif(a[i]<max) {\n\t\t\t\tgg+=max-a[i];\n\t\t\t}else {\n\t\t\t\tmax=a[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(gg);\n\t}", "int n=inp.nextInt();", "n", "inp.nextInt()", "inp.nextInt", "inp", "long a[]=new long[n];", "a", "new long[n]", "n", "for(int i=0;i<n;i++) a[i]=inp.nextLong();", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "a[i]=inp.nextLong();", "a[i]=inp.nextLong()", "a[i]", "a", "i", "inp.nextLong()", "inp.nextLong", "inp", "long gg=0;", "gg", "0", "long max=a[0];", "max", "a[0]", "a", "0", "for(int i=1;i<n;i++) {\n\t\t\tif(a[i]<max) {\n\t\t\t\tgg+=max-a[i];\n\t\t\t}else {\n\t\t\t\tmax=a[i];\n\t\t\t}\n\t\t}", "int i=1;", "int i=1;", "i", "1", "i<n", "i", "n", "i++", "i++", "i", "{\n\t\t\tif(a[i]<max) {\n\t\t\t\tgg+=max-a[i];\n\t\t\t}else {\n\t\t\t\tmax=a[i];\n\t\t\t}\n\t\t}", "{\n\t\t\tif(a[i]<max) {\n\t\t\t\tgg+=max-a[i];\n\t\t\t}else {\n\t\t\t\tmax=a[i];\n\t\t\t}\n\t\t}", "if(a[i]<max) {\n\t\t\t\tgg+=max-a[i];\n\t\t\t}else {\n\t\t\t\tmax=a[i];\n\t\t\t}", "a[i]<max", "a[i]", "a", "i", "max", "{\n\t\t\t\tgg+=max-a[i];\n\t\t\t}", "gg+=max-a[i]", "gg", "max-a[i]", "max", "a[i]", "a", "i", "{\n\t\t\t\tmax=a[i];\n\t\t\t}", "max=a[i]", "max", "a[i]", "a", "i", "System.out.println(gg)", "System.out.println", "System.out", "System", "System.out", "gg", "public class Main {\n\n\tstatic Scanner inp= new Scanner(System.in);\n\tstatic PrintWriter out= new PrintWriter(System.out);\n\tpublic static void main(String args[]) {\t\t \t\n\t \tMain g=new Main();\n\t \tg.main();\n\t \tout.close();\n\t}\n\n\t\n\t\n\t//Main\n\tvoid main() {\n\t\t\n\t\tint n=inp.nextInt();\n\t\tlong a[]=new long[n];\n\t\tfor(int i=0;i<n;i++) a[i]=inp.nextLong();\n\t\tlong gg=0;\n\t\tlong max=a[0];\n\t\tfor(int i=1;i<n;i++) {\n\t\t\tif(a[i]<max) {\n\t\t\t\tgg+=max-a[i];\n\t\t\t}else {\n\t\t\t\tmax=a[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(gg);\n\t}\n \n \n\t\t\n}", "public class Main {\n\n\tstatic Scanner inp= new Scanner(System.in);\n\tstatic PrintWriter out= new PrintWriter(System.out);\n\tpublic static void main(String args[]) {\t\t \t\n\t \tMain g=new Main();\n\t \tg.main();\n\t \tout.close();\n\t}\n\n\t\n\t\n\t//Main\n\tvoid main() {\n\t\t\n\t\tint n=inp.nextInt();\n\t\tlong a[]=new long[n];\n\t\tfor(int i=0;i<n;i++) a[i]=inp.nextLong();\n\t\tlong gg=0;\n\t\tlong max=a[0];\n\t\tfor(int i=1;i<n;i++) {\n\t\t\tif(a[i]<max) {\n\t\t\t\tgg+=max-a[i];\n\t\t\t}else {\n\t\t\t\tmax=a[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(gg);\n\t}\n \n \n\t\t\n}", "Main" ]
import java.util.*; import java.io.*; public class Main { static Scanner inp= new Scanner(System.in); static PrintWriter out= new PrintWriter(System.out); public static void main(String args[]) { Main g=new Main(); g.main(); out.close(); } //Main void main() { int n=inp.nextInt(); long a[]=new long[n]; for(int i=0;i<n;i++) a[i]=inp.nextLong(); long gg=0; long max=a[0]; for(int i=1;i<n;i++) { if(a[i]<max) { gg+=max-a[i]; }else { max=a[i]; } } System.out.println(gg); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 38, 5, 13, 30, 4, 18, 18, 13, 13, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 4, 18, 13, 41, 13, 4, 18, 4, 18, 13, 17, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 2, 13, 17, 1, 40, 13, 30, 30, 41, 13, 18, 13, 13, 41, 13, 18, 13, 2, 13, 17, 14, 2, 13, 13, 30, 0, 13, 2, 2, 13, 13, 13, 0, 18, 13, 2, 13, 17, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 124, 5 ], [ 124, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 10, 11 ], [ 10, 12 ], [ 12, 13 ], [ 13, 14 ], [ 14, 15 ], [ 15, 16 ], [ 15, 17 ], [ 13, 18 ], [ 9, 19 ], [ 19, 20 ], [ 20, 21 ], [ 20, 22 ], [ 19, 23 ], [ 23, 24 ], [ 23, 25 ], [ 25, 26 ], [ 26, 27 ], [ 25, 28 ], [ 28, 29 ], [ 29, 30 ], [ 19, 31 ], [ 31, 32 ], [ 31, 33 ], [ 33, 34 ], [ 34, 35 ], [ 35, 36 ], [ 36, 37 ], [ 33, 38 ], [ 19, 39 ], [ 39, 40 ], [ 39, 41 ], [ 19, 43 ], [ 43, 44 ], [ 44, 45 ], [ 45, 46 ], [ 45, 47 ], [ 43, 48 ], [ 48, 49 ], [ 48, 50 ], [ 43, 51 ], [ 51, 52 ], [ 52, 53 ], [ 43, 54 ], [ 55, 55 ], [ 55, 56 ], [ 56, 57 ], [ 57, 58 ], [ 57, 59 ], [ 56, 60 ], [ 60, 61 ], [ 61, 62 ], [ 60, 63 ], [ 63, 64 ], [ 63, 65 ], [ 19, 66 ], [ 66, 67 ], [ 66, 68 ], [ 19, 69 ], [ 69, 70 ], [ 70, 71 ], [ 71, 72 ], [ 71, 73 ], [ 69, 74 ], [ 74, 75 ], [ 74, 76 ], [ 76, 77 ], [ 76, 78 ], [ 69, 79 ], [ 79, 80 ], [ 80, 81 ], [ 69, 82 ], [ 83, 83 ], [ 83, 84 ], [ 84, 85 ], [ 84, 86 ], [ 86, 87 ], [ 86, 88 ], [ 83, 89 ], [ 89, 90 ], [ 89, 91 ], [ 91, 92 ], [ 91, 93 ], [ 93, 94 ], [ 93, 95 ], [ 83, 96 ], [ 96, 97 ], [ 97, 98 ], [ 97, 99 ], [ 96, 100 ], [ 100, 101 ], [ 101, 102 ], [ 101, 103 ], [ 103, 104 ], [ 104, 105 ], [ 104, 106 ], [ 103, 107 ], [ 100, 108 ], [ 108, 109 ], [ 109, 110 ], [ 109, 111 ], [ 111, 112 ], [ 111, 113 ], [ 108, 114 ], [ 19, 115 ], [ 115, 116 ], [ 116, 117 ], [ 117, 118 ], [ 117, 119 ], [ 115, 120 ], [ 6, 121 ], [ 121, 122 ], [ 0, 123 ], [ 123, 124 ], [ 123, 125 ] ]
[ "import java.io.*;\n\npublic class Main {\n public static void main(String[] args) throws Exception {\n try{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \n //String N = br.readLine();\n int N = Integer.parseInt(br.readLine());\n String strSplit[] = br.readLine().split(\" \");\n int A[] = new int[N];\n for(int i=0; i<N; i++){\n A[i] = Integer.parseInt(strSplit[i]);\n }\n \n long ans = 0;\n for(int i=0; i<N-1; i++){\n int a = A[i];\n int b = A[i+1];\n \n if(a > b){\n ans = ans + a - b;\n A[i+1] = a;\n }\n }\n \n System.out.println(ans);\n \n }catch(Exception e){\n System.out.println(e);\n }\n }\n}", "import java.io.*;", "io.*", "java", "public class Main {\n public static void main(String[] args) throws Exception {\n try{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \n //String N = br.readLine();\n int N = Integer.parseInt(br.readLine());\n String strSplit[] = br.readLine().split(\" \");\n int A[] = new int[N];\n for(int i=0; i<N; i++){\n A[i] = Integer.parseInt(strSplit[i]);\n }\n \n long ans = 0;\n for(int i=0; i<N-1; i++){\n int a = A[i];\n int b = A[i+1];\n \n if(a > b){\n ans = ans + a - b;\n A[i+1] = a;\n }\n }\n \n System.out.println(ans);\n \n }catch(Exception e){\n System.out.println(e);\n }\n }\n}", "Main", "public static void main(String[] args) throws Exception {\n try{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \n //String N = br.readLine();\n int N = Integer.parseInt(br.readLine());\n String strSplit[] = br.readLine().split(\" \");\n int A[] = new int[N];\n for(int i=0; i<N; i++){\n A[i] = Integer.parseInt(strSplit[i]);\n }\n \n long ans = 0;\n for(int i=0; i<N-1; i++){\n int a = A[i];\n int b = A[i+1];\n \n if(a > b){\n ans = ans + a - b;\n A[i+1] = a;\n }\n }\n \n System.out.println(ans);\n \n }catch(Exception e){\n System.out.println(e);\n }\n }", "main", "{\n try{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \n //String N = br.readLine();\n int N = Integer.parseInt(br.readLine());\n String strSplit[] = br.readLine().split(\" \");\n int A[] = new int[N];\n for(int i=0; i<N; i++){\n A[i] = Integer.parseInt(strSplit[i]);\n }\n \n long ans = 0;\n for(int i=0; i<N-1; i++){\n int a = A[i];\n int b = A[i+1];\n \n if(a > b){\n ans = ans + a - b;\n A[i+1] = a;\n }\n }\n \n System.out.println(ans);\n \n }catch(Exception e){\n System.out.println(e);\n }\n }", "try{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \n //String N = br.readLine();\n int N = Integer.parseInt(br.readLine());\n String strSplit[] = br.readLine().split(\" \");\n int A[] = new int[N];\n for(int i=0; i<N; i++){\n A[i] = Integer.parseInt(strSplit[i]);\n }\n \n long ans = 0;\n for(int i=0; i<N-1; i++){\n int a = A[i];\n int b = A[i+1];\n \n if(a > b){\n ans = ans + a - b;\n A[i+1] = a;\n }\n }\n \n System.out.println(ans);\n \n }catch(Exception e){\n System.out.println(e);\n }", "catch(Exception e){\n System.out.println(e);\n }", "Exception e", "{\n System.out.println(e);\n }", "System.out.println(e)", "System.out.println", "System.out", "System", "System.out", "e", "{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \n //String N = br.readLine();\n int N = Integer.parseInt(br.readLine());\n String strSplit[] = br.readLine().split(\" \");\n int A[] = new int[N];\n for(int i=0; i<N; i++){\n A[i] = Integer.parseInt(strSplit[i]);\n }\n \n long ans = 0;\n for(int i=0; i<N-1; i++){\n int a = A[i];\n int b = A[i+1];\n \n if(a > b){\n ans = ans + a - b;\n A[i+1] = a;\n }\n }\n \n System.out.println(ans);\n \n }", "BufferedReader br = new BufferedReader(new InputStreamReader(System.in));", "br", "new BufferedReader(new InputStreamReader(System.in))", "int N = Integer.parseInt(br.readLine());", "N", "Integer.parseInt(br.readLine())", "Integer.parseInt", "Integer", "br.readLine()", "br.readLine", "br", "String strSplit[] = br.readLine().split(\" \");", "strSplit", "br.readLine().split(\" \")", "br.readLine().split", "br.readLine()", "br.readLine", "br", "\" \"", "int A[] = new int[N];", "A", "new int[N]", "N", "for(int i=0; i<N; i++){\n A[i] = Integer.parseInt(strSplit[i]);\n }", "int i=0;", "int i=0;", "i", "0", "i<N", "i", "N", "i++", "i++", "i", "{\n A[i] = Integer.parseInt(strSplit[i]);\n }", "{\n A[i] = Integer.parseInt(strSplit[i]);\n }", "A[i] = Integer.parseInt(strSplit[i])", "A[i]", "A", "i", "Integer.parseInt(strSplit[i])", "Integer.parseInt", "Integer", "strSplit[i]", "strSplit", "i", "long ans = 0;", "ans", "0", "for(int i=0; i<N-1; i++){\n int a = A[i];\n int b = A[i+1];\n \n if(a > b){\n ans = ans + a - b;\n A[i+1] = a;\n }\n }", "int i=0;", "int i=0;", "i", "0", "i<N-1", "i", "N-1", "N", "1", "i++", "i++", "i", "{\n int a = A[i];\n int b = A[i+1];\n \n if(a > b){\n ans = ans + a - b;\n A[i+1] = a;\n }\n }", "{\n int a = A[i];\n int b = A[i+1];\n \n if(a > b){\n ans = ans + a - b;\n A[i+1] = a;\n }\n }", "int a = A[i];", "a", "A[i]", "A", "i", "int b = A[i+1];", "b", "A[i+1]", "A", "i+1", "i", "1", "if(a > b){\n ans = ans + a - b;\n A[i+1] = a;\n }", "a > b", "a", "b", "{\n ans = ans + a - b;\n A[i+1] = a;\n }", "ans = ans + a - b", "ans", "ans + a - b", "ans + a", "ans", "a", "b", "A[i+1] = a", "A[i+1]", "A", "i+1", "i", "1", "a", "System.out.println(ans)", "System.out.println", "System.out", "System", "System.out", "ans", "String[] args", "args", "public class Main {\n public static void main(String[] args) throws Exception {\n try{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \n //String N = br.readLine();\n int N = Integer.parseInt(br.readLine());\n String strSplit[] = br.readLine().split(\" \");\n int A[] = new int[N];\n for(int i=0; i<N; i++){\n A[i] = Integer.parseInt(strSplit[i]);\n }\n \n long ans = 0;\n for(int i=0; i<N-1; i++){\n int a = A[i];\n int b = A[i+1];\n \n if(a > b){\n ans = ans + a - b;\n A[i+1] = a;\n }\n }\n \n System.out.println(ans);\n \n }catch(Exception e){\n System.out.println(e);\n }\n }\n}", "public class Main {\n public static void main(String[] args) throws Exception {\n try{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \n //String N = br.readLine();\n int N = Integer.parseInt(br.readLine());\n String strSplit[] = br.readLine().split(\" \");\n int A[] = new int[N];\n for(int i=0; i<N; i++){\n A[i] = Integer.parseInt(strSplit[i]);\n }\n \n long ans = 0;\n for(int i=0; i<N-1; i++){\n int a = A[i];\n int b = A[i+1];\n \n if(a > b){\n ans = ans + a - b;\n A[i+1] = a;\n }\n }\n \n System.out.println(ans);\n \n }catch(Exception e){\n System.out.println(e);\n }\n }\n}", "Main" ]
import java.io.*; public class Main { public static void main(String[] args) throws Exception { try{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); //String N = br.readLine(); int N = Integer.parseInt(br.readLine()); String strSplit[] = br.readLine().split(" "); int A[] = new int[N]; for(int i=0; i<N; i++){ A[i] = Integer.parseInt(strSplit[i]); } long ans = 0; for(int i=0; i<N-1; i++){ int a = A[i]; int b = A[i+1]; if(a > b){ ans = ans + a - b; A[i+1] = a; } } System.out.println(ans); }catch(Exception e){ System.out.println(e); } } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 41, 13, 20, 13, 41, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 14, 2, 13, 17, 30, 0, 18, 13, 13, 18, 13, 13, 30, 14, 2, 18, 13, 2, 13, 17, 18, 13, 13, 30, 0, 18, 13, 13, 18, 13, 13, 30, 0, 18, 13, 13, 18, 13, 2, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 18, 13, 13, 18, 13, 13, 30, 0, 13, 2, 18, 13, 13, 18, 13, 13, 0, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 134, 5 ], [ 134, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 8, 21 ], [ 21, 22 ], [ 21, 23 ], [ 8, 25 ], [ 25, 26 ], [ 8, 27 ], [ 27, 28 ], [ 27, 29 ], [ 8, 30 ], [ 30, 31 ], [ 31, 32 ], [ 32, 33 ], [ 32, 34 ], [ 30, 35 ], [ 35, 36 ], [ 35, 37 ], [ 30, 38 ], [ 38, 39 ], [ 39, 40 ], [ 30, 41 ], [ 42, 42 ], [ 42, 43 ], [ 43, 44 ], [ 44, 45 ], [ 44, 46 ], [ 43, 47 ], [ 47, 48 ], [ 48, 49 ], [ 42, 50 ], [ 50, 51 ], [ 51, 52 ], [ 51, 53 ], [ 50, 54 ], [ 54, 55 ], [ 55, 56 ], [ 56, 57 ], [ 56, 58 ], [ 55, 59 ], [ 59, 60 ], [ 59, 61 ], [ 50, 62 ], [ 62, 63 ], [ 63, 64 ], [ 64, 65 ], [ 65, 66 ], [ 65, 67 ], [ 67, 68 ], [ 67, 69 ], [ 64, 70 ], [ 70, 71 ], [ 70, 72 ], [ 63, 73 ], [ 73, 74 ], [ 74, 75 ], [ 75, 76 ], [ 75, 77 ], [ 74, 78 ], [ 78, 79 ], [ 78, 80 ], [ 63, 81 ], [ 81, 82 ], [ 82, 83 ], [ 83, 84 ], [ 83, 85 ], [ 82, 86 ], [ 86, 87 ], [ 86, 88 ], [ 88, 89 ], [ 88, 90 ], [ 8, 91 ], [ 91, 92 ], [ 92, 93 ], [ 93, 94 ], [ 93, 95 ], [ 91, 96 ], [ 96, 97 ], [ 96, 98 ], [ 91, 99 ], [ 99, 100 ], [ 100, 101 ], [ 91, 102 ], [ 103, 103 ], [ 103, 104 ], [ 104, 105 ], [ 105, 106 ], [ 106, 107 ], [ 106, 108 ], [ 105, 109 ], [ 109, 110 ], [ 109, 111 ], [ 104, 112 ], [ 112, 113 ], [ 113, 114 ], [ 113, 115 ], [ 115, 116 ], [ 116, 117 ], [ 116, 118 ], [ 115, 119 ], [ 119, 120 ], [ 119, 121 ], [ 112, 122 ], [ 122, 123 ], [ 122, 124 ], [ 8, 125 ], [ 125, 126 ], [ 126, 127 ], [ 127, 128 ], [ 127, 129 ], [ 125, 130 ], [ 6, 131 ], [ 131, 132 ], [ 0, 133 ], [ 133, 134 ], [ 133, 135 ] ]
[ "import java.util.*;\npublic class Main{\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n long result[] = new long[N];\n long Comparison[] = new long[N];\n long min;\n long anc = 0;\n for(int i = 0;i < N;i++){\n result[i] = sc.nextInt();\n if(i < 1){\n Comparison[i] = result[i];\n }else{\n if(Comparison[i - 1] < result[i]){\n Comparison[i] = result[i];\n }else{\n Comparison[i] = Comparison[i-1];\n }\n }\n }\n for(int i = 0;i < N;i++){\n if(result[i] != Comparison[i]){\n min = Comparison[i] - result[i];\n anc += min;\n }\n }\n System.out.println(anc);\n }\n}", "import java.util.*;", "util.*", "java", "public class Main{\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n long result[] = new long[N];\n long Comparison[] = new long[N];\n long min;\n long anc = 0;\n for(int i = 0;i < N;i++){\n result[i] = sc.nextInt();\n if(i < 1){\n Comparison[i] = result[i];\n }else{\n if(Comparison[i - 1] < result[i]){\n Comparison[i] = result[i];\n }else{\n Comparison[i] = Comparison[i-1];\n }\n }\n }\n for(int i = 0;i < N;i++){\n if(result[i] != Comparison[i]){\n min = Comparison[i] - result[i];\n anc += min;\n }\n }\n System.out.println(anc);\n }\n}", "Main", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n long result[] = new long[N];\n long Comparison[] = new long[N];\n long min;\n long anc = 0;\n for(int i = 0;i < N;i++){\n result[i] = sc.nextInt();\n if(i < 1){\n Comparison[i] = result[i];\n }else{\n if(Comparison[i - 1] < result[i]){\n Comparison[i] = result[i];\n }else{\n Comparison[i] = Comparison[i-1];\n }\n }\n }\n for(int i = 0;i < N;i++){\n if(result[i] != Comparison[i]){\n min = Comparison[i] - result[i];\n anc += min;\n }\n }\n System.out.println(anc);\n }", "main", "{\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n long result[] = new long[N];\n long Comparison[] = new long[N];\n long min;\n long anc = 0;\n for(int i = 0;i < N;i++){\n result[i] = sc.nextInt();\n if(i < 1){\n Comparison[i] = result[i];\n }else{\n if(Comparison[i - 1] < result[i]){\n Comparison[i] = result[i];\n }else{\n Comparison[i] = Comparison[i-1];\n }\n }\n }\n for(int i = 0;i < N;i++){\n if(result[i] != Comparison[i]){\n min = Comparison[i] - result[i];\n anc += min;\n }\n }\n System.out.println(anc);\n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int N = sc.nextInt();", "N", "sc.nextInt()", "sc.nextInt", "sc", "long result[] = new long[N];", "result", "new long[N]", "N", "long Comparison[] = new long[N];", "Comparison", "new long[N]", "N", "long min;", "min", "long anc = 0;", "anc", "0", "for(int i = 0;i < N;i++){\n result[i] = sc.nextInt();\n if(i < 1){\n Comparison[i] = result[i];\n }else{\n if(Comparison[i - 1] < result[i]){\n Comparison[i] = result[i];\n }else{\n Comparison[i] = Comparison[i-1];\n }\n }\n }", "int i = 0;", "int i = 0;", "i", "0", "i < N", "i", "N", "i++", "i++", "i", "{\n result[i] = sc.nextInt();\n if(i < 1){\n Comparison[i] = result[i];\n }else{\n if(Comparison[i - 1] < result[i]){\n Comparison[i] = result[i];\n }else{\n Comparison[i] = Comparison[i-1];\n }\n }\n }", "{\n result[i] = sc.nextInt();\n if(i < 1){\n Comparison[i] = result[i];\n }else{\n if(Comparison[i - 1] < result[i]){\n Comparison[i] = result[i];\n }else{\n Comparison[i] = Comparison[i-1];\n }\n }\n }", "result[i] = sc.nextInt()", "result[i]", "result", "i", "sc.nextInt()", "sc.nextInt", "sc", "if(i < 1){\n Comparison[i] = result[i];\n }else{\n if(Comparison[i - 1] < result[i]){\n Comparison[i] = result[i];\n }else{\n Comparison[i] = Comparison[i-1];\n }\n }", "i < 1", "i", "1", "{\n Comparison[i] = result[i];\n }", "Comparison[i] = result[i]", "Comparison[i]", "Comparison", "i", "result[i]", "result", "i", "{\n if(Comparison[i - 1] < result[i]){\n Comparison[i] = result[i];\n }else{\n Comparison[i] = Comparison[i-1];\n }\n }", "if(Comparison[i - 1] < result[i]){\n Comparison[i] = result[i];\n }else{\n Comparison[i] = Comparison[i-1];\n }", "Comparison[i - 1] < result[i]", "Comparison[i - 1]", "Comparison", "i - 1", "i", "1", "result[i]", "result", "i", "{\n Comparison[i] = result[i];\n }", "Comparison[i] = result[i]", "Comparison[i]", "Comparison", "i", "result[i]", "result", "i", "{\n Comparison[i] = Comparison[i-1];\n }", "Comparison[i] = Comparison[i-1]", "Comparison[i]", "Comparison", "i", "Comparison[i-1]", "Comparison", "i-1", "i", "1", "for(int i = 0;i < N;i++){\n if(result[i] != Comparison[i]){\n min = Comparison[i] - result[i];\n anc += min;\n }\n }", "int i = 0;", "int i = 0;", "i", "0", "i < N", "i", "N", "i++", "i++", "i", "{\n if(result[i] != Comparison[i]){\n min = Comparison[i] - result[i];\n anc += min;\n }\n }", "{\n if(result[i] != Comparison[i]){\n min = Comparison[i] - result[i];\n anc += min;\n }\n }", "if(result[i] != Comparison[i]){\n min = Comparison[i] - result[i];\n anc += min;\n }", "result[i] != Comparison[i]", "result[i]", "result", "i", "Comparison[i]", "Comparison", "i", "{\n min = Comparison[i] - result[i];\n anc += min;\n }", "min = Comparison[i] - result[i]", "min", "Comparison[i] - result[i]", "Comparison[i]", "Comparison", "i", "result[i]", "result", "i", "anc += min", "anc", "min", "System.out.println(anc)", "System.out.println", "System.out", "System", "System.out", "anc", "String[] args", "args", "public class Main{\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n long result[] = new long[N];\n long Comparison[] = new long[N];\n long min;\n long anc = 0;\n for(int i = 0;i < N;i++){\n result[i] = sc.nextInt();\n if(i < 1){\n Comparison[i] = result[i];\n }else{\n if(Comparison[i - 1] < result[i]){\n Comparison[i] = result[i];\n }else{\n Comparison[i] = Comparison[i-1];\n }\n }\n }\n for(int i = 0;i < N;i++){\n if(result[i] != Comparison[i]){\n min = Comparison[i] - result[i];\n anc += min;\n }\n }\n System.out.println(anc);\n }\n}", "public class Main{\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n long result[] = new long[N];\n long Comparison[] = new long[N];\n long min;\n long anc = 0;\n for(int i = 0;i < N;i++){\n result[i] = sc.nextInt();\n if(i < 1){\n Comparison[i] = result[i];\n }else{\n if(Comparison[i - 1] < result[i]){\n Comparison[i] = result[i];\n }else{\n Comparison[i] = Comparison[i-1];\n }\n }\n }\n for(int i = 0;i < N;i++){\n if(result[i] != Comparison[i]){\n min = Comparison[i] - result[i];\n anc += min;\n }\n }\n System.out.println(anc);\n }\n}", "Main" ]
import java.util.*; public class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); long result[] = new long[N]; long Comparison[] = new long[N]; long min; long anc = 0; for(int i = 0;i < N;i++){ result[i] = sc.nextInt(); if(i < 1){ Comparison[i] = result[i]; }else{ if(Comparison[i - 1] < result[i]){ Comparison[i] = result[i]; }else{ Comparison[i] = Comparison[i-1]; } } } for(int i = 0;i < N;i++){ if(result[i] != Comparison[i]){ min = Comparison[i] - result[i]; anc += min; } } System.out.println(anc); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 14, 2, 13, 17, 30, 14, 2, 18, 13, 13, 18, 13, 2, 13, 17, 30, 0, 13, 4, 18, 13, 2, 18, 13, 13, 18, 13, 2, 13, 17, 0, 18, 13, 13, 18, 13, 2, 13, 17, 4, 18, 18, 13, 13, 13, 23, 13, 6, 13, 41, 13, 20, 41, 13, 12, 13, 30, 0, 13, 20, 12, 13, 30, 42, 40, 4, 18, 13, 0, 13, 20, 29, 4, 18, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 13, 14 ], [ 13, 15 ], [ 0, 16 ], [ 16, 17 ], [ 16, 18 ], [ 0, 19 ], [ 147, 20 ], [ 147, 21 ], [ 21, 22 ], [ 21, 23 ], [ 23, 24 ], [ 24, 25 ], [ 24, 26 ], [ 23, 27 ], [ 27, 28 ], [ 27, 29 ], [ 23, 30 ], [ 30, 31 ], [ 30, 32 ], [ 32, 33 ], [ 33, 34 ], [ 23, 35 ], [ 35, 36 ], [ 35, 37 ], [ 23, 39 ], [ 39, 40 ], [ 39, 41 ], [ 23, 42 ], [ 42, 43 ], [ 43, 44 ], [ 44, 45 ], [ 44, 46 ], [ 42, 47 ], [ 47, 48 ], [ 47, 49 ], [ 42, 50 ], [ 50, 51 ], [ 51, 52 ], [ 42, 53 ], [ 54, 54 ], [ 54, 55 ], [ 55, 56 ], [ 56, 57 ], [ 56, 58 ], [ 55, 59 ], [ 59, 60 ], [ 60, 61 ], [ 54, 62 ], [ 62, 63 ], [ 63, 64 ], [ 63, 65 ], [ 62, 66 ], [ 66, 67 ], [ 67, 68 ], [ 68, 69 ], [ 69, 70 ], [ 69, 71 ], [ 68, 72 ], [ 72, 73 ], [ 72, 74 ], [ 74, 75 ], [ 74, 76 ], [ 67, 77 ], [ 77, 78 ], [ 78, 79 ], [ 78, 80 ], [ 80, 81 ], [ 81, 82 ], [ 80, 83 ], [ 83, 84 ], [ 84, 85 ], [ 84, 86 ], [ 83, 87 ], [ 87, 88 ], [ 87, 89 ], [ 89, 90 ], [ 89, 91 ], [ 77, 92 ], [ 92, 93 ], [ 93, 94 ], [ 93, 95 ], [ 92, 96 ], [ 96, 97 ], [ 96, 98 ], [ 98, 99 ], [ 98, 100 ], [ 23, 101 ], [ 101, 102 ], [ 102, 103 ], [ 103, 104 ], [ 103, 105 ], [ 101, 106 ], [ 21, 107 ], [ 107, 108 ], [ 147, 109 ], [ 109, 110 ], [ 109, 111 ], [ 111, 112 ], [ 111, 113 ], [ 109, 114 ], [ 114, 115 ], [ 109, 116 ], [ 116, 117 ], [ 116, 118 ], [ 118, 119 ], [ 119, 120 ], [ 119, 121 ], [ 109, 122 ], [ 122, 123 ], [ 122, 124 ], [ 124, 125 ], [ 125, 126 ], [ 126, 127 ], [ 127, 128 ], [ 128, 129 ], [ 125, 130 ], [ 130, 131 ], [ 130, 132 ], [ 124, 133 ], [ 133, 134 ], [ 134, 135 ], [ 135, 136 ], [ 109, 137 ], [ 137, 138 ], [ 137, 139 ], [ 139, 140 ], [ 140, 141 ], [ 141, 142 ], [ 142, 143 ], [ 141, 144 ], [ 144, 145 ], [ 0, 146 ], [ 146, 147 ], [ 146, 148 ] ]
[ "//package com.company;\nimport java.util.Scanner;\nimport java.util.*;\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\nimport static java.lang.Math.*;\n\npublic class Main {\n\n static class FastScanner {\n StringTokenizer tok = new StringTokenizer(\"\");\n BufferedReader in;\n\n FastScanner() {\n in = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() throws IOException {\n while (!tok.hasMoreElements())\n tok = new StringTokenizer(in.readLine());\n return tok.nextToken();\n }\n\n int nextInt() throws IOException {\n return Integer.parseInt(next());\n }\n\n\n }\n\n public static void main(String[] args) throws IOException {\n\n FastScanner input = new FastScanner();\n Scanner in = new Scanner(System.in);\n\n int n = input.nextInt();\n int a[] = new int[n];\n long ans = 0 ;\n for( int i = 0 ; i < n ; i++ ){\n a[i] = input.nextInt();\n if( i > 0 ){\n if( a[i] < a[i-1]){\n ans += Math.abs(a[i]-a[i-1]);\n a[i] = a[i-1];\n }\n }\n }\n System.out.println(ans);\n\n\n\n\n }\n}", "import java.util.Scanner;", "Scanner", "java.util", "import java.util.*;", "util.*", "java", "import java.io.BufferedReader;", "BufferedReader", "java.io", "import java.io.IOException;", "IOException", "java.io", "import java.io.InputStreamReader;", "InputStreamReader", "java.io", "import static java.lang.Math.*;", "import static java.lang.Math.*;", "import static java.lang.Math.*;", "public class Main {\n\n static class FastScanner {\n StringTokenizer tok = new StringTokenizer(\"\");\n BufferedReader in;\n\n FastScanner() {\n in = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() throws IOException {\n while (!tok.hasMoreElements())\n tok = new StringTokenizer(in.readLine());\n return tok.nextToken();\n }\n\n int nextInt() throws IOException {\n return Integer.parseInt(next());\n }\n\n\n }\n\n public static void main(String[] args) throws IOException {\n\n FastScanner input = new FastScanner();\n Scanner in = new Scanner(System.in);\n\n int n = input.nextInt();\n int a[] = new int[n];\n long ans = 0 ;\n for( int i = 0 ; i < n ; i++ ){\n a[i] = input.nextInt();\n if( i > 0 ){\n if( a[i] < a[i-1]){\n ans += Math.abs(a[i]-a[i-1]);\n a[i] = a[i-1];\n }\n }\n }\n System.out.println(ans);\n\n\n\n\n }\n}", "Main", "public static void main(String[] args) throws IOException {\n\n FastScanner input = new FastScanner();\n Scanner in = new Scanner(System.in);\n\n int n = input.nextInt();\n int a[] = new int[n];\n long ans = 0 ;\n for( int i = 0 ; i < n ; i++ ){\n a[i] = input.nextInt();\n if( i > 0 ){\n if( a[i] < a[i-1]){\n ans += Math.abs(a[i]-a[i-1]);\n a[i] = a[i-1];\n }\n }\n }\n System.out.println(ans);\n\n\n\n\n }", "main", "{\n\n FastScanner input = new FastScanner();\n Scanner in = new Scanner(System.in);\n\n int n = input.nextInt();\n int a[] = new int[n];\n long ans = 0 ;\n for( int i = 0 ; i < n ; i++ ){\n a[i] = input.nextInt();\n if( i > 0 ){\n if( a[i] < a[i-1]){\n ans += Math.abs(a[i]-a[i-1]);\n a[i] = a[i-1];\n }\n }\n }\n System.out.println(ans);\n\n\n\n\n }", "FastScanner input = new FastScanner();", "input", "new FastScanner()", "Scanner in = new Scanner(System.in);", "in", "new Scanner(System.in)", "int n = input.nextInt();", "n", "input.nextInt()", "input.nextInt", "input", "int a[] = new int[n];", "a", "new int[n]", "n", "long ans = 0 ;", "ans", "0", "for( int i = 0 ; i < n ; i++ ){\n a[i] = input.nextInt();\n if( i > 0 ){\n if( a[i] < a[i-1]){\n ans += Math.abs(a[i]-a[i-1]);\n a[i] = a[i-1];\n }\n }\n }", "int i = 0 ;", "int i = 0 ;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n a[i] = input.nextInt();\n if( i > 0 ){\n if( a[i] < a[i-1]){\n ans += Math.abs(a[i]-a[i-1]);\n a[i] = a[i-1];\n }\n }\n }", "{\n a[i] = input.nextInt();\n if( i > 0 ){\n if( a[i] < a[i-1]){\n ans += Math.abs(a[i]-a[i-1]);\n a[i] = a[i-1];\n }\n }\n }", "a[i] = input.nextInt()", "a[i]", "a", "i", "input.nextInt()", "input.nextInt", "input", "if( i > 0 ){\n if( a[i] < a[i-1]){\n ans += Math.abs(a[i]-a[i-1]);\n a[i] = a[i-1];\n }\n }", "i > 0", "i", "0", "{\n if( a[i] < a[i-1]){\n ans += Math.abs(a[i]-a[i-1]);\n a[i] = a[i-1];\n }\n }", "if( a[i] < a[i-1]){\n ans += Math.abs(a[i]-a[i-1]);\n a[i] = a[i-1];\n }", "a[i] < a[i-1]", "a[i]", "a", "i", "a[i-1]", "a", "i-1", "i", "1", "{\n ans += Math.abs(a[i]-a[i-1]);\n a[i] = a[i-1];\n }", "ans += Math.abs(a[i]-a[i-1])", "ans", "Math.abs(a[i]-a[i-1])", "Math.abs", "Math", "a[i]-a[i-1]", "a[i]", "a", "i", "a[i-1]", "a", "i-1", "i", "1", "a[i] = a[i-1]", "a[i]", "a", "i", "a[i-1]", "a", "i-1", "i", "1", "System.out.println(ans)", "System.out.println", "System.out", "System", "System.out", "ans", "String[] args", "args", "static class FastScanner {\n StringTokenizer tok = new StringTokenizer(\"\");\n BufferedReader in;\n\n FastScanner() {\n in = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() throws IOException {\n while (!tok.hasMoreElements())\n tok = new StringTokenizer(in.readLine());\n return tok.nextToken();\n }\n\n int nextInt() throws IOException {\n return Integer.parseInt(next());\n }\n\n\n }", "FastScanner", "StringTokenizer tok = new StringTokenizer(\"\");", "tok", "new StringTokenizer(\"\")", "BufferedReader in;", "in", "FastScanner() {\n in = new BufferedReader(new InputStreamReader(System.in));\n }", "FastScanner", "{\n in = new BufferedReader(new InputStreamReader(System.in));\n }", "in = new BufferedReader(new InputStreamReader(System.in))", "in", "new BufferedReader(new InputStreamReader(System.in))", "String next() throws IOException {\n while (!tok.hasMoreElements())\n tok = new StringTokenizer(in.readLine());\n return tok.nextToken();\n }", "next", "{\n while (!tok.hasMoreElements())\n tok = new StringTokenizer(in.readLine());\n return tok.nextToken();\n }", "while (!tok.hasMoreElements())\n tok = new StringTokenizer(in.readLine());", "!tok.hasMoreElements()", "tok.hasMoreElements()", "tok.hasMoreElements", "tok", "tok = new StringTokenizer(in.readLine())", "tok", "new StringTokenizer(in.readLine())", "return tok.nextToken();", "tok.nextToken()", "tok.nextToken", "tok", "int nextInt() throws IOException {\n return Integer.parseInt(next());\n }", "nextInt", "{\n return Integer.parseInt(next());\n }", "return Integer.parseInt(next());", "Integer.parseInt(next())", "Integer.parseInt", "Integer", "next()", "next", "public class Main {\n\n static class FastScanner {\n StringTokenizer tok = new StringTokenizer(\"\");\n BufferedReader in;\n\n FastScanner() {\n in = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() throws IOException {\n while (!tok.hasMoreElements())\n tok = new StringTokenizer(in.readLine());\n return tok.nextToken();\n }\n\n int nextInt() throws IOException {\n return Integer.parseInt(next());\n }\n\n\n }\n\n public static void main(String[] args) throws IOException {\n\n FastScanner input = new FastScanner();\n Scanner in = new Scanner(System.in);\n\n int n = input.nextInt();\n int a[] = new int[n];\n long ans = 0 ;\n for( int i = 0 ; i < n ; i++ ){\n a[i] = input.nextInt();\n if( i > 0 ){\n if( a[i] < a[i-1]){\n ans += Math.abs(a[i]-a[i-1]);\n a[i] = a[i-1];\n }\n }\n }\n System.out.println(ans);\n\n\n\n\n }\n}", "public class Main {\n\n static class FastScanner {\n StringTokenizer tok = new StringTokenizer(\"\");\n BufferedReader in;\n\n FastScanner() {\n in = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() throws IOException {\n while (!tok.hasMoreElements())\n tok = new StringTokenizer(in.readLine());\n return tok.nextToken();\n }\n\n int nextInt() throws IOException {\n return Integer.parseInt(next());\n }\n\n\n }\n\n public static void main(String[] args) throws IOException {\n\n FastScanner input = new FastScanner();\n Scanner in = new Scanner(System.in);\n\n int n = input.nextInt();\n int a[] = new int[n];\n long ans = 0 ;\n for( int i = 0 ; i < n ; i++ ){\n a[i] = input.nextInt();\n if( i > 0 ){\n if( a[i] < a[i-1]){\n ans += Math.abs(a[i]-a[i-1]);\n a[i] = a[i-1];\n }\n }\n }\n System.out.println(ans);\n\n\n\n\n }\n}", "Main" ]
//package com.company; import java.util.Scanner; import java.util.*; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import static java.lang.Math.*; public class Main { static class FastScanner { StringTokenizer tok = new StringTokenizer(""); BufferedReader in; FastScanner() { in = new BufferedReader(new InputStreamReader(System.in)); } String next() throws IOException { while (!tok.hasMoreElements()) tok = new StringTokenizer(in.readLine()); return tok.nextToken(); } int nextInt() throws IOException { return Integer.parseInt(next()); } } public static void main(String[] args) throws IOException { FastScanner input = new FastScanner(); Scanner in = new Scanner(System.in); int n = input.nextInt(); int a[] = new int[n]; long ans = 0 ; for( int i = 0 ; i < n ; i++ ){ a[i] = input.nextInt(); if( i > 0 ){ if( a[i] < a[i-1]){ ans += Math.abs(a[i]-a[i-1]); a[i] = a[i-1]; } } } System.out.println(ans); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 41, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 0, 13, 18, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 13, 18, 13, 13, 30, 0, 13, 18, 13, 13, 0, 13, 2, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 93, 5 ], [ 93, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 8, 21 ], [ 21, 22 ], [ 21, 23 ], [ 8, 24 ], [ 24, 25 ], [ 24, 26 ], [ 8, 27 ], [ 27, 28 ], [ 28, 29 ], [ 29, 30 ], [ 29, 31 ], [ 27, 32 ], [ 32, 33 ], [ 32, 34 ], [ 27, 35 ], [ 35, 36 ], [ 36, 37 ], [ 27, 38 ], [ 39, 39 ], [ 39, 40 ], [ 40, 41 ], [ 41, 42 ], [ 41, 43 ], [ 40, 44 ], [ 44, 45 ], [ 45, 46 ], [ 8, 47 ], [ 47, 48 ], [ 47, 49 ], [ 49, 50 ], [ 49, 51 ], [ 8, 52 ], [ 52, 53 ], [ 53, 54 ], [ 54, 55 ], [ 54, 56 ], [ 52, 57 ], [ 57, 58 ], [ 57, 59 ], [ 52, 60 ], [ 60, 61 ], [ 61, 62 ], [ 52, 63 ], [ 64, 64 ], [ 64, 65 ], [ 65, 66 ], [ 66, 67 ], [ 66, 68 ], [ 68, 69 ], [ 68, 70 ], [ 65, 71 ], [ 71, 72 ], [ 72, 73 ], [ 72, 74 ], [ 74, 75 ], [ 74, 76 ], [ 64, 77 ], [ 77, 78 ], [ 77, 79 ], [ 79, 80 ], [ 79, 81 ], [ 81, 82 ], [ 81, 83 ], [ 8, 84 ], [ 84, 85 ], [ 85, 86 ], [ 86, 87 ], [ 86, 88 ], [ 84, 89 ], [ 6, 90 ], [ 90, 91 ], [ 0, 92 ], [ 92, 93 ], [ 92, 94 ] ]
[ "import java.util.Scanner;\n \npublic class Main {\n \n public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();// 人数\n \tint[] height =new int[n];//身長\n \tint max=0;//自分より前の最大身長\n \tlong sum=0;\n \n \tfor(int i=0;i<n;i++){\n height[i] = sc.nextInt();\n }\n \n \tmax=height[0];\n \tfor(int i=0;i<n;i++){\n if(max<=height[i]){\n max=height[i];\n }\n sum+=max-height[i];\n }\n \tSystem.out.println(sum);\n } \n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n \n public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();// 人数\n \tint[] height =new int[n];//身長\n \tint max=0;//自分より前の最大身長\n \tlong sum=0;\n \n \tfor(int i=0;i<n;i++){\n height[i] = sc.nextInt();\n }\n \n \tmax=height[0];\n \tfor(int i=0;i<n;i++){\n if(max<=height[i]){\n max=height[i];\n }\n sum+=max-height[i];\n }\n \tSystem.out.println(sum);\n } \n}", "Main", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();// 人数\n \tint[] height =new int[n];//身長\n \tint max=0;//自分より前の最大身長\n \tlong sum=0;\n \n \tfor(int i=0;i<n;i++){\n height[i] = sc.nextInt();\n }\n \n \tmax=height[0];\n \tfor(int i=0;i<n;i++){\n if(max<=height[i]){\n max=height[i];\n }\n sum+=max-height[i];\n }\n \tSystem.out.println(sum);\n }", "main", "{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();// 人数\n \tint[] height =new int[n];//身長\n \tint max=0;//自分より前の最大身長\n \tlong sum=0;\n \n \tfor(int i=0;i<n;i++){\n height[i] = sc.nextInt();\n }\n \n \tmax=height[0];\n \tfor(int i=0;i<n;i++){\n if(max<=height[i]){\n max=height[i];\n }\n sum+=max-height[i];\n }\n \tSystem.out.println(sum);\n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "int[] height =new int[n];", "height", "new int[n]", "n", "int max=0;", "max", "0", "long sum=0;", "sum", "0", "for(int i=0;i<n;i++){\n height[i] = sc.nextInt();\n }", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\n height[i] = sc.nextInt();\n }", "{\n height[i] = sc.nextInt();\n }", "height[i] = sc.nextInt()", "height[i]", "height", "i", "sc.nextInt()", "sc.nextInt", "sc", "max=height[0]", "max", "height[0]", "height", "0", "for(int i=0;i<n;i++){\n if(max<=height[i]){\n max=height[i];\n }\n sum+=max-height[i];\n }", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\n if(max<=height[i]){\n max=height[i];\n }\n sum+=max-height[i];\n }", "{\n if(max<=height[i]){\n max=height[i];\n }\n sum+=max-height[i];\n }", "if(max<=height[i]){\n max=height[i];\n }", "max<=height[i]", "max", "height[i]", "height", "i", "{\n max=height[i];\n }", "max=height[i]", "max", "height[i]", "height", "i", "sum+=max-height[i]", "sum", "max-height[i]", "max", "height[i]", "height", "i", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "String[] args", "args", "public class Main {\n \n public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();// 人数\n \tint[] height =new int[n];//身長\n \tint max=0;//自分より前の最大身長\n \tlong sum=0;\n \n \tfor(int i=0;i<n;i++){\n height[i] = sc.nextInt();\n }\n \n \tmax=height[0];\n \tfor(int i=0;i<n;i++){\n if(max<=height[i]){\n max=height[i];\n }\n sum+=max-height[i];\n }\n \tSystem.out.println(sum);\n } \n}", "public class Main {\n \n public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();// 人数\n \tint[] height =new int[n];//身長\n \tint max=0;//自分より前の最大身長\n \tlong sum=0;\n \n \tfor(int i=0;i<n;i++){\n height[i] = sc.nextInt();\n }\n \n \tmax=height[0];\n \tfor(int i=0;i<n;i++){\n if(max<=height[i]){\n max=height[i];\n }\n sum+=max-height[i];\n }\n \tSystem.out.println(sum);\n } \n}", "Main" ]
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt();// 人数 int[] height =new int[n];//身長 int max=0;//自分より前の最大身長 long sum=0; for(int i=0;i<n;i++){ height[i] = sc.nextInt(); } max=height[0]; for(int i=0;i<n;i++){ if(max<=height[i]){ max=height[i]; } sum+=max-height[i]; } System.out.println(sum); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 41, 13, 20, 12, 13, 30, 41, 13, 4, 13, 41, 13, 4, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 41, 13, 4, 13, 14, 2, 13, 13, 30, 0, 13, 2, 13, 13, 30, 0, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 12, 13, 30, 4, 18, 13, 17, 42, 17, 30, 38, 5, 13, 30, 3, 30, 41, 13, 4, 18, 18, 13, 13, 14, 2, 2, 2, 13, 17, 2, 13, 17, 2, 13, 40, 17, 30, 3, 30, 4, 18, 13, 13, 12, 13, 30, 4, 13, 29, 4, 18, 13, 4, 18, 13, 12, 13, 30, 4, 13, 29, 4, 18, 13, 4, 18, 13, 13, 23, 13, 12, 13, 30, 4, 13, 29, 4, 18, 13, 4, 18, 13, 12, 13, 30, 4, 13, 29, 4, 18, 13, 4, 18, 13, 13, 23, 13, 12, 13, 30, 4, 13, 29, 20, 12, 13, 30, 4, 13, 29, 20, 23, 13, 12, 13, 30, 4, 13, 29, 4, 18, 13, 4, 18, 13, 12, 13, 30, 4, 13, 29, 20, 12, 13, 30, 4, 13, 29, 4, 18, 13, 4, 18, 13, 12, 13, 30, 42, 17, 30, 38, 5, 13, 30, 3, 30, 41, 13, 4, 18, 18, 13, 13, 14, 2, 2, 13, 17, 2, 13, 40, 17, 30, 3, 12, 13, 30, 42, 17, 30, 38, 5, 13, 30, 3, 30, 41, 13, 4, 18, 18, 13, 13, 14, 2, 2, 2, 13, 17, 2, 13, 17, 2, 13, 40, 17, 3, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 276, 11 ], [ 276, 12 ], [ 12, 13 ], [ 12, 14 ], [ 276, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 18, 20 ], [ 20, 21 ], [ 17, 22 ], [ 22, 23 ], [ 22, 24 ], [ 24, 25 ], [ 17, 26 ], [ 26, 27 ], [ 26, 28 ], [ 17, 29 ], [ 29, 30 ], [ 30, 31 ], [ 31, 32 ], [ 31, 33 ], [ 29, 34 ], [ 34, 35 ], [ 34, 36 ], [ 29, 37 ], [ 37, 38 ], [ 38, 39 ], [ 29, 40 ], [ 41, 41 ], [ 41, 42 ], [ 42, 43 ], [ 42, 44 ], [ 44, 45 ], [ 41, 46 ], [ 46, 47 ], [ 47, 48 ], [ 47, 49 ], [ 46, 50 ], [ 50, 51 ], [ 51, 52 ], [ 51, 53 ], [ 53, 54 ], [ 53, 55 ], [ 46, 56 ], [ 56, 57 ], [ 57, 58 ], [ 57, 59 ], [ 17, 60 ], [ 60, 61 ], [ 61, 62 ], [ 62, 63 ], [ 62, 64 ], [ 60, 65 ], [ 15, 66 ], [ 66, 67 ], [ 276, 68 ], [ 68, 69 ], [ 68, 70 ], [ 70, 71 ], [ 71, 72 ], [ 72, 73 ], [ 71, 74 ], [ 70, 75 ], [ 75, 76 ], [ 75, 77 ], [ 77, 78 ], [ 78, 79 ], [ 79, 80 ], [ 79, 81 ], [ 81, 82 ], [ 78, 83 ], [ 83, 84 ], [ 84, 85 ], [ 84, 86 ], [ 86, 87 ], [ 87, 88 ], [ 88, 89 ], [ 88, 90 ], [ 83, 91 ], [ 91, 92 ], [ 93, 93 ], [ 93, 94 ], [ 94, 95 ], [ 94, 96 ], [ 93, 97 ], [ 97, 98 ], [ 97, 99 ], [ 93, 100 ], [ 100, 101 ], [ 100, 102 ], [ 102, 103 ], [ 91, 104 ], [ 104, 105 ], [ 91, 106 ], [ 106, 107 ], [ 107, 108 ], [ 108, 109 ], [ 107, 110 ], [ 276, 111 ], [ 111, 112 ], [ 111, 113 ], [ 113, 114 ], [ 114, 115 ], [ 113, 116 ], [ 116, 117 ], [ 117, 118 ], [ 118, 119 ], [ 117, 120 ], [ 120, 121 ], [ 121, 122 ], [ 276, 123 ], [ 123, 124 ], [ 123, 125 ], [ 125, 126 ], [ 126, 127 ], [ 125, 128 ], [ 128, 129 ], [ 129, 130 ], [ 130, 131 ], [ 129, 132 ], [ 132, 133 ], [ 133, 134 ], [ 129, 135 ], [ 123, 136 ], [ 136, 137 ], [ 276, 138 ], [ 138, 139 ], [ 138, 140 ], [ 140, 141 ], [ 141, 142 ], [ 140, 143 ], [ 143, 144 ], [ 144, 145 ], [ 145, 146 ], [ 144, 147 ], [ 147, 148 ], [ 148, 149 ], [ 276, 150 ], [ 150, 151 ], [ 150, 152 ], [ 152, 153 ], [ 153, 154 ], [ 152, 155 ], [ 155, 156 ], [ 156, 157 ], [ 157, 158 ], [ 156, 159 ], [ 159, 160 ], [ 160, 161 ], [ 156, 162 ], [ 150, 163 ], [ 163, 164 ], [ 276, 165 ], [ 165, 166 ], [ 165, 167 ], [ 167, 168 ], [ 168, 169 ], [ 167, 170 ], [ 170, 171 ], [ 276, 172 ], [ 172, 173 ], [ 172, 174 ], [ 174, 175 ], [ 175, 176 ], [ 174, 177 ], [ 177, 178 ], [ 172, 179 ], [ 179, 180 ], [ 276, 181 ], [ 181, 182 ], [ 181, 183 ], [ 183, 184 ], [ 184, 185 ], [ 183, 186 ], [ 186, 187 ], [ 187, 188 ], [ 188, 189 ], [ 187, 190 ], [ 190, 191 ], [ 191, 192 ], [ 276, 193 ], [ 193, 194 ], [ 193, 195 ], [ 195, 196 ], [ 196, 197 ], [ 195, 198 ], [ 198, 199 ], [ 276, 200 ], [ 200, 201 ], [ 200, 202 ], [ 202, 203 ], [ 203, 204 ], [ 202, 205 ], [ 205, 206 ], [ 206, 207 ], [ 207, 208 ], [ 206, 209 ], [ 209, 210 ], [ 210, 211 ], [ 276, 212 ], [ 212, 213 ], [ 212, 214 ], [ 214, 215 ], [ 215, 216 ], [ 215, 217 ], [ 217, 218 ], [ 218, 219 ], [ 219, 220 ], [ 219, 221 ], [ 221, 222 ], [ 218, 223 ], [ 223, 224 ], [ 224, 225 ], [ 224, 226 ], [ 226, 227 ], [ 227, 228 ], [ 228, 229 ], [ 228, 230 ], [ 223, 231 ], [ 231, 232 ], [ 232, 233 ], [ 233, 234 ], [ 233, 235 ], [ 232, 236 ], [ 236, 237 ], [ 236, 238 ], [ 238, 239 ], [ 231, 240 ], [ 240, 241 ], [ 276, 242 ], [ 242, 243 ], [ 242, 244 ], [ 244, 245 ], [ 245, 246 ], [ 245, 247 ], [ 247, 248 ], [ 248, 249 ], [ 249, 250 ], [ 249, 251 ], [ 251, 252 ], [ 248, 253 ], [ 253, 254 ], [ 254, 255 ], [ 254, 256 ], [ 256, 257 ], [ 257, 258 ], [ 258, 259 ], [ 258, 260 ], [ 253, 261 ], [ 261, 262 ], [ 263, 263 ], [ 263, 264 ], [ 264, 265 ], [ 264, 266 ], [ 263, 267 ], [ 267, 268 ], [ 267, 269 ], [ 263, 270 ], [ 270, 271 ], [ 270, 272 ], [ 272, 273 ], [ 261, 274 ], [ 0, 275 ], [ 275, 276 ], [ 275, 277 ] ]
[ "import java.io.IOException;\nimport java.math.BigDecimal;\nimport java.math.BigInteger;\n\npublic class Main {\n private static final StringBuilder builder = new StringBuilder();\n public static void main(String[] args) {\n int n = readInt();\n long prev = readLong();\n long step = 0;\n for (int i = 1; i < n; i++) {\n long cur = readLong();\n if (prev > cur) {\n step += prev - cur;\n } else {\n prev = cur;\n }\n }\n\n System.out.print(step);\n }\n\n private static void read() {\n builder.setLength(0);\n while (true) {\n try {\n int b = System.in.read();\n if (b == ' ' || b == '\\n' || b == -1) {\n break;\n } else {\n builder.appendCodePoint(b);\n }\n } catch (IOException e) {\n break;\n }\n }\n }\n\n private static int readInt() {\n read();\n return Integer.parseInt(builder.toString());\n }\n\n private static int readInt(int radix) {\n read();\n return Integer.parseInt(builder.toString(), radix);\n }\n\n private static long readLong() {\n read();\n return Long.parseLong(builder.toString());\n }\n\n private static long readLong(int radix) {\n read();\n return Long.parseLong(builder.toString(), radix);\n }\n\n private static BigInteger readBigInteger() {\n read();\n return new BigInteger(builder.toString());\n }\n\n private static BigInteger readBigInteger(int radix) {\n read();\n return new BigInteger(builder.toString(), radix);\n }\n\n private static double readDouble() {\n read();\n return Double.parseDouble(builder.toString());\n }\n\n private static BigDecimal readBigDecimal() {\n read();\n return new BigDecimal(builder.toString());\n }\n\n private static float readFloat() {\n read();\n return Float.parseFloat(builder.toString());\n }\n\n private static void skipLine() {\n while (true) {\n try {\n int b = System.in.read();\n if (b == '\\n' || b == -1) {\n break;\n }\n } catch (IOException e) {\n break;\n }\n }\n }\n\n private static void skip() {\n while (true) {\n try {\n int b = System.in.read();\n if (b == ' ' || b == '\\n' || b == -1) break;\n } catch (IOException e) {\n break;\n }\n }\n }\n\n}", "import java.io.IOException;", "IOException", "java.io", "import java.math.BigDecimal;", "BigDecimal", "java.math", "import java.math.BigInteger;", "BigInteger", "java.math", "public class Main {\n private static final StringBuilder builder = new StringBuilder();\n public static void main(String[] args) {\n int n = readInt();\n long prev = readLong();\n long step = 0;\n for (int i = 1; i < n; i++) {\n long cur = readLong();\n if (prev > cur) {\n step += prev - cur;\n } else {\n prev = cur;\n }\n }\n\n System.out.print(step);\n }\n\n private static void read() {\n builder.setLength(0);\n while (true) {\n try {\n int b = System.in.read();\n if (b == ' ' || b == '\\n' || b == -1) {\n break;\n } else {\n builder.appendCodePoint(b);\n }\n } catch (IOException e) {\n break;\n }\n }\n }\n\n private static int readInt() {\n read();\n return Integer.parseInt(builder.toString());\n }\n\n private static int readInt(int radix) {\n read();\n return Integer.parseInt(builder.toString(), radix);\n }\n\n private static long readLong() {\n read();\n return Long.parseLong(builder.toString());\n }\n\n private static long readLong(int radix) {\n read();\n return Long.parseLong(builder.toString(), radix);\n }\n\n private static BigInteger readBigInteger() {\n read();\n return new BigInteger(builder.toString());\n }\n\n private static BigInteger readBigInteger(int radix) {\n read();\n return new BigInteger(builder.toString(), radix);\n }\n\n private static double readDouble() {\n read();\n return Double.parseDouble(builder.toString());\n }\n\n private static BigDecimal readBigDecimal() {\n read();\n return new BigDecimal(builder.toString());\n }\n\n private static float readFloat() {\n read();\n return Float.parseFloat(builder.toString());\n }\n\n private static void skipLine() {\n while (true) {\n try {\n int b = System.in.read();\n if (b == '\\n' || b == -1) {\n break;\n }\n } catch (IOException e) {\n break;\n }\n }\n }\n\n private static void skip() {\n while (true) {\n try {\n int b = System.in.read();\n if (b == ' ' || b == '\\n' || b == -1) break;\n } catch (IOException e) {\n break;\n }\n }\n }\n\n}", "Main", "private static final StringBuilder builder = new StringBuilder();", "builder", "new StringBuilder()", "public static void main(String[] args) {\n int n = readInt();\n long prev = readLong();\n long step = 0;\n for (int i = 1; i < n; i++) {\n long cur = readLong();\n if (prev > cur) {\n step += prev - cur;\n } else {\n prev = cur;\n }\n }\n\n System.out.print(step);\n }", "main", "{\n int n = readInt();\n long prev = readLong();\n long step = 0;\n for (int i = 1; i < n; i++) {\n long cur = readLong();\n if (prev > cur) {\n step += prev - cur;\n } else {\n prev = cur;\n }\n }\n\n System.out.print(step);\n }", "int n = readInt();", "n", "readInt()", "readInt", "long prev = readLong();", "prev", "readLong()", "readLong", "long step = 0;", "step", "0", "for (int i = 1; i < n; i++) {\n long cur = readLong();\n if (prev > cur) {\n step += prev - cur;\n } else {\n prev = cur;\n }\n }", "int i = 1;", "int i = 1;", "i", "1", "i < n", "i", "n", "i++", "i++", "i", "{\n long cur = readLong();\n if (prev > cur) {\n step += prev - cur;\n } else {\n prev = cur;\n }\n }", "{\n long cur = readLong();\n if (prev > cur) {\n step += prev - cur;\n } else {\n prev = cur;\n }\n }", "long cur = readLong();", "cur", "readLong()", "readLong", "if (prev > cur) {\n step += prev - cur;\n } else {\n prev = cur;\n }", "prev > cur", "prev", "cur", "{\n step += prev - cur;\n }", "step += prev - cur", "step", "prev - cur", "prev", "cur", "{\n prev = cur;\n }", "prev = cur", "prev", "cur", "System.out.print(step)", "System.out.print", "System.out", "System", "System.out", "step", "String[] args", "args", "private static void read() {\n builder.setLength(0);\n while (true) {\n try {\n int b = System.in.read();\n if (b == ' ' || b == '\\n' || b == -1) {\n break;\n } else {\n builder.appendCodePoint(b);\n }\n } catch (IOException e) {\n break;\n }\n }\n }", "read", "{\n builder.setLength(0);\n while (true) {\n try {\n int b = System.in.read();\n if (b == ' ' || b == '\\n' || b == -1) {\n break;\n } else {\n builder.appendCodePoint(b);\n }\n } catch (IOException e) {\n break;\n }\n }\n }", "builder.setLength(0)", "builder.setLength", "builder", "0", "while (true) {\n try {\n int b = System.in.read();\n if (b == ' ' || b == '\\n' || b == -1) {\n break;\n } else {\n builder.appendCodePoint(b);\n }\n } catch (IOException e) {\n break;\n }\n }", "true", "{\n try {\n int b = System.in.read();\n if (b == ' ' || b == '\\n' || b == -1) {\n break;\n } else {\n builder.appendCodePoint(b);\n }\n } catch (IOException e) {\n break;\n }\n }", "try {\n int b = System.in.read();\n if (b == ' ' || b == '\\n' || b == -1) {\n break;\n } else {\n builder.appendCodePoint(b);\n }\n } catch (IOException e) {\n break;\n }", "catch (IOException e) {\n break;\n }", "IOException e", "{\n break;\n }", "break;", "{\n int b = System.in.read();\n if (b == ' ' || b == '\\n' || b == -1) {\n break;\n } else {\n builder.appendCodePoint(b);\n }\n }", "int b = System.in.read();", "b", "System.in.read()", "System.in.read", "System.in", "System", "System.in", "if (b == ' ' || b == '\\n' || b == -1) {\n break;\n } else {\n builder.appendCodePoint(b);\n }", "b == ' ' || b == '\\n' || b == -1", "b == ' ' || b == '\\n' || b == -1", "b == ' '", "b", "' '", "b == '\\n'", "b", "'\\n'", "b == -1", "b", "-1", "1", "{\n break;\n }", "break;", "{\n builder.appendCodePoint(b);\n }", "builder.appendCodePoint(b)", "builder.appendCodePoint", "builder", "b", "private static int readInt() {\n read();\n return Integer.parseInt(builder.toString());\n }", "readInt", "{\n read();\n return Integer.parseInt(builder.toString());\n }", "read()", "read", "return Integer.parseInt(builder.toString());", "Integer.parseInt(builder.toString())", "Integer.parseInt", "Integer", "builder.toString()", "builder.toString", "builder", "private static int readInt(int radix) {\n read();\n return Integer.parseInt(builder.toString(), radix);\n }", "readInt", "{\n read();\n return Integer.parseInt(builder.toString(), radix);\n }", "read()", "read", "return Integer.parseInt(builder.toString(), radix);", "Integer.parseInt(builder.toString(), radix)", "Integer.parseInt", "Integer", "builder.toString()", "builder.toString", "builder", "radix", "int radix", "radix", "private static long readLong() {\n read();\n return Long.parseLong(builder.toString());\n }", "readLong", "{\n read();\n return Long.parseLong(builder.toString());\n }", "read()", "read", "return Long.parseLong(builder.toString());", "Long.parseLong(builder.toString())", "Long.parseLong", "Long", "builder.toString()", "builder.toString", "builder", "private static long readLong(int radix) {\n read();\n return Long.parseLong(builder.toString(), radix);\n }", "readLong", "{\n read();\n return Long.parseLong(builder.toString(), radix);\n }", "read()", "read", "return Long.parseLong(builder.toString(), radix);", "Long.parseLong(builder.toString(), radix)", "Long.parseLong", "Long", "builder.toString()", "builder.toString", "builder", "radix", "int radix", "radix", "private static BigInteger readBigInteger() {\n read();\n return new BigInteger(builder.toString());\n }", "readBigInteger", "{\n read();\n return new BigInteger(builder.toString());\n }", "read()", "read", "return new BigInteger(builder.toString());", "new BigInteger(builder.toString())", "private static BigInteger readBigInteger(int radix) {\n read();\n return new BigInteger(builder.toString(), radix);\n }", "readBigInteger", "{\n read();\n return new BigInteger(builder.toString(), radix);\n }", "read()", "read", "return new BigInteger(builder.toString(), radix);", "new BigInteger(builder.toString(), radix)", "int radix", "radix", "private static double readDouble() {\n read();\n return Double.parseDouble(builder.toString());\n }", "readDouble", "{\n read();\n return Double.parseDouble(builder.toString());\n }", "read()", "read", "return Double.parseDouble(builder.toString());", "Double.parseDouble(builder.toString())", "Double.parseDouble", "Double", "builder.toString()", "builder.toString", "builder", "private static BigDecimal readBigDecimal() {\n read();\n return new BigDecimal(builder.toString());\n }", "readBigDecimal", "{\n read();\n return new BigDecimal(builder.toString());\n }", "read()", "read", "return new BigDecimal(builder.toString());", "new BigDecimal(builder.toString())", "private static float readFloat() {\n read();\n return Float.parseFloat(builder.toString());\n }", "readFloat", "{\n read();\n return Float.parseFloat(builder.toString());\n }", "read()", "read", "return Float.parseFloat(builder.toString());", "Float.parseFloat(builder.toString())", "Float.parseFloat", "Float", "builder.toString()", "builder.toString", "builder", "private static void skipLine() {\n while (true) {\n try {\n int b = System.in.read();\n if (b == '\\n' || b == -1) {\n break;\n }\n } catch (IOException e) {\n break;\n }\n }\n }", "skipLine", "{\n while (true) {\n try {\n int b = System.in.read();\n if (b == '\\n' || b == -1) {\n break;\n }\n } catch (IOException e) {\n break;\n }\n }\n }", "while (true) {\n try {\n int b = System.in.read();\n if (b == '\\n' || b == -1) {\n break;\n }\n } catch (IOException e) {\n break;\n }\n }", "true", "{\n try {\n int b = System.in.read();\n if (b == '\\n' || b == -1) {\n break;\n }\n } catch (IOException e) {\n break;\n }\n }", "try {\n int b = System.in.read();\n if (b == '\\n' || b == -1) {\n break;\n }\n } catch (IOException e) {\n break;\n }", "catch (IOException e) {\n break;\n }", "IOException e", "{\n break;\n }", "break;", "{\n int b = System.in.read();\n if (b == '\\n' || b == -1) {\n break;\n }\n }", "int b = System.in.read();", "b", "System.in.read()", "System.in.read", "System.in", "System", "System.in", "if (b == '\\n' || b == -1) {\n break;\n }", "b == '\\n' || b == -1", "b == '\\n'", "b", "'\\n'", "b == -1", "b", "-1", "1", "{\n break;\n }", "break;", "private static void skip() {\n while (true) {\n try {\n int b = System.in.read();\n if (b == ' ' || b == '\\n' || b == -1) break;\n } catch (IOException e) {\n break;\n }\n }\n }", "skip", "{\n while (true) {\n try {\n int b = System.in.read();\n if (b == ' ' || b == '\\n' || b == -1) break;\n } catch (IOException e) {\n break;\n }\n }\n }", "while (true) {\n try {\n int b = System.in.read();\n if (b == ' ' || b == '\\n' || b == -1) break;\n } catch (IOException e) {\n break;\n }\n }", "true", "{\n try {\n int b = System.in.read();\n if (b == ' ' || b == '\\n' || b == -1) break;\n } catch (IOException e) {\n break;\n }\n }", "try {\n int b = System.in.read();\n if (b == ' ' || b == '\\n' || b == -1) break;\n } catch (IOException e) {\n break;\n }", "catch (IOException e) {\n break;\n }", "IOException e", "{\n break;\n }", "break;", "{\n int b = System.in.read();\n if (b == ' ' || b == '\\n' || b == -1) break;\n }", "int b = System.in.read();", "b", "System.in.read()", "System.in.read", "System.in", "System", "System.in", "if (b == ' ' || b == '\\n' || b == -1) break;", "b == ' ' || b == '\\n' || b == -1", "b == ' ' || b == '\\n' || b == -1", "b == ' '", "b", "' '", "b == '\\n'", "b", "'\\n'", "b == -1", "b", "-1", "1", "break;", "public class Main {\n private static final StringBuilder builder = new StringBuilder();\n public static void main(String[] args) {\n int n = readInt();\n long prev = readLong();\n long step = 0;\n for (int i = 1; i < n; i++) {\n long cur = readLong();\n if (prev > cur) {\n step += prev - cur;\n } else {\n prev = cur;\n }\n }\n\n System.out.print(step);\n }\n\n private static void read() {\n builder.setLength(0);\n while (true) {\n try {\n int b = System.in.read();\n if (b == ' ' || b == '\\n' || b == -1) {\n break;\n } else {\n builder.appendCodePoint(b);\n }\n } catch (IOException e) {\n break;\n }\n }\n }\n\n private static int readInt() {\n read();\n return Integer.parseInt(builder.toString());\n }\n\n private static int readInt(int radix) {\n read();\n return Integer.parseInt(builder.toString(), radix);\n }\n\n private static long readLong() {\n read();\n return Long.parseLong(builder.toString());\n }\n\n private static long readLong(int radix) {\n read();\n return Long.parseLong(builder.toString(), radix);\n }\n\n private static BigInteger readBigInteger() {\n read();\n return new BigInteger(builder.toString());\n }\n\n private static BigInteger readBigInteger(int radix) {\n read();\n return new BigInteger(builder.toString(), radix);\n }\n\n private static double readDouble() {\n read();\n return Double.parseDouble(builder.toString());\n }\n\n private static BigDecimal readBigDecimal() {\n read();\n return new BigDecimal(builder.toString());\n }\n\n private static float readFloat() {\n read();\n return Float.parseFloat(builder.toString());\n }\n\n private static void skipLine() {\n while (true) {\n try {\n int b = System.in.read();\n if (b == '\\n' || b == -1) {\n break;\n }\n } catch (IOException e) {\n break;\n }\n }\n }\n\n private static void skip() {\n while (true) {\n try {\n int b = System.in.read();\n if (b == ' ' || b == '\\n' || b == -1) break;\n } catch (IOException e) {\n break;\n }\n }\n }\n\n}", "public class Main {\n private static final StringBuilder builder = new StringBuilder();\n public static void main(String[] args) {\n int n = readInt();\n long prev = readLong();\n long step = 0;\n for (int i = 1; i < n; i++) {\n long cur = readLong();\n if (prev > cur) {\n step += prev - cur;\n } else {\n prev = cur;\n }\n }\n\n System.out.print(step);\n }\n\n private static void read() {\n builder.setLength(0);\n while (true) {\n try {\n int b = System.in.read();\n if (b == ' ' || b == '\\n' || b == -1) {\n break;\n } else {\n builder.appendCodePoint(b);\n }\n } catch (IOException e) {\n break;\n }\n }\n }\n\n private static int readInt() {\n read();\n return Integer.parseInt(builder.toString());\n }\n\n private static int readInt(int radix) {\n read();\n return Integer.parseInt(builder.toString(), radix);\n }\n\n private static long readLong() {\n read();\n return Long.parseLong(builder.toString());\n }\n\n private static long readLong(int radix) {\n read();\n return Long.parseLong(builder.toString(), radix);\n }\n\n private static BigInteger readBigInteger() {\n read();\n return new BigInteger(builder.toString());\n }\n\n private static BigInteger readBigInteger(int radix) {\n read();\n return new BigInteger(builder.toString(), radix);\n }\n\n private static double readDouble() {\n read();\n return Double.parseDouble(builder.toString());\n }\n\n private static BigDecimal readBigDecimal() {\n read();\n return new BigDecimal(builder.toString());\n }\n\n private static float readFloat() {\n read();\n return Float.parseFloat(builder.toString());\n }\n\n private static void skipLine() {\n while (true) {\n try {\n int b = System.in.read();\n if (b == '\\n' || b == -1) {\n break;\n }\n } catch (IOException e) {\n break;\n }\n }\n }\n\n private static void skip() {\n while (true) {\n try {\n int b = System.in.read();\n if (b == ' ' || b == '\\n' || b == -1) break;\n } catch (IOException e) {\n break;\n }\n }\n }\n\n}", "Main" ]
import java.io.IOException; import java.math.BigDecimal; import java.math.BigInteger; public class Main { private static final StringBuilder builder = new StringBuilder(); public static void main(String[] args) { int n = readInt(); long prev = readLong(); long step = 0; for (int i = 1; i < n; i++) { long cur = readLong(); if (prev > cur) { step += prev - cur; } else { prev = cur; } } System.out.print(step); } private static void read() { builder.setLength(0); while (true) { try { int b = System.in.read(); if (b == ' ' || b == '\n' || b == -1) { break; } else { builder.appendCodePoint(b); } } catch (IOException e) { break; } } } private static int readInt() { read(); return Integer.parseInt(builder.toString()); } private static int readInt(int radix) { read(); return Integer.parseInt(builder.toString(), radix); } private static long readLong() { read(); return Long.parseLong(builder.toString()); } private static long readLong(int radix) { read(); return Long.parseLong(builder.toString(), radix); } private static BigInteger readBigInteger() { read(); return new BigInteger(builder.toString()); } private static BigInteger readBigInteger(int radix) { read(); return new BigInteger(builder.toString(), radix); } private static double readDouble() { read(); return Double.parseDouble(builder.toString()); } private static BigDecimal readBigDecimal() { read(); return new BigDecimal(builder.toString()); } private static float readFloat() { read(); return Float.parseFloat(builder.toString()); } private static void skipLine() { while (true) { try { int b = System.in.read(); if (b == '\n' || b == -1) { break; } } catch (IOException e) { break; } } } private static void skip() { while (true) { try { int b = System.in.read(); if (b == ' ' || b == '\n' || b == -1) break; } catch (IOException e) { break; } } } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 41, 13, 17, 41, 13, 18, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 13, 18, 13, 13, 30, 0, 13, 2, 13, 18, 13, 13, 30, 0, 13, 18, 13, 13, 4, 13, 13, 23, 13, 12, 13, 30, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 102, 5 ], [ 102, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 8, 21 ], [ 21, 22 ], [ 22, 23 ], [ 23, 24 ], [ 23, 25 ], [ 21, 26 ], [ 26, 27 ], [ 26, 28 ], [ 21, 29 ], [ 29, 30 ], [ 30, 31 ], [ 21, 32 ], [ 33, 33 ], [ 33, 34 ], [ 34, 35 ], [ 35, 36 ], [ 35, 37 ], [ 34, 38 ], [ 38, 39 ], [ 39, 40 ], [ 8, 41 ], [ 41, 42 ], [ 42, 43 ], [ 8, 44 ], [ 44, 45 ], [ 44, 46 ], [ 8, 47 ], [ 47, 48 ], [ 47, 49 ], [ 49, 50 ], [ 49, 51 ], [ 8, 52 ], [ 52, 53 ], [ 53, 54 ], [ 54, 55 ], [ 54, 56 ], [ 52, 57 ], [ 57, 58 ], [ 57, 59 ], [ 52, 60 ], [ 60, 61 ], [ 61, 62 ], [ 52, 63 ], [ 64, 64 ], [ 64, 65 ], [ 65, 66 ], [ 66, 67 ], [ 66, 68 ], [ 68, 69 ], [ 68, 70 ], [ 65, 71 ], [ 71, 72 ], [ 72, 73 ], [ 72, 74 ], [ 74, 75 ], [ 74, 76 ], [ 76, 77 ], [ 76, 78 ], [ 65, 79 ], [ 79, 80 ], [ 80, 81 ], [ 80, 82 ], [ 82, 83 ], [ 82, 84 ], [ 8, 85 ], [ 85, 86 ], [ 85, 87 ], [ 6, 88 ], [ 88, 89 ], [ 102, 90 ], [ 90, 91 ], [ 90, 92 ], [ 92, 93 ], [ 93, 94 ], [ 94, 95 ], [ 95, 96 ], [ 95, 97 ], [ 93, 98 ], [ 90, 99 ], [ 99, 100 ], [ 0, 101 ], [ 101, 102 ], [ 101, 103 ] ]
[ "import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(final String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] a = new long[n];\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t}\n\t\tsc.close();\n\t\tlong ret = 0L;\n\t\tlong kijun = a[0];\n\t\tfor(int i = 1; i < n; i++) {\n\t\t\tif(kijun > a[i]) {\n\t\t\t\tret += kijun - a[i];\n\t\t\t} else {\n\t\t\t\tkijun = a[i];\n\t\t\t}\n\t\t}\n\t\tprtln(ret);\n\t}\n\tpublic static <T> void prtln(T t) { System.out.println(t); }\n}", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\n\tpublic static void main(final String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] a = new long[n];\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t}\n\t\tsc.close();\n\t\tlong ret = 0L;\n\t\tlong kijun = a[0];\n\t\tfor(int i = 1; i < n; i++) {\n\t\t\tif(kijun > a[i]) {\n\t\t\t\tret += kijun - a[i];\n\t\t\t} else {\n\t\t\t\tkijun = a[i];\n\t\t\t}\n\t\t}\n\t\tprtln(ret);\n\t}\n\tpublic static <T> void prtln(T t) { System.out.println(t); }\n}", "Main", "public static void main(final String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] a = new long[n];\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t}\n\t\tsc.close();\n\t\tlong ret = 0L;\n\t\tlong kijun = a[0];\n\t\tfor(int i = 1; i < n; i++) {\n\t\t\tif(kijun > a[i]) {\n\t\t\t\tret += kijun - a[i];\n\t\t\t} else {\n\t\t\t\tkijun = a[i];\n\t\t\t}\n\t\t}\n\t\tprtln(ret);\n\t}", "main", "{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] a = new long[n];\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t}\n\t\tsc.close();\n\t\tlong ret = 0L;\n\t\tlong kijun = a[0];\n\t\tfor(int i = 1; i < n; i++) {\n\t\t\tif(kijun > a[i]) {\n\t\t\t\tret += kijun - a[i];\n\t\t\t} else {\n\t\t\t\tkijun = a[i];\n\t\t\t}\n\t\t}\n\t\tprtln(ret);\n\t}", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "long[] a = new long[n];", "a", "new long[n]", "n", "for(int i = 0; i < n; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n\t\t\ta[i] = sc.nextLong();\n\t\t}", "{\n\t\t\ta[i] = sc.nextLong();\n\t\t}", "a[i] = sc.nextLong()", "a[i]", "a", "i", "sc.nextLong()", "sc.nextLong", "sc", "sc.close()", "sc.close", "sc", "long ret = 0L;", "ret", "0L", "long kijun = a[0];", "kijun", "a[0]", "a", "0", "for(int i = 1; i < n; i++) {\n\t\t\tif(kijun > a[i]) {\n\t\t\t\tret += kijun - a[i];\n\t\t\t} else {\n\t\t\t\tkijun = a[i];\n\t\t\t}\n\t\t}", "int i = 1;", "int i = 1;", "i", "1", "i < n", "i", "n", "i++", "i++", "i", "{\n\t\t\tif(kijun > a[i]) {\n\t\t\t\tret += kijun - a[i];\n\t\t\t} else {\n\t\t\t\tkijun = a[i];\n\t\t\t}\n\t\t}", "{\n\t\t\tif(kijun > a[i]) {\n\t\t\t\tret += kijun - a[i];\n\t\t\t} else {\n\t\t\t\tkijun = a[i];\n\t\t\t}\n\t\t}", "if(kijun > a[i]) {\n\t\t\t\tret += kijun - a[i];\n\t\t\t} else {\n\t\t\t\tkijun = a[i];\n\t\t\t}", "kijun > a[i]", "kijun", "a[i]", "a", "i", "{\n\t\t\t\tret += kijun - a[i];\n\t\t\t}", "ret += kijun - a[i]", "ret", "kijun - a[i]", "kijun", "a[i]", "a", "i", "{\n\t\t\t\tkijun = a[i];\n\t\t\t}", "kijun = a[i]", "kijun", "a[i]", "a", "i", "prtln(ret)", "prtln", "ret", "final String[] args", "args", "public static <T> void prtln(T t) { System.out.println(t); }", "prtln", "{ System.out.println(t); }", "System.out.println(t)", "System.out.println", "System.out", "System", "System.out", "t", "T t", "t", "public class Main {\n\n\tpublic static void main(final String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] a = new long[n];\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t}\n\t\tsc.close();\n\t\tlong ret = 0L;\n\t\tlong kijun = a[0];\n\t\tfor(int i = 1; i < n; i++) {\n\t\t\tif(kijun > a[i]) {\n\t\t\t\tret += kijun - a[i];\n\t\t\t} else {\n\t\t\t\tkijun = a[i];\n\t\t\t}\n\t\t}\n\t\tprtln(ret);\n\t}\n\tpublic static <T> void prtln(T t) { System.out.println(t); }\n}", "public class Main {\n\n\tpublic static void main(final String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] a = new long[n];\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t}\n\t\tsc.close();\n\t\tlong ret = 0L;\n\t\tlong kijun = a[0];\n\t\tfor(int i = 1; i < n; i++) {\n\t\t\tif(kijun > a[i]) {\n\t\t\t\tret += kijun - a[i];\n\t\t\t} else {\n\t\t\t\tkijun = a[i];\n\t\t\t}\n\t\t}\n\t\tprtln(ret);\n\t}\n\tpublic static <T> void prtln(T t) { System.out.println(t); }\n}", "Main" ]
import java.util.Scanner; public class Main { public static void main(final String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long[] a = new long[n]; for(int i = 0; i < n; i++) { a[i] = sc.nextLong(); } sc.close(); long ret = 0L; long kijun = a[0]; for(int i = 1; i < n; i++) { if(kijun > a[i]) { ret += kijun - a[i]; } else { kijun = a[i]; } } prtln(ret); } public static <T> void prtln(T t) { System.out.println(t); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 17, 41, 13, 18, 13, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 14, 2, 18, 13, 13, 13, 30, 0, 13, 2, 13, 18, 13, 13, 0, 13, 4, 18, 13, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 6, 13, 41, 13, 41, 13, 12, 13, 30, 0, 13, 20, 12, 13, 30, 42, 2, 2, 13, 17, 40, 4, 18, 13, 30, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 20, 29, 4, 18, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 41, 13, 17, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 4, 18, 13, 29, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 172, 8 ], [ 172, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 11, 23 ], [ 23, 24 ], [ 23, 25 ], [ 25, 26 ], [ 25, 27 ], [ 11, 28 ], [ 28, 29 ], [ 28, 30 ], [ 11, 32 ], [ 32, 33 ], [ 33, 34 ], [ 34, 35 ], [ 34, 36 ], [ 32, 37 ], [ 37, 38 ], [ 37, 39 ], [ 32, 40 ], [ 40, 41 ], [ 41, 42 ], [ 32, 43 ], [ 44, 44 ], [ 44, 45 ], [ 45, 46 ], [ 46, 47 ], [ 46, 48 ], [ 45, 49 ], [ 49, 50 ], [ 50, 51 ], [ 44, 52 ], [ 52, 53 ], [ 53, 54 ], [ 54, 55 ], [ 54, 56 ], [ 53, 57 ], [ 52, 58 ], [ 58, 59 ], [ 59, 60 ], [ 59, 61 ], [ 61, 62 ], [ 61, 63 ], [ 63, 64 ], [ 63, 65 ], [ 44, 66 ], [ 66, 67 ], [ 66, 68 ], [ 68, 69 ], [ 69, 70 ], [ 68, 71 ], [ 68, 72 ], [ 72, 73 ], [ 72, 74 ], [ 11, 75 ], [ 75, 76 ], [ 76, 77 ], [ 77, 78 ], [ 77, 79 ], [ 75, 80 ], [ 9, 81 ], [ 81, 82 ], [ 172, 83 ], [ 83, 84 ], [ 83, 85 ], [ 85, 86 ], [ 83, 87 ], [ 87, 88 ], [ 83, 89 ], [ 89, 90 ], [ 89, 91 ], [ 91, 92 ], [ 92, 93 ], [ 92, 94 ], [ 83, 95 ], [ 95, 96 ], [ 95, 97 ], [ 97, 98 ], [ 98, 99 ], [ 99, 100 ], [ 100, 101 ], [ 100, 102 ], [ 99, 103 ], [ 103, 104 ], [ 104, 105 ], [ 105, 106 ], [ 98, 107 ], [ 107, 108 ], [ 108, 109 ], [ 109, 110 ], [ 109, 111 ], [ 111, 112 ], [ 112, 113 ], [ 113, 114 ], [ 108, 115 ], [ 115, 116 ], [ 116, 117 ], [ 116, 118 ], [ 97, 119 ], [ 119, 120 ], [ 120, 121 ], [ 121, 122 ], [ 83, 123 ], [ 123, 124 ], [ 123, 125 ], [ 125, 126 ], [ 126, 127 ], [ 127, 128 ], [ 128, 129 ], [ 127, 130 ], [ 130, 131 ], [ 83, 132 ], [ 132, 133 ], [ 132, 134 ], [ 134, 135 ], [ 135, 136 ], [ 136, 137 ], [ 137, 138 ], [ 136, 139 ], [ 139, 140 ], [ 83, 141 ], [ 141, 142 ], [ 141, 143 ], [ 143, 144 ], [ 144, 145 ], [ 145, 146 ], [ 146, 147 ], [ 145, 148 ], [ 148, 149 ], [ 83, 150 ], [ 150, 151 ], [ 150, 152 ], [ 152, 153 ], [ 153, 154 ], [ 153, 155 ], [ 152, 156 ], [ 156, 157 ], [ 157, 158 ], [ 157, 159 ], [ 159, 160 ], [ 160, 161 ], [ 161, 162 ], [ 156, 163 ], [ 163, 164 ], [ 164, 165 ], [ 164, 166 ], [ 166, 167 ], [ 167, 168 ], [ 152, 169 ], [ 169, 170 ], [ 0, 171 ], [ 171, 172 ], [ 171, 173 ] ]
[ "import java.util.*;\nimport java.io.*;\npublic class Main\n{\n\tpublic static void main(String[] args) throws Exception{\n\t\tFastReader s = new FastReader();\n\t\tint n = s.nextInt();\n\t\tlong sum = 0;\n\t\tint max = Integer.MIN_VALUE;\n\t\tint[] arr = new int[n];\n\t\tfor(int i = 0; i < n; i++){\n\t\t arr[i] = s.nextInt();\n\t\t if(arr[i] < max){\n\t\t sum += max-arr[i];\n\t\t }\n\t\t max = Math.max(max, arr[i]);\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\t\n\tstatic class FastReader \n { \n BufferedReader br; \n StringTokenizer st; \n \n public FastReader() \n { \n br = new BufferedReader(new\n InputStreamReader(System.in)); \n } \n \n String next() \n { \n while (st == null || !st.hasMoreElements()) \n { \n try\n { \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n } \n return st.nextToken(); \n } \n \n int nextInt() \n { \n return Integer.parseInt(next()); \n } \n \n long nextLong() \n { \n return Long.parseLong(next()); \n } \n \n double nextDouble() \n { \n return Double.parseDouble(next()); \n } \n \n String nextLine() \n { \n String str = \"\"; \n try\n { \n str = br.readLine(); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n return str; \n } \n } \n}", "import java.util.*;", "util.*", "java", "import java.io.*;", "io.*", "java", "public class Main\n{\n\tpublic static void main(String[] args) throws Exception{\n\t\tFastReader s = new FastReader();\n\t\tint n = s.nextInt();\n\t\tlong sum = 0;\n\t\tint max = Integer.MIN_VALUE;\n\t\tint[] arr = new int[n];\n\t\tfor(int i = 0; i < n; i++){\n\t\t arr[i] = s.nextInt();\n\t\t if(arr[i] < max){\n\t\t sum += max-arr[i];\n\t\t }\n\t\t max = Math.max(max, arr[i]);\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\t\n\tstatic class FastReader \n { \n BufferedReader br; \n StringTokenizer st; \n \n public FastReader() \n { \n br = new BufferedReader(new\n InputStreamReader(System.in)); \n } \n \n String next() \n { \n while (st == null || !st.hasMoreElements()) \n { \n try\n { \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n } \n return st.nextToken(); \n } \n \n int nextInt() \n { \n return Integer.parseInt(next()); \n } \n \n long nextLong() \n { \n return Long.parseLong(next()); \n } \n \n double nextDouble() \n { \n return Double.parseDouble(next()); \n } \n \n String nextLine() \n { \n String str = \"\"; \n try\n { \n str = br.readLine(); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n return str; \n } \n } \n}", "Main", "public static void main(String[] args) throws Exception{\n\t\tFastReader s = new FastReader();\n\t\tint n = s.nextInt();\n\t\tlong sum = 0;\n\t\tint max = Integer.MIN_VALUE;\n\t\tint[] arr = new int[n];\n\t\tfor(int i = 0; i < n; i++){\n\t\t arr[i] = s.nextInt();\n\t\t if(arr[i] < max){\n\t\t sum += max-arr[i];\n\t\t }\n\t\t max = Math.max(max, arr[i]);\n\t\t}\n\t\tSystem.out.println(sum);\n\t}", "main", "{\n\t\tFastReader s = new FastReader();\n\t\tint n = s.nextInt();\n\t\tlong sum = 0;\n\t\tint max = Integer.MIN_VALUE;\n\t\tint[] arr = new int[n];\n\t\tfor(int i = 0; i < n; i++){\n\t\t arr[i] = s.nextInt();\n\t\t if(arr[i] < max){\n\t\t sum += max-arr[i];\n\t\t }\n\t\t max = Math.max(max, arr[i]);\n\t\t}\n\t\tSystem.out.println(sum);\n\t}", "FastReader s = new FastReader();", "s", "new FastReader()", "int n = s.nextInt();", "n", "s.nextInt()", "s.nextInt", "s", "long sum = 0;", "sum", "0", "int max = Integer.MIN_VALUE;", "max", "Integer.MIN_VALUE", "Integer", "Integer.MIN_VALUE", "int[] arr = new int[n];", "arr", "new int[n]", "n", "for(int i = 0; i < n; i++){\n\t\t arr[i] = s.nextInt();\n\t\t if(arr[i] < max){\n\t\t sum += max-arr[i];\n\t\t }\n\t\t max = Math.max(max, arr[i]);\n\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n\t\t arr[i] = s.nextInt();\n\t\t if(arr[i] < max){\n\t\t sum += max-arr[i];\n\t\t }\n\t\t max = Math.max(max, arr[i]);\n\t\t}", "{\n\t\t arr[i] = s.nextInt();\n\t\t if(arr[i] < max){\n\t\t sum += max-arr[i];\n\t\t }\n\t\t max = Math.max(max, arr[i]);\n\t\t}", "arr[i] = s.nextInt()", "arr[i]", "arr", "i", "s.nextInt()", "s.nextInt", "s", "if(arr[i] < max){\n\t\t sum += max-arr[i];\n\t\t }", "arr[i] < max", "arr[i]", "arr", "i", "max", "{\n\t\t sum += max-arr[i];\n\t\t }", "sum += max-arr[i]", "sum", "max-arr[i]", "max", "arr[i]", "arr", "i", "max = Math.max(max, arr[i])", "max", "Math.max(max, arr[i])", "Math.max", "Math", "max", "arr[i]", "arr", "i", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "String[] args", "args", "static class FastReader \n { \n BufferedReader br; \n StringTokenizer st; \n \n public FastReader() \n { \n br = new BufferedReader(new\n InputStreamReader(System.in)); \n } \n \n String next() \n { \n while (st == null || !st.hasMoreElements()) \n { \n try\n { \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n } \n return st.nextToken(); \n } \n \n int nextInt() \n { \n return Integer.parseInt(next()); \n } \n \n long nextLong() \n { \n return Long.parseLong(next()); \n } \n \n double nextDouble() \n { \n return Double.parseDouble(next()); \n } \n \n String nextLine() \n { \n String str = \"\"; \n try\n { \n str = br.readLine(); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n return str; \n } \n }", "FastReader", "BufferedReader br;", "br", "StringTokenizer st;", "st", "public FastReader() \n { \n br = new BufferedReader(new\n InputStreamReader(System.in)); \n }", "FastReader", "{ \n br = new BufferedReader(new\n InputStreamReader(System.in)); \n }", "br = new BufferedReader(new\n InputStreamReader(System.in))", "br", "new BufferedReader(new\n InputStreamReader(System.in))", "String next() \n { \n while (st == null || !st.hasMoreElements()) \n { \n try\n { \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n } \n return st.nextToken(); \n }", "next", "{ \n while (st == null || !st.hasMoreElements()) \n { \n try\n { \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n } \n return st.nextToken(); \n }", "while (st == null || !st.hasMoreElements()) \n { \n try\n { \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n }", "st == null || !st.hasMoreElements()", "st == null", "st", "null", "!st.hasMoreElements()", "st.hasMoreElements()", "st.hasMoreElements", "st", "{ \n try\n { \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n }", "try\n { \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n }", "catch (IOException e) \n { \n e.printStackTrace(); \n }", "IOException e", "{ \n e.printStackTrace(); \n }", "e.printStackTrace()", "e.printStackTrace", "e", "{ \n st = new StringTokenizer(br.readLine()); \n }", "st = new StringTokenizer(br.readLine())", "st", "new StringTokenizer(br.readLine())", "return st.nextToken();", "st.nextToken()", "st.nextToken", "st", "int nextInt() \n { \n return Integer.parseInt(next()); \n }", "nextInt", "{ \n return Integer.parseInt(next()); \n }", "return Integer.parseInt(next());", "Integer.parseInt(next())", "Integer.parseInt", "Integer", "next()", "next", "long nextLong() \n { \n return Long.parseLong(next()); \n }", "nextLong", "{ \n return Long.parseLong(next()); \n }", "return Long.parseLong(next());", "Long.parseLong(next())", "Long.parseLong", "Long", "next()", "next", "double nextDouble() \n { \n return Double.parseDouble(next()); \n }", "nextDouble", "{ \n return Double.parseDouble(next()); \n }", "return Double.parseDouble(next());", "Double.parseDouble(next())", "Double.parseDouble", "Double", "next()", "next", "String nextLine() \n { \n String str = \"\"; \n try\n { \n str = br.readLine(); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n return str; \n }", "nextLine", "{ \n String str = \"\"; \n try\n { \n str = br.readLine(); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n return str; \n }", "String str = \"\";", "str", "\"\"", "try\n { \n str = br.readLine(); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n }", "catch (IOException e) \n { \n e.printStackTrace(); \n }", "IOException e", "{ \n e.printStackTrace(); \n }", "e.printStackTrace()", "e.printStackTrace", "e", "{ \n str = br.readLine(); \n }", "str = br.readLine()", "str", "br.readLine()", "br.readLine", "br", "return str;", "str", "public class Main\n{\n\tpublic static void main(String[] args) throws Exception{\n\t\tFastReader s = new FastReader();\n\t\tint n = s.nextInt();\n\t\tlong sum = 0;\n\t\tint max = Integer.MIN_VALUE;\n\t\tint[] arr = new int[n];\n\t\tfor(int i = 0; i < n; i++){\n\t\t arr[i] = s.nextInt();\n\t\t if(arr[i] < max){\n\t\t sum += max-arr[i];\n\t\t }\n\t\t max = Math.max(max, arr[i]);\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\t\n\tstatic class FastReader \n { \n BufferedReader br; \n StringTokenizer st; \n \n public FastReader() \n { \n br = new BufferedReader(new\n InputStreamReader(System.in)); \n } \n \n String next() \n { \n while (st == null || !st.hasMoreElements()) \n { \n try\n { \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n } \n return st.nextToken(); \n } \n \n int nextInt() \n { \n return Integer.parseInt(next()); \n } \n \n long nextLong() \n { \n return Long.parseLong(next()); \n } \n \n double nextDouble() \n { \n return Double.parseDouble(next()); \n } \n \n String nextLine() \n { \n String str = \"\"; \n try\n { \n str = br.readLine(); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n return str; \n } \n } \n}", "public class Main\n{\n\tpublic static void main(String[] args) throws Exception{\n\t\tFastReader s = new FastReader();\n\t\tint n = s.nextInt();\n\t\tlong sum = 0;\n\t\tint max = Integer.MIN_VALUE;\n\t\tint[] arr = new int[n];\n\t\tfor(int i = 0; i < n; i++){\n\t\t arr[i] = s.nextInt();\n\t\t if(arr[i] < max){\n\t\t sum += max-arr[i];\n\t\t }\n\t\t max = Math.max(max, arr[i]);\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\t\n\tstatic class FastReader \n { \n BufferedReader br; \n StringTokenizer st; \n \n public FastReader() \n { \n br = new BufferedReader(new\n InputStreamReader(System.in)); \n } \n \n String next() \n { \n while (st == null || !st.hasMoreElements()) \n { \n try\n { \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n } \n return st.nextToken(); \n } \n \n int nextInt() \n { \n return Integer.parseInt(next()); \n } \n \n long nextLong() \n { \n return Long.parseLong(next()); \n } \n \n double nextDouble() \n { \n return Double.parseDouble(next()); \n } \n \n String nextLine() \n { \n String str = \"\"; \n try\n { \n str = br.readLine(); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n return str; \n } \n } \n}", "Main" ]
import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws Exception{ FastReader s = new FastReader(); int n = s.nextInt(); long sum = 0; int max = Integer.MIN_VALUE; int[] arr = new int[n]; for(int i = 0; i < n; i++){ arr[i] = s.nextInt(); if(arr[i] < max){ sum += max-arr[i]; } max = Math.max(max, arr[i]); } System.out.println(sum); } static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while (st == null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } String nextLine() { String str = ""; try { str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 41, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 14, 2, 13, 17, 30, 0, 13, 2, 18, 13, 13, 18, 13, 2, 13, 17, 14, 2, 13, 17, 30, 0, 18, 13, 13, 2, 18, 13, 13, 4, 18, 13, 13, 0, 13, 2, 13, 4, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 97, 5 ], [ 97, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 8, 21 ], [ 21, 22 ], [ 21, 23 ], [ 8, 24 ], [ 24, 25 ], [ 24, 26 ], [ 8, 27 ], [ 27, 28 ], [ 28, 29 ], [ 29, 30 ], [ 29, 31 ], [ 27, 32 ], [ 32, 33 ], [ 32, 34 ], [ 27, 35 ], [ 35, 36 ], [ 36, 37 ], [ 27, 38 ], [ 39, 39 ], [ 39, 40 ], [ 40, 41 ], [ 41, 42 ], [ 41, 43 ], [ 40, 44 ], [ 44, 45 ], [ 45, 46 ], [ 39, 47 ], [ 47, 48 ], [ 48, 49 ], [ 48, 50 ], [ 47, 51 ], [ 51, 52 ], [ 52, 53 ], [ 52, 54 ], [ 54, 55 ], [ 55, 56 ], [ 55, 57 ], [ 54, 58 ], [ 58, 59 ], [ 58, 60 ], [ 60, 61 ], [ 60, 62 ], [ 51, 63 ], [ 63, 64 ], [ 64, 65 ], [ 64, 66 ], [ 63, 67 ], [ 67, 68 ], [ 68, 69 ], [ 69, 70 ], [ 69, 71 ], [ 68, 72 ], [ 72, 73 ], [ 73, 74 ], [ 73, 75 ], [ 72, 76 ], [ 76, 77 ], [ 77, 78 ], [ 76, 79 ], [ 67, 80 ], [ 80, 81 ], [ 80, 82 ], [ 82, 83 ], [ 82, 84 ], [ 84, 85 ], [ 85, 86 ], [ 84, 87 ], [ 8, 88 ], [ 88, 89 ], [ 89, 90 ], [ 90, 91 ], [ 90, 92 ], [ 88, 93 ], [ 6, 94 ], [ 94, 95 ], [ 0, 96 ], [ 96, 97 ], [ 96, 98 ] ]
[ "import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan = new Scanner(System.in);\n\t\tint N = scan.nextInt();\n\n\t\tlong[] array = new long[N];\n\n\t\tlong sum = 0;\n\t\tlong num = 0;\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tarray[i] = scan.nextLong();\n\t\t\tif(i != 0) {\n\t\t\t\tnum = array[i] - array[i-1];\n\t\t\t\tif(num < 0) {\n\t\t\t\t\tarray[i] = array[i] + Math.abs(num);\n\t\t\t\t\tsum = sum + Math.abs(num);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\n}", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan = new Scanner(System.in);\n\t\tint N = scan.nextInt();\n\n\t\tlong[] array = new long[N];\n\n\t\tlong sum = 0;\n\t\tlong num = 0;\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tarray[i] = scan.nextLong();\n\t\t\tif(i != 0) {\n\t\t\t\tnum = array[i] - array[i-1];\n\t\t\t\tif(num < 0) {\n\t\t\t\t\tarray[i] = array[i] + Math.abs(num);\n\t\t\t\t\tsum = sum + Math.abs(num);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\n}", "Main", "public static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan = new Scanner(System.in);\n\t\tint N = scan.nextInt();\n\n\t\tlong[] array = new long[N];\n\n\t\tlong sum = 0;\n\t\tlong num = 0;\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tarray[i] = scan.nextLong();\n\t\t\tif(i != 0) {\n\t\t\t\tnum = array[i] - array[i-1];\n\t\t\t\tif(num < 0) {\n\t\t\t\t\tarray[i] = array[i] + Math.abs(num);\n\t\t\t\t\tsum = sum + Math.abs(num);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}", "main", "{\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan = new Scanner(System.in);\n\t\tint N = scan.nextInt();\n\n\t\tlong[] array = new long[N];\n\n\t\tlong sum = 0;\n\t\tlong num = 0;\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tarray[i] = scan.nextLong();\n\t\t\tif(i != 0) {\n\t\t\t\tnum = array[i] - array[i-1];\n\t\t\t\tif(num < 0) {\n\t\t\t\t\tarray[i] = array[i] + Math.abs(num);\n\t\t\t\t\tsum = sum + Math.abs(num);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}", "Scanner scan = new Scanner(System.in);", "scan", "new Scanner(System.in)", "int N = scan.nextInt();", "N", "scan.nextInt()", "scan.nextInt", "scan", "long[] array = new long[N];", "array", "new long[N]", "N", "long sum = 0;", "sum", "0", "long num = 0;", "num", "0", "for(int i = 0; i < N; i++) {\n\t\t\tarray[i] = scan.nextLong();\n\t\t\tif(i != 0) {\n\t\t\t\tnum = array[i] - array[i-1];\n\t\t\t\tif(num < 0) {\n\t\t\t\t\tarray[i] = array[i] + Math.abs(num);\n\t\t\t\t\tsum = sum + Math.abs(num);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < N", "i", "N", "i++", "i++", "i", "{\n\t\t\tarray[i] = scan.nextLong();\n\t\t\tif(i != 0) {\n\t\t\t\tnum = array[i] - array[i-1];\n\t\t\t\tif(num < 0) {\n\t\t\t\t\tarray[i] = array[i] + Math.abs(num);\n\t\t\t\t\tsum = sum + Math.abs(num);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "{\n\t\t\tarray[i] = scan.nextLong();\n\t\t\tif(i != 0) {\n\t\t\t\tnum = array[i] - array[i-1];\n\t\t\t\tif(num < 0) {\n\t\t\t\t\tarray[i] = array[i] + Math.abs(num);\n\t\t\t\t\tsum = sum + Math.abs(num);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "array[i] = scan.nextLong()", "array[i]", "array", "i", "scan.nextLong()", "scan.nextLong", "scan", "if(i != 0) {\n\t\t\t\tnum = array[i] - array[i-1];\n\t\t\t\tif(num < 0) {\n\t\t\t\t\tarray[i] = array[i] + Math.abs(num);\n\t\t\t\t\tsum = sum + Math.abs(num);\n\t\t\t\t}\n\t\t\t}", "i != 0", "i", "0", "{\n\t\t\t\tnum = array[i] - array[i-1];\n\t\t\t\tif(num < 0) {\n\t\t\t\t\tarray[i] = array[i] + Math.abs(num);\n\t\t\t\t\tsum = sum + Math.abs(num);\n\t\t\t\t}\n\t\t\t}", "num = array[i] - array[i-1]", "num", "array[i] - array[i-1]", "array[i]", "array", "i", "array[i-1]", "array", "i-1", "i", "1", "if(num < 0) {\n\t\t\t\t\tarray[i] = array[i] + Math.abs(num);\n\t\t\t\t\tsum = sum + Math.abs(num);\n\t\t\t\t}", "num < 0", "num", "0", "{\n\t\t\t\t\tarray[i] = array[i] + Math.abs(num);\n\t\t\t\t\tsum = sum + Math.abs(num);\n\t\t\t\t}", "array[i] = array[i] + Math.abs(num)", "array[i]", "array", "i", "array[i] + Math.abs(num)", "array[i]", "array", "i", "Math.abs(num)", "Math.abs", "Math", "num", "sum = sum + Math.abs(num)", "sum", "sum + Math.abs(num)", "sum", "Math.abs(num)", "Math.abs", "Math", "num", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "String[] args", "args", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan = new Scanner(System.in);\n\t\tint N = scan.nextInt();\n\n\t\tlong[] array = new long[N];\n\n\t\tlong sum = 0;\n\t\tlong num = 0;\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tarray[i] = scan.nextLong();\n\t\t\tif(i != 0) {\n\t\t\t\tnum = array[i] - array[i-1];\n\t\t\t\tif(num < 0) {\n\t\t\t\t\tarray[i] = array[i] + Math.abs(num);\n\t\t\t\t\tsum = sum + Math.abs(num);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\n}", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan = new Scanner(System.in);\n\t\tint N = scan.nextInt();\n\n\t\tlong[] array = new long[N];\n\n\t\tlong sum = 0;\n\t\tlong num = 0;\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tarray[i] = scan.nextLong();\n\t\t\tif(i != 0) {\n\t\t\t\tnum = array[i] - array[i-1];\n\t\t\t\tif(num < 0) {\n\t\t\t\t\tarray[i] = array[i] + Math.abs(num);\n\t\t\t\t\tsum = sum + Math.abs(num);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\n}", "Main" ]
import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner scan = new Scanner(System.in); int N = scan.nextInt(); long[] array = new long[N]; long sum = 0; long num = 0; for(int i = 0; i < N; i++) { array[i] = scan.nextLong(); if(i != 0) { num = array[i] - array[i-1]; if(num < 0) { array[i] = array[i] + Math.abs(num); sum = sum + Math.abs(num); } } } System.out.println(sum); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 18, 13, 13, 41, 13, 18, 13, 13, 41, 13, 20, 41, 13, 20, 41, 13, 20, 4, 18, 13, 17, 13, 13, 4, 18, 13, 23, 13, 6, 13, 12, 13, 30, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 18, 13, 41, 13, 20, 13, 0, 18, 13, 17, 18, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 18, 13, 18, 13, 13, 18, 13, 2, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 13, 4, 18, 13, 2, 18, 13, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 23, 13, 23, 13, 6, 13, 41, 13, 41, 13, 20, 17, 41, 13, 41, 13, 12, 13, 30, 0, 18, 36, 13, 13, 23, 13, 12, 13, 30, 14, 2, 13, 40, 17, 37, 20, 14, 2, 13, 13, 30, 0, 13, 17, 38, 5, 13, 30, 37, 20, 30, 0, 13, 4, 18, 13, 13, 14, 2, 13, 17, 29, 40, 17, 29, 18, 13, 40, 13, 12, 13, 30, 41, 13, 4, 13, 42, 4, 13, 13, 0, 13, 4, 13, 41, 13, 17, 14, 2, 13, 17, 30, 0, 13, 40, 17, 0, 13, 4, 13, 41, 13, 17, 42, 40, 4, 13, 13, 30, 0, 13, 17, 0, 13, 2, 13, 17, 0, 13, 4, 13, 29, 2, 13, 13, 12, 13, 30, 29, 2, 2, 2, 2, 2, 13, 17, 2, 13, 17, 2, 13, 17, 2, 13, 17, 2, 13, 40, 17, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 306, 14 ], [ 306, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 18, 20 ], [ 20, 21 ], [ 20, 22 ], [ 17, 23 ], [ 23, 24 ], [ 23, 25 ], [ 25, 26 ], [ 25, 27 ], [ 17, 28 ], [ 28, 29 ], [ 28, 30 ], [ 17, 31 ], [ 31, 32 ], [ 31, 33 ], [ 17, 34 ], [ 34, 35 ], [ 34, 36 ], [ 17, 37 ], [ 37, 38 ], [ 38, 39 ], [ 37, 40 ], [ 37, 41 ], [ 37, 42 ], [ 17, 43 ], [ 43, 44 ], [ 44, 45 ], [ 15, 46 ], [ 46, 47 ], [ 306, 48 ], [ 48, 49 ], [ 48, 50 ], [ 50, 51 ], [ 50, 52 ], [ 52, 53 ], [ 53, 54 ], [ 53, 55 ], [ 55, 56 ], [ 56, 57 ], [ 52, 58 ], [ 58, 59 ], [ 58, 60 ], [ 52, 62 ], [ 62, 63 ], [ 63, 64 ], [ 64, 65 ], [ 64, 66 ], [ 62, 67 ], [ 67, 68 ], [ 67, 69 ], [ 62, 70 ], [ 70, 71 ], [ 71, 72 ], [ 62, 73 ], [ 73, 74 ], [ 74, 75 ], [ 75, 76 ], [ 75, 77 ], [ 74, 78 ], [ 78, 79 ], [ 79, 80 ], [ 52, 81 ], [ 81, 82 ], [ 81, 83 ], [ 52, 85 ], [ 85, 86 ], [ 86, 87 ], [ 86, 88 ], [ 85, 89 ], [ 89, 90 ], [ 89, 91 ], [ 52, 92 ], [ 92, 93 ], [ 93, 94 ], [ 94, 95 ], [ 94, 96 ], [ 92, 97 ], [ 97, 98 ], [ 97, 99 ], [ 92, 100 ], [ 100, 101 ], [ 101, 102 ], [ 92, 103 ], [ 103, 104 ], [ 104, 105 ], [ 105, 106 ], [ 105, 107 ], [ 104, 108 ], [ 108, 109 ], [ 109, 110 ], [ 108, 111 ], [ 111, 112 ], [ 111, 113 ], [ 108, 114 ], [ 114, 115 ], [ 114, 116 ], [ 116, 117 ], [ 116, 118 ], [ 52, 119 ], [ 119, 120 ], [ 119, 121 ], [ 52, 122 ], [ 122, 123 ], [ 123, 124 ], [ 124, 125 ], [ 124, 126 ], [ 122, 127 ], [ 127, 128 ], [ 127, 129 ], [ 122, 130 ], [ 130, 131 ], [ 131, 132 ], [ 122, 133 ], [ 133, 134 ], [ 134, 135 ], [ 134, 136 ], [ 136, 137 ], [ 137, 138 ], [ 136, 139 ], [ 139, 140 ], [ 140, 141 ], [ 140, 142 ], [ 139, 143 ], [ 143, 144 ], [ 143, 145 ], [ 52, 146 ], [ 146, 147 ], [ 147, 148 ], [ 148, 149 ], [ 148, 150 ], [ 146, 151 ], [ 50, 152 ], [ 152, 153 ], [ 50, 154 ], [ 154, 155 ], [ 50, 156 ], [ 156, 157 ], [ 306, 158 ], [ 158, 159 ], [ 158, 160 ], [ 160, 161 ], [ 158, 162 ], [ 162, 163 ], [ 162, 164 ], [ 158, 166 ], [ 166, 167 ], [ 158, 168 ], [ 168, 169 ], [ 158, 170 ], [ 170, 171 ], [ 170, 172 ], [ 172, 173 ], [ 173, 174 ], [ 174, 175 ], [ 174, 176 ], [ 173, 177 ], [ 170, 178 ], [ 178, 179 ], [ 158, 180 ], [ 180, 181 ], [ 180, 182 ], [ 182, 183 ], [ 183, 184 ], [ 184, 185 ], [ 184, 186 ], [ 186, 187 ], [ 183, 188 ], [ 188, 189 ], [ 182, 190 ], [ 190, 191 ], [ 191, 192 ], [ 191, 193 ], [ 190, 194 ], [ 194, 195 ], [ 195, 196 ], [ 195, 197 ], [ 194, 198 ], [ 198, 199 ], [ 199, 200 ], [ 199, 201 ], [ 201, 202 ], [ 202, 203 ], [ 198, 204 ], [ 204, 205 ], [ 205, 206 ], [ 205, 207 ], [ 207, 208 ], [ 208, 209 ], [ 207, 210 ], [ 194, 211 ], [ 211, 212 ], [ 212, 213 ], [ 212, 214 ], [ 211, 215 ], [ 215, 216 ], [ 216, 217 ], [ 182, 218 ], [ 218, 219 ], [ 219, 220 ], [ 219, 221 ], [ 221, 222 ], [ 158, 223 ], [ 223, 224 ], [ 223, 225 ], [ 225, 226 ], [ 226, 227 ], [ 226, 228 ], [ 228, 229 ], [ 225, 230 ], [ 230, 231 ], [ 231, 232 ], [ 231, 233 ], [ 230, 234 ], [ 234, 235 ], [ 234, 236 ], [ 236, 237 ], [ 225, 238 ], [ 238, 239 ], [ 238, 240 ], [ 225, 241 ], [ 241, 242 ], [ 242, 243 ], [ 242, 244 ], [ 241, 245 ], [ 245, 246 ], [ 246, 247 ], [ 246, 248 ], [ 248, 249 ], [ 245, 250 ], [ 250, 251 ], [ 250, 252 ], [ 252, 253 ], [ 225, 254 ], [ 254, 255 ], [ 254, 256 ], [ 225, 257 ], [ 257, 258 ], [ 258, 259 ], [ 259, 260 ], [ 259, 261 ], [ 257, 262 ], [ 262, 263 ], [ 263, 264 ], [ 263, 265 ], [ 262, 266 ], [ 266, 267 ], [ 266, 268 ], [ 268, 269 ], [ 268, 270 ], [ 262, 271 ], [ 271, 272 ], [ 271, 273 ], [ 273, 274 ], [ 225, 275 ], [ 275, 276 ], [ 276, 277 ], [ 276, 278 ], [ 158, 279 ], [ 279, 280 ], [ 279, 281 ], [ 281, 282 ], [ 282, 283 ], [ 286, 284 ], [ 296, 285 ], [ 293, 286 ], [ 286, 287 ], [ 287, 288 ], [ 287, 289 ], [ 286, 290 ], [ 290, 291 ], [ 290, 292 ], [ 293, 293 ], [ 293, 294 ], [ 293, 295 ], [ 296, 296 ], [ 296, 297 ], [ 296, 298 ], [ 286, 299 ], [ 299, 300 ], [ 299, 301 ], [ 301, 302 ], [ 279, 303 ], [ 303, 304 ], [ 0, 305 ], [ 305, 306 ], [ 305, 307 ] ]
[ "import java.io.IOException;\nimport java.io.InputStream;\nimport java.io.OutputStream;\nimport java.io.PrintWriter;\n\n/**\n * Built using CHelper plug-in\n * Actual solution is at the top\n *\n * @author Spandan Mishra\n */\npublic class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n CStep solver = new CStep();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class CStep {\n public void solve(int testNumber, InputReader in, PrintWriter out) {\n int n = in.readInt();\n int[] a = new int[n];\n\n for (int i = 0; i < n; i++)\n a[i] = in.readInt();\n\n int[] dp = new int[n];\n dp[0] = a[0];\n\n for (int i = 1; i < n; i++)\n dp[i] = Math.max(a[i], dp[i - 1]);\n\n// System.out.println(Arrays.toString(dp));\n\n long ans = 0;\n for (int i = 0; i < n; i++)\n ans += Math.abs(dp[i] - a[i]);\n\n System.out.println(ans);\n\n }\n\n }\n\n static class InputReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n\n public InputReader(InputStream stream) {\n this.stream = stream;\n }\n\n public int read() {\n if (numChars == -1)\n throw new RuntimeException();\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new RuntimeException();\n }\n if (numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }\n\n public int readInt() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public boolean isSpaceChar(int c) {\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n }\n}\n", "import java.io.IOException;", "IOException", "java.io", "import java.io.InputStream;", "InputStream", "java.io", "import java.io.OutputStream;", "OutputStream", "java.io", "import java.io.PrintWriter;", "PrintWriter", "java.io", "public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n CStep solver = new CStep();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class CStep {\n public void solve(int testNumber, InputReader in, PrintWriter out) {\n int n = in.readInt();\n int[] a = new int[n];\n\n for (int i = 0; i < n; i++)\n a[i] = in.readInt();\n\n int[] dp = new int[n];\n dp[0] = a[0];\n\n for (int i = 1; i < n; i++)\n dp[i] = Math.max(a[i], dp[i - 1]);\n\n// System.out.println(Arrays.toString(dp));\n\n long ans = 0;\n for (int i = 0; i < n; i++)\n ans += Math.abs(dp[i] - a[i]);\n\n System.out.println(ans);\n\n }\n\n }\n\n static class InputReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n\n public InputReader(InputStream stream) {\n this.stream = stream;\n }\n\n public int read() {\n if (numChars == -1)\n throw new RuntimeException();\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new RuntimeException();\n }\n if (numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }\n\n public int readInt() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public boolean isSpaceChar(int c) {\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n }\n}", "Main", "public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n CStep solver = new CStep();\n solver.solve(1, in, out);\n out.close();\n }", "main", "{\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n CStep solver = new CStep();\n solver.solve(1, in, out);\n out.close();\n }", "InputStream inputStream = System.in;", "inputStream", "System.in", "System", "System.in", "OutputStream outputStream = System.out;", "outputStream", "System.out", "System", "System.out", "InputReader in = new InputReader(inputStream);", "in", "new InputReader(inputStream)", "PrintWriter out = new PrintWriter(outputStream);", "out", "new PrintWriter(outputStream)", "CStep solver = new CStep();", "solver", "new CStep()", "solver.solve(1, in, out)", "solver.solve", "solver", "1", "in", "out", "out.close()", "out.close", "out", "String[] args", "args", "static class CStep {\n public void solve(int testNumber, InputReader in, PrintWriter out) {\n int n = in.readInt();\n int[] a = new int[n];\n\n for (int i = 0; i < n; i++)\n a[i] = in.readInt();\n\n int[] dp = new int[n];\n dp[0] = a[0];\n\n for (int i = 1; i < n; i++)\n dp[i] = Math.max(a[i], dp[i - 1]);\n\n// System.out.println(Arrays.toString(dp));\n\n long ans = 0;\n for (int i = 0; i < n; i++)\n ans += Math.abs(dp[i] - a[i]);\n\n System.out.println(ans);\n\n }\n\n }", "CStep", "public void solve(int testNumber, InputReader in, PrintWriter out) {\n int n = in.readInt();\n int[] a = new int[n];\n\n for (int i = 0; i < n; i++)\n a[i] = in.readInt();\n\n int[] dp = new int[n];\n dp[0] = a[0];\n\n for (int i = 1; i < n; i++)\n dp[i] = Math.max(a[i], dp[i - 1]);\n\n// System.out.println(Arrays.toString(dp));\n\n long ans = 0;\n for (int i = 0; i < n; i++)\n ans += Math.abs(dp[i] - a[i]);\n\n System.out.println(ans);\n\n }", "solve", "{\n int n = in.readInt();\n int[] a = new int[n];\n\n for (int i = 0; i < n; i++)\n a[i] = in.readInt();\n\n int[] dp = new int[n];\n dp[0] = a[0];\n\n for (int i = 1; i < n; i++)\n dp[i] = Math.max(a[i], dp[i - 1]);\n\n// System.out.println(Arrays.toString(dp));\n\n long ans = 0;\n for (int i = 0; i < n; i++)\n ans += Math.abs(dp[i] - a[i]);\n\n System.out.println(ans);\n\n }", "int n = in.readInt();", "n", "in.readInt()", "in.readInt", "in", "int[] a = new int[n];", "a", "new int[n]", "n", "for (int i = 0; i < n; i++)\n a[i] = in.readInt();", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "a[i] = in.readInt();", "a[i] = in.readInt()", "a[i]", "a", "i", "in.readInt()", "in.readInt", "in", "int[] dp = new int[n];", "dp", "new int[n]", "n", "dp[0] = a[0]", "dp[0]", "dp", "0", "a[0]", "a", "0", "for (int i = 1; i < n; i++)\n dp[i] = Math.max(a[i], dp[i - 1]);", "int i = 1;", "int i = 1;", "i", "1", "i < n", "i", "n", "i++", "i++", "i", "dp[i] = Math.max(a[i], dp[i - 1]);", "dp[i] = Math.max(a[i], dp[i - 1])", "dp[i]", "dp", "i", "Math.max(a[i], dp[i - 1])", "Math.max", "Math", "a[i]", "a", "i", "dp[i - 1]", "dp", "i - 1", "i", "1", "long ans = 0;", "ans", "0", "for (int i = 0; i < n; i++)\n ans += Math.abs(dp[i] - a[i]);", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "ans += Math.abs(dp[i] - a[i]);", "ans += Math.abs(dp[i] - a[i])", "ans", "Math.abs(dp[i] - a[i])", "Math.abs", "Math", "dp[i] - a[i]", "dp[i]", "dp", "i", "a[i]", "a", "i", "System.out.println(ans)", "System.out.println", "System.out", "System", "System.out", "ans", "int testNumber", "testNumber", "InputReader in", "in", "PrintWriter out", "out", "static class InputReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n\n public InputReader(InputStream stream) {\n this.stream = stream;\n }\n\n public int read() {\n if (numChars == -1)\n throw new RuntimeException();\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new RuntimeException();\n }\n if (numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }\n\n public int readInt() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public boolean isSpaceChar(int c) {\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n }", "InputReader", "private InputStream stream;", "stream", "private byte[] buf = new byte[1024];", "buf", "new byte[1024]", "1024", "private int curChar;", "curChar", "private int numChars;", "numChars", "public InputReader(InputStream stream) {\n this.stream = stream;\n }", "InputReader", "{\n this.stream = stream;\n }", "this.stream = stream", "this.stream", "this", "this.stream", "stream", "InputStream stream", "stream", "public int read() {\n if (numChars == -1)\n throw new RuntimeException();\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new RuntimeException();\n }\n if (numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }", "read", "{\n if (numChars == -1)\n throw new RuntimeException();\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new RuntimeException();\n }\n if (numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }", "if (numChars == -1)\n throw new RuntimeException();", "numChars == -1", "numChars", "-1", "1", "throw new RuntimeException();", "new RuntimeException()", "if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new RuntimeException();\n }\n if (numChars <= 0)\n return -1;\n }", "curChar >= numChars", "curChar", "numChars", "{\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new RuntimeException();\n }\n if (numChars <= 0)\n return -1;\n }", "curChar = 0", "curChar", "0", "try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new RuntimeException();\n }", "catch (IOException e) {\n throw new RuntimeException();\n }", "IOException e", "{\n throw new RuntimeException();\n }", "throw new RuntimeException();", "new RuntimeException()", "{\n numChars = stream.read(buf);\n }", "numChars = stream.read(buf)", "numChars", "stream.read(buf)", "stream.read", "stream", "buf", "if (numChars <= 0)\n return -1;", "numChars <= 0", "numChars", "0", "return -1;", "-1", "1", "return buf[curChar++];", "buf[curChar++]", "buf", "curChar++", "curChar", "public int readInt() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }", "readInt", "{\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }", "int c = read();", "c", "read()", "read", "while (isSpaceChar(c))\n c = read();", "isSpaceChar(c)", "isSpaceChar", "c", "c = read()", "c", "read()", "read", "int sgn = 1;", "sgn", "1", "if (c == '-') {\n sgn = -1;\n c = read();\n }", "c == '-'", "c", "'-'", "{\n sgn = -1;\n c = read();\n }", "sgn = -1", "sgn", "-1", "1", "c = read()", "c", "read()", "read", "int res = 0;", "res", "0", "do {\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));", "!isSpaceChar(c)", "isSpaceChar(c)", "isSpaceChar", "c", "{\n res *= 10;\n res += c - '0';\n c = read();\n }", "res *= 10", "res", "10", "res += c - '0'", "res", "c - '0'", "c", "'0'", "c = read()", "c", "read()", "read", "return res * sgn;", "res * sgn", "res", "sgn", "public boolean isSpaceChar(int c) {\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }", "isSpaceChar", "{\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }", "return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;", "c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1", "c == '\\t'", "c == '\\r'", "c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1", "c == ' '", "c", "' '", "c == '\\n'", "c", "'\\n'", "c == '\\r'", "c", "'\\r'", "c == '\\t'", "c", "'\\t'", "c == -1", "c", "-1", "1", "int c", "c", "public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n CStep solver = new CStep();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class CStep {\n public void solve(int testNumber, InputReader in, PrintWriter out) {\n int n = in.readInt();\n int[] a = new int[n];\n\n for (int i = 0; i < n; i++)\n a[i] = in.readInt();\n\n int[] dp = new int[n];\n dp[0] = a[0];\n\n for (int i = 1; i < n; i++)\n dp[i] = Math.max(a[i], dp[i - 1]);\n\n// System.out.println(Arrays.toString(dp));\n\n long ans = 0;\n for (int i = 0; i < n; i++)\n ans += Math.abs(dp[i] - a[i]);\n\n System.out.println(ans);\n\n }\n\n }\n\n static class InputReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n\n public InputReader(InputStream stream) {\n this.stream = stream;\n }\n\n public int read() {\n if (numChars == -1)\n throw new RuntimeException();\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new RuntimeException();\n }\n if (numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }\n\n public int readInt() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public boolean isSpaceChar(int c) {\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n }\n}", "public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n CStep solver = new CStep();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class CStep {\n public void solve(int testNumber, InputReader in, PrintWriter out) {\n int n = in.readInt();\n int[] a = new int[n];\n\n for (int i = 0; i < n; i++)\n a[i] = in.readInt();\n\n int[] dp = new int[n];\n dp[0] = a[0];\n\n for (int i = 1; i < n; i++)\n dp[i] = Math.max(a[i], dp[i - 1]);\n\n// System.out.println(Arrays.toString(dp));\n\n long ans = 0;\n for (int i = 0; i < n; i++)\n ans += Math.abs(dp[i] - a[i]);\n\n System.out.println(ans);\n\n }\n\n }\n\n static class InputReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n\n public InputReader(InputStream stream) {\n this.stream = stream;\n }\n\n public int read() {\n if (numChars == -1)\n throw new RuntimeException();\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new RuntimeException();\n }\n if (numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }\n\n public int readInt() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public boolean isSpaceChar(int c) {\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n }\n}", "Main" ]
import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintWriter; /** * Built using CHelper plug-in * Actual solution is at the top * * @author Spandan Mishra */ public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; InputReader in = new InputReader(inputStream); PrintWriter out = new PrintWriter(outputStream); CStep solver = new CStep(); solver.solve(1, in, out); out.close(); } static class CStep { public void solve(int testNumber, InputReader in, PrintWriter out) { int n = in.readInt(); int[] a = new int[n]; for (int i = 0; i < n; i++) a[i] = in.readInt(); int[] dp = new int[n]; dp[0] = a[0]; for (int i = 1; i < n; i++) dp[i] = Math.max(a[i], dp[i - 1]); // System.out.println(Arrays.toString(dp)); long ans = 0; for (int i = 0; i < n; i++) ans += Math.abs(dp[i] - a[i]); System.out.println(ans); } } static class InputReader { private InputStream stream; private byte[] buf = new byte[1024]; private int curChar; private int numChars; public InputReader(InputStream stream) { this.stream = stream; } public int read() { if (numChars == -1) throw new RuntimeException(); if (curChar >= numChars) { curChar = 0; try { numChars = stream.read(buf); } catch (IOException e) { throw new RuntimeException(); } if (numChars <= 0) return -1; } return buf[curChar++]; } public int readInt() { int c = read(); while (isSpaceChar(c)) c = read(); int sgn = 1; if (c == '-') { sgn = -1; c = read(); } int res = 0; do { res *= 10; res += c - '0'; c = read(); } while (!isSpaceChar(c)); return res * sgn; } public boolean isSpaceChar(int c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; } } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 13, 41, 13, 17, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 18, 13, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 18, 13, 2, 13, 17, 18, 13, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 2, 18, 13, 13, 18, 13, 13, 4, 18, 13, 13, 4, 18, 13, 23, 13, 6, 13, 41, 13, 20, 41, 13, 20, 12, 13, 30, 42, 40, 4, 18, 13, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 20, 29, 4, 18, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 13, 29, 13, 23, 13, 12, 13, 30, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 13, 29, 13, 23, 13, 12, 13, 30, 41, 13, 20, 17, 11, 1, 41, 13, 17, 2, 13, 17, 1, 40, 13, 30, 30, 14, 2, 2, 2, 17, 13, 13, 17, 0, 18, 13, 13, 17, 29, 13, 23, 13, 12, 13, 30, 41, 13, 18, 13, 13, 14, 2, 18, 13, 13, 17, 0, 13, 18, 13, 17, 41, 13, 17, 42, 2, 18, 13, 17, 17, 30, 14, 2, 2, 18, 13, 17, 17, 17, 0, 13, 2, 2, 13, 18, 13, 17, 13, 0, 18, 13, 17, 17, 0, 18, 13, 17, 2, 2, 18, 13, 17, 18, 13, 17, 13, 29, 13, 23, 13, 12, 13, 30, 28, 13, 13, 30, 30, 4, 18, 18, 13, 13, 2, 13, 17, 23, 13, 12, 13, 30, 28, 13, 13, 30, 30, 4, 18, 18, 13, 13, 2, 13, 17, 4, 18, 18, 13, 13, 23, 13, 12, 13, 30, 41, 13, 17, 28, 13, 13, 30, 30, 41, 13, 17, 14, 4, 18, 4, 18, 13, 30, 41, 13, 4, 18, 4, 18, 4, 18, 13, 35, 13, 34, 17, 30, 30, 41, 13, 13, 4, 13, 2, 2, 13, 17, 4, 18, 13, 13, 3, 34, 17, 30, 30, 41, 13, 13, 4, 13, 2, 2, 13, 17, 4, 18, 13, 13, 3, 34, 17, 30, 30, 41, 13, 13, 4, 13, 2, 2, 13, 17, 4, 18, 13, 13, 3, 34, 17, 30, 30, 41, 13, 13, 4, 13, 2, 2, 13, 17, 4, 18, 13, 13, 3, 34, 17, 30, 30, 41, 13, 13, 4, 13, 2, 2, 13, 17, 4, 18, 13, 13, 3, 34, 17, 30, 30, 41, 13, 13, 4, 13, 2, 2, 13, 17, 4, 18, 13, 13, 3, 34, 17, 30, 30, 41, 13, 13, 4, 13, 2, 2, 13, 17, 4, 18, 13, 13, 3, 34, 17, 30, 30, 41, 13, 13, 4, 13, 2, 2, 13, 17, 4, 18, 13, 13, 3, 34, 17, 30, 30, 41, 13, 13, 4, 13, 2, 2, 13, 17, 4, 18, 13, 13, 3, 34, 17, 30, 30, 41, 13, 13, 4, 13, 2, 2, 13, 17, 4, 18, 13, 13, 3, 34, 30, 30, 4, 13, 2, 13, 17, 3, 0, 13, 17, 14, 2, 4, 18, 13, 18, 13, 30, 4, 13, 2, 2, 13, 17, 13, 0, 13, 17, 14, 2, 4, 18, 13, 18, 13, 30, 4, 13, 2, 2, 13, 17, 13, 0, 13, 17, 14, 2, 4, 18, 13, 18, 13, 30, 4, 13, 2, 2, 13, 17, 13, 0, 13, 17, 14, 2, 4, 18, 13, 18, 13, 30, 4, 13, 2, 2, 13, 17, 13, 0, 13, 17, 14, 2, 4, 18, 13, 18, 13, 30, 4, 13, 2, 2, 13, 17, 13, 0, 13, 17, 14, 2, 4, 18, 13, 18, 13, 30, 4, 13, 2, 2, 13, 17, 13, 0, 13, 17, 14, 40, 13, 30, 4, 13, 2, 2, 13, 17, 13, 40, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 13, 14 ], [ 13, 15 ], [ 0, 16 ], [ 16, 17 ], [ 16, 18 ], [ 0, 19 ], [ 739, 20 ], [ 739, 21 ], [ 21, 22 ], [ 21, 23 ], [ 23, 24 ], [ 24, 25 ], [ 24, 26 ], [ 23, 27 ], [ 27, 28 ], [ 27, 29 ], [ 23, 30 ], [ 30, 31 ], [ 30, 32 ], [ 32, 33 ], [ 33, 34 ], [ 23, 35 ], [ 35, 36 ], [ 35, 37 ], [ 37, 38 ], [ 38, 39 ], [ 37, 40 ], [ 23, 41 ], [ 41, 42 ], [ 41, 43 ], [ 23, 44 ], [ 44, 45 ], [ 44, 46 ], [ 23, 48 ], [ 48, 49 ], [ 49, 50 ], [ 50, 51 ], [ 50, 52 ], [ 48, 53 ], [ 53, 54 ], [ 53, 55 ], [ 48, 56 ], [ 56, 57 ], [ 57, 58 ], [ 48, 59 ], [ 60, 60 ], [ 60, 61 ], [ 61, 62 ], [ 62, 63 ], [ 62, 64 ], [ 61, 65 ], [ 65, 66 ], [ 65, 67 ], [ 23, 68 ], [ 68, 69 ], [ 69, 70 ], [ 70, 71 ], [ 70, 72 ], [ 68, 73 ], [ 73, 74 ], [ 73, 75 ], [ 68, 76 ], [ 76, 77 ], [ 77, 78 ], [ 68, 79 ], [ 80, 80 ], [ 80, 81 ], [ 81, 82 ], [ 82, 83 ], [ 82, 84 ], [ 81, 85 ], [ 85, 86 ], [ 86, 87 ], [ 85, 88 ], [ 88, 89 ], [ 88, 90 ], [ 90, 91 ], [ 90, 92 ], [ 85, 93 ], [ 93, 94 ], [ 93, 95 ], [ 23, 96 ], [ 96, 97 ], [ 97, 98 ], [ 98, 99 ], [ 98, 100 ], [ 96, 101 ], [ 101, 102 ], [ 101, 103 ], [ 96, 104 ], [ 104, 105 ], [ 105, 106 ], [ 96, 107 ], [ 108, 108 ], [ 108, 109 ], [ 109, 110 ], [ 109, 111 ], [ 111, 112 ], [ 112, 113 ], [ 112, 114 ], [ 111, 115 ], [ 115, 116 ], [ 115, 117 ], [ 23, 118 ], [ 118, 119 ], [ 119, 120 ], [ 118, 121 ], [ 23, 122 ], [ 122, 123 ], [ 123, 124 ], [ 21, 125 ], [ 125, 126 ], [ 739, 127 ], [ 127, 128 ], [ 127, 129 ], [ 129, 130 ], [ 129, 131 ], [ 127, 132 ], [ 132, 133 ], [ 132, 134 ], [ 127, 135 ], [ 135, 136 ], [ 135, 137 ], [ 137, 138 ], [ 138, 139 ], [ 139, 140 ], [ 140, 141 ], [ 141, 142 ], [ 138, 143 ], [ 143, 144 ], [ 144, 145 ], [ 144, 146 ], [ 146, 147 ], [ 147, 148 ], [ 148, 149 ], [ 143, 150 ], [ 150, 151 ], [ 151, 152 ], [ 151, 153 ], [ 137, 154 ], [ 154, 155 ], [ 155, 156 ], [ 156, 157 ], [ 127, 158 ], [ 158, 159 ], [ 158, 160 ], [ 160, 161 ], [ 161, 162 ], [ 162, 163 ], [ 163, 164 ], [ 162, 165 ], [ 165, 166 ], [ 127, 167 ], [ 167, 168 ], [ 167, 169 ], [ 169, 170 ], [ 170, 171 ], [ 171, 172 ], [ 172, 173 ], [ 171, 174 ], [ 174, 175 ], [ 127, 176 ], [ 176, 177 ], [ 176, 178 ], [ 178, 179 ], [ 179, 180 ], [ 180, 181 ], [ 181, 182 ], [ 180, 183 ], [ 183, 184 ], [ 127, 185 ], [ 185, 186 ], [ 185, 187 ], [ 187, 188 ], [ 188, 189 ], [ 188, 190 ], [ 187, 192 ], [ 192, 193 ], [ 193, 194 ], [ 194, 195 ], [ 194, 196 ], [ 192, 197 ], [ 197, 198 ], [ 197, 199 ], [ 192, 200 ], [ 200, 201 ], [ 201, 202 ], [ 192, 203 ], [ 204, 204 ], [ 204, 205 ], [ 205, 206 ], [ 206, 207 ], [ 206, 208 ], [ 205, 209 ], [ 209, 210 ], [ 187, 211 ], [ 211, 212 ], [ 185, 213 ], [ 213, 214 ], [ 127, 215 ], [ 215, 216 ], [ 215, 217 ], [ 217, 218 ], [ 218, 219 ], [ 218, 220 ], [ 217, 222 ], [ 222, 223 ], [ 223, 224 ], [ 224, 225 ], [ 224, 226 ], [ 222, 227 ], [ 227, 228 ], [ 227, 229 ], [ 222, 230 ], [ 230, 231 ], [ 231, 232 ], [ 222, 233 ], [ 234, 234 ], [ 234, 235 ], [ 235, 236 ], [ 236, 237 ], [ 236, 238 ], [ 235, 239 ], [ 239, 240 ], [ 217, 241 ], [ 241, 242 ], [ 215, 243 ], [ 243, 244 ], [ 127, 245 ], [ 245, 246 ], [ 245, 247 ], [ 247, 248 ], [ 248, 249 ], [ 248, 250 ], [ 247, 252 ], [ 252, 253 ], [ 253, 254 ], [ 254, 255 ], [ 254, 256 ], [ 252, 257 ], [ 257, 258 ], [ 257, 259 ], [ 252, 260 ], [ 260, 261 ], [ 261, 262 ], [ 252, 263 ], [ 264, 264 ], [ 264, 265 ], [ 265, 266 ], [ 266, 267 ], [ 267, 268 ], [ 268, 269 ], [ 268, 270 ], [ 267, 271 ], [ 266, 272 ], [ 265, 273 ], [ 273, 274 ], [ 274, 275 ], [ 274, 276 ], [ 273, 277 ], [ 247, 278 ], [ 278, 279 ], [ 245, 280 ], [ 280, 281 ], [ 127, 282 ], [ 282, 283 ], [ 282, 284 ], [ 284, 285 ], [ 285, 286 ], [ 285, 287 ], [ 287, 288 ], [ 287, 289 ], [ 284, 290 ], [ 290, 291 ], [ 291, 292 ], [ 292, 293 ], [ 292, 294 ], [ 291, 295 ], [ 290, 296 ], [ 296, 297 ], [ 296, 298 ], [ 298, 299 ], [ 298, 300 ], [ 284, 301 ], [ 301, 302 ], [ 301, 303 ], [ 284, 304 ], [ 304, 305 ], [ 305, 306 ], [ 306, 307 ], [ 306, 308 ], [ 305, 309 ], [ 304, 310 ], [ 310, 311 ], [ 311, 312 ], [ 312, 313 ], [ 313, 314 ], [ 314, 315 ], [ 314, 316 ], [ 313, 317 ], [ 312, 318 ], [ 311, 319 ], [ 319, 320 ], [ 319, 321 ], [ 321, 322 ], [ 322, 323 ], [ 322, 324 ], [ 324, 325 ], [ 324, 326 ], [ 321, 327 ], [ 310, 328 ], [ 328, 329 ], [ 329, 330 ], [ 329, 331 ], [ 328, 332 ], [ 310, 333 ], [ 333, 334 ], [ 334, 335 ], [ 334, 336 ], [ 333, 337 ], [ 337, 338 ], [ 338, 339 ], [ 339, 340 ], [ 339, 341 ], [ 338, 342 ], [ 342, 343 ], [ 342, 344 ], [ 337, 345 ], [ 284, 346 ], [ 346, 347 ], [ 282, 348 ], [ 348, 349 ], [ 127, 350 ], [ 350, 351 ], [ 350, 352 ], [ 352, 353 ], [ 353, 354 ], [ 353, 355 ], [ 353, 356 ], [ 357, 357 ], [ 357, 358 ], [ 358, 359 ], [ 359, 360 ], [ 360, 361 ], [ 360, 362 ], [ 358, 363 ], [ 363, 364 ], [ 363, 365 ], [ 350, 366 ], [ 366, 367 ], [ 127, 368 ], [ 368, 369 ], [ 368, 370 ], [ 370, 371 ], [ 371, 372 ], [ 371, 373 ], [ 371, 374 ], [ 375, 375 ], [ 375, 376 ], [ 376, 377 ], [ 377, 378 ], [ 378, 379 ], [ 378, 380 ], [ 376, 381 ], [ 381, 382 ], [ 381, 383 ], [ 370, 384 ], [ 384, 385 ], [ 385, 386 ], [ 386, 387 ], [ 386, 388 ], [ 368, 389 ], [ 389, 390 ], [ 127, 391 ], [ 391, 392 ], [ 391, 393 ], [ 393, 394 ], [ 394, 395 ], [ 394, 396 ], [ 393, 397 ], [ 397, 398 ], [ 397, 399 ], [ 397, 400 ], [ 401, 401 ], [ 401, 402 ], [ 402, 403 ], [ 402, 404 ], [ 401, 405 ], [ 405, 406 ], [ 406, 407 ], [ 407, 408 ], [ 408, 409 ], [ 409, 410 ], [ 405, 411 ], [ 411, 412 ], [ 412, 413 ], [ 412, 414 ], [ 414, 415 ], [ 415, 416 ], [ 416, 417 ], [ 417, 418 ], [ 418, 419 ], [ 419, 420 ], [ 411, 421 ], [ 421, 422 ], [ 421, 423 ], [ 423, 424 ], [ 423, 425 ], [ 425, 426 ], [ 426, 427 ], [ 427, 428 ], [ 427, 429 ], [ 426, 430 ], [ 430, 431 ], [ 430, 432 ], [ 433, 433 ], [ 433, 434 ], [ 433, 435 ], [ 433, 436 ], [ 436, 437 ], [ 437, 438 ], [ 436, 439 ], [ 426, 440 ], [ 421, 441 ], [ 441, 442 ], [ 441, 443 ], [ 443, 444 ], [ 444, 445 ], [ 445, 446 ], [ 445, 447 ], [ 444, 448 ], [ 448, 449 ], [ 448, 450 ], [ 451, 451 ], [ 451, 452 ], [ 451, 453 ], [ 451, 454 ], [ 454, 455 ], [ 455, 456 ], [ 454, 457 ], [ 444, 458 ], [ 421, 459 ], [ 459, 460 ], [ 459, 461 ], [ 461, 462 ], [ 462, 463 ], [ 463, 464 ], [ 463, 465 ], [ 462, 466 ], [ 466, 467 ], [ 466, 468 ], [ 469, 469 ], [ 469, 470 ], [ 469, 471 ], [ 469, 472 ], [ 472, 473 ], [ 473, 474 ], [ 472, 475 ], [ 462, 476 ], [ 421, 477 ], [ 477, 478 ], [ 477, 479 ], [ 479, 480 ], [ 480, 481 ], [ 481, 482 ], [ 481, 483 ], [ 480, 484 ], [ 484, 485 ], [ 484, 486 ], [ 487, 487 ], [ 487, 488 ], [ 487, 489 ], [ 487, 490 ], [ 490, 491 ], [ 491, 492 ], [ 490, 493 ], [ 480, 494 ], [ 421, 495 ], [ 495, 496 ], [ 495, 497 ], [ 497, 498 ], [ 498, 499 ], [ 499, 500 ], [ 499, 501 ], [ 498, 502 ], [ 502, 503 ], [ 502, 504 ], [ 505, 505 ], [ 505, 506 ], [ 505, 507 ], [ 505, 508 ], [ 508, 509 ], [ 509, 510 ], [ 508, 511 ], [ 498, 512 ], [ 421, 513 ], [ 513, 514 ], [ 513, 515 ], [ 515, 516 ], [ 516, 517 ], [ 517, 518 ], [ 517, 519 ], [ 516, 520 ], [ 520, 521 ], [ 520, 522 ], [ 523, 523 ], [ 523, 524 ], [ 523, 525 ], [ 523, 526 ], [ 526, 527 ], [ 527, 528 ], [ 526, 529 ], [ 516, 530 ], [ 421, 531 ], [ 531, 532 ], [ 531, 533 ], [ 533, 534 ], [ 534, 535 ], [ 535, 536 ], [ 535, 537 ], [ 534, 538 ], [ 538, 539 ], [ 538, 540 ], [ 541, 541 ], [ 541, 542 ], [ 541, 543 ], [ 541, 544 ], [ 544, 545 ], [ 545, 546 ], [ 544, 547 ], [ 534, 548 ], [ 421, 549 ], [ 549, 550 ], [ 549, 551 ], [ 551, 552 ], [ 552, 553 ], [ 553, 554 ], [ 553, 555 ], [ 552, 556 ], [ 556, 557 ], [ 556, 558 ], [ 559, 559 ], [ 559, 560 ], [ 559, 561 ], [ 559, 562 ], [ 562, 563 ], [ 563, 564 ], [ 562, 565 ], [ 552, 566 ], [ 421, 567 ], [ 567, 568 ], [ 567, 569 ], [ 569, 570 ], [ 570, 571 ], [ 571, 572 ], [ 571, 573 ], [ 570, 574 ], [ 574, 575 ], [ 574, 576 ], [ 577, 577 ], [ 577, 578 ], [ 577, 579 ], [ 577, 580 ], [ 580, 581 ], [ 581, 582 ], [ 580, 583 ], [ 570, 584 ], [ 421, 585 ], [ 585, 586 ], [ 585, 587 ], [ 587, 588 ], [ 588, 589 ], [ 589, 590 ], [ 589, 591 ], [ 588, 592 ], [ 592, 593 ], [ 592, 594 ], [ 595, 595 ], [ 595, 596 ], [ 595, 597 ], [ 595, 598 ], [ 598, 599 ], [ 599, 600 ], [ 598, 601 ], [ 588, 602 ], [ 421, 603 ], [ 603, 604 ], [ 604, 605 ], [ 605, 606 ], [ 606, 607 ], [ 606, 608 ], [ 608, 609 ], [ 608, 610 ], [ 605, 611 ], [ 411, 612 ], [ 612, 613 ], [ 612, 614 ], [ 401, 615 ], [ 615, 616 ], [ 616, 617 ], [ 617, 618 ], [ 618, 619 ], [ 616, 620 ], [ 620, 621 ], [ 615, 622 ], [ 622, 623 ], [ 623, 624 ], [ 623, 625 ], [ 626, 626 ], [ 626, 627 ], [ 626, 628 ], [ 626, 629 ], [ 622, 630 ], [ 630, 631 ], [ 630, 632 ], [ 401, 633 ], [ 633, 634 ], [ 634, 635 ], [ 635, 636 ], [ 636, 637 ], [ 634, 638 ], [ 638, 639 ], [ 633, 640 ], [ 640, 641 ], [ 641, 642 ], [ 641, 643 ], [ 644, 644 ], [ 644, 645 ], [ 644, 646 ], [ 644, 647 ], [ 640, 648 ], [ 648, 649 ], [ 648, 650 ], [ 401, 651 ], [ 651, 652 ], [ 652, 653 ], [ 653, 654 ], [ 654, 655 ], [ 652, 656 ], [ 656, 657 ], [ 651, 658 ], [ 658, 659 ], [ 659, 660 ], [ 659, 661 ], [ 662, 662 ], [ 662, 663 ], [ 662, 664 ], [ 662, 665 ], [ 658, 666 ], [ 666, 667 ], [ 666, 668 ], [ 401, 669 ], [ 669, 670 ], [ 670, 671 ], [ 671, 672 ], [ 672, 673 ], [ 670, 674 ], [ 674, 675 ], [ 669, 676 ], [ 676, 677 ], [ 677, 678 ], [ 677, 679 ], [ 680, 680 ], [ 680, 681 ], [ 680, 682 ], [ 680, 683 ], [ 676, 684 ], [ 684, 685 ], [ 684, 686 ], [ 401, 687 ], [ 687, 688 ], [ 688, 689 ], [ 689, 690 ], [ 690, 691 ], [ 688, 692 ], [ 692, 693 ], [ 687, 694 ], [ 694, 695 ], [ 695, 696 ], [ 695, 697 ], [ 698, 698 ], [ 698, 699 ], [ 698, 700 ], [ 698, 701 ], [ 694, 702 ], [ 702, 703 ], [ 702, 704 ], [ 401, 705 ], [ 705, 706 ], [ 706, 707 ], [ 707, 708 ], [ 708, 709 ], [ 706, 710 ], [ 710, 711 ], [ 705, 712 ], [ 712, 713 ], [ 713, 714 ], [ 713, 715 ], [ 716, 716 ], [ 716, 717 ], [ 716, 718 ], [ 716, 719 ], [ 712, 720 ], [ 720, 721 ], [ 720, 722 ], [ 401, 723 ], [ 723, 724 ], [ 724, 725 ], [ 723, 726 ], [ 726, 727 ], [ 727, 728 ], [ 727, 729 ], [ 730, 730 ], [ 730, 731 ], [ 730, 732 ], [ 730, 733 ], [ 401, 734 ], [ 734, 735 ], [ 391, 736 ], [ 736, 737 ], [ 0, 738 ], [ 738, 739 ], [ 738, 740 ] ]
[ "import java.io.*;\nimport java.math.BigInteger;\nimport java.util.*;\nimport static java.lang.Math.PI;\nimport static java.lang.System.in;\nimport static java.lang.System.out;\n\npublic class Main\n{ \n public static void main(String [] args) throws Exception\n {\n Foster sc = new Foster();\n PrintWriter p = new PrintWriter(out);\n int n = sc.nextInt();\n int a[] = sc.intArray(n);\n long ans = 0;\n int max[] = new int[n];\n for(int i = 0; i < n; i++)\n {\n max[i] = a[i];\n }\n for(int i = 1; i < n; i++)\n {\n max[i] = Math.max(max[i-1],max[i]);\n }\n for(int i = 0; i < n; i++)\n {\n ans += max[i] - a[i];\n }\n p.println(ans);\n p.close();\n }\n\n/*\n*/ \n/*\n1. Check overflow in pow function or in general\n2. Check indices of read array function\n3. Think of an easier solution because the problems you solve are always easy\n4. Check iterator of loop\n5. If still doesn't work, then jump from the 729th floor 'coz \"beta tumse na ho paayega\"\n\n Move to top!!\n*/\n static class Foster \n {\n BufferedReader br = new BufferedReader(new InputStreamReader(in));\n StringTokenizer st = new StringTokenizer(\"\");\n String next() \n {\n while (!st.hasMoreTokens())\n try \n {\n st = new StringTokenizer(br.readLine());\n } \n catch (IOException e) \n {\n e.printStackTrace();\n }\n return st.nextToken();\n }\n int nextInt() \n {\n return Integer.parseInt(next());\n }\n long nextLong() \n {\n return Long.parseLong(next());\n }\n double nextDouble() \n {\n return Double.parseDouble(next());\n }\n int[] intArray(int n) // Check indices\n {\n int arr[] = new int[n];\n for(int i = 0; i < n; i++)\n {\n arr[i] = nextInt();\n }\n return arr;\n }\n long[] longArray(int n) // Check indices\n {\n long arr[] = new long[n];\n for(int i = 0; i < n; i++)\n {\n arr[i] = nextLong();\n }\n return arr;\n }\n int[] getBits(int n) //in Reverse Order\n {\n int a[] = new int[31];\n for(int i = 0; i < 31; i++)\n {\n if(((1<<i) & n) != 0)\n a[i] = 1;\n }\n return a;\n }\n static long pow(long... a)\n {\n long mod = Long.MAX_VALUE;\n if(a.length == 3) mod = a[2];\n long res = 1;\n while(a[1] > 0)\n {\n if((a[1] & 1) == 1)\n res = (res * a[0]) % mod;\n a[1] /= 2;\n a[0] = (a[0] * a[0]) % mod;\n }\n return res;\n }\n void print(Object... o) \n {\n for(Object next : o)\n {\n System.out.print(next + \" \");\n }\n }\n void println(Object... o) \n {\n for(Object next : o)\n {\n System.out.print(next + \" \");\n }\n System.out.println();\n }\n void watch(Object...a) throws Exception \n {\n int i = 1;\n for (Object o: a) \n {\n boolean found = false;\n if (o.getClass().isArray()) \n {\n String type = o.getClass().getName().toString();\n switch (type) \n {\n case \"[I\":\n {\n int[] test = (int[]) o;\n println(i + \" : \" + Arrays.toString(test));\n break;\n }\n case \"[[I\":\n {\n int[][] obj = (int[][]) o;\n\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[J\":\n {\n\n long[] obj = (long[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[J\":\n {\n\n long[][] obj = (long[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[D\":\n {\n\n double[] obj = (double[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[D\":\n {\n\n double[][] obj = (double[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[Ljava.lang.String\":\n {\n\n String[] obj = (String[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[Ljava.lang.String\":\n {\n\n String[][] obj = (String[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[C\":\n {\n char[] obj = (char[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[C\":\n {\n\n char[][] obj = (char[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n default:\n {\n println(i + \" : type not identified\");\n break;\n }\n }\n found = true;\n }\n if (o.getClass() == ArrayList.class) \n {\n println(i + \" : LIST = \" + o);\n found = true;\n }\n if (o.getClass() == TreeSet.class) \n {\n println(i + \" : SET = \" + o);\n found = true;\n }\n if (o.getClass() == TreeMap.class) \n {\n println(i + \" : MAP = \" + o);\n found = true;\n }\n if (o.getClass() == HashMap.class) \n {\n println(i + \" : MAP = \" + o);\n found = true;\n }\n if (o.getClass() == LinkedList.class) \n {\n println(i + \" : LIST = \" + o);\n found = true;\n }\n if (o.getClass() == PriorityQueue.class) \n {\n println(i + \" : PQ = \" + o);\n found = true;\n }\n if (!found) \n {\n println(i + \" = \" + o);\n }\n i++;\n }\n }\n }\n}", "import java.io.*;", "io.*", "java", "import java.math.BigInteger;", "BigInteger", "java.math", "import java.util.*;", "util.*", "java", "import static java.lang.Math.PI;", "import static java.lang.Math.PI;", "import static java.lang.Math.PI;", "import static java.lang.System.in;", "import static java.lang.System.in;", "import static java.lang.System.in;", "import static java.lang.System.out;", "import static java.lang.System.out;", "import static java.lang.System.out;", "public class Main\n{ \n public static void main(String [] args) throws Exception\n {\n Foster sc = new Foster();\n PrintWriter p = new PrintWriter(out);\n int n = sc.nextInt();\n int a[] = sc.intArray(n);\n long ans = 0;\n int max[] = new int[n];\n for(int i = 0; i < n; i++)\n {\n max[i] = a[i];\n }\n for(int i = 1; i < n; i++)\n {\n max[i] = Math.max(max[i-1],max[i]);\n }\n for(int i = 0; i < n; i++)\n {\n ans += max[i] - a[i];\n }\n p.println(ans);\n p.close();\n }\n\n/*\n*/ \n/*\n1. Check overflow in pow function or in general\n2. Check indices of read array function\n3. Think of an easier solution because the problems you solve are always easy\n4. Check iterator of loop\n5. If still doesn't work, then jump from the 729th floor 'coz \"beta tumse na ho paayega\"\n\n Move to top!!\n*/\n static class Foster \n {\n BufferedReader br = new BufferedReader(new InputStreamReader(in));\n StringTokenizer st = new StringTokenizer(\"\");\n String next() \n {\n while (!st.hasMoreTokens())\n try \n {\n st = new StringTokenizer(br.readLine());\n } \n catch (IOException e) \n {\n e.printStackTrace();\n }\n return st.nextToken();\n }\n int nextInt() \n {\n return Integer.parseInt(next());\n }\n long nextLong() \n {\n return Long.parseLong(next());\n }\n double nextDouble() \n {\n return Double.parseDouble(next());\n }\n int[] intArray(int n) // Check indices\n {\n int arr[] = new int[n];\n for(int i = 0; i < n; i++)\n {\n arr[i] = nextInt();\n }\n return arr;\n }\n long[] longArray(int n) // Check indices\n {\n long arr[] = new long[n];\n for(int i = 0; i < n; i++)\n {\n arr[i] = nextLong();\n }\n return arr;\n }\n int[] getBits(int n) //in Reverse Order\n {\n int a[] = new int[31];\n for(int i = 0; i < 31; i++)\n {\n if(((1<<i) & n) != 0)\n a[i] = 1;\n }\n return a;\n }\n static long pow(long... a)\n {\n long mod = Long.MAX_VALUE;\n if(a.length == 3) mod = a[2];\n long res = 1;\n while(a[1] > 0)\n {\n if((a[1] & 1) == 1)\n res = (res * a[0]) % mod;\n a[1] /= 2;\n a[0] = (a[0] * a[0]) % mod;\n }\n return res;\n }\n void print(Object... o) \n {\n for(Object next : o)\n {\n System.out.print(next + \" \");\n }\n }\n void println(Object... o) \n {\n for(Object next : o)\n {\n System.out.print(next + \" \");\n }\n System.out.println();\n }\n void watch(Object...a) throws Exception \n {\n int i = 1;\n for (Object o: a) \n {\n boolean found = false;\n if (o.getClass().isArray()) \n {\n String type = o.getClass().getName().toString();\n switch (type) \n {\n case \"[I\":\n {\n int[] test = (int[]) o;\n println(i + \" : \" + Arrays.toString(test));\n break;\n }\n case \"[[I\":\n {\n int[][] obj = (int[][]) o;\n\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[J\":\n {\n\n long[] obj = (long[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[J\":\n {\n\n long[][] obj = (long[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[D\":\n {\n\n double[] obj = (double[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[D\":\n {\n\n double[][] obj = (double[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[Ljava.lang.String\":\n {\n\n String[] obj = (String[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[Ljava.lang.String\":\n {\n\n String[][] obj = (String[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[C\":\n {\n char[] obj = (char[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[C\":\n {\n\n char[][] obj = (char[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n default:\n {\n println(i + \" : type not identified\");\n break;\n }\n }\n found = true;\n }\n if (o.getClass() == ArrayList.class) \n {\n println(i + \" : LIST = \" + o);\n found = true;\n }\n if (o.getClass() == TreeSet.class) \n {\n println(i + \" : SET = \" + o);\n found = true;\n }\n if (o.getClass() == TreeMap.class) \n {\n println(i + \" : MAP = \" + o);\n found = true;\n }\n if (o.getClass() == HashMap.class) \n {\n println(i + \" : MAP = \" + o);\n found = true;\n }\n if (o.getClass() == LinkedList.class) \n {\n println(i + \" : LIST = \" + o);\n found = true;\n }\n if (o.getClass() == PriorityQueue.class) \n {\n println(i + \" : PQ = \" + o);\n found = true;\n }\n if (!found) \n {\n println(i + \" = \" + o);\n }\n i++;\n }\n }\n }\n}", "Main", "public static void main(String [] args) throws Exception\n {\n Foster sc = new Foster();\n PrintWriter p = new PrintWriter(out);\n int n = sc.nextInt();\n int a[] = sc.intArray(n);\n long ans = 0;\n int max[] = new int[n];\n for(int i = 0; i < n; i++)\n {\n max[i] = a[i];\n }\n for(int i = 1; i < n; i++)\n {\n max[i] = Math.max(max[i-1],max[i]);\n }\n for(int i = 0; i < n; i++)\n {\n ans += max[i] - a[i];\n }\n p.println(ans);\n p.close();\n }", "main", "{\n Foster sc = new Foster();\n PrintWriter p = new PrintWriter(out);\n int n = sc.nextInt();\n int a[] = sc.intArray(n);\n long ans = 0;\n int max[] = new int[n];\n for(int i = 0; i < n; i++)\n {\n max[i] = a[i];\n }\n for(int i = 1; i < n; i++)\n {\n max[i] = Math.max(max[i-1],max[i]);\n }\n for(int i = 0; i < n; i++)\n {\n ans += max[i] - a[i];\n }\n p.println(ans);\n p.close();\n }", "Foster sc = new Foster();", "sc", "new Foster()", "PrintWriter p = new PrintWriter(out);", "p", "new PrintWriter(out)", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "int a[] = sc.intArray(n);", "a", "sc.intArray(n)", "sc.intArray", "sc", "n", "long ans = 0;", "ans", "0", "int max[] = new int[n];", "max", "new int[n]", "n", "for(int i = 0; i < n; i++)\n {\n max[i] = a[i];\n }", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n max[i] = a[i];\n }", "{\n max[i] = a[i];\n }", "max[i] = a[i]", "max[i]", "max", "i", "a[i]", "a", "i", "for(int i = 1; i < n; i++)\n {\n max[i] = Math.max(max[i-1],max[i]);\n }", "int i = 1;", "int i = 1;", "i", "1", "i < n", "i", "n", "i++", "i++", "i", "{\n max[i] = Math.max(max[i-1],max[i]);\n }", "{\n max[i] = Math.max(max[i-1],max[i]);\n }", "max[i] = Math.max(max[i-1],max[i])", "max[i]", "max", "i", "Math.max(max[i-1],max[i])", "Math.max", "Math", "max[i-1]", "max", "i-1", "i", "1", "max[i]", "max", "i", "for(int i = 0; i < n; i++)\n {\n ans += max[i] - a[i];\n }", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n ans += max[i] - a[i];\n }", "{\n ans += max[i] - a[i];\n }", "ans += max[i] - a[i]", "ans", "max[i] - a[i]", "max[i]", "max", "i", "a[i]", "a", "i", "p.println(ans)", "p.println", "p", "ans", "p.close()", "p.close", "p", "String [] args", "args", " static class Foster \n {\n BufferedReader br = new BufferedReader(new InputStreamReader(in));\n StringTokenizer st = new StringTokenizer(\"\");\n String next() \n {\n while (!st.hasMoreTokens())\n try \n {\n st = new StringTokenizer(br.readLine());\n } \n catch (IOException e) \n {\n e.printStackTrace();\n }\n return st.nextToken();\n }\n int nextInt() \n {\n return Integer.parseInt(next());\n }\n long nextLong() \n {\n return Long.parseLong(next());\n }\n double nextDouble() \n {\n return Double.parseDouble(next());\n }\n int[] intArray(int n) // Check indices\n {\n int arr[] = new int[n];\n for(int i = 0; i < n; i++)\n {\n arr[i] = nextInt();\n }\n return arr;\n }\n long[] longArray(int n) // Check indices\n {\n long arr[] = new long[n];\n for(int i = 0; i < n; i++)\n {\n arr[i] = nextLong();\n }\n return arr;\n }\n int[] getBits(int n) //in Reverse Order\n {\n int a[] = new int[31];\n for(int i = 0; i < 31; i++)\n {\n if(((1<<i) & n) != 0)\n a[i] = 1;\n }\n return a;\n }\n static long pow(long... a)\n {\n long mod = Long.MAX_VALUE;\n if(a.length == 3) mod = a[2];\n long res = 1;\n while(a[1] > 0)\n {\n if((a[1] & 1) == 1)\n res = (res * a[0]) % mod;\n a[1] /= 2;\n a[0] = (a[0] * a[0]) % mod;\n }\n return res;\n }\n void print(Object... o) \n {\n for(Object next : o)\n {\n System.out.print(next + \" \");\n }\n }\n void println(Object... o) \n {\n for(Object next : o)\n {\n System.out.print(next + \" \");\n }\n System.out.println();\n }\n void watch(Object...a) throws Exception \n {\n int i = 1;\n for (Object o: a) \n {\n boolean found = false;\n if (o.getClass().isArray()) \n {\n String type = o.getClass().getName().toString();\n switch (type) \n {\n case \"[I\":\n {\n int[] test = (int[]) o;\n println(i + \" : \" + Arrays.toString(test));\n break;\n }\n case \"[[I\":\n {\n int[][] obj = (int[][]) o;\n\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[J\":\n {\n\n long[] obj = (long[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[J\":\n {\n\n long[][] obj = (long[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[D\":\n {\n\n double[] obj = (double[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[D\":\n {\n\n double[][] obj = (double[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[Ljava.lang.String\":\n {\n\n String[] obj = (String[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[Ljava.lang.String\":\n {\n\n String[][] obj = (String[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[C\":\n {\n char[] obj = (char[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[C\":\n {\n\n char[][] obj = (char[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n default:\n {\n println(i + \" : type not identified\");\n break;\n }\n }\n found = true;\n }\n if (o.getClass() == ArrayList.class) \n {\n println(i + \" : LIST = \" + o);\n found = true;\n }\n if (o.getClass() == TreeSet.class) \n {\n println(i + \" : SET = \" + o);\n found = true;\n }\n if (o.getClass() == TreeMap.class) \n {\n println(i + \" : MAP = \" + o);\n found = true;\n }\n if (o.getClass() == HashMap.class) \n {\n println(i + \" : MAP = \" + o);\n found = true;\n }\n if (o.getClass() == LinkedList.class) \n {\n println(i + \" : LIST = \" + o);\n found = true;\n }\n if (o.getClass() == PriorityQueue.class) \n {\n println(i + \" : PQ = \" + o);\n found = true;\n }\n if (!found) \n {\n println(i + \" = \" + o);\n }\n i++;\n }\n }\n }", "Foster", "BufferedReader br = new BufferedReader(new InputStreamReader(in));", "br", "new BufferedReader(new InputStreamReader(in))", "StringTokenizer st = new StringTokenizer(\"\");", "st", "new StringTokenizer(\"\")", "String next() \n {\n while (!st.hasMoreTokens())\n try \n {\n st = new StringTokenizer(br.readLine());\n } \n catch (IOException e) \n {\n e.printStackTrace();\n }\n return st.nextToken();\n }", "next", "{\n while (!st.hasMoreTokens())\n try \n {\n st = new StringTokenizer(br.readLine());\n } \n catch (IOException e) \n {\n e.printStackTrace();\n }\n return st.nextToken();\n }", "while (!st.hasMoreTokens())\n try \n {\n st = new StringTokenizer(br.readLine());\n } \n catch (IOException e) \n {\n e.printStackTrace();\n }", "!st.hasMoreTokens()", "st.hasMoreTokens()", "st.hasMoreTokens", "st", "try \n {\n st = new StringTokenizer(br.readLine());\n } \n catch (IOException e) \n {\n e.printStackTrace();\n }", "catch (IOException e) \n {\n e.printStackTrace();\n }", "IOException e", "{\n e.printStackTrace();\n }", "e.printStackTrace()", "e.printStackTrace", "e", "{\n st = new StringTokenizer(br.readLine());\n }", "st = new StringTokenizer(br.readLine())", "st", "new StringTokenizer(br.readLine())", "return st.nextToken();", "st.nextToken()", "st.nextToken", "st", "int nextInt() \n {\n return Integer.parseInt(next());\n }", "nextInt", "{\n return Integer.parseInt(next());\n }", "return Integer.parseInt(next());", "Integer.parseInt(next())", "Integer.parseInt", "Integer", "next()", "next", "long nextLong() \n {\n return Long.parseLong(next());\n }", "nextLong", "{\n return Long.parseLong(next());\n }", "return Long.parseLong(next());", "Long.parseLong(next())", "Long.parseLong", "Long", "next()", "next", "double nextDouble() \n {\n return Double.parseDouble(next());\n }", "nextDouble", "{\n return Double.parseDouble(next());\n }", "return Double.parseDouble(next());", "Double.parseDouble(next())", "Double.parseDouble", "Double", "next()", "next", "int[] intArray(int n) // Check indices\n {\n int arr[] = new int[n];\n for(int i = 0; i < n; i++)\n {\n arr[i] = nextInt();\n }\n return arr;\n }", "intArray", "{\n int arr[] = new int[n];\n for(int i = 0; i < n; i++)\n {\n arr[i] = nextInt();\n }\n return arr;\n }", "int arr[] = new int[n];", "arr", "new int[n]", "n", "for(int i = 0; i < n; i++)\n {\n arr[i] = nextInt();\n }", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n arr[i] = nextInt();\n }", "{\n arr[i] = nextInt();\n }", "arr[i] = nextInt()", "arr[i]", "arr", "i", "nextInt()", "nextInt", "return arr;", "arr", "int n", "n", "long[] longArray(int n) // Check indices\n {\n long arr[] = new long[n];\n for(int i = 0; i < n; i++)\n {\n arr[i] = nextLong();\n }\n return arr;\n }", "longArray", "{\n long arr[] = new long[n];\n for(int i = 0; i < n; i++)\n {\n arr[i] = nextLong();\n }\n return arr;\n }", "long arr[] = new long[n];", "arr", "new long[n]", "n", "for(int i = 0; i < n; i++)\n {\n arr[i] = nextLong();\n }", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n arr[i] = nextLong();\n }", "{\n arr[i] = nextLong();\n }", "arr[i] = nextLong()", "arr[i]", "arr", "i", "nextLong()", "nextLong", "return arr;", "arr", "int n", "n", "int[] getBits(int n) //in Reverse Order\n {\n int a[] = new int[31];\n for(int i = 0; i < 31; i++)\n {\n if(((1<<i) & n) != 0)\n a[i] = 1;\n }\n return a;\n }", "getBits", "{\n int a[] = new int[31];\n for(int i = 0; i < 31; i++)\n {\n if(((1<<i) & n) != 0)\n a[i] = 1;\n }\n return a;\n }", "int a[] = new int[31];", "a", "new int[31]", "31", "for(int i = 0; i < 31; i++)\n {\n if(((1<<i) & n) != 0)\n a[i] = 1;\n }", "int i = 0;", "int i = 0;", "i", "0", "i < 31", "i", "31", "i++", "i++", "i", "{\n if(((1<<i) & n) != 0)\n a[i] = 1;\n }", "{\n if(((1<<i) & n) != 0)\n a[i] = 1;\n }", "if(((1<<i) & n) != 0)\n a[i] = 1;", "((1<<i) & n) != 0", "((1<<i) & n)", "(1<<i)", "1", "i", "n", "0", "a[i] = 1", "a[i]", "a", "i", "1", "return a;", "a", "int n", "n", "static long pow(long... a)\n {\n long mod = Long.MAX_VALUE;\n if(a.length == 3) mod = a[2];\n long res = 1;\n while(a[1] > 0)\n {\n if((a[1] & 1) == 1)\n res = (res * a[0]) % mod;\n a[1] /= 2;\n a[0] = (a[0] * a[0]) % mod;\n }\n return res;\n }", "pow", "{\n long mod = Long.MAX_VALUE;\n if(a.length == 3) mod = a[2];\n long res = 1;\n while(a[1] > 0)\n {\n if((a[1] & 1) == 1)\n res = (res * a[0]) % mod;\n a[1] /= 2;\n a[0] = (a[0] * a[0]) % mod;\n }\n return res;\n }", "long mod = Long.MAX_VALUE;", "mod", "Long.MAX_VALUE", "Long", "Long.MAX_VALUE", "if(a.length == 3) mod = a[2];", "a.length == 3", "a.length", "a", "a.length", "3", "mod = a[2]", "mod", "a[2]", "a", "2", "long res = 1;", "res", "1", "while(a[1] > 0)\n {\n if((a[1] & 1) == 1)\n res = (res * a[0]) % mod;\n a[1] /= 2;\n a[0] = (a[0] * a[0]) % mod;\n }", "a[1] > 0", "a[1]", "a", "1", "0", "{\n if((a[1] & 1) == 1)\n res = (res * a[0]) % mod;\n a[1] /= 2;\n a[0] = (a[0] * a[0]) % mod;\n }", "if((a[1] & 1) == 1)\n res = (res * a[0]) % mod;", "(a[1] & 1) == 1", "(a[1] & 1)", "a[1]", "a", "1", "1", "1", "res = (res * a[0]) % mod", "res", "(res * a[0]) % mod", "(res * a[0])", "res", "a[0]", "a", "0", "mod", "a[1] /= 2", "a[1]", "a", "1", "2", "a[0] = (a[0] * a[0]) % mod", "a[0]", "a", "0", "(a[0] * a[0]) % mod", "(a[0] * a[0])", "a[0]", "a", "0", "a[0]", "a", "0", "mod", "return res;", "res", "long... a", "a", "void print(Object... o) \n {\n for(Object next : o)\n {\n System.out.print(next + \" \");\n }\n }", "print", "{\n for(Object next : o)\n {\n System.out.print(next + \" \");\n }\n }", "for(Object next : o)\n {\n System.out.print(next + \" \");\n }", "Object next", "o", "{\n System.out.print(next + \" \");\n }", "{\n System.out.print(next + \" \");\n }", "System.out.print(next + \" \")", "System.out.print", "System.out", "System", "System.out", "next + \" \"", "next", "\" \"", "Object... o", "o", "void println(Object... o) \n {\n for(Object next : o)\n {\n System.out.print(next + \" \");\n }\n System.out.println();\n }", "println", "{\n for(Object next : o)\n {\n System.out.print(next + \" \");\n }\n System.out.println();\n }", "for(Object next : o)\n {\n System.out.print(next + \" \");\n }", "Object next", "o", "{\n System.out.print(next + \" \");\n }", "{\n System.out.print(next + \" \");\n }", "System.out.print(next + \" \")", "System.out.print", "System.out", "System", "System.out", "next + \" \"", "next", "\" \"", "System.out.println()", "System.out.println", "System.out", "System", "System.out", "Object... o", "o", "void watch(Object...a) throws Exception \n {\n int i = 1;\n for (Object o: a) \n {\n boolean found = false;\n if (o.getClass().isArray()) \n {\n String type = o.getClass().getName().toString();\n switch (type) \n {\n case \"[I\":\n {\n int[] test = (int[]) o;\n println(i + \" : \" + Arrays.toString(test));\n break;\n }\n case \"[[I\":\n {\n int[][] obj = (int[][]) o;\n\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[J\":\n {\n\n long[] obj = (long[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[J\":\n {\n\n long[][] obj = (long[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[D\":\n {\n\n double[] obj = (double[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[D\":\n {\n\n double[][] obj = (double[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[Ljava.lang.String\":\n {\n\n String[] obj = (String[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[Ljava.lang.String\":\n {\n\n String[][] obj = (String[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[C\":\n {\n char[] obj = (char[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[C\":\n {\n\n char[][] obj = (char[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n default:\n {\n println(i + \" : type not identified\");\n break;\n }\n }\n found = true;\n }\n if (o.getClass() == ArrayList.class) \n {\n println(i + \" : LIST = \" + o);\n found = true;\n }\n if (o.getClass() == TreeSet.class) \n {\n println(i + \" : SET = \" + o);\n found = true;\n }\n if (o.getClass() == TreeMap.class) \n {\n println(i + \" : MAP = \" + o);\n found = true;\n }\n if (o.getClass() == HashMap.class) \n {\n println(i + \" : MAP = \" + o);\n found = true;\n }\n if (o.getClass() == LinkedList.class) \n {\n println(i + \" : LIST = \" + o);\n found = true;\n }\n if (o.getClass() == PriorityQueue.class) \n {\n println(i + \" : PQ = \" + o);\n found = true;\n }\n if (!found) \n {\n println(i + \" = \" + o);\n }\n i++;\n }\n }", "watch", "{\n int i = 1;\n for (Object o: a) \n {\n boolean found = false;\n if (o.getClass().isArray()) \n {\n String type = o.getClass().getName().toString();\n switch (type) \n {\n case \"[I\":\n {\n int[] test = (int[]) o;\n println(i + \" : \" + Arrays.toString(test));\n break;\n }\n case \"[[I\":\n {\n int[][] obj = (int[][]) o;\n\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[J\":\n {\n\n long[] obj = (long[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[J\":\n {\n\n long[][] obj = (long[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[D\":\n {\n\n double[] obj = (double[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[D\":\n {\n\n double[][] obj = (double[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[Ljava.lang.String\":\n {\n\n String[] obj = (String[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[Ljava.lang.String\":\n {\n\n String[][] obj = (String[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[C\":\n {\n char[] obj = (char[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[C\":\n {\n\n char[][] obj = (char[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n default:\n {\n println(i + \" : type not identified\");\n break;\n }\n }\n found = true;\n }\n if (o.getClass() == ArrayList.class) \n {\n println(i + \" : LIST = \" + o);\n found = true;\n }\n if (o.getClass() == TreeSet.class) \n {\n println(i + \" : SET = \" + o);\n found = true;\n }\n if (o.getClass() == TreeMap.class) \n {\n println(i + \" : MAP = \" + o);\n found = true;\n }\n if (o.getClass() == HashMap.class) \n {\n println(i + \" : MAP = \" + o);\n found = true;\n }\n if (o.getClass() == LinkedList.class) \n {\n println(i + \" : LIST = \" + o);\n found = true;\n }\n if (o.getClass() == PriorityQueue.class) \n {\n println(i + \" : PQ = \" + o);\n found = true;\n }\n if (!found) \n {\n println(i + \" = \" + o);\n }\n i++;\n }\n }", "int i = 1;", "i", "1", "for (Object o: a) \n {\n boolean found = false;\n if (o.getClass().isArray()) \n {\n String type = o.getClass().getName().toString();\n switch (type) \n {\n case \"[I\":\n {\n int[] test = (int[]) o;\n println(i + \" : \" + Arrays.toString(test));\n break;\n }\n case \"[[I\":\n {\n int[][] obj = (int[][]) o;\n\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[J\":\n {\n\n long[] obj = (long[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[J\":\n {\n\n long[][] obj = (long[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[D\":\n {\n\n double[] obj = (double[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[D\":\n {\n\n double[][] obj = (double[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[Ljava.lang.String\":\n {\n\n String[] obj = (String[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[Ljava.lang.String\":\n {\n\n String[][] obj = (String[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[C\":\n {\n char[] obj = (char[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[C\":\n {\n\n char[][] obj = (char[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n default:\n {\n println(i + \" : type not identified\");\n break;\n }\n }\n found = true;\n }\n if (o.getClass() == ArrayList.class) \n {\n println(i + \" : LIST = \" + o);\n found = true;\n }\n if (o.getClass() == TreeSet.class) \n {\n println(i + \" : SET = \" + o);\n found = true;\n }\n if (o.getClass() == TreeMap.class) \n {\n println(i + \" : MAP = \" + o);\n found = true;\n }\n if (o.getClass() == HashMap.class) \n {\n println(i + \" : MAP = \" + o);\n found = true;\n }\n if (o.getClass() == LinkedList.class) \n {\n println(i + \" : LIST = \" + o);\n found = true;\n }\n if (o.getClass() == PriorityQueue.class) \n {\n println(i + \" : PQ = \" + o);\n found = true;\n }\n if (!found) \n {\n println(i + \" = \" + o);\n }\n i++;\n }", "Object o", "a", "{\n boolean found = false;\n if (o.getClass().isArray()) \n {\n String type = o.getClass().getName().toString();\n switch (type) \n {\n case \"[I\":\n {\n int[] test = (int[]) o;\n println(i + \" : \" + Arrays.toString(test));\n break;\n }\n case \"[[I\":\n {\n int[][] obj = (int[][]) o;\n\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[J\":\n {\n\n long[] obj = (long[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[J\":\n {\n\n long[][] obj = (long[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[D\":\n {\n\n double[] obj = (double[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[D\":\n {\n\n double[][] obj = (double[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[Ljava.lang.String\":\n {\n\n String[] obj = (String[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[Ljava.lang.String\":\n {\n\n String[][] obj = (String[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[C\":\n {\n char[] obj = (char[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[C\":\n {\n\n char[][] obj = (char[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n default:\n {\n println(i + \" : type not identified\");\n break;\n }\n }\n found = true;\n }\n if (o.getClass() == ArrayList.class) \n {\n println(i + \" : LIST = \" + o);\n found = true;\n }\n if (o.getClass() == TreeSet.class) \n {\n println(i + \" : SET = \" + o);\n found = true;\n }\n if (o.getClass() == TreeMap.class) \n {\n println(i + \" : MAP = \" + o);\n found = true;\n }\n if (o.getClass() == HashMap.class) \n {\n println(i + \" : MAP = \" + o);\n found = true;\n }\n if (o.getClass() == LinkedList.class) \n {\n println(i + \" : LIST = \" + o);\n found = true;\n }\n if (o.getClass() == PriorityQueue.class) \n {\n println(i + \" : PQ = \" + o);\n found = true;\n }\n if (!found) \n {\n println(i + \" = \" + o);\n }\n i++;\n }", "{\n boolean found = false;\n if (o.getClass().isArray()) \n {\n String type = o.getClass().getName().toString();\n switch (type) \n {\n case \"[I\":\n {\n int[] test = (int[]) o;\n println(i + \" : \" + Arrays.toString(test));\n break;\n }\n case \"[[I\":\n {\n int[][] obj = (int[][]) o;\n\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[J\":\n {\n\n long[] obj = (long[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[J\":\n {\n\n long[][] obj = (long[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[D\":\n {\n\n double[] obj = (double[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[D\":\n {\n\n double[][] obj = (double[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[Ljava.lang.String\":\n {\n\n String[] obj = (String[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[Ljava.lang.String\":\n {\n\n String[][] obj = (String[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[C\":\n {\n char[] obj = (char[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[C\":\n {\n\n char[][] obj = (char[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n default:\n {\n println(i + \" : type not identified\");\n break;\n }\n }\n found = true;\n }\n if (o.getClass() == ArrayList.class) \n {\n println(i + \" : LIST = \" + o);\n found = true;\n }\n if (o.getClass() == TreeSet.class) \n {\n println(i + \" : SET = \" + o);\n found = true;\n }\n if (o.getClass() == TreeMap.class) \n {\n println(i + \" : MAP = \" + o);\n found = true;\n }\n if (o.getClass() == HashMap.class) \n {\n println(i + \" : MAP = \" + o);\n found = true;\n }\n if (o.getClass() == LinkedList.class) \n {\n println(i + \" : LIST = \" + o);\n found = true;\n }\n if (o.getClass() == PriorityQueue.class) \n {\n println(i + \" : PQ = \" + o);\n found = true;\n }\n if (!found) \n {\n println(i + \" = \" + o);\n }\n i++;\n }", "boolean found = false;", "found", "false", "if (o.getClass().isArray()) \n {\n String type = o.getClass().getName().toString();\n switch (type) \n {\n case \"[I\":\n {\n int[] test = (int[]) o;\n println(i + \" : \" + Arrays.toString(test));\n break;\n }\n case \"[[I\":\n {\n int[][] obj = (int[][]) o;\n\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[J\":\n {\n\n long[] obj = (long[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[J\":\n {\n\n long[][] obj = (long[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[D\":\n {\n\n double[] obj = (double[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[D\":\n {\n\n double[][] obj = (double[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[Ljava.lang.String\":\n {\n\n String[] obj = (String[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[Ljava.lang.String\":\n {\n\n String[][] obj = (String[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[C\":\n {\n char[] obj = (char[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[C\":\n {\n\n char[][] obj = (char[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n default:\n {\n println(i + \" : type not identified\");\n break;\n }\n }\n found = true;\n }", "o.getClass().isArray()", "o.getClass().isArray", "o.getClass()", "o.getClass", "o", "{\n String type = o.getClass().getName().toString();\n switch (type) \n {\n case \"[I\":\n {\n int[] test = (int[]) o;\n println(i + \" : \" + Arrays.toString(test));\n break;\n }\n case \"[[I\":\n {\n int[][] obj = (int[][]) o;\n\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[J\":\n {\n\n long[] obj = (long[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[J\":\n {\n\n long[][] obj = (long[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[D\":\n {\n\n double[] obj = (double[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[D\":\n {\n\n double[][] obj = (double[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[Ljava.lang.String\":\n {\n\n String[] obj = (String[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[Ljava.lang.String\":\n {\n\n String[][] obj = (String[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[C\":\n {\n char[] obj = (char[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[C\":\n {\n\n char[][] obj = (char[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n default:\n {\n println(i + \" : type not identified\");\n break;\n }\n }\n found = true;\n }", "String type = o.getClass().getName().toString();", "type", "o.getClass().getName().toString()", "o.getClass().getName().toString", "o.getClass().getName()", "o.getClass().getName", "o.getClass()", "o.getClass", "o", "switch (type) \n {\n case \"[I\":\n {\n int[] test = (int[]) o;\n println(i + \" : \" + Arrays.toString(test));\n break;\n }\n case \"[[I\":\n {\n int[][] obj = (int[][]) o;\n\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[J\":\n {\n\n long[] obj = (long[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[J\":\n {\n\n long[][] obj = (long[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[D\":\n {\n\n double[] obj = (double[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[D\":\n {\n\n double[][] obj = (double[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[Ljava.lang.String\":\n {\n\n String[] obj = (String[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[Ljava.lang.String\":\n {\n\n String[][] obj = (String[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[C\":\n {\n char[] obj = (char[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[C\":\n {\n\n char[][] obj = (char[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n default:\n {\n println(i + \" : type not identified\");\n break;\n }\n }", "type", "case \"[I\":", "\"[I\"", "case \"[I\":", "{\n int[] test = (int[]) o;\n println(i + \" : \" + Arrays.toString(test));\n break;\n }", "int[] test = (int[]) o;", "test", "(int[]) o", "println(i + \" : \" + Arrays.toString(test))", "println", "i + \" : \" + Arrays.toString(test)", "i + \" : \" + Arrays.toString(test)", "i", "\" : \"", "Arrays.toString(test)", "Arrays.toString", "Arrays", "test", "break;", "case \"[[I\":", "\"[[I\"", "case \"[[I\":", "{\n int[][] obj = (int[][]) o;\n\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }", "int[][] obj = (int[][]) o;", "obj", "(int[][]) o", "println(i + \" : \" + Arrays.deepToString(obj))", "println", "i + \" : \" + Arrays.deepToString(obj)", "i + \" : \" + Arrays.deepToString(obj)", "i", "\" : \"", "Arrays.deepToString(obj)", "Arrays.deepToString", "Arrays", "obj", "break;", "case \"[J\":", "\"[J\"", "case \"[J\":", "{\n\n long[] obj = (long[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }", "long[] obj = (long[]) o;", "obj", "(long[]) o", "println(i + \" : \" + Arrays.toString(obj))", "println", "i + \" : \" + Arrays.toString(obj)", "i + \" : \" + Arrays.toString(obj)", "i", "\" : \"", "Arrays.toString(obj)", "Arrays.toString", "Arrays", "obj", "break;", "case \"[[J\":", "\"[[J\"", "case \"[[J\":", "{\n\n long[][] obj = (long[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }", "long[][] obj = (long[][]) o;", "obj", "(long[][]) o", "println(i + \" : \" + Arrays.deepToString(obj))", "println", "i + \" : \" + Arrays.deepToString(obj)", "i + \" : \" + Arrays.deepToString(obj)", "i", "\" : \"", "Arrays.deepToString(obj)", "Arrays.deepToString", "Arrays", "obj", "break;", "case \"[D\":", "\"[D\"", "case \"[D\":", "{\n\n double[] obj = (double[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }", "double[] obj = (double[]) o;", "obj", "(double[]) o", "println(i + \" : \" + Arrays.toString(obj))", "println", "i + \" : \" + Arrays.toString(obj)", "i + \" : \" + Arrays.toString(obj)", "i", "\" : \"", "Arrays.toString(obj)", "Arrays.toString", "Arrays", "obj", "break;", "case \"[[D\":", "\"[[D\"", "case \"[[D\":", "{\n\n double[][] obj = (double[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }", "double[][] obj = (double[][]) o;", "obj", "(double[][]) o", "println(i + \" : \" + Arrays.deepToString(obj))", "println", "i + \" : \" + Arrays.deepToString(obj)", "i + \" : \" + Arrays.deepToString(obj)", "i", "\" : \"", "Arrays.deepToString(obj)", "Arrays.deepToString", "Arrays", "obj", "break;", "case \"[Ljava.lang.String\":", "\"[Ljava.lang.String\"", "case \"[Ljava.lang.String\":", "{\n\n String[] obj = (String[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }", "String[] obj = (String[]) o;", "obj", "(String[]) o", "println(i + \" : \" + Arrays.toString(obj))", "println", "i + \" : \" + Arrays.toString(obj)", "i + \" : \" + Arrays.toString(obj)", "i", "\" : \"", "Arrays.toString(obj)", "Arrays.toString", "Arrays", "obj", "break;", "case \"[[Ljava.lang.String\":", "\"[[Ljava.lang.String\"", "case \"[[Ljava.lang.String\":", "{\n\n String[][] obj = (String[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }", "String[][] obj = (String[][]) o;", "obj", "(String[][]) o", "println(i + \" : \" + Arrays.deepToString(obj))", "println", "i + \" : \" + Arrays.deepToString(obj)", "i + \" : \" + Arrays.deepToString(obj)", "i", "\" : \"", "Arrays.deepToString(obj)", "Arrays.deepToString", "Arrays", "obj", "break;", "case \"[C\":", "\"[C\"", "case \"[C\":", "{\n char[] obj = (char[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }", "char[] obj = (char[]) o;", "obj", "(char[]) o", "println(i + \" : \" + Arrays.toString(obj))", "println", "i + \" : \" + Arrays.toString(obj)", "i + \" : \" + Arrays.toString(obj)", "i", "\" : \"", "Arrays.toString(obj)", "Arrays.toString", "Arrays", "obj", "break;", "case \"[[C\":", "\"[[C\"", "case \"[[C\":", "{\n\n char[][] obj = (char[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }", "char[][] obj = (char[][]) o;", "obj", "(char[][]) o", "println(i + \" : \" + Arrays.deepToString(obj))", "println", "i + \" : \" + Arrays.deepToString(obj)", "i + \" : \" + Arrays.deepToString(obj)", "i", "\" : \"", "Arrays.deepToString(obj)", "Arrays.deepToString", "Arrays", "obj", "break;", "default:", "default:", "{\n println(i + \" : type not identified\");\n break;\n }", "println(i + \" : type not identified\")", "println", "i + \" : type not identified\"", "i", "\" : type not identified\"", "break;", "found = true", "found", "true", "if (o.getClass() == ArrayList.class) \n {\n println(i + \" : LIST = \" + o);\n found = true;\n }", "o.getClass() == ArrayList.class", "o.getClass()", "o.getClass", "o", "ArrayList.class", "ArrayList.class", "{\n println(i + \" : LIST = \" + o);\n found = true;\n }", "println(i + \" : LIST = \" + o)", "println", "i + \" : LIST = \" + o", "i + \" : LIST = \" + o", "i", "\" : LIST = \"", "o", "found = true", "found", "true", "if (o.getClass() == TreeSet.class) \n {\n println(i + \" : SET = \" + o);\n found = true;\n }", "o.getClass() == TreeSet.class", "o.getClass()", "o.getClass", "o", "TreeSet.class", "TreeSet.class", "{\n println(i + \" : SET = \" + o);\n found = true;\n }", "println(i + \" : SET = \" + o)", "println", "i + \" : SET = \" + o", "i + \" : SET = \" + o", "i", "\" : SET = \"", "o", "found = true", "found", "true", "if (o.getClass() == TreeMap.class) \n {\n println(i + \" : MAP = \" + o);\n found = true;\n }", "o.getClass() == TreeMap.class", "o.getClass()", "o.getClass", "o", "TreeMap.class", "TreeMap.class", "{\n println(i + \" : MAP = \" + o);\n found = true;\n }", "println(i + \" : MAP = \" + o)", "println", "i + \" : MAP = \" + o", "i + \" : MAP = \" + o", "i", "\" : MAP = \"", "o", "found = true", "found", "true", "if (o.getClass() == HashMap.class) \n {\n println(i + \" : MAP = \" + o);\n found = true;\n }", "o.getClass() == HashMap.class", "o.getClass()", "o.getClass", "o", "HashMap.class", "HashMap.class", "{\n println(i + \" : MAP = \" + o);\n found = true;\n }", "println(i + \" : MAP = \" + o)", "println", "i + \" : MAP = \" + o", "i + \" : MAP = \" + o", "i", "\" : MAP = \"", "o", "found = true", "found", "true", "if (o.getClass() == LinkedList.class) \n {\n println(i + \" : LIST = \" + o);\n found = true;\n }", "o.getClass() == LinkedList.class", "o.getClass()", "o.getClass", "o", "LinkedList.class", "LinkedList.class", "{\n println(i + \" : LIST = \" + o);\n found = true;\n }", "println(i + \" : LIST = \" + o)", "println", "i + \" : LIST = \" + o", "i + \" : LIST = \" + o", "i", "\" : LIST = \"", "o", "found = true", "found", "true", "if (o.getClass() == PriorityQueue.class) \n {\n println(i + \" : PQ = \" + o);\n found = true;\n }", "o.getClass() == PriorityQueue.class", "o.getClass()", "o.getClass", "o", "PriorityQueue.class", "PriorityQueue.class", "{\n println(i + \" : PQ = \" + o);\n found = true;\n }", "println(i + \" : PQ = \" + o)", "println", "i + \" : PQ = \" + o", "i + \" : PQ = \" + o", "i", "\" : PQ = \"", "o", "found = true", "found", "true", "if (!found) \n {\n println(i + \" = \" + o);\n }", "!found", "found", "{\n println(i + \" = \" + o);\n }", "println(i + \" = \" + o)", "println", "i + \" = \" + o", "i + \" = \" + o", "i", "\" = \"", "o", "i++", "i", "Object...a", "a", "public class Main\n{ \n public static void main(String [] args) throws Exception\n {\n Foster sc = new Foster();\n PrintWriter p = new PrintWriter(out);\n int n = sc.nextInt();\n int a[] = sc.intArray(n);\n long ans = 0;\n int max[] = new int[n];\n for(int i = 0; i < n; i++)\n {\n max[i] = a[i];\n }\n for(int i = 1; i < n; i++)\n {\n max[i] = Math.max(max[i-1],max[i]);\n }\n for(int i = 0; i < n; i++)\n {\n ans += max[i] - a[i];\n }\n p.println(ans);\n p.close();\n }\n\n/*\n*/ \n/*\n1. Check overflow in pow function or in general\n2. Check indices of read array function\n3. Think of an easier solution because the problems you solve are always easy\n4. Check iterator of loop\n5. If still doesn't work, then jump from the 729th floor 'coz \"beta tumse na ho paayega\"\n\n Move to top!!\n*/\n static class Foster \n {\n BufferedReader br = new BufferedReader(new InputStreamReader(in));\n StringTokenizer st = new StringTokenizer(\"\");\n String next() \n {\n while (!st.hasMoreTokens())\n try \n {\n st = new StringTokenizer(br.readLine());\n } \n catch (IOException e) \n {\n e.printStackTrace();\n }\n return st.nextToken();\n }\n int nextInt() \n {\n return Integer.parseInt(next());\n }\n long nextLong() \n {\n return Long.parseLong(next());\n }\n double nextDouble() \n {\n return Double.parseDouble(next());\n }\n int[] intArray(int n) // Check indices\n {\n int arr[] = new int[n];\n for(int i = 0; i < n; i++)\n {\n arr[i] = nextInt();\n }\n return arr;\n }\n long[] longArray(int n) // Check indices\n {\n long arr[] = new long[n];\n for(int i = 0; i < n; i++)\n {\n arr[i] = nextLong();\n }\n return arr;\n }\n int[] getBits(int n) //in Reverse Order\n {\n int a[] = new int[31];\n for(int i = 0; i < 31; i++)\n {\n if(((1<<i) & n) != 0)\n a[i] = 1;\n }\n return a;\n }\n static long pow(long... a)\n {\n long mod = Long.MAX_VALUE;\n if(a.length == 3) mod = a[2];\n long res = 1;\n while(a[1] > 0)\n {\n if((a[1] & 1) == 1)\n res = (res * a[0]) % mod;\n a[1] /= 2;\n a[0] = (a[0] * a[0]) % mod;\n }\n return res;\n }\n void print(Object... o) \n {\n for(Object next : o)\n {\n System.out.print(next + \" \");\n }\n }\n void println(Object... o) \n {\n for(Object next : o)\n {\n System.out.print(next + \" \");\n }\n System.out.println();\n }\n void watch(Object...a) throws Exception \n {\n int i = 1;\n for (Object o: a) \n {\n boolean found = false;\n if (o.getClass().isArray()) \n {\n String type = o.getClass().getName().toString();\n switch (type) \n {\n case \"[I\":\n {\n int[] test = (int[]) o;\n println(i + \" : \" + Arrays.toString(test));\n break;\n }\n case \"[[I\":\n {\n int[][] obj = (int[][]) o;\n\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[J\":\n {\n\n long[] obj = (long[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[J\":\n {\n\n long[][] obj = (long[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[D\":\n {\n\n double[] obj = (double[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[D\":\n {\n\n double[][] obj = (double[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[Ljava.lang.String\":\n {\n\n String[] obj = (String[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[Ljava.lang.String\":\n {\n\n String[][] obj = (String[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[C\":\n {\n char[] obj = (char[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[C\":\n {\n\n char[][] obj = (char[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n default:\n {\n println(i + \" : type not identified\");\n break;\n }\n }\n found = true;\n }\n if (o.getClass() == ArrayList.class) \n {\n println(i + \" : LIST = \" + o);\n found = true;\n }\n if (o.getClass() == TreeSet.class) \n {\n println(i + \" : SET = \" + o);\n found = true;\n }\n if (o.getClass() == TreeMap.class) \n {\n println(i + \" : MAP = \" + o);\n found = true;\n }\n if (o.getClass() == HashMap.class) \n {\n println(i + \" : MAP = \" + o);\n found = true;\n }\n if (o.getClass() == LinkedList.class) \n {\n println(i + \" : LIST = \" + o);\n found = true;\n }\n if (o.getClass() == PriorityQueue.class) \n {\n println(i + \" : PQ = \" + o);\n found = true;\n }\n if (!found) \n {\n println(i + \" = \" + o);\n }\n i++;\n }\n }\n }\n}", "public class Main\n{ \n public static void main(String [] args) throws Exception\n {\n Foster sc = new Foster();\n PrintWriter p = new PrintWriter(out);\n int n = sc.nextInt();\n int a[] = sc.intArray(n);\n long ans = 0;\n int max[] = new int[n];\n for(int i = 0; i < n; i++)\n {\n max[i] = a[i];\n }\n for(int i = 1; i < n; i++)\n {\n max[i] = Math.max(max[i-1],max[i]);\n }\n for(int i = 0; i < n; i++)\n {\n ans += max[i] - a[i];\n }\n p.println(ans);\n p.close();\n }\n\n/*\n*/ \n/*\n1. Check overflow in pow function or in general\n2. Check indices of read array function\n3. Think of an easier solution because the problems you solve are always easy\n4. Check iterator of loop\n5. If still doesn't work, then jump from the 729th floor 'coz \"beta tumse na ho paayega\"\n\n Move to top!!\n*/\n static class Foster \n {\n BufferedReader br = new BufferedReader(new InputStreamReader(in));\n StringTokenizer st = new StringTokenizer(\"\");\n String next() \n {\n while (!st.hasMoreTokens())\n try \n {\n st = new StringTokenizer(br.readLine());\n } \n catch (IOException e) \n {\n e.printStackTrace();\n }\n return st.nextToken();\n }\n int nextInt() \n {\n return Integer.parseInt(next());\n }\n long nextLong() \n {\n return Long.parseLong(next());\n }\n double nextDouble() \n {\n return Double.parseDouble(next());\n }\n int[] intArray(int n) // Check indices\n {\n int arr[] = new int[n];\n for(int i = 0; i < n; i++)\n {\n arr[i] = nextInt();\n }\n return arr;\n }\n long[] longArray(int n) // Check indices\n {\n long arr[] = new long[n];\n for(int i = 0; i < n; i++)\n {\n arr[i] = nextLong();\n }\n return arr;\n }\n int[] getBits(int n) //in Reverse Order\n {\n int a[] = new int[31];\n for(int i = 0; i < 31; i++)\n {\n if(((1<<i) & n) != 0)\n a[i] = 1;\n }\n return a;\n }\n static long pow(long... a)\n {\n long mod = Long.MAX_VALUE;\n if(a.length == 3) mod = a[2];\n long res = 1;\n while(a[1] > 0)\n {\n if((a[1] & 1) == 1)\n res = (res * a[0]) % mod;\n a[1] /= 2;\n a[0] = (a[0] * a[0]) % mod;\n }\n return res;\n }\n void print(Object... o) \n {\n for(Object next : o)\n {\n System.out.print(next + \" \");\n }\n }\n void println(Object... o) \n {\n for(Object next : o)\n {\n System.out.print(next + \" \");\n }\n System.out.println();\n }\n void watch(Object...a) throws Exception \n {\n int i = 1;\n for (Object o: a) \n {\n boolean found = false;\n if (o.getClass().isArray()) \n {\n String type = o.getClass().getName().toString();\n switch (type) \n {\n case \"[I\":\n {\n int[] test = (int[]) o;\n println(i + \" : \" + Arrays.toString(test));\n break;\n }\n case \"[[I\":\n {\n int[][] obj = (int[][]) o;\n\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[J\":\n {\n\n long[] obj = (long[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[J\":\n {\n\n long[][] obj = (long[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[D\":\n {\n\n double[] obj = (double[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[D\":\n {\n\n double[][] obj = (double[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[Ljava.lang.String\":\n {\n\n String[] obj = (String[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[Ljava.lang.String\":\n {\n\n String[][] obj = (String[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n case \"[C\":\n {\n char[] obj = (char[]) o;\n println(i + \" : \" + Arrays.toString(obj));\n break;\n }\n case \"[[C\":\n {\n\n char[][] obj = (char[][]) o;\n println(i + \" : \" + Arrays.deepToString(obj));\n break;\n }\n default:\n {\n println(i + \" : type not identified\");\n break;\n }\n }\n found = true;\n }\n if (o.getClass() == ArrayList.class) \n {\n println(i + \" : LIST = \" + o);\n found = true;\n }\n if (o.getClass() == TreeSet.class) \n {\n println(i + \" : SET = \" + o);\n found = true;\n }\n if (o.getClass() == TreeMap.class) \n {\n println(i + \" : MAP = \" + o);\n found = true;\n }\n if (o.getClass() == HashMap.class) \n {\n println(i + \" : MAP = \" + o);\n found = true;\n }\n if (o.getClass() == LinkedList.class) \n {\n println(i + \" : LIST = \" + o);\n found = true;\n }\n if (o.getClass() == PriorityQueue.class) \n {\n println(i + \" : PQ = \" + o);\n found = true;\n }\n if (!found) \n {\n println(i + \" = \" + o);\n }\n i++;\n }\n }\n }\n}", "Main" ]
import java.io.*; import java.math.BigInteger; import java.util.*; import static java.lang.Math.PI; import static java.lang.System.in; import static java.lang.System.out; public class Main { public static void main(String [] args) throws Exception { Foster sc = new Foster(); PrintWriter p = new PrintWriter(out); int n = sc.nextInt(); int a[] = sc.intArray(n); long ans = 0; int max[] = new int[n]; for(int i = 0; i < n; i++) { max[i] = a[i]; } for(int i = 1; i < n; i++) { max[i] = Math.max(max[i-1],max[i]); } for(int i = 0; i < n; i++) { ans += max[i] - a[i]; } p.println(ans); p.close(); } /* */ /* 1. Check overflow in pow function or in general 2. Check indices of read array function 3. Think of an easier solution because the problems you solve are always easy 4. Check iterator of loop 5. If still doesn't work, then jump from the 729th floor 'coz "beta tumse na ho paayega" Move to top!! */ static class Foster { BufferedReader br = new BufferedReader(new InputStreamReader(in)); StringTokenizer st = new StringTokenizer(""); String next() { while (!st.hasMoreTokens()) try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } int[] intArray(int n) // Check indices { int arr[] = new int[n]; for(int i = 0; i < n; i++) { arr[i] = nextInt(); } return arr; } long[] longArray(int n) // Check indices { long arr[] = new long[n]; for(int i = 0; i < n; i++) { arr[i] = nextLong(); } return arr; } int[] getBits(int n) //in Reverse Order { int a[] = new int[31]; for(int i = 0; i < 31; i++) { if(((1<<i) & n) != 0) a[i] = 1; } return a; } static long pow(long... a) { long mod = Long.MAX_VALUE; if(a.length == 3) mod = a[2]; long res = 1; while(a[1] > 0) { if((a[1] & 1) == 1) res = (res * a[0]) % mod; a[1] /= 2; a[0] = (a[0] * a[0]) % mod; } return res; } void print(Object... o) { for(Object next : o) { System.out.print(next + " "); } } void println(Object... o) { for(Object next : o) { System.out.print(next + " "); } System.out.println(); } void watch(Object...a) throws Exception { int i = 1; for (Object o: a) { boolean found = false; if (o.getClass().isArray()) { String type = o.getClass().getName().toString(); switch (type) { case "[I": { int[] test = (int[]) o; println(i + " : " + Arrays.toString(test)); break; } case "[[I": { int[][] obj = (int[][]) o; println(i + " : " + Arrays.deepToString(obj)); break; } case "[J": { long[] obj = (long[]) o; println(i + " : " + Arrays.toString(obj)); break; } case "[[J": { long[][] obj = (long[][]) o; println(i + " : " + Arrays.deepToString(obj)); break; } case "[D": { double[] obj = (double[]) o; println(i + " : " + Arrays.toString(obj)); break; } case "[[D": { double[][] obj = (double[][]) o; println(i + " : " + Arrays.deepToString(obj)); break; } case "[Ljava.lang.String": { String[] obj = (String[]) o; println(i + " : " + Arrays.toString(obj)); break; } case "[[Ljava.lang.String": { String[][] obj = (String[][]) o; println(i + " : " + Arrays.deepToString(obj)); break; } case "[C": { char[] obj = (char[]) o; println(i + " : " + Arrays.toString(obj)); break; } case "[[C": { char[][] obj = (char[][]) o; println(i + " : " + Arrays.deepToString(obj)); break; } default: { println(i + " : type not identified"); break; } } found = true; } if (o.getClass() == ArrayList.class) { println(i + " : LIST = " + o); found = true; } if (o.getClass() == TreeSet.class) { println(i + " : SET = " + o); found = true; } if (o.getClass() == TreeMap.class) { println(i + " : MAP = " + o); found = true; } if (o.getClass() == HashMap.class) { println(i + " : MAP = " + o); found = true; } if (o.getClass() == LinkedList.class) { println(i + " : LIST = " + o); found = true; } if (o.getClass() == PriorityQueue.class) { println(i + " : PQ = " + o); found = true; } if (!found) { println(i + " = " + o); } i++; } } } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 18, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 2, 18, 13, 13, 17, 1, 40, 13, 30, 30, 14, 2, 18, 13, 13, 18, 13, 2, 13, 17, 30, 41, 13, 2, 18, 13, 13, 18, 13, 2, 13, 17, 0, 13, 2, 13, 13, 0, 18, 13, 2, 13, 17, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 111, 8 ], [ 111, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 11, 24 ], [ 24, 25 ], [ 25, 26 ], [ 26, 27 ], [ 26, 28 ], [ 24, 29 ], [ 29, 30 ], [ 29, 31 ], [ 31, 32 ], [ 31, 33 ], [ 24, 34 ], [ 34, 35 ], [ 35, 36 ], [ 24, 37 ], [ 38, 38 ], [ 38, 39 ], [ 39, 40 ], [ 40, 41 ], [ 40, 42 ], [ 39, 43 ], [ 43, 44 ], [ 44, 45 ], [ 11, 46 ], [ 46, 47 ], [ 46, 48 ], [ 11, 49 ], [ 49, 50 ], [ 50, 51 ], [ 51, 52 ], [ 51, 53 ], [ 49, 54 ], [ 54, 55 ], [ 54, 56 ], [ 56, 57 ], [ 57, 58 ], [ 57, 59 ], [ 56, 60 ], [ 49, 61 ], [ 61, 62 ], [ 62, 63 ], [ 49, 64 ], [ 65, 65 ], [ 65, 66 ], [ 66, 67 ], [ 67, 68 ], [ 68, 69 ], [ 68, 70 ], [ 67, 71 ], [ 71, 72 ], [ 71, 73 ], [ 73, 74 ], [ 73, 75 ], [ 66, 76 ], [ 76, 77 ], [ 77, 78 ], [ 77, 79 ], [ 79, 80 ], [ 80, 81 ], [ 80, 82 ], [ 79, 83 ], [ 83, 84 ], [ 83, 85 ], [ 85, 86 ], [ 85, 87 ], [ 76, 88 ], [ 88, 89 ], [ 88, 90 ], [ 90, 91 ], [ 90, 92 ], [ 76, 93 ], [ 93, 94 ], [ 94, 95 ], [ 94, 96 ], [ 96, 97 ], [ 96, 98 ], [ 93, 99 ], [ 99, 100 ], [ 99, 101 ], [ 11, 102 ], [ 102, 103 ], [ 103, 104 ], [ 104, 105 ], [ 104, 106 ], [ 102, 107 ], [ 9, 108 ], [ 108, 109 ], [ 0, 110 ], [ 110, 111 ], [ 110, 112 ] ]
[ "\nimport java.util.Arrays;\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner ob=new Scanner(System.in);\n\t\tint n=ob.nextInt();\n\t\tlong a[]=new long[n];\n\t\tfor (int i=0; i<a.length; i++) {\n\t\t\ta[i]=ob.nextLong();\n\t\t}\n\t\tlong sum=0;\n\t\tfor (int i=0; i<a.length-1; i++) {\n\t\t\tif(a[i]>a[i+1])\n\t\t\t{\n\t\t\tlong d=a[i]-a[i+1];\n\t\t\tsum=sum+d;\n\t\t\ta[i+1]=a[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n}", "import java.util.Arrays;", "Arrays", "java.util", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner ob=new Scanner(System.in);\n\t\tint n=ob.nextInt();\n\t\tlong a[]=new long[n];\n\t\tfor (int i=0; i<a.length; i++) {\n\t\t\ta[i]=ob.nextLong();\n\t\t}\n\t\tlong sum=0;\n\t\tfor (int i=0; i<a.length-1; i++) {\n\t\t\tif(a[i]>a[i+1])\n\t\t\t{\n\t\t\tlong d=a[i]-a[i+1];\n\t\t\tsum=sum+d;\n\t\t\ta[i+1]=a[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n}", "Main", "public static void main(String[] args) {\n\t\tScanner ob=new Scanner(System.in);\n\t\tint n=ob.nextInt();\n\t\tlong a[]=new long[n];\n\t\tfor (int i=0; i<a.length; i++) {\n\t\t\ta[i]=ob.nextLong();\n\t\t}\n\t\tlong sum=0;\n\t\tfor (int i=0; i<a.length-1; i++) {\n\t\t\tif(a[i]>a[i+1])\n\t\t\t{\n\t\t\tlong d=a[i]-a[i+1];\n\t\t\tsum=sum+d;\n\t\t\ta[i+1]=a[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}", "main", "{\n\t\tScanner ob=new Scanner(System.in);\n\t\tint n=ob.nextInt();\n\t\tlong a[]=new long[n];\n\t\tfor (int i=0; i<a.length; i++) {\n\t\t\ta[i]=ob.nextLong();\n\t\t}\n\t\tlong sum=0;\n\t\tfor (int i=0; i<a.length-1; i++) {\n\t\t\tif(a[i]>a[i+1])\n\t\t\t{\n\t\t\tlong d=a[i]-a[i+1];\n\t\t\tsum=sum+d;\n\t\t\ta[i+1]=a[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}", "Scanner ob=new Scanner(System.in);", "ob", "new Scanner(System.in)", "int n=ob.nextInt();", "n", "ob.nextInt()", "ob.nextInt", "ob", "long a[]=new long[n];", "a", "new long[n]", "n", "for (int i=0; i<a.length; i++) {\n\t\t\ta[i]=ob.nextLong();\n\t\t}", "int i=0;", "int i=0;", "i", "0", "i<a.length", "i", "a.length", "a", "a.length", "i++", "i++", "i", "{\n\t\t\ta[i]=ob.nextLong();\n\t\t}", "{\n\t\t\ta[i]=ob.nextLong();\n\t\t}", "a[i]=ob.nextLong()", "a[i]", "a", "i", "ob.nextLong()", "ob.nextLong", "ob", "long sum=0;", "sum", "0", "for (int i=0; i<a.length-1; i++) {\n\t\t\tif(a[i]>a[i+1])\n\t\t\t{\n\t\t\tlong d=a[i]-a[i+1];\n\t\t\tsum=sum+d;\n\t\t\ta[i+1]=a[i];\n\t\t\t}\n\t\t}", "int i=0;", "int i=0;", "i", "0", "i<a.length-1", "i", "a.length-1", "a.length", "a", "a.length", "1", "i++", "i++", "i", "{\n\t\t\tif(a[i]>a[i+1])\n\t\t\t{\n\t\t\tlong d=a[i]-a[i+1];\n\t\t\tsum=sum+d;\n\t\t\ta[i+1]=a[i];\n\t\t\t}\n\t\t}", "{\n\t\t\tif(a[i]>a[i+1])\n\t\t\t{\n\t\t\tlong d=a[i]-a[i+1];\n\t\t\tsum=sum+d;\n\t\t\ta[i+1]=a[i];\n\t\t\t}\n\t\t}", "if(a[i]>a[i+1])\n\t\t\t{\n\t\t\tlong d=a[i]-a[i+1];\n\t\t\tsum=sum+d;\n\t\t\ta[i+1]=a[i];\n\t\t\t}", "a[i]>a[i+1]", "a[i]", "a", "i", "a[i+1]", "a", "i+1", "i", "1", "{\n\t\t\tlong d=a[i]-a[i+1];\n\t\t\tsum=sum+d;\n\t\t\ta[i+1]=a[i];\n\t\t\t}", "long d=a[i]-a[i+1];", "d", "a[i]-a[i+1]", "a[i]", "a", "i", "a[i+1]", "a", "i+1", "i", "1", "sum=sum+d", "sum", "sum+d", "sum", "d", "a[i+1]=a[i]", "a[i+1]", "a", "i+1", "i", "1", "a[i]", "a", "i", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "String[] args", "args", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner ob=new Scanner(System.in);\n\t\tint n=ob.nextInt();\n\t\tlong a[]=new long[n];\n\t\tfor (int i=0; i<a.length; i++) {\n\t\t\ta[i]=ob.nextLong();\n\t\t}\n\t\tlong sum=0;\n\t\tfor (int i=0; i<a.length-1; i++) {\n\t\t\tif(a[i]>a[i+1])\n\t\t\t{\n\t\t\tlong d=a[i]-a[i+1];\n\t\t\tsum=sum+d;\n\t\t\ta[i+1]=a[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n}", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner ob=new Scanner(System.in);\n\t\tint n=ob.nextInt();\n\t\tlong a[]=new long[n];\n\t\tfor (int i=0; i<a.length; i++) {\n\t\t\ta[i]=ob.nextLong();\n\t\t}\n\t\tlong sum=0;\n\t\tfor (int i=0; i<a.length-1; i++) {\n\t\t\tif(a[i]>a[i+1])\n\t\t\t{\n\t\t\tlong d=a[i]-a[i+1];\n\t\t\tsum=sum+d;\n\t\t\ta[i+1]=a[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n}", "Main" ]
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner ob=new Scanner(System.in); int n=ob.nextInt(); long a[]=new long[n]; for (int i=0; i<a.length; i++) { a[i]=ob.nextLong(); } long sum=0; for (int i=0; i<a.length-1; i++) { if(a[i]>a[i+1]) { long d=a[i]-a[i+1]; sum=sum+d; a[i+1]=a[i]; } } System.out.println(sum); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 4, 18, 13, 41, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 41, 13, 4, 18, 13, 4, 18, 13, 14, 2, 13, 13, 30, 0, 13, 2, 13, 13, 30, 0, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 73, 8 ], [ 73, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 17, 20 ], [ 20, 21 ], [ 21, 22 ], [ 11, 23 ], [ 23, 24 ], [ 23, 25 ], [ 11, 26 ], [ 26, 27 ], [ 26, 28 ], [ 11, 29 ], [ 29, 30 ], [ 30, 31 ], [ 31, 32 ], [ 31, 33 ], [ 29, 34 ], [ 34, 35 ], [ 34, 36 ], [ 29, 37 ], [ 37, 38 ], [ 38, 39 ], [ 29, 40 ], [ 41, 41 ], [ 41, 42 ], [ 42, 43 ], [ 42, 44 ], [ 44, 45 ], [ 45, 46 ], [ 44, 47 ], [ 47, 48 ], [ 48, 49 ], [ 41, 50 ], [ 50, 51 ], [ 51, 52 ], [ 51, 53 ], [ 50, 54 ], [ 54, 55 ], [ 55, 56 ], [ 55, 57 ], [ 57, 58 ], [ 57, 59 ], [ 50, 60 ], [ 60, 61 ], [ 61, 62 ], [ 61, 63 ], [ 11, 64 ], [ 64, 65 ], [ 65, 66 ], [ 66, 67 ], [ 66, 68 ], [ 64, 69 ], [ 9, 70 ], [ 70, 71 ], [ 0, 72 ], [ 72, 73 ], [ 72, 74 ] ]
[ "\nimport java.util.Map.Entry;\nimport java.util.*;\n \n//import org.w3c.dom.css.Counter;\n \npublic class Main {\n//public class App {\n \n public static void main(final String[] args){\n //スキャン\n final Scanner s = new Scanner(System.in);\n //String N = Integer.parseInt(s.next());\n long N = Integer.parseInt(s.next());\n //int T = Integer.parseInt(s.next());\n //int ans = N /X;\n //String hoge = s.next();\n //int huge = hoge.length();\n //int hage = 0;\n int tmp = 0;\n long ans=0;\n for(long i =0;i<N;i++){\n int T = Integer.parseInt(s.next());\n if(tmp >T){\n ans += tmp -T;\n }else{\n tmp = T;\n }\n }\n System.out.println(ans);\n }\n}", "import java.util.Map.Entry;", "Entry", "java.util.Map", "import java.util.*;", "util.*", "java", "public class Main {\n//public class App {\n \n public static void main(final String[] args){\n //スキャン\n final Scanner s = new Scanner(System.in);\n //String N = Integer.parseInt(s.next());\n long N = Integer.parseInt(s.next());\n //int T = Integer.parseInt(s.next());\n //int ans = N /X;\n //String hoge = s.next();\n //int huge = hoge.length();\n //int hage = 0;\n int tmp = 0;\n long ans=0;\n for(long i =0;i<N;i++){\n int T = Integer.parseInt(s.next());\n if(tmp >T){\n ans += tmp -T;\n }else{\n tmp = T;\n }\n }\n System.out.println(ans);\n }\n}", "Main", "public static void main(final String[] args){\n //スキャン\n final Scanner s = new Scanner(System.in);\n //String N = Integer.parseInt(s.next());\n long N = Integer.parseInt(s.next());\n //int T = Integer.parseInt(s.next());\n //int ans = N /X;\n //String hoge = s.next();\n //int huge = hoge.length();\n //int hage = 0;\n int tmp = 0;\n long ans=0;\n for(long i =0;i<N;i++){\n int T = Integer.parseInt(s.next());\n if(tmp >T){\n ans += tmp -T;\n }else{\n tmp = T;\n }\n }\n System.out.println(ans);\n }", "main", "{\n //スキャン\n final Scanner s = new Scanner(System.in);\n //String N = Integer.parseInt(s.next());\n long N = Integer.parseInt(s.next());\n //int T = Integer.parseInt(s.next());\n //int ans = N /X;\n //String hoge = s.next();\n //int huge = hoge.length();\n //int hage = 0;\n int tmp = 0;\n long ans=0;\n for(long i =0;i<N;i++){\n int T = Integer.parseInt(s.next());\n if(tmp >T){\n ans += tmp -T;\n }else{\n tmp = T;\n }\n }\n System.out.println(ans);\n }", "final Scanner s = new Scanner(System.in);", "s", "new Scanner(System.in)", "long N = Integer.parseInt(s.next());", "N", "Integer.parseInt(s.next())", "Integer.parseInt", "Integer", "s.next()", "s.next", "s", "int tmp = 0;", "tmp", "0", "long ans=0;", "ans", "0", "for(long i =0;i<N;i++){\n int T = Integer.parseInt(s.next());\n if(tmp >T){\n ans += tmp -T;\n }else{\n tmp = T;\n }\n }", "long i =0;", "long i =0;", "i", "0", "i<N", "i", "N", "i++", "i++", "i", "{\n int T = Integer.parseInt(s.next());\n if(tmp >T){\n ans += tmp -T;\n }else{\n tmp = T;\n }\n }", "{\n int T = Integer.parseInt(s.next());\n if(tmp >T){\n ans += tmp -T;\n }else{\n tmp = T;\n }\n }", "int T = Integer.parseInt(s.next());", "T", "Integer.parseInt(s.next())", "Integer.parseInt", "Integer", "s.next()", "s.next", "s", "if(tmp >T){\n ans += tmp -T;\n }else{\n tmp = T;\n }", "tmp >T", "tmp", "T", "{\n ans += tmp -T;\n }", "ans += tmp -T", "ans", "tmp -T", "tmp", "T", "{\n tmp = T;\n }", "tmp = T", "tmp", "T", "System.out.println(ans)", "System.out.println", "System.out", "System", "System.out", "ans", "final String[] args", "args", "public class Main {\n//public class App {\n \n public static void main(final String[] args){\n //スキャン\n final Scanner s = new Scanner(System.in);\n //String N = Integer.parseInt(s.next());\n long N = Integer.parseInt(s.next());\n //int T = Integer.parseInt(s.next());\n //int ans = N /X;\n //String hoge = s.next();\n //int huge = hoge.length();\n //int hage = 0;\n int tmp = 0;\n long ans=0;\n for(long i =0;i<N;i++){\n int T = Integer.parseInt(s.next());\n if(tmp >T){\n ans += tmp -T;\n }else{\n tmp = T;\n }\n }\n System.out.println(ans);\n }\n}", "public class Main {\n//public class App {\n \n public static void main(final String[] args){\n //スキャン\n final Scanner s = new Scanner(System.in);\n //String N = Integer.parseInt(s.next());\n long N = Integer.parseInt(s.next());\n //int T = Integer.parseInt(s.next());\n //int ans = N /X;\n //String hoge = s.next();\n //int huge = hoge.length();\n //int hage = 0;\n int tmp = 0;\n long ans=0;\n for(long i =0;i<N;i++){\n int T = Integer.parseInt(s.next());\n if(tmp >T){\n ans += tmp -T;\n }else{\n tmp = T;\n }\n }\n System.out.println(ans);\n }\n}", "Main" ]
import java.util.Map.Entry; import java.util.*; //import org.w3c.dom.css.Counter; public class Main { //public class App { public static void main(final String[] args){ //スキャン final Scanner s = new Scanner(System.in); //String N = Integer.parseInt(s.next()); long N = Integer.parseInt(s.next()); //int T = Integer.parseInt(s.next()); //int ans = N /X; //String hoge = s.next(); //int huge = hoge.length(); //int hage = 0; int tmp = 0; long ans=0; for(long i =0;i<N;i++){ int T = Integer.parseInt(s.next()); if(tmp >T){ ans += tmp -T; }else{ tmp = T; } } System.out.println(ans); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 29, 8, 2, 13, 17, 4, 13, 13, 2, 13, 13, 13, 23, 13, 23, 13, 12, 13, 30, 29, 2, 2, 13, 13, 4, 13, 13, 13, 23, 13, 23, 13, 12, 13, 30, 29, 2, 4, 18, 13, 13, 4, 18, 13, 13, 23, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 18, 13, 41, 13, 17, 41, 13, 40, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 13, 18, 13, 13, 30, 0, 13, 18, 13, 13, 30, 0, 13, 2, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 10, 11 ], [ 11, 12 ], [ 11, 13 ], [ 10, 14 ], [ 14, 15 ], [ 14, 16 ], [ 14, 17 ], [ 17, 18 ], [ 17, 19 ], [ 10, 20 ], [ 6, 21 ], [ 21, 22 ], [ 6, 23 ], [ 23, 24 ], [ 4, 25 ], [ 25, 26 ], [ 25, 27 ], [ 27, 28 ], [ 28, 29 ], [ 29, 30 ], [ 30, 31 ], [ 30, 32 ], [ 29, 33 ], [ 33, 34 ], [ 33, 35 ], [ 33, 36 ], [ 25, 37 ], [ 37, 38 ], [ 25, 39 ], [ 39, 40 ], [ 4, 41 ], [ 41, 42 ], [ 41, 43 ], [ 43, 44 ], [ 44, 45 ], [ 45, 46 ], [ 46, 47 ], [ 47, 48 ], [ 46, 49 ], [ 45, 50 ], [ 50, 51 ], [ 51, 52 ], [ 50, 53 ], [ 41, 54 ], [ 54, 55 ], [ 4, 56 ], [ 56, 57 ], [ 56, 58 ], [ 58, 59 ], [ 59, 60 ], [ 59, 61 ], [ 58, 62 ], [ 62, 63 ], [ 62, 64 ], [ 64, 65 ], [ 65, 66 ], [ 58, 67 ], [ 67, 68 ], [ 67, 69 ], [ 58, 71 ], [ 71, 72 ], [ 72, 73 ], [ 73, 74 ], [ 73, 75 ], [ 71, 76 ], [ 76, 77 ], [ 76, 78 ], [ 71, 79 ], [ 79, 80 ], [ 80, 81 ], [ 71, 82 ], [ 82, 83 ], [ 83, 84 ], [ 84, 85 ], [ 84, 86 ], [ 83, 87 ], [ 87, 88 ], [ 88, 89 ], [ 58, 90 ], [ 90, 91 ], [ 90, 92 ], [ 58, 93 ], [ 93, 94 ], [ 93, 95 ], [ 95, 96 ], [ 58, 97 ], [ 97, 98 ], [ 98, 99 ], [ 99, 100 ], [ 99, 101 ], [ 97, 102 ], [ 102, 103 ], [ 102, 104 ], [ 97, 105 ], [ 105, 106 ], [ 106, 107 ], [ 97, 108 ], [ 109, 109 ], [ 109, 110 ], [ 110, 111 ], [ 111, 112 ], [ 111, 113 ], [ 113, 114 ], [ 113, 115 ], [ 110, 116 ], [ 116, 117 ], [ 117, 118 ], [ 117, 119 ], [ 119, 120 ], [ 119, 121 ], [ 110, 122 ], [ 122, 123 ], [ 123, 124 ], [ 123, 125 ], [ 125, 126 ], [ 125, 127 ], [ 127, 128 ], [ 127, 129 ], [ 58, 130 ], [ 130, 131 ], [ 131, 132 ], [ 132, 133 ], [ 132, 134 ], [ 130, 135 ], [ 56, 136 ], [ 136, 137 ] ]
[ "import java.util.*;\nclass Main {\n \n\t//最大公約数・最小公倍数(セットで使う)\nstatic int gcd (int a, int b) {return b>0?gcd(b,a%b):a;}\nstatic int lcm (int a, int b) {return a*b/gcd(a,b);}\n //整数かどうかを判定する\n static boolean isInteger(double number){return Math.ceil(number) == Math.floor(number); }\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n \n\t\tint n = sc.nextInt();\n\t\tLong[] a = new Long[n];\n\n\t\tfor(int i=0;i<n;i++)a[i] = sc.nextLong();\n\t\t\n\t\tLong ans = 0l;\n\t\tLong max = -1l;\n\n\t\tfor(int i=0;i<n;i++){\n\t\t\tif(max < a[i]){\n\t\t\t\tmax = a[i];\n\t\t\t} else {\n\t\t\t\tans += max - a[i];\n\t\t\t}\n\t\t}\n\n\t\t\n\t\tSystem.out.println(ans);\n\t}\n}", "import java.util.*;", "util.*", "java", "class Main {\n \n\t//最大公約数・最小公倍数(セットで使う)\nstatic int gcd (int a, int b) {return b>0?gcd(b,a%b):a;}\nstatic int lcm (int a, int b) {return a*b/gcd(a,b);}\n //整数かどうかを判定する\n static boolean isInteger(double number){return Math.ceil(number) == Math.floor(number); }\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n \n\t\tint n = sc.nextInt();\n\t\tLong[] a = new Long[n];\n\n\t\tfor(int i=0;i<n;i++)a[i] = sc.nextLong();\n\t\t\n\t\tLong ans = 0l;\n\t\tLong max = -1l;\n\n\t\tfor(int i=0;i<n;i++){\n\t\t\tif(max < a[i]){\n\t\t\t\tmax = a[i];\n\t\t\t} else {\n\t\t\t\tans += max - a[i];\n\t\t\t}\n\t\t}\n\n\t\t\n\t\tSystem.out.println(ans);\n\t}\n}", "Main", "//最大公約数・最小公倍数(セットで使う)\nstatic int gcd (int a, int b) {return b>0?gcd(b,a%b):a;}", "gcd", "{return b>0?gcd(b,a%b):a;}", "return b>0?gcd(b,a%b):a;", "b>0?gcd(b,a%b):a", "b>0", "b", "0", "gcd(b,a%b)", "gcd", "b", "a%b", "a", "b", "a", "int a", "a", "int b", "b", "static int lcm (int a, int b) {return a*b/gcd(a,b);}", "lcm", "{return a*b/gcd(a,b);}", "return a*b/gcd(a,b);", "a*b/gcd(a,b)", "a*b", "a", "b", "gcd(a,b)", "gcd", "a", "b", "int a", "a", "int b", "b", "//整数かどうかを判定する\n static boolean isInteger(double number){return Math.ceil(number) == Math.floor(number); }", "isInteger", "{return Math.ceil(number) == Math.floor(number); }", "return Math.ceil(number) == Math.floor(number);", "Math.ceil(number) == Math.floor(number)", "Math.ceil(number)", "Math.ceil", "Math", "number", "Math.floor(number)", "Math.floor", "Math", "number", "double number", "number", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n \n\t\tint n = sc.nextInt();\n\t\tLong[] a = new Long[n];\n\n\t\tfor(int i=0;i<n;i++)a[i] = sc.nextLong();\n\t\t\n\t\tLong ans = 0l;\n\t\tLong max = -1l;\n\n\t\tfor(int i=0;i<n;i++){\n\t\t\tif(max < a[i]){\n\t\t\t\tmax = a[i];\n\t\t\t} else {\n\t\t\t\tans += max - a[i];\n\t\t\t}\n\t\t}\n\n\t\t\n\t\tSystem.out.println(ans);\n\t}", "main", "{\n\t\tScanner sc = new Scanner(System.in);\n \n\t\tint n = sc.nextInt();\n\t\tLong[] a = new Long[n];\n\n\t\tfor(int i=0;i<n;i++)a[i] = sc.nextLong();\n\t\t\n\t\tLong ans = 0l;\n\t\tLong max = -1l;\n\n\t\tfor(int i=0;i<n;i++){\n\t\t\tif(max < a[i]){\n\t\t\t\tmax = a[i];\n\t\t\t} else {\n\t\t\t\tans += max - a[i];\n\t\t\t}\n\t\t}\n\n\t\t\n\t\tSystem.out.println(ans);\n\t}", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "Long[] a = new Long[n];", "a", "new Long[n]", "n", "for(int i=0;i<n;i++)a[i] = sc.nextLong();", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "a[i] = sc.nextLong();", "a[i] = sc.nextLong()", "a[i]", "a", "i", "sc.nextLong()", "sc.nextLong", "sc", "Long ans = 0l;", "ans", "0l", "Long max = -1l;", "max", "-1l", "1l", "for(int i=0;i<n;i++){\n\t\t\tif(max < a[i]){\n\t\t\t\tmax = a[i];\n\t\t\t} else {\n\t\t\t\tans += max - a[i];\n\t\t\t}\n\t\t}", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\n\t\t\tif(max < a[i]){\n\t\t\t\tmax = a[i];\n\t\t\t} else {\n\t\t\t\tans += max - a[i];\n\t\t\t}\n\t\t}", "{\n\t\t\tif(max < a[i]){\n\t\t\t\tmax = a[i];\n\t\t\t} else {\n\t\t\t\tans += max - a[i];\n\t\t\t}\n\t\t}", "if(max < a[i]){\n\t\t\t\tmax = a[i];\n\t\t\t} else {\n\t\t\t\tans += max - a[i];\n\t\t\t}", "max < a[i]", "max", "a[i]", "a", "i", "{\n\t\t\t\tmax = a[i];\n\t\t\t}", "max = a[i]", "max", "a[i]", "a", "i", "{\n\t\t\t\tans += max - a[i];\n\t\t\t}", "ans += max - a[i]", "ans", "max - a[i]", "max", "a[i]", "a", "i", "System.out.println(ans)", "System.out.println", "System.out", "System", "System.out", "ans", "String[] args", "args" ]
import java.util.*; class Main { //最大公約数・最小公倍数(セットで使う) static int gcd (int a, int b) {return b>0?gcd(b,a%b):a;} static int lcm (int a, int b) {return a*b/gcd(a,b);} //整数かどうかを判定する static boolean isInteger(double number){return Math.ceil(number) == Math.floor(number); } public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); Long[] a = new Long[n]; for(int i=0;i<n;i++)a[i] = sc.nextLong(); Long ans = 0l; Long max = -1l; for(int i=0;i<n;i++){ if(max < a[i]){ max = a[i]; } else { ans += max - a[i]; } } System.out.println(ans); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 18, 13, 41, 13, 17, 41, 13, 18, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 13, 18, 13, 13, 0, 13, 18, 13, 13, 0, 13, 2, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 88, 5 ], [ 88, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 8, 21 ], [ 21, 22 ], [ 22, 23 ], [ 23, 24 ], [ 23, 25 ], [ 21, 26 ], [ 26, 27 ], [ 26, 28 ], [ 21, 29 ], [ 29, 30 ], [ 30, 31 ], [ 21, 32 ], [ 32, 33 ], [ 33, 34 ], [ 34, 35 ], [ 34, 36 ], [ 33, 37 ], [ 37, 38 ], [ 38, 39 ], [ 8, 40 ], [ 40, 41 ], [ 40, 42 ], [ 8, 43 ], [ 43, 44 ], [ 43, 45 ], [ 45, 46 ], [ 45, 47 ], [ 8, 48 ], [ 48, 49 ], [ 49, 50 ], [ 50, 51 ], [ 50, 52 ], [ 48, 53 ], [ 53, 54 ], [ 53, 55 ], [ 48, 56 ], [ 56, 57 ], [ 57, 58 ], [ 48, 59 ], [ 60, 60 ], [ 60, 61 ], [ 61, 62 ], [ 62, 63 ], [ 62, 64 ], [ 64, 65 ], [ 64, 66 ], [ 61, 67 ], [ 67, 68 ], [ 67, 69 ], [ 69, 70 ], [ 69, 71 ], [ 60, 72 ], [ 72, 73 ], [ 72, 74 ], [ 74, 75 ], [ 74, 76 ], [ 76, 77 ], [ 76, 78 ], [ 8, 79 ], [ 79, 80 ], [ 80, 81 ], [ 81, 82 ], [ 81, 83 ], [ 79, 84 ], [ 6, 85 ], [ 85, 86 ], [ 0, 87 ], [ 87, 88 ], [ 87, 89 ] ]
[ "import java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int[] a = new int[n];\n for (int i = 0; i < n; i++) a[i] = sc.nextInt();\n\n long result = 0;\n int max = a[0];\n for(int i = 0; i < n; i++) {\n if (max <= a[i]) max = a[i];\n result += max - a[i];\n }\n System.out.println(result);\n }\n}", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int[] a = new int[n];\n for (int i = 0; i < n; i++) a[i] = sc.nextInt();\n\n long result = 0;\n int max = a[0];\n for(int i = 0; i < n; i++) {\n if (max <= a[i]) max = a[i];\n result += max - a[i];\n }\n System.out.println(result);\n }\n}", "Main", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int[] a = new int[n];\n for (int i = 0; i < n; i++) a[i] = sc.nextInt();\n\n long result = 0;\n int max = a[0];\n for(int i = 0; i < n; i++) {\n if (max <= a[i]) max = a[i];\n result += max - a[i];\n }\n System.out.println(result);\n }", "main", "{\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int[] a = new int[n];\n for (int i = 0; i < n; i++) a[i] = sc.nextInt();\n\n long result = 0;\n int max = a[0];\n for(int i = 0; i < n; i++) {\n if (max <= a[i]) max = a[i];\n result += max - a[i];\n }\n System.out.println(result);\n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "int[] a = new int[n];", "a", "new int[n]", "n", "for (int i = 0; i < n; i++) a[i] = sc.nextInt();", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "a[i] = sc.nextInt();", "a[i] = sc.nextInt()", "a[i]", "a", "i", "sc.nextInt()", "sc.nextInt", "sc", "long result = 0;", "result", "0", "int max = a[0];", "max", "a[0]", "a", "0", "for(int i = 0; i < n; i++) {\n if (max <= a[i]) max = a[i];\n result += max - a[i];\n }", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n if (max <= a[i]) max = a[i];\n result += max - a[i];\n }", "{\n if (max <= a[i]) max = a[i];\n result += max - a[i];\n }", "if (max <= a[i]) max = a[i];", "max <= a[i]", "max", "a[i]", "a", "i", "max = a[i]", "max", "a[i]", "a", "i", "result += max - a[i]", "result", "max - a[i]", "max", "a[i]", "a", "i", "System.out.println(result)", "System.out.println", "System.out", "System", "System.out", "result", "String[] args", "args", "public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int[] a = new int[n];\n for (int i = 0; i < n; i++) a[i] = sc.nextInt();\n\n long result = 0;\n int max = a[0];\n for(int i = 0; i < n; i++) {\n if (max <= a[i]) max = a[i];\n result += max - a[i];\n }\n System.out.println(result);\n }\n}", "public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int[] a = new int[n];\n for (int i = 0; i < n; i++) a[i] = sc.nextInt();\n\n long result = 0;\n int max = a[0];\n for(int i = 0; i < n; i++) {\n if (max <= a[i]) max = a[i];\n result += max - a[i];\n }\n System.out.println(result);\n }\n}", "Main" ]
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] a = new int[n]; for (int i = 0; i < n; i++) a[i] = sc.nextInt(); long result = 0; int max = a[0]; for(int i = 0; i < n; i++) { if (max <= a[i]) max = a[i]; result += max - a[i]; } System.out.println(result); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 41, 13, 12, 13, 30, 41, 13, 20, 0, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 41, 13, 18, 13, 13, 11, 1, 41, 13, 2, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 18, 13, 13, 13, 30, 0, 13, 2, 13, 18, 13, 13, 30, 0, 13, 2, 13, 17, 3, 14, 2, 13, 2, 13, 17, 30, 0, 13, 13, 4, 18, 13, 13, 4, 18, 13, 23, 13, 6, 13, 41, 13, 41, 13, 12, 13, 30, 0, 13, 20, 12, 13, 30, 42, 2, 2, 13, 17, 40, 4, 18, 13, 30, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 20, 29, 4, 18, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 41, 13, 17, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 4, 18, 13, 29, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 214, 8 ], [ 214, 9 ], [ 9, 10 ], [ 214, 11 ], [ 11, 12 ], [ 11, 13 ], [ 13, 14 ], [ 14, 15 ], [ 14, 16 ], [ 13, 17 ], [ 17, 18 ], [ 17, 19 ], [ 13, 20 ], [ 20, 21 ], [ 20, 22 ], [ 22, 23 ], [ 23, 24 ], [ 13, 25 ], [ 25, 26 ], [ 25, 27 ], [ 13, 29 ], [ 29, 30 ], [ 30, 31 ], [ 31, 32 ], [ 31, 33 ], [ 29, 34 ], [ 34, 35 ], [ 34, 36 ], [ 29, 37 ], [ 37, 38 ], [ 38, 39 ], [ 29, 40 ], [ 41, 41 ], [ 41, 42 ], [ 42, 43 ], [ 43, 44 ], [ 43, 45 ], [ 42, 46 ], [ 46, 47 ], [ 47, 48 ], [ 13, 49 ], [ 49, 50 ], [ 49, 51 ], [ 13, 52 ], [ 52, 53 ], [ 53, 54 ], [ 54, 55 ], [ 54, 56 ], [ 52, 57 ], [ 57, 58 ], [ 57, 59 ], [ 52, 60 ], [ 60, 61 ], [ 61, 62 ], [ 52, 63 ], [ 64, 64 ], [ 64, 65 ], [ 65, 66 ], [ 65, 67 ], [ 67, 68 ], [ 67, 69 ], [ 64, 70 ], [ 70, 71 ], [ 71, 72 ], [ 72, 73 ], [ 72, 74 ], [ 74, 75 ], [ 74, 76 ], [ 70, 77 ], [ 77, 78 ], [ 77, 79 ], [ 70, 80 ], [ 80, 81 ], [ 81, 82 ], [ 70, 83 ], [ 84, 84 ], [ 84, 85 ], [ 85, 86 ], [ 86, 87 ], [ 87, 88 ], [ 87, 89 ], [ 86, 90 ], [ 85, 91 ], [ 91, 92 ], [ 92, 93 ], [ 92, 94 ], [ 94, 95 ], [ 94, 96 ], [ 96, 97 ], [ 96, 98 ], [ 85, 99 ], [ 99, 100 ], [ 100, 101 ], [ 100, 102 ], [ 102, 103 ], [ 102, 104 ], [ 99, 105 ], [ 84, 106 ], [ 106, 107 ], [ 107, 108 ], [ 107, 109 ], [ 109, 110 ], [ 109, 111 ], [ 106, 112 ], [ 112, 113 ], [ 113, 114 ], [ 113, 115 ], [ 13, 116 ], [ 116, 117 ], [ 117, 118 ], [ 116, 119 ], [ 13, 120 ], [ 120, 121 ], [ 121, 122 ], [ 11, 123 ], [ 123, 124 ], [ 214, 125 ], [ 125, 126 ], [ 125, 127 ], [ 127, 128 ], [ 125, 129 ], [ 129, 130 ], [ 125, 131 ], [ 131, 132 ], [ 131, 133 ], [ 133, 134 ], [ 134, 135 ], [ 134, 136 ], [ 125, 137 ], [ 137, 138 ], [ 137, 139 ], [ 139, 140 ], [ 140, 141 ], [ 141, 142 ], [ 142, 143 ], [ 142, 144 ], [ 141, 145 ], [ 145, 146 ], [ 146, 147 ], [ 147, 148 ], [ 140, 149 ], [ 149, 150 ], [ 150, 151 ], [ 151, 152 ], [ 151, 153 ], [ 153, 154 ], [ 154, 155 ], [ 155, 156 ], [ 150, 157 ], [ 157, 158 ], [ 158, 159 ], [ 158, 160 ], [ 139, 161 ], [ 161, 162 ], [ 162, 163 ], [ 163, 164 ], [ 125, 165 ], [ 165, 166 ], [ 165, 167 ], [ 167, 168 ], [ 168, 169 ], [ 169, 170 ], [ 170, 171 ], [ 169, 172 ], [ 172, 173 ], [ 125, 174 ], [ 174, 175 ], [ 174, 176 ], [ 176, 177 ], [ 177, 178 ], [ 178, 179 ], [ 179, 180 ], [ 178, 181 ], [ 181, 182 ], [ 125, 183 ], [ 183, 184 ], [ 183, 185 ], [ 185, 186 ], [ 186, 187 ], [ 187, 188 ], [ 188, 189 ], [ 187, 190 ], [ 190, 191 ], [ 125, 192 ], [ 192, 193 ], [ 192, 194 ], [ 194, 195 ], [ 195, 196 ], [ 195, 197 ], [ 194, 198 ], [ 198, 199 ], [ 199, 200 ], [ 199, 201 ], [ 201, 202 ], [ 202, 203 ], [ 203, 204 ], [ 198, 205 ], [ 205, 206 ], [ 206, 207 ], [ 206, 208 ], [ 208, 209 ], [ 209, 210 ], [ 194, 211 ], [ 211, 212 ], [ 0, 213 ], [ 213, 214 ], [ 213, 215 ] ]
[ "import java.io.*;\nimport java.util.*;\n\npublic class Main {\n\n\n public static void main(String[] args) throws Exception {\n\n FastReader fs = new FastReader();\n out = new PrintWriter(new BufferedOutputStream(System.out));\n\n int n = fs.nextInt();\n int[] inp = new int[n];\n\n for(int i=0 ; i<n ; i++){\n inp[i] = fs.nextInt();\n }\n\n long ans = 0 ;\n\n for(int i=0 ; i<n ; i++){\n int max = inp[i];\n for(int j=i+1 ; j<n ; j++){\n if(inp[j]<max){\n ans += (max-inp[j]);\n }else{\n i = j - 1 ;\n break;\n }\n if(j==n-1){\n i = j;\n }\n }\n }\n\n out.println(ans);\n\n out.close();\n\n }\n\n //-----------PrintWriter for faster output---------------------------------\n public static PrintWriter out;\n\n //-----------MyScanner class for faster input----------\n public static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n\n }\n //--------------------------------------------------------\n}\n", "import java.io.*;", "io.*", "java", "import java.util.*;", "util.*", "java", "public class Main {\n\n\n public static void main(String[] args) throws Exception {\n\n FastReader fs = new FastReader();\n out = new PrintWriter(new BufferedOutputStream(System.out));\n\n int n = fs.nextInt();\n int[] inp = new int[n];\n\n for(int i=0 ; i<n ; i++){\n inp[i] = fs.nextInt();\n }\n\n long ans = 0 ;\n\n for(int i=0 ; i<n ; i++){\n int max = inp[i];\n for(int j=i+1 ; j<n ; j++){\n if(inp[j]<max){\n ans += (max-inp[j]);\n }else{\n i = j - 1 ;\n break;\n }\n if(j==n-1){\n i = j;\n }\n }\n }\n\n out.println(ans);\n\n out.close();\n\n }\n\n //-----------PrintWriter for faster output---------------------------------\n public static PrintWriter out;\n\n //-----------MyScanner class for faster input----------\n public static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n\n }\n //--------------------------------------------------------\n}", "Main", "//-----------PrintWriter for faster output---------------------------------\n public static PrintWriter out;", "out", "public static void main(String[] args) throws Exception {\n\n FastReader fs = new FastReader();\n out = new PrintWriter(new BufferedOutputStream(System.out));\n\n int n = fs.nextInt();\n int[] inp = new int[n];\n\n for(int i=0 ; i<n ; i++){\n inp[i] = fs.nextInt();\n }\n\n long ans = 0 ;\n\n for(int i=0 ; i<n ; i++){\n int max = inp[i];\n for(int j=i+1 ; j<n ; j++){\n if(inp[j]<max){\n ans += (max-inp[j]);\n }else{\n i = j - 1 ;\n break;\n }\n if(j==n-1){\n i = j;\n }\n }\n }\n\n out.println(ans);\n\n out.close();\n\n }", "main", "{\n\n FastReader fs = new FastReader();\n out = new PrintWriter(new BufferedOutputStream(System.out));\n\n int n = fs.nextInt();\n int[] inp = new int[n];\n\n for(int i=0 ; i<n ; i++){\n inp[i] = fs.nextInt();\n }\n\n long ans = 0 ;\n\n for(int i=0 ; i<n ; i++){\n int max = inp[i];\n for(int j=i+1 ; j<n ; j++){\n if(inp[j]<max){\n ans += (max-inp[j]);\n }else{\n i = j - 1 ;\n break;\n }\n if(j==n-1){\n i = j;\n }\n }\n }\n\n out.println(ans);\n\n out.close();\n\n }", "FastReader fs = new FastReader();", "fs", "new FastReader()", "out = new PrintWriter(new BufferedOutputStream(System.out))", "out", "new PrintWriter(new BufferedOutputStream(System.out))", "int n = fs.nextInt();", "n", "fs.nextInt()", "fs.nextInt", "fs", "int[] inp = new int[n];", "inp", "new int[n]", "n", "for(int i=0 ; i<n ; i++){\n inp[i] = fs.nextInt();\n }", "int i=0 ;", "int i=0 ;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\n inp[i] = fs.nextInt();\n }", "{\n inp[i] = fs.nextInt();\n }", "inp[i] = fs.nextInt()", "inp[i]", "inp", "i", "fs.nextInt()", "fs.nextInt", "fs", "long ans = 0 ;", "ans", "0", "for(int i=0 ; i<n ; i++){\n int max = inp[i];\n for(int j=i+1 ; j<n ; j++){\n if(inp[j]<max){\n ans += (max-inp[j]);\n }else{\n i = j - 1 ;\n break;\n }\n if(j==n-1){\n i = j;\n }\n }\n }", "int i=0 ;", "int i=0 ;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\n int max = inp[i];\n for(int j=i+1 ; j<n ; j++){\n if(inp[j]<max){\n ans += (max-inp[j]);\n }else{\n i = j - 1 ;\n break;\n }\n if(j==n-1){\n i = j;\n }\n }\n }", "{\n int max = inp[i];\n for(int j=i+1 ; j<n ; j++){\n if(inp[j]<max){\n ans += (max-inp[j]);\n }else{\n i = j - 1 ;\n break;\n }\n if(j==n-1){\n i = j;\n }\n }\n }", "int max = inp[i];", "max", "inp[i]", "inp", "i", "for(int j=i+1 ; j<n ; j++){\n if(inp[j]<max){\n ans += (max-inp[j]);\n }else{\n i = j - 1 ;\n break;\n }\n if(j==n-1){\n i = j;\n }\n }", "int j=i+1 ;", "int j=i+1 ;", "j", "i+1", "i", "1", "j<n", "j", "n", "j++", "j++", "j", "{\n if(inp[j]<max){\n ans += (max-inp[j]);\n }else{\n i = j - 1 ;\n break;\n }\n if(j==n-1){\n i = j;\n }\n }", "{\n if(inp[j]<max){\n ans += (max-inp[j]);\n }else{\n i = j - 1 ;\n break;\n }\n if(j==n-1){\n i = j;\n }\n }", "if(inp[j]<max){\n ans += (max-inp[j]);\n }else{\n i = j - 1 ;\n break;\n }", "inp[j]<max", "inp[j]", "inp", "j", "max", "{\n ans += (max-inp[j]);\n }", "ans += (max-inp[j])", "ans", "(max-inp[j])", "max", "inp[j]", "inp", "j", "{\n i = j - 1 ;\n break;\n }", "i = j - 1", "i", "j - 1", "j", "1", "break;", "if(j==n-1){\n i = j;\n }", "j==n-1", "j", "n-1", "n", "1", "{\n i = j;\n }", "i = j", "i", "j", "out.println(ans)", "out.println", "out", "ans", "out.close()", "out.close", "out", "String[] args", "args", "public static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n\n }", "FastReader", "BufferedReader br;", "br", "StringTokenizer st;", "st", "public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }", "FastReader", "{\n br = new BufferedReader(new InputStreamReader(System.in));\n }", "br = new BufferedReader(new InputStreamReader(System.in))", "br", "new BufferedReader(new InputStreamReader(System.in))", "String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }", "next", "{\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }", "while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "st == null || !st.hasMoreElements()", "st == null", "st", "null", "!st.hasMoreElements()", "st.hasMoreElements()", "st.hasMoreElements", "st", "{\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }", "catch (IOException e) {\n e.printStackTrace();\n }", "IOException e", "{\n e.printStackTrace();\n }", "e.printStackTrace()", "e.printStackTrace", "e", "{\n st = new StringTokenizer(br.readLine());\n }", "st = new StringTokenizer(br.readLine())", "st", "new StringTokenizer(br.readLine())", "return st.nextToken();", "st.nextToken()", "st.nextToken", "st", "int nextInt() {\n return Integer.parseInt(next());\n }", "nextInt", "{\n return Integer.parseInt(next());\n }", "return Integer.parseInt(next());", "Integer.parseInt(next())", "Integer.parseInt", "Integer", "next()", "next", "long nextLong() {\n return Long.parseLong(next());\n }", "nextLong", "{\n return Long.parseLong(next());\n }", "return Long.parseLong(next());", "Long.parseLong(next())", "Long.parseLong", "Long", "next()", "next", "double nextDouble() {\n return Double.parseDouble(next());\n }", "nextDouble", "{\n return Double.parseDouble(next());\n }", "return Double.parseDouble(next());", "Double.parseDouble(next())", "Double.parseDouble", "Double", "next()", "next", "String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }", "nextLine", "{\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }", "String str = \"\";", "str", "\"\"", "try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }", "catch (IOException e) {\n e.printStackTrace();\n }", "IOException e", "{\n e.printStackTrace();\n }", "e.printStackTrace()", "e.printStackTrace", "e", "{\n str = br.readLine();\n }", "str = br.readLine()", "str", "br.readLine()", "br.readLine", "br", "return str;", "str", "public class Main {\n\n\n public static void main(String[] args) throws Exception {\n\n FastReader fs = new FastReader();\n out = new PrintWriter(new BufferedOutputStream(System.out));\n\n int n = fs.nextInt();\n int[] inp = new int[n];\n\n for(int i=0 ; i<n ; i++){\n inp[i] = fs.nextInt();\n }\n\n long ans = 0 ;\n\n for(int i=0 ; i<n ; i++){\n int max = inp[i];\n for(int j=i+1 ; j<n ; j++){\n if(inp[j]<max){\n ans += (max-inp[j]);\n }else{\n i = j - 1 ;\n break;\n }\n if(j==n-1){\n i = j;\n }\n }\n }\n\n out.println(ans);\n\n out.close();\n\n }\n\n //-----------PrintWriter for faster output---------------------------------\n public static PrintWriter out;\n\n //-----------MyScanner class for faster input----------\n public static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n\n }\n //--------------------------------------------------------\n}", "public class Main {\n\n\n public static void main(String[] args) throws Exception {\n\n FastReader fs = new FastReader();\n out = new PrintWriter(new BufferedOutputStream(System.out));\n\n int n = fs.nextInt();\n int[] inp = new int[n];\n\n for(int i=0 ; i<n ; i++){\n inp[i] = fs.nextInt();\n }\n\n long ans = 0 ;\n\n for(int i=0 ; i<n ; i++){\n int max = inp[i];\n for(int j=i+1 ; j<n ; j++){\n if(inp[j]<max){\n ans += (max-inp[j]);\n }else{\n i = j - 1 ;\n break;\n }\n if(j==n-1){\n i = j;\n }\n }\n }\n\n out.println(ans);\n\n out.close();\n\n }\n\n //-----------PrintWriter for faster output---------------------------------\n public static PrintWriter out;\n\n //-----------MyScanner class for faster input----------\n public static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n\n }\n //--------------------------------------------------------\n}", "Main" ]
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws Exception { FastReader fs = new FastReader(); out = new PrintWriter(new BufferedOutputStream(System.out)); int n = fs.nextInt(); int[] inp = new int[n]; for(int i=0 ; i<n ; i++){ inp[i] = fs.nextInt(); } long ans = 0 ; for(int i=0 ; i<n ; i++){ int max = inp[i]; for(int j=i+1 ; j<n ; j++){ if(inp[j]<max){ ans += (max-inp[j]); }else{ i = j - 1 ; break; } if(j==n-1){ i = j; } } } out.println(ans); out.close(); } //-----------PrintWriter for faster output--------------------------------- public static PrintWriter out; //-----------MyScanner class for faster input---------- public static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while (st == null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } String nextLine() { String str = ""; try { str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } } //-------------------------------------------------------- }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 18, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 18, 13, 2, 13, 17, 18, 13, 13, 30, 0, 13, 2, 18, 13, 2, 13, 17, 18, 13, 13, 0, 18, 13, 13, 18, 13, 2, 13, 17, 4, 18, 18, 13, 13, 13, 23, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 8, 21 ], [ 21, 22 ], [ 22, 23 ], [ 23, 24 ], [ 23, 25 ], [ 21, 26 ], [ 26, 27 ], [ 26, 28 ], [ 21, 29 ], [ 29, 30 ], [ 30, 31 ], [ 21, 32 ], [ 32, 33 ], [ 33, 34 ], [ 34, 35 ], [ 34, 36 ], [ 33, 37 ], [ 37, 38 ], [ 38, 39 ], [ 8, 40 ], [ 40, 41 ], [ 40, 42 ], [ 8, 43 ], [ 43, 44 ], [ 44, 45 ], [ 45, 46 ], [ 45, 47 ], [ 43, 48 ], [ 48, 49 ], [ 48, 50 ], [ 43, 51 ], [ 51, 52 ], [ 52, 53 ], [ 43, 54 ], [ 55, 55 ], [ 55, 56 ], [ 56, 57 ], [ 57, 58 ], [ 58, 59 ], [ 58, 60 ], [ 60, 61 ], [ 60, 62 ], [ 57, 63 ], [ 63, 64 ], [ 63, 65 ], [ 56, 66 ], [ 66, 67 ], [ 67, 68 ], [ 67, 69 ], [ 69, 70 ], [ 70, 71 ], [ 70, 72 ], [ 72, 73 ], [ 72, 74 ], [ 69, 75 ], [ 75, 76 ], [ 75, 77 ], [ 66, 78 ], [ 78, 79 ], [ 79, 80 ], [ 79, 81 ], [ 78, 82 ], [ 82, 83 ], [ 82, 84 ], [ 84, 85 ], [ 84, 86 ], [ 8, 87 ], [ 87, 88 ], [ 88, 89 ], [ 89, 90 ], [ 89, 91 ], [ 87, 92 ], [ 6, 93 ], [ 93, 94 ] ]
[ "import java.util.*;\nclass Main{\n\n public static void main(String args[]){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int[] arr = new int[n];\n for(int i=0; i<n; i++) \n arr[i] = sc.nextInt();\n long res =0;\n for(int i=1; i<n; i++) {\n if(arr[i-1]>arr[i]){\n res += arr[i-1]-arr[i];\n arr[i] = arr[i-1];\n }\n }\n System.out.println(res);\n // System.out.println(\"Hello World\");\n }\n}", "import java.util.*;", "util.*", "java", "class Main{\n\n public static void main(String args[]){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int[] arr = new int[n];\n for(int i=0; i<n; i++) \n arr[i] = sc.nextInt();\n long res =0;\n for(int i=1; i<n; i++) {\n if(arr[i-1]>arr[i]){\n res += arr[i-1]-arr[i];\n arr[i] = arr[i-1];\n }\n }\n System.out.println(res);\n // System.out.println(\"Hello World\");\n }\n}", "Main", "public static void main(String args[]){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int[] arr = new int[n];\n for(int i=0; i<n; i++) \n arr[i] = sc.nextInt();\n long res =0;\n for(int i=1; i<n; i++) {\n if(arr[i-1]>arr[i]){\n res += arr[i-1]-arr[i];\n arr[i] = arr[i-1];\n }\n }\n System.out.println(res);\n // System.out.println(\"Hello World\");\n }", "main", "{\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int[] arr = new int[n];\n for(int i=0; i<n; i++) \n arr[i] = sc.nextInt();\n long res =0;\n for(int i=1; i<n; i++) {\n if(arr[i-1]>arr[i]){\n res += arr[i-1]-arr[i];\n arr[i] = arr[i-1];\n }\n }\n System.out.println(res);\n // System.out.println(\"Hello World\");\n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "int[] arr = new int[n];", "arr", "new int[n]", "n", "for(int i=0; i<n; i++) \n arr[i] = sc.nextInt();", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "arr[i] = sc.nextInt();", "arr[i] = sc.nextInt()", "arr[i]", "arr", "i", "sc.nextInt()", "sc.nextInt", "sc", "long res =0;", "res", "0", "for(int i=1; i<n; i++) {\n if(arr[i-1]>arr[i]){\n res += arr[i-1]-arr[i];\n arr[i] = arr[i-1];\n }\n }", "int i=1;", "int i=1;", "i", "1", "i<n", "i", "n", "i++", "i++", "i", "{\n if(arr[i-1]>arr[i]){\n res += arr[i-1]-arr[i];\n arr[i] = arr[i-1];\n }\n }", "{\n if(arr[i-1]>arr[i]){\n res += arr[i-1]-arr[i];\n arr[i] = arr[i-1];\n }\n }", "if(arr[i-1]>arr[i]){\n res += arr[i-1]-arr[i];\n arr[i] = arr[i-1];\n }", "arr[i-1]>arr[i]", "arr[i-1]", "arr", "i-1", "i", "1", "arr[i]", "arr", "i", "{\n res += arr[i-1]-arr[i];\n arr[i] = arr[i-1];\n }", "res += arr[i-1]-arr[i]", "res", "arr[i-1]-arr[i]", "arr[i-1]", "arr", "i-1", "i", "1", "arr[i]", "arr", "i", "arr[i] = arr[i-1]", "arr[i]", "arr", "i", "arr[i-1]", "arr", "i-1", "i", "1", "System.out.println(res)", "System.out.println", "System.out", "System", "System.out", "res", "String args[]", "args" ]
import java.util.*; class Main{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] arr = new int[n]; for(int i=0; i<n; i++) arr[i] = sc.nextInt(); long res =0; for(int i=1; i<n; i++) { if(arr[i-1]>arr[i]){ res += arr[i-1]-arr[i]; arr[i] = arr[i-1]; } } System.out.println(res); // System.out.println("Hello World"); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 17, 41, 13, 13, 11, 1, 41, 13, 17, 2, 13, 2, 13, 17, 1, 40, 13, 30, 30, 41, 13, 4, 18, 13, 14, 2, 13, 13, 30, 0, 13, 2, 13, 13, 30, 0, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 71, 5 ], [ 71, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 19, 20 ], [ 20, 21 ], [ 8, 22 ], [ 22, 23 ], [ 22, 24 ], [ 8, 25 ], [ 25, 26 ], [ 25, 27 ], [ 8, 28 ], [ 28, 29 ], [ 29, 30 ], [ 30, 31 ], [ 30, 32 ], [ 28, 33 ], [ 33, 34 ], [ 33, 35 ], [ 35, 36 ], [ 35, 37 ], [ 28, 38 ], [ 38, 39 ], [ 39, 40 ], [ 28, 41 ], [ 42, 42 ], [ 42, 43 ], [ 43, 44 ], [ 43, 45 ], [ 45, 46 ], [ 46, 47 ], [ 42, 48 ], [ 48, 49 ], [ 49, 50 ], [ 49, 51 ], [ 48, 52 ], [ 52, 53 ], [ 53, 54 ], [ 53, 55 ], [ 55, 56 ], [ 55, 57 ], [ 48, 58 ], [ 58, 59 ], [ 59, 60 ], [ 59, 61 ], [ 8, 62 ], [ 62, 63 ], [ 63, 64 ], [ 64, 65 ], [ 64, 66 ], [ 62, 67 ], [ 6, 68 ], [ 68, 69 ], [ 0, 70 ], [ 70, 71 ], [ 70, 72 ] ]
[ "import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tlong N = scanner.nextLong();\n\t\tlong A1 = scanner.nextLong();\n\t\tlong sum = 0;\n\t\tlong b = A1;\n\t\t//System.out.println(\"bは\" + b);\n \t\tfor (long i = 0; i < N-1; i++) {\n \t\t\tlong a = scanner.nextLong();\n \t\t\t//System.out.println(\"aは\" + a);\n \t\t\tif (a < b) {\n \t\t\t\tsum += b-a;\n \t\t\t\t//System.out.println(\"パターン1\");\n \t\t\t} else {\n \t\t\t\tb = a;\n \t\t\t\t//System.out.println(\"パターン2\");\n \t\t\t}\n \t\t\t//System.out.println(sum);\n \t\t}\n \tSystem.out.println(sum);\n\t}\n}", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tlong N = scanner.nextLong();\n\t\tlong A1 = scanner.nextLong();\n\t\tlong sum = 0;\n\t\tlong b = A1;\n\t\t//System.out.println(\"bは\" + b);\n \t\tfor (long i = 0; i < N-1; i++) {\n \t\t\tlong a = scanner.nextLong();\n \t\t\t//System.out.println(\"aは\" + a);\n \t\t\tif (a < b) {\n \t\t\t\tsum += b-a;\n \t\t\t\t//System.out.println(\"パターン1\");\n \t\t\t} else {\n \t\t\t\tb = a;\n \t\t\t\t//System.out.println(\"パターン2\");\n \t\t\t}\n \t\t\t//System.out.println(sum);\n \t\t}\n \tSystem.out.println(sum);\n\t}\n}", "Main", "public static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tlong N = scanner.nextLong();\n\t\tlong A1 = scanner.nextLong();\n\t\tlong sum = 0;\n\t\tlong b = A1;\n\t\t//System.out.println(\"bは\" + b);\n \t\tfor (long i = 0; i < N-1; i++) {\n \t\t\tlong a = scanner.nextLong();\n \t\t\t//System.out.println(\"aは\" + a);\n \t\t\tif (a < b) {\n \t\t\t\tsum += b-a;\n \t\t\t\t//System.out.println(\"パターン1\");\n \t\t\t} else {\n \t\t\t\tb = a;\n \t\t\t\t//System.out.println(\"パターン2\");\n \t\t\t}\n \t\t\t//System.out.println(sum);\n \t\t}\n \tSystem.out.println(sum);\n\t}", "main", "{\n\t\tScanner scanner = new Scanner(System.in);\n\t\tlong N = scanner.nextLong();\n\t\tlong A1 = scanner.nextLong();\n\t\tlong sum = 0;\n\t\tlong b = A1;\n\t\t//System.out.println(\"bは\" + b);\n \t\tfor (long i = 0; i < N-1; i++) {\n \t\t\tlong a = scanner.nextLong();\n \t\t\t//System.out.println(\"aは\" + a);\n \t\t\tif (a < b) {\n \t\t\t\tsum += b-a;\n \t\t\t\t//System.out.println(\"パターン1\");\n \t\t\t} else {\n \t\t\t\tb = a;\n \t\t\t\t//System.out.println(\"パターン2\");\n \t\t\t}\n \t\t\t//System.out.println(sum);\n \t\t}\n \tSystem.out.println(sum);\n\t}", "Scanner scanner = new Scanner(System.in);", "scanner", "new Scanner(System.in)", "long N = scanner.nextLong();", "N", "scanner.nextLong()", "scanner.nextLong", "scanner", "long A1 = scanner.nextLong();", "A1", "scanner.nextLong()", "scanner.nextLong", "scanner", "long sum = 0;", "sum", "0", "long b = A1;", "b", "A1", "for (long i = 0; i < N-1; i++) {\n \t\t\tlong a = scanner.nextLong();\n \t\t\t//System.out.println(\"aは\" + a);\n \t\t\tif (a < b) {\n \t\t\t\tsum += b-a;\n \t\t\t\t//System.out.println(\"パターン1\");\n \t\t\t} else {\n \t\t\t\tb = a;\n \t\t\t\t//System.out.println(\"パターン2\");\n \t\t\t}\n \t\t\t//System.out.println(sum);\n \t\t}", "long i = 0;", "long i = 0;", "i", "0", "i < N-1", "i", "N-1", "N", "1", "i++", "i++", "i", "{\n \t\t\tlong a = scanner.nextLong();\n \t\t\t//System.out.println(\"aは\" + a);\n \t\t\tif (a < b) {\n \t\t\t\tsum += b-a;\n \t\t\t\t//System.out.println(\"パターン1\");\n \t\t\t} else {\n \t\t\t\tb = a;\n \t\t\t\t//System.out.println(\"パターン2\");\n \t\t\t}\n \t\t\t//System.out.println(sum);\n \t\t}", "{\n \t\t\tlong a = scanner.nextLong();\n \t\t\t//System.out.println(\"aは\" + a);\n \t\t\tif (a < b) {\n \t\t\t\tsum += b-a;\n \t\t\t\t//System.out.println(\"パターン1\");\n \t\t\t} else {\n \t\t\t\tb = a;\n \t\t\t\t//System.out.println(\"パターン2\");\n \t\t\t}\n \t\t\t//System.out.println(sum);\n \t\t}", "long a = scanner.nextLong();", "a", "scanner.nextLong()", "scanner.nextLong", "scanner", "if (a < b) {\n \t\t\t\tsum += b-a;\n \t\t\t\t//System.out.println(\"パターン1\");\n \t\t\t} else {\n \t\t\t\tb = a;\n \t\t\t\t//System.out.println(\"パターン2\");\n \t\t\t}", "a < b", "a", "b", "{\n \t\t\t\tsum += b-a;\n \t\t\t\t//System.out.println(\"パターン1\");\n \t\t\t}", "sum += b-a", "sum", "b-a", "b", "a", "{\n \t\t\t\tb = a;\n \t\t\t\t//System.out.println(\"パターン2\");\n \t\t\t}", "b = a", "b", "a", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "String[] args", "args", "public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tlong N = scanner.nextLong();\n\t\tlong A1 = scanner.nextLong();\n\t\tlong sum = 0;\n\t\tlong b = A1;\n\t\t//System.out.println(\"bは\" + b);\n \t\tfor (long i = 0; i < N-1; i++) {\n \t\t\tlong a = scanner.nextLong();\n \t\t\t//System.out.println(\"aは\" + a);\n \t\t\tif (a < b) {\n \t\t\t\tsum += b-a;\n \t\t\t\t//System.out.println(\"パターン1\");\n \t\t\t} else {\n \t\t\t\tb = a;\n \t\t\t\t//System.out.println(\"パターン2\");\n \t\t\t}\n \t\t\t//System.out.println(sum);\n \t\t}\n \tSystem.out.println(sum);\n\t}\n}", "public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tlong N = scanner.nextLong();\n\t\tlong A1 = scanner.nextLong();\n\t\tlong sum = 0;\n\t\tlong b = A1;\n\t\t//System.out.println(\"bは\" + b);\n \t\tfor (long i = 0; i < N-1; i++) {\n \t\t\tlong a = scanner.nextLong();\n \t\t\t//System.out.println(\"aは\" + a);\n \t\t\tif (a < b) {\n \t\t\t\tsum += b-a;\n \t\t\t\t//System.out.println(\"パターン1\");\n \t\t\t} else {\n \t\t\t\tb = a;\n \t\t\t\t//System.out.println(\"パターン2\");\n \t\t\t}\n \t\t\t//System.out.println(sum);\n \t\t}\n \tSystem.out.println(sum);\n\t}\n}", "Main" ]
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); long N = scanner.nextLong(); long A1 = scanner.nextLong(); long sum = 0; long b = A1; //System.out.println("bは" + b); for (long i = 0; i < N-1; i++) { long a = scanner.nextLong(); //System.out.println("aは" + a); if (a < b) { sum += b-a; //System.out.println("パターン1"); } else { b = a; //System.out.println("パターン2"); } //System.out.println(sum); } System.out.println(sum); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 18, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 18, 13, 2, 13, 17, 18, 13, 13, 30, 0, 13, 2, 18, 13, 2, 13, 17, 18, 13, 13, 0, 18, 13, 13, 18, 13, 2, 13, 17, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 102, 11 ], [ 102, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 15, 17 ], [ 14, 18 ], [ 18, 19 ], [ 18, 20 ], [ 20, 21 ], [ 21, 22 ], [ 14, 23 ], [ 23, 24 ], [ 23, 25 ], [ 14, 27 ], [ 27, 28 ], [ 27, 29 ], [ 14, 30 ], [ 30, 31 ], [ 31, 32 ], [ 32, 33 ], [ 32, 34 ], [ 30, 35 ], [ 35, 36 ], [ 35, 37 ], [ 30, 38 ], [ 38, 39 ], [ 39, 40 ], [ 30, 41 ], [ 41, 42 ], [ 42, 43 ], [ 43, 44 ], [ 43, 45 ], [ 42, 46 ], [ 46, 47 ], [ 47, 48 ], [ 14, 49 ], [ 49, 50 ], [ 50, 51 ], [ 51, 52 ], [ 51, 53 ], [ 49, 54 ], [ 54, 55 ], [ 54, 56 ], [ 49, 57 ], [ 57, 58 ], [ 58, 59 ], [ 49, 60 ], [ 61, 61 ], [ 61, 62 ], [ 62, 63 ], [ 63, 64 ], [ 64, 65 ], [ 64, 66 ], [ 66, 67 ], [ 66, 68 ], [ 63, 69 ], [ 69, 70 ], [ 69, 71 ], [ 62, 72 ], [ 72, 73 ], [ 73, 74 ], [ 73, 75 ], [ 75, 76 ], [ 76, 77 ], [ 76, 78 ], [ 78, 79 ], [ 78, 80 ], [ 75, 81 ], [ 81, 82 ], [ 81, 83 ], [ 72, 84 ], [ 84, 85 ], [ 85, 86 ], [ 85, 87 ], [ 84, 88 ], [ 88, 89 ], [ 88, 90 ], [ 90, 91 ], [ 90, 92 ], [ 14, 93 ], [ 93, 94 ], [ 94, 95 ], [ 95, 96 ], [ 95, 97 ], [ 93, 98 ], [ 12, 99 ], [ 99, 100 ], [ 0, 101 ], [ 101, 102 ], [ 101, 103 ] ]
[ "\n\nimport java.util.*;\nimport java.lang.*;\nimport java.io.*;\n\npublic class Main\n{\n public static void main (String[] args)\n {\n // your code goes here\n Scanner s = new Scanner(System.in);\n int n = s.nextInt();\n int[] h = new int[n];\n long sum = 0;\n for(int j=0; j<n; j++)\n h[j] = s.nextInt();\n\n for(int j=1; j<n; j++)\n {\n if(h[j-1]>h[j])\n {\n sum+=h[j-1]-h[j];\n h[j] = h[j-1];\n }\n }\n System.out.println(sum);\n }\n}", "import java.util.*;", "util.*", "java", "import java.lang.*;", "lang.*", "java", "import java.io.*;", "io.*", "java", "public class Main\n{\n public static void main (String[] args)\n {\n // your code goes here\n Scanner s = new Scanner(System.in);\n int n = s.nextInt();\n int[] h = new int[n];\n long sum = 0;\n for(int j=0; j<n; j++)\n h[j] = s.nextInt();\n\n for(int j=1; j<n; j++)\n {\n if(h[j-1]>h[j])\n {\n sum+=h[j-1]-h[j];\n h[j] = h[j-1];\n }\n }\n System.out.println(sum);\n }\n}", "Main", "public static void main (String[] args)\n {\n // your code goes here\n Scanner s = new Scanner(System.in);\n int n = s.nextInt();\n int[] h = new int[n];\n long sum = 0;\n for(int j=0; j<n; j++)\n h[j] = s.nextInt();\n\n for(int j=1; j<n; j++)\n {\n if(h[j-1]>h[j])\n {\n sum+=h[j-1]-h[j];\n h[j] = h[j-1];\n }\n }\n System.out.println(sum);\n }", "main", "{\n // your code goes here\n Scanner s = new Scanner(System.in);\n int n = s.nextInt();\n int[] h = new int[n];\n long sum = 0;\n for(int j=0; j<n; j++)\n h[j] = s.nextInt();\n\n for(int j=1; j<n; j++)\n {\n if(h[j-1]>h[j])\n {\n sum+=h[j-1]-h[j];\n h[j] = h[j-1];\n }\n }\n System.out.println(sum);\n }", "Scanner s = new Scanner(System.in);", "s", "new Scanner(System.in)", "int n = s.nextInt();", "n", "s.nextInt()", "s.nextInt", "s", "int[] h = new int[n];", "h", "new int[n]", "n", "long sum = 0;", "sum", "0", "for(int j=0; j<n; j++)\n h[j] = s.nextInt();", "int j=0;", "int j=0;", "j", "0", "j<n", "j", "n", "j++", "j++", "j", "h[j] = s.nextInt();", "h[j] = s.nextInt()", "h[j]", "h", "j", "s.nextInt()", "s.nextInt", "s", "for(int j=1; j<n; j++)\n {\n if(h[j-1]>h[j])\n {\n sum+=h[j-1]-h[j];\n h[j] = h[j-1];\n }\n }", "int j=1;", "int j=1;", "j", "1", "j<n", "j", "n", "j++", "j++", "j", "{\n if(h[j-1]>h[j])\n {\n sum+=h[j-1]-h[j];\n h[j] = h[j-1];\n }\n }", "{\n if(h[j-1]>h[j])\n {\n sum+=h[j-1]-h[j];\n h[j] = h[j-1];\n }\n }", "if(h[j-1]>h[j])\n {\n sum+=h[j-1]-h[j];\n h[j] = h[j-1];\n }", "h[j-1]>h[j]", "h[j-1]", "h", "j-1", "j", "1", "h[j]", "h", "j", "{\n sum+=h[j-1]-h[j];\n h[j] = h[j-1];\n }", "sum+=h[j-1]-h[j]", "sum", "h[j-1]-h[j]", "h[j-1]", "h", "j-1", "j", "1", "h[j]", "h", "j", "h[j] = h[j-1]", "h[j]", "h", "j", "h[j-1]", "h", "j-1", "j", "1", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "String[] args", "args", "public class Main\n{\n public static void main (String[] args)\n {\n // your code goes here\n Scanner s = new Scanner(System.in);\n int n = s.nextInt();\n int[] h = new int[n];\n long sum = 0;\n for(int j=0; j<n; j++)\n h[j] = s.nextInt();\n\n for(int j=1; j<n; j++)\n {\n if(h[j-1]>h[j])\n {\n sum+=h[j-1]-h[j];\n h[j] = h[j-1];\n }\n }\n System.out.println(sum);\n }\n}", "public class Main\n{\n public static void main (String[] args)\n {\n // your code goes here\n Scanner s = new Scanner(System.in);\n int n = s.nextInt();\n int[] h = new int[n];\n long sum = 0;\n for(int j=0; j<n; j++)\n h[j] = s.nextInt();\n\n for(int j=1; j<n; j++)\n {\n if(h[j-1]>h[j])\n {\n sum+=h[j-1]-h[j];\n h[j] = h[j-1];\n }\n }\n System.out.println(sum);\n }\n}", "Main" ]
import java.util.*; import java.lang.*; import java.io.*; public class Main { public static void main (String[] args) { // your code goes here Scanner s = new Scanner(System.in); int n = s.nextInt(); int[] h = new int[n]; long sum = 0; for(int j=0; j<n; j++) h[j] = s.nextInt(); for(int j=1; j<n; j++) { if(h[j-1]>h[j]) { sum+=h[j-1]-h[j]; h[j] = h[j-1]; } } System.out.println(sum); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 18, 13, 13, 18, 13, 2, 13, 17, 30, 0, 13, 2, 18, 13, 2, 13, 17, 18, 13, 13, 0, 18, 13, 13, 18, 13, 2, 13, 17, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 97, 5 ], [ 97, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 8, 21 ], [ 21, 22 ], [ 22, 23 ], [ 23, 24 ], [ 23, 25 ], [ 21, 26 ], [ 26, 27 ], [ 26, 28 ], [ 21, 29 ], [ 29, 30 ], [ 30, 31 ], [ 21, 32 ], [ 33, 33 ], [ 33, 34 ], [ 34, 35 ], [ 35, 36 ], [ 35, 37 ], [ 34, 38 ], [ 38, 39 ], [ 39, 40 ], [ 8, 41 ], [ 41, 42 ], [ 41, 43 ], [ 8, 44 ], [ 44, 45 ], [ 45, 46 ], [ 46, 47 ], [ 46, 48 ], [ 44, 49 ], [ 49, 50 ], [ 49, 51 ], [ 44, 52 ], [ 52, 53 ], [ 53, 54 ], [ 44, 55 ], [ 56, 56 ], [ 56, 57 ], [ 57, 58 ], [ 58, 59 ], [ 59, 60 ], [ 59, 61 ], [ 58, 62 ], [ 62, 63 ], [ 62, 64 ], [ 64, 65 ], [ 64, 66 ], [ 57, 67 ], [ 67, 68 ], [ 68, 69 ], [ 68, 70 ], [ 70, 71 ], [ 71, 72 ], [ 71, 73 ], [ 73, 74 ], [ 73, 75 ], [ 70, 76 ], [ 76, 77 ], [ 76, 78 ], [ 67, 79 ], [ 79, 80 ], [ 80, 81 ], [ 80, 82 ], [ 79, 83 ], [ 83, 84 ], [ 83, 85 ], [ 85, 86 ], [ 85, 87 ], [ 8, 88 ], [ 88, 89 ], [ 89, 90 ], [ 90, 91 ], [ 90, 92 ], [ 88, 93 ], [ 6, 94 ], [ 94, 95 ], [ 0, 96 ], [ 96, 97 ], [ 96, 98 ] ]
[ "import java.util.Scanner;\n\npublic class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = sc.nextLong();\n }\n long sum = 0;\n for (int i = 1; i < n; i++) {\n if (a[i] < a[i - 1]) {\n sum += (a[i - 1] - a[i]);\n a[i] = a[i - 1];\n }\n }\n System.out.println(sum);\n }\n}", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = sc.nextLong();\n }\n long sum = 0;\n for (int i = 1; i < n; i++) {\n if (a[i] < a[i - 1]) {\n sum += (a[i - 1] - a[i]);\n a[i] = a[i - 1];\n }\n }\n System.out.println(sum);\n }\n}", "Main", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = sc.nextLong();\n }\n long sum = 0;\n for (int i = 1; i < n; i++) {\n if (a[i] < a[i - 1]) {\n sum += (a[i - 1] - a[i]);\n a[i] = a[i - 1];\n }\n }\n System.out.println(sum);\n }", "main", "{\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = sc.nextLong();\n }\n long sum = 0;\n for (int i = 1; i < n; i++) {\n if (a[i] < a[i - 1]) {\n sum += (a[i - 1] - a[i]);\n a[i] = a[i - 1];\n }\n }\n System.out.println(sum);\n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "long[] a = new long[n];", "a", "new long[n]", "n", "for (int i = 0; i < n; i++) {\n a[i] = sc.nextLong();\n }", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n a[i] = sc.nextLong();\n }", "{\n a[i] = sc.nextLong();\n }", "a[i] = sc.nextLong()", "a[i]", "a", "i", "sc.nextLong()", "sc.nextLong", "sc", "long sum = 0;", "sum", "0", "for (int i = 1; i < n; i++) {\n if (a[i] < a[i - 1]) {\n sum += (a[i - 1] - a[i]);\n a[i] = a[i - 1];\n }\n }", "int i = 1;", "int i = 1;", "i", "1", "i < n", "i", "n", "i++", "i++", "i", "{\n if (a[i] < a[i - 1]) {\n sum += (a[i - 1] - a[i]);\n a[i] = a[i - 1];\n }\n }", "{\n if (a[i] < a[i - 1]) {\n sum += (a[i - 1] - a[i]);\n a[i] = a[i - 1];\n }\n }", "if (a[i] < a[i - 1]) {\n sum += (a[i - 1] - a[i]);\n a[i] = a[i - 1];\n }", "a[i] < a[i - 1]", "a[i]", "a", "i", "a[i - 1]", "a", "i - 1", "i", "1", "{\n sum += (a[i - 1] - a[i]);\n a[i] = a[i - 1];\n }", "sum += (a[i - 1] - a[i])", "sum", "(a[i - 1] - a[i])", "a[i - 1]", "a", "i - 1", "i", "1", "a[i]", "a", "i", "a[i] = a[i - 1]", "a[i]", "a", "i", "a[i - 1]", "a", "i - 1", "i", "1", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "String[] args", "args", "public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = sc.nextLong();\n }\n long sum = 0;\n for (int i = 1; i < n; i++) {\n if (a[i] < a[i - 1]) {\n sum += (a[i - 1] - a[i]);\n a[i] = a[i - 1];\n }\n }\n System.out.println(sum);\n }\n}", "public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = sc.nextLong();\n }\n long sum = 0;\n for (int i = 1; i < n; i++) {\n if (a[i] < a[i - 1]) {\n sum += (a[i - 1] - a[i]);\n a[i] = a[i - 1];\n }\n }\n System.out.println(sum);\n }\n}", "Main" ]
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long[] a = new long[n]; for (int i = 0; i < n; i++) { a[i] = sc.nextLong(); } long sum = 0; for (int i = 1; i < n; i++) { if (a[i] < a[i - 1]) { sum += (a[i - 1] - a[i]); a[i] = a[i - 1]; } } System.out.println(sum); } }
[ 7, 15, 13, 17, 6, 13, 41, 13, 20, 12, 13, 30, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 18, 13, 41, 13, 17, 41, 13, 18, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 18, 13, 13, 13, 0, 13, 2, 13, 18, 13, 13, 0, 13, 4, 18, 13, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 92, 5 ], [ 92, 6 ], [ 6, 7 ], [ 6, 8 ], [ 92, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 11, 17 ], [ 17, 18 ], [ 17, 19 ], [ 11, 21 ], [ 21, 22 ], [ 22, 23 ], [ 23, 24 ], [ 23, 25 ], [ 21, 26 ], [ 26, 27 ], [ 26, 28 ], [ 21, 29 ], [ 29, 30 ], [ 30, 31 ], [ 21, 32 ], [ 32, 33 ], [ 33, 34 ], [ 34, 35 ], [ 34, 36 ], [ 33, 37 ], [ 37, 38 ], [ 38, 39 ], [ 11, 40 ], [ 40, 41 ], [ 40, 42 ], [ 11, 43 ], [ 43, 44 ], [ 43, 45 ], [ 45, 46 ], [ 45, 47 ], [ 11, 48 ], [ 48, 49 ], [ 49, 50 ], [ 50, 51 ], [ 50, 52 ], [ 48, 53 ], [ 53, 54 ], [ 53, 55 ], [ 48, 56 ], [ 56, 57 ], [ 57, 58 ], [ 48, 59 ], [ 60, 60 ], [ 60, 61 ], [ 61, 62 ], [ 62, 63 ], [ 63, 64 ], [ 63, 65 ], [ 62, 66 ], [ 61, 67 ], [ 67, 68 ], [ 67, 69 ], [ 69, 70 ], [ 69, 71 ], [ 71, 72 ], [ 71, 73 ], [ 60, 74 ], [ 74, 75 ], [ 74, 76 ], [ 76, 77 ], [ 77, 78 ], [ 76, 79 ], [ 76, 80 ], [ 80, 81 ], [ 80, 82 ], [ 11, 83 ], [ 83, 84 ], [ 84, 85 ], [ 85, 86 ], [ 85, 87 ], [ 83, 88 ], [ 9, 89 ], [ 89, 90 ], [ 0, 91 ], [ 91, 92 ], [ 91, 93 ] ]
[ "import java.util.*;\n\npublic class Main{\n static Scanner in = new Scanner(System.in);\n\n public static void main(String[] args){\n int n = in.nextInt();\n int[] arr = new int[n];\n for(int i = 0; i < n; i++)\n arr[i] = in.nextInt();\n\n long count = 0;\n int max = arr[0];\n for(int i = 1; i < n; i++){\n if(arr[i] < max)\n count += (max - arr[i]);\n max = Math.max(max, arr[i]);\n }\n System.out.println(count);\n }\n}", "import java.util.*;", "util.*", "java", "public class Main{\n static Scanner in = new Scanner(System.in);\n\n public static void main(String[] args){\n int n = in.nextInt();\n int[] arr = new int[n];\n for(int i = 0; i < n; i++)\n arr[i] = in.nextInt();\n\n long count = 0;\n int max = arr[0];\n for(int i = 1; i < n; i++){\n if(arr[i] < max)\n count += (max - arr[i]);\n max = Math.max(max, arr[i]);\n }\n System.out.println(count);\n }\n}", "Main", "static Scanner in = new Scanner(System.in);", "in", "new Scanner(System.in)", "public static void main(String[] args){\n int n = in.nextInt();\n int[] arr = new int[n];\n for(int i = 0; i < n; i++)\n arr[i] = in.nextInt();\n\n long count = 0;\n int max = arr[0];\n for(int i = 1; i < n; i++){\n if(arr[i] < max)\n count += (max - arr[i]);\n max = Math.max(max, arr[i]);\n }\n System.out.println(count);\n }", "main", "{\n int n = in.nextInt();\n int[] arr = new int[n];\n for(int i = 0; i < n; i++)\n arr[i] = in.nextInt();\n\n long count = 0;\n int max = arr[0];\n for(int i = 1; i < n; i++){\n if(arr[i] < max)\n count += (max - arr[i]);\n max = Math.max(max, arr[i]);\n }\n System.out.println(count);\n }", "int n = in.nextInt();", "n", "in.nextInt()", "in.nextInt", "in", "int[] arr = new int[n];", "arr", "new int[n]", "n", "for(int i = 0; i < n; i++)\n arr[i] = in.nextInt();", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "arr[i] = in.nextInt();", "arr[i] = in.nextInt()", "arr[i]", "arr", "i", "in.nextInt()", "in.nextInt", "in", "long count = 0;", "count", "0", "int max = arr[0];", "max", "arr[0]", "arr", "0", "for(int i = 1; i < n; i++){\n if(arr[i] < max)\n count += (max - arr[i]);\n max = Math.max(max, arr[i]);\n }", "int i = 1;", "int i = 1;", "i", "1", "i < n", "i", "n", "i++", "i++", "i", "{\n if(arr[i] < max)\n count += (max - arr[i]);\n max = Math.max(max, arr[i]);\n }", "{\n if(arr[i] < max)\n count += (max - arr[i]);\n max = Math.max(max, arr[i]);\n }", "if(arr[i] < max)\n count += (max - arr[i]);", "arr[i] < max", "arr[i]", "arr", "i", "max", "count += (max - arr[i])", "count", "(max - arr[i])", "max", "arr[i]", "arr", "i", "max = Math.max(max, arr[i])", "max", "Math.max(max, arr[i])", "Math.max", "Math", "max", "arr[i]", "arr", "i", "System.out.println(count)", "System.out.println", "System.out", "System", "System.out", "count", "String[] args", "args", "public class Main{\n static Scanner in = new Scanner(System.in);\n\n public static void main(String[] args){\n int n = in.nextInt();\n int[] arr = new int[n];\n for(int i = 0; i < n; i++)\n arr[i] = in.nextInt();\n\n long count = 0;\n int max = arr[0];\n for(int i = 1; i < n; i++){\n if(arr[i] < max)\n count += (max - arr[i]);\n max = Math.max(max, arr[i]);\n }\n System.out.println(count);\n }\n}", "public class Main{\n static Scanner in = new Scanner(System.in);\n\n public static void main(String[] args){\n int n = in.nextInt();\n int[] arr = new int[n];\n for(int i = 0; i < n; i++)\n arr[i] = in.nextInt();\n\n long count = 0;\n int max = arr[0];\n for(int i = 1; i < n; i++){\n if(arr[i] < max)\n count += (max - arr[i]);\n max = Math.max(max, arr[i]);\n }\n System.out.println(count);\n }\n}", "Main" ]
import java.util.*; public class Main{ static Scanner in = new Scanner(System.in); public static void main(String[] args){ int n = in.nextInt(); int[] arr = new int[n]; for(int i = 0; i < n; i++) arr[i] = in.nextInt(); long count = 0; int max = arr[0]; for(int i = 1; i < n; i++){ if(arr[i] < max) count += (max - arr[i]); max = Math.max(max, arr[i]); } System.out.println(count); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 17, 41, 13, 17, 41, 13, 4, 18, 13, 11, 1, 41, 13, 17, 2, 13, 2, 13, 17, 1, 40, 13, 30, 30, 41, 13, 4, 18, 13, 0, 13, 13, 14, 2, 13, 13, 30, 0, 13, 13, 0, 13, 2, 13, 13, 0, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 76, 5 ], [ 76, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 8, 20 ], [ 20, 21 ], [ 20, 22 ], [ 8, 23 ], [ 23, 24 ], [ 23, 25 ], [ 25, 26 ], [ 26, 27 ], [ 8, 28 ], [ 28, 29 ], [ 29, 30 ], [ 30, 31 ], [ 30, 32 ], [ 28, 33 ], [ 33, 34 ], [ 33, 35 ], [ 35, 36 ], [ 35, 37 ], [ 28, 38 ], [ 38, 39 ], [ 39, 40 ], [ 28, 41 ], [ 42, 42 ], [ 42, 43 ], [ 43, 44 ], [ 43, 45 ], [ 45, 46 ], [ 46, 47 ], [ 42, 48 ], [ 48, 49 ], [ 48, 50 ], [ 42, 51 ], [ 51, 52 ], [ 52, 53 ], [ 52, 54 ], [ 51, 55 ], [ 55, 56 ], [ 56, 57 ], [ 56, 58 ], [ 55, 59 ], [ 59, 60 ], [ 59, 61 ], [ 61, 62 ], [ 61, 63 ], [ 42, 64 ], [ 64, 65 ], [ 64, 66 ], [ 8, 67 ], [ 67, 68 ], [ 68, 69 ], [ 69, 70 ], [ 69, 71 ], [ 67, 72 ], [ 6, 73 ], [ 73, 74 ], [ 0, 75 ], [ 75, 76 ], [ 75, 77 ] ]
[ "import java.util.*;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n long count = 0;\n int base = 0;\n int now = sc.nextInt();\n for (int i = 0; i < N-1; i++) {\n int Ai = sc.nextInt();\n base = Ai;\n if (Ai < now) {\n base = now;\n count += (now-Ai);\n }\n now = base;\n }\n System.out.println(count);\n }\n}", "import java.util.*;", "util.*", "java", "public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n long count = 0;\n int base = 0;\n int now = sc.nextInt();\n for (int i = 0; i < N-1; i++) {\n int Ai = sc.nextInt();\n base = Ai;\n if (Ai < now) {\n base = now;\n count += (now-Ai);\n }\n now = base;\n }\n System.out.println(count);\n }\n}", "Main", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n long count = 0;\n int base = 0;\n int now = sc.nextInt();\n for (int i = 0; i < N-1; i++) {\n int Ai = sc.nextInt();\n base = Ai;\n if (Ai < now) {\n base = now;\n count += (now-Ai);\n }\n now = base;\n }\n System.out.println(count);\n }", "main", "{\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n long count = 0;\n int base = 0;\n int now = sc.nextInt();\n for (int i = 0; i < N-1; i++) {\n int Ai = sc.nextInt();\n base = Ai;\n if (Ai < now) {\n base = now;\n count += (now-Ai);\n }\n now = base;\n }\n System.out.println(count);\n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int N = sc.nextInt();", "N", "sc.nextInt()", "sc.nextInt", "sc", "long count = 0;", "count", "0", "int base = 0;", "base", "0", "int now = sc.nextInt();", "now", "sc.nextInt()", "sc.nextInt", "sc", "for (int i = 0; i < N-1; i++) {\n int Ai = sc.nextInt();\n base = Ai;\n if (Ai < now) {\n base = now;\n count += (now-Ai);\n }\n now = base;\n }", "int i = 0;", "int i = 0;", "i", "0", "i < N-1", "i", "N-1", "N", "1", "i++", "i++", "i", "{\n int Ai = sc.nextInt();\n base = Ai;\n if (Ai < now) {\n base = now;\n count += (now-Ai);\n }\n now = base;\n }", "{\n int Ai = sc.nextInt();\n base = Ai;\n if (Ai < now) {\n base = now;\n count += (now-Ai);\n }\n now = base;\n }", "int Ai = sc.nextInt();", "Ai", "sc.nextInt()", "sc.nextInt", "sc", "base = Ai", "base", "Ai", "if (Ai < now) {\n base = now;\n count += (now-Ai);\n }", "Ai < now", "Ai", "now", "{\n base = now;\n count += (now-Ai);\n }", "base = now", "base", "now", "count += (now-Ai)", "count", "(now-Ai)", "now", "Ai", "now = base", "now", "base", "System.out.println(count)", "System.out.println", "System.out", "System", "System.out", "count", "String[] args", "args", "public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n long count = 0;\n int base = 0;\n int now = sc.nextInt();\n for (int i = 0; i < N-1; i++) {\n int Ai = sc.nextInt();\n base = Ai;\n if (Ai < now) {\n base = now;\n count += (now-Ai);\n }\n now = base;\n }\n System.out.println(count);\n }\n}", "public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n long count = 0;\n int base = 0;\n int now = sc.nextInt();\n for (int i = 0; i < N-1; i++) {\n int Ai = sc.nextInt();\n base = Ai;\n if (Ai < now) {\n base = now;\n count += (now-Ai);\n }\n now = base;\n }\n System.out.println(count);\n }\n}", "Main" ]
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); long count = 0; int base = 0; int now = sc.nextInt(); for (int i = 0; i < N-1; i++) { int Ai = sc.nextInt(); base = Ai; if (Ai < now) { base = now; count += (now-Ai); } now = base; } System.out.println(count); } }
[ 7, 15, 13, 17, 6, 13, 41, 13, 20, 12, 13, 30, 41, 13, 4, 18, 13, 41, 13, 17, 41, 13, 4, 18, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 4, 18, 13, 14, 2, 13, 13, 30, 0, 13, 2, 13, 13, 30, 0, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 6, 7 ], [ 6, 8 ], [ 4, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 11, 17 ], [ 17, 18 ], [ 17, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 22, 23 ], [ 23, 24 ], [ 11, 25 ], [ 25, 26 ], [ 25, 27 ], [ 11, 28 ], [ 28, 29 ], [ 29, 30 ], [ 30, 31 ], [ 30, 32 ], [ 28, 33 ], [ 33, 34 ], [ 33, 35 ], [ 28, 36 ], [ 36, 37 ], [ 37, 38 ], [ 28, 39 ], [ 40, 40 ], [ 40, 41 ], [ 41, 42 ], [ 41, 43 ], [ 43, 44 ], [ 44, 45 ], [ 40, 46 ], [ 46, 47 ], [ 47, 48 ], [ 47, 49 ], [ 46, 50 ], [ 50, 51 ], [ 51, 52 ], [ 51, 53 ], [ 53, 54 ], [ 53, 55 ], [ 46, 56 ], [ 56, 57 ], [ 57, 58 ], [ 57, 59 ], [ 11, 60 ], [ 60, 61 ], [ 61, 62 ], [ 62, 63 ], [ 62, 64 ], [ 60, 65 ], [ 9, 66 ], [ 66, 67 ] ]
[ "import java.util.*;\n\nclass Main{\n static Scanner sc = new Scanner(System.in);\n public static void main(String args[]){\n int N=sc.nextInt();\n long n=0,p=sc.nextLong(),res=0;\n for(int i=1;i<N;i++){\n n=sc.nextLong();\n if(p>n){\n res+=p-n;\n }\n else{\n p=n;\n }\n }\n System.out.println(res);\n }\n}", "import java.util.*;", "util.*", "java", "class Main{\n static Scanner sc = new Scanner(System.in);\n public static void main(String args[]){\n int N=sc.nextInt();\n long n=0,p=sc.nextLong(),res=0;\n for(int i=1;i<N;i++){\n n=sc.nextLong();\n if(p>n){\n res+=p-n;\n }\n else{\n p=n;\n }\n }\n System.out.println(res);\n }\n}", "Main", "static Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "public static void main(String args[]){\n int N=sc.nextInt();\n long n=0,p=sc.nextLong(),res=0;\n for(int i=1;i<N;i++){\n n=sc.nextLong();\n if(p>n){\n res+=p-n;\n }\n else{\n p=n;\n }\n }\n System.out.println(res);\n }", "main", "{\n int N=sc.nextInt();\n long n=0,p=sc.nextLong(),res=0;\n for(int i=1;i<N;i++){\n n=sc.nextLong();\n if(p>n){\n res+=p-n;\n }\n else{\n p=n;\n }\n }\n System.out.println(res);\n }", "int N=sc.nextInt();", "N", "sc.nextInt()", "sc.nextInt", "sc", "long n=0", "n", "0", "p=sc.nextLong()", "p", "sc.nextLong()", "sc.nextLong", "sc", "res=0;", "res", "0", "for(int i=1;i<N;i++){\n n=sc.nextLong();\n if(p>n){\n res+=p-n;\n }\n else{\n p=n;\n }\n }", "int i=1;", "int i=1;", "i", "1", "i<N", "i", "N", "i++", "i++", "i", "{\n n=sc.nextLong();\n if(p>n){\n res+=p-n;\n }\n else{\n p=n;\n }\n }", "{\n n=sc.nextLong();\n if(p>n){\n res+=p-n;\n }\n else{\n p=n;\n }\n }", "n=sc.nextLong()", "n", "sc.nextLong()", "sc.nextLong", "sc", "if(p>n){\n res+=p-n;\n }\n else{\n p=n;\n }", "p>n", "p", "n", "{\n res+=p-n;\n }", "res+=p-n", "res", "p-n", "p", "n", "{\n p=n;\n }", "p=n", "p", "n", "System.out.println(res)", "System.out.println", "System.out", "System", "System.out", "res", "String args[]", "args" ]
import java.util.*; class Main{ static Scanner sc = new Scanner(System.in); public static void main(String args[]){ int N=sc.nextInt(); long n=0,p=sc.nextLong(),res=0; for(int i=1;i<N;i++){ n=sc.nextLong(); if(p>n){ res+=p-n; } else{ p=n; } } System.out.println(res); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 2, 13, 17, 1, 40, 13, 30, 30, 0, 13, 4, 18, 13, 14, 2, 13, 13, 30, 0, 13, 2, 13, 2, 13, 13, 30, 0, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 73, 5 ], [ 73, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 19, 20 ], [ 20, 21 ], [ 8, 22 ], [ 22, 23 ], [ 22, 24 ], [ 8, 25 ], [ 25, 26 ], [ 25, 27 ], [ 8, 28 ], [ 28, 29 ], [ 29, 30 ], [ 30, 31 ], [ 30, 32 ], [ 28, 33 ], [ 33, 34 ], [ 33, 35 ], [ 35, 36 ], [ 35, 37 ], [ 28, 38 ], [ 38, 39 ], [ 39, 40 ], [ 28, 41 ], [ 42, 42 ], [ 42, 43 ], [ 43, 44 ], [ 43, 45 ], [ 45, 46 ], [ 46, 47 ], [ 42, 48 ], [ 48, 49 ], [ 49, 50 ], [ 49, 51 ], [ 48, 52 ], [ 52, 53 ], [ 53, 54 ], [ 53, 55 ], [ 55, 56 ], [ 55, 57 ], [ 57, 58 ], [ 57, 59 ], [ 48, 60 ], [ 60, 61 ], [ 61, 62 ], [ 61, 63 ], [ 8, 64 ], [ 64, 65 ], [ 65, 66 ], [ 66, 67 ], [ 66, 68 ], [ 64, 69 ], [ 6, 70 ], [ 70, 71 ], [ 0, 72 ], [ 72, 73 ], [ 72, 74 ] ]
[ "import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\t\t\n\t\t\tint N = sc.nextInt();\n\t\t\tint check = sc.nextInt();\n\t\t\tint tall = 0;\n\t\t\tlong cnt = 0;\n\t\t\t\n\t\t\t\n\t\t\tfor(int i=0;i<N-1;i++) {\n\t\t\t\ttall = sc.nextInt();\n\t\t\t\tif( tall<check) {\n\t\t\t\t\tcnt=cnt+(check-tall);\n\t\t\t\t}else {\n\t\t\t\t\tcheck=tall;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\t\t\t\n\t\t\tSystem.out.println(cnt);\n\t}\t\n}", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\t\t\n\t\t\tint N = sc.nextInt();\n\t\t\tint check = sc.nextInt();\n\t\t\tint tall = 0;\n\t\t\tlong cnt = 0;\n\t\t\t\n\t\t\t\n\t\t\tfor(int i=0;i<N-1;i++) {\n\t\t\t\ttall = sc.nextInt();\n\t\t\t\tif( tall<check) {\n\t\t\t\t\tcnt=cnt+(check-tall);\n\t\t\t\t}else {\n\t\t\t\t\tcheck=tall;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\t\t\t\n\t\t\tSystem.out.println(cnt);\n\t}\t\n}", "Main", "public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\t\t\n\t\t\tint N = sc.nextInt();\n\t\t\tint check = sc.nextInt();\n\t\t\tint tall = 0;\n\t\t\tlong cnt = 0;\n\t\t\t\n\t\t\t\n\t\t\tfor(int i=0;i<N-1;i++) {\n\t\t\t\ttall = sc.nextInt();\n\t\t\t\tif( tall<check) {\n\t\t\t\t\tcnt=cnt+(check-tall);\n\t\t\t\t}else {\n\t\t\t\t\tcheck=tall;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\t\t\t\n\t\t\tSystem.out.println(cnt);\n\t}", "main", "{\n\t\tScanner sc = new Scanner(System.in);\n\t\t\t\n\t\t\tint N = sc.nextInt();\n\t\t\tint check = sc.nextInt();\n\t\t\tint tall = 0;\n\t\t\tlong cnt = 0;\n\t\t\t\n\t\t\t\n\t\t\tfor(int i=0;i<N-1;i++) {\n\t\t\t\ttall = sc.nextInt();\n\t\t\t\tif( tall<check) {\n\t\t\t\t\tcnt=cnt+(check-tall);\n\t\t\t\t}else {\n\t\t\t\t\tcheck=tall;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\t\t\t\n\t\t\tSystem.out.println(cnt);\n\t}", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int N = sc.nextInt();", "N", "sc.nextInt()", "sc.nextInt", "sc", "int check = sc.nextInt();", "check", "sc.nextInt()", "sc.nextInt", "sc", "int tall = 0;", "tall", "0", "long cnt = 0;", "cnt", "0", "for(int i=0;i<N-1;i++) {\n\t\t\t\ttall = sc.nextInt();\n\t\t\t\tif( tall<check) {\n\t\t\t\t\tcnt=cnt+(check-tall);\n\t\t\t\t}else {\n\t\t\t\t\tcheck=tall;\n\t\t\t\t}\n\t\t\t}", "int i=0;", "int i=0;", "i", "0", "i<N-1", "i", "N-1", "N", "1", "i++", "i++", "i", "{\n\t\t\t\ttall = sc.nextInt();\n\t\t\t\tif( tall<check) {\n\t\t\t\t\tcnt=cnt+(check-tall);\n\t\t\t\t}else {\n\t\t\t\t\tcheck=tall;\n\t\t\t\t}\n\t\t\t}", "{\n\t\t\t\ttall = sc.nextInt();\n\t\t\t\tif( tall<check) {\n\t\t\t\t\tcnt=cnt+(check-tall);\n\t\t\t\t}else {\n\t\t\t\t\tcheck=tall;\n\t\t\t\t}\n\t\t\t}", "tall = sc.nextInt()", "tall", "sc.nextInt()", "sc.nextInt", "sc", "if( tall<check) {\n\t\t\t\t\tcnt=cnt+(check-tall);\n\t\t\t\t}else {\n\t\t\t\t\tcheck=tall;\n\t\t\t\t}", "tall<check", "tall", "check", "{\n\t\t\t\t\tcnt=cnt+(check-tall);\n\t\t\t\t}", "cnt=cnt+(check-tall)", "cnt", "cnt+(check-tall)", "cnt", "(check-tall)", "check", "tall", "{\n\t\t\t\t\tcheck=tall;\n\t\t\t\t}", "check=tall", "check", "tall", "System.out.println(cnt)", "System.out.println", "System.out", "System", "System.out", "cnt", "String[] args", "args", "public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\t\t\n\t\t\tint N = sc.nextInt();\n\t\t\tint check = sc.nextInt();\n\t\t\tint tall = 0;\n\t\t\tlong cnt = 0;\n\t\t\t\n\t\t\t\n\t\t\tfor(int i=0;i<N-1;i++) {\n\t\t\t\ttall = sc.nextInt();\n\t\t\t\tif( tall<check) {\n\t\t\t\t\tcnt=cnt+(check-tall);\n\t\t\t\t}else {\n\t\t\t\t\tcheck=tall;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\t\t\t\n\t\t\tSystem.out.println(cnt);\n\t}\t\n}", "public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\t\t\n\t\t\tint N = sc.nextInt();\n\t\t\tint check = sc.nextInt();\n\t\t\tint tall = 0;\n\t\t\tlong cnt = 0;\n\t\t\t\n\t\t\t\n\t\t\tfor(int i=0;i<N-1;i++) {\n\t\t\t\ttall = sc.nextInt();\n\t\t\t\tif( tall<check) {\n\t\t\t\t\tcnt=cnt+(check-tall);\n\t\t\t\t}else {\n\t\t\t\t\tcheck=tall;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\t\t\t\n\t\t\tSystem.out.println(cnt);\n\t}\t\n}", "Main" ]
import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int check = sc.nextInt(); int tall = 0; long cnt = 0; for(int i=0;i<N-1;i++) { tall = sc.nextInt(); if( tall<check) { cnt=cnt+(check-tall); }else { check=tall; } } System.out.println(cnt); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 18, 13, 13, 18, 13, 2, 13, 17, 30, 0, 13, 2, 2, 13, 18, 13, 2, 13, 17, 18, 13, 13, 0, 18, 13, 13, 18, 13, 2, 13, 17, 4, 18, 18, 13, 13, 13, 23, 13, 6, 13, 41, 13, 41, 13, 12, 13, 30, 0, 13, 20, 0, 13, 17, 23, 13, 12, 13, 30, 42, 2, 2, 13, 17, 40, 4, 18, 13, 30, 38, 5, 13, 30, 37, 20, 30, 0, 13, 20, 29, 4, 18, 13, 4, 18, 13, 12, 13, 30, 42, 2, 2, 13, 17, 40, 4, 18, 13, 30, 38, 5, 13, 30, 37, 20, 30, 0, 13, 20, 29, 4, 18, 13, 4, 18, 13, 12, 13, 30, 42, 2, 2, 13, 17, 40, 4, 18, 13, 30, 38, 5, 13, 30, 37, 20, 30, 0, 13, 20, 29, 4, 18, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 206, 8 ], [ 206, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 11, 24 ], [ 24, 25 ], [ 25, 26 ], [ 26, 27 ], [ 26, 28 ], [ 24, 29 ], [ 29, 30 ], [ 29, 31 ], [ 24, 32 ], [ 32, 33 ], [ 33, 34 ], [ 24, 35 ], [ 36, 36 ], [ 36, 37 ], [ 37, 38 ], [ 38, 39 ], [ 38, 40 ], [ 37, 41 ], [ 41, 42 ], [ 42, 43 ], [ 11, 44 ], [ 44, 45 ], [ 44, 46 ], [ 11, 47 ], [ 47, 48 ], [ 48, 49 ], [ 49, 50 ], [ 49, 51 ], [ 47, 52 ], [ 52, 53 ], [ 52, 54 ], [ 47, 55 ], [ 55, 56 ], [ 56, 57 ], [ 47, 58 ], [ 59, 59 ], [ 59, 60 ], [ 60, 61 ], [ 61, 62 ], [ 62, 63 ], [ 62, 64 ], [ 61, 65 ], [ 65, 66 ], [ 65, 67 ], [ 67, 68 ], [ 67, 69 ], [ 60, 70 ], [ 70, 71 ], [ 71, 72 ], [ 71, 73 ], [ 73, 74 ], [ 74, 75 ], [ 74, 76 ], [ 76, 77 ], [ 76, 78 ], [ 78, 79 ], [ 78, 80 ], [ 73, 81 ], [ 81, 82 ], [ 81, 83 ], [ 70, 84 ], [ 84, 85 ], [ 85, 86 ], [ 85, 87 ], [ 84, 88 ], [ 88, 89 ], [ 88, 90 ], [ 90, 91 ], [ 90, 92 ], [ 11, 93 ], [ 93, 94 ], [ 94, 95 ], [ 95, 96 ], [ 95, 97 ], [ 93, 98 ], [ 9, 99 ], [ 99, 100 ], [ 0, 101 ], [ 101, 102 ], [ 101, 103 ], [ 103, 104 ], [ 101, 105 ], [ 105, 106 ], [ 101, 107 ], [ 107, 108 ], [ 107, 109 ], [ 109, 110 ], [ 110, 111 ], [ 110, 112 ], [ 109, 113 ], [ 113, 114 ], [ 113, 115 ], [ 107, 116 ], [ 116, 117 ], [ 101, 118 ], [ 118, 119 ], [ 118, 120 ], [ 120, 121 ], [ 121, 122 ], [ 122, 123 ], [ 123, 124 ], [ 123, 125 ], [ 122, 126 ], [ 126, 127 ], [ 127, 128 ], [ 128, 129 ], [ 121, 130 ], [ 130, 131 ], [ 131, 132 ], [ 132, 133 ], [ 132, 134 ], [ 134, 135 ], [ 135, 136 ], [ 131, 137 ], [ 137, 138 ], [ 138, 139 ], [ 138, 140 ], [ 120, 141 ], [ 141, 142 ], [ 142, 143 ], [ 143, 144 ], [ 142, 145 ], [ 145, 146 ], [ 146, 147 ], [ 101, 148 ], [ 148, 149 ], [ 148, 150 ], [ 150, 151 ], [ 151, 152 ], [ 152, 153 ], [ 153, 154 ], [ 153, 155 ], [ 152, 156 ], [ 156, 157 ], [ 157, 158 ], [ 158, 159 ], [ 151, 160 ], [ 160, 161 ], [ 161, 162 ], [ 162, 163 ], [ 162, 164 ], [ 164, 165 ], [ 165, 166 ], [ 161, 167 ], [ 167, 168 ], [ 168, 169 ], [ 168, 170 ], [ 150, 171 ], [ 171, 172 ], [ 172, 173 ], [ 173, 174 ], [ 172, 175 ], [ 175, 176 ], [ 176, 177 ], [ 101, 178 ], [ 178, 179 ], [ 178, 180 ], [ 180, 181 ], [ 181, 182 ], [ 182, 183 ], [ 183, 184 ], [ 183, 185 ], [ 182, 186 ], [ 186, 187 ], [ 187, 188 ], [ 188, 189 ], [ 181, 190 ], [ 190, 191 ], [ 191, 192 ], [ 192, 193 ], [ 192, 194 ], [ 194, 195 ], [ 195, 196 ], [ 191, 197 ], [ 197, 198 ], [ 198, 199 ], [ 198, 200 ], [ 180, 201 ], [ 201, 202 ], [ 202, 203 ], [ 203, 204 ], [ 0, 205 ], [ 205, 206 ], [ 205, 207 ] ]
[ "import java.io.*;\nimport java.util.*;\npublic class Main {\n public static void main(String args[]) {\n Scanner in=new Scanner(System.in);\n int n=in.nextInt();\n long a[]=new long[n];\n for(int i=0;i<n;i++){\n a[i]=in.nextLong();\n }\n long sum=0;\n for(int i=1;i<n;i++){\n if(a[i]<a[i-1]){\n sum=sum+a[i-1]-a[i];\n a[i]=a[i-1];\n }\n }\n System.out.println(sum);\n }\n}\nclass scan\n{\n public static BufferedReader reader;\n public static StringTokenizer token;\n\n scan(InputStream str)\n {\n reader=new BufferedReader(new InputStreamReader(str));\n token=null;\n }\n\n static int nextInt()\n {\n while(token==null||!token.hasMoreTokens())\n {\n try { token=new StringTokenizer(reader.readLine()); }\n catch(IOException e){ throw new RuntimeException(e); }\n }\n return Integer.parseInt(token.nextToken());\n }\n\n static long nextLong()\n {\n while(token==null||!token.hasMoreTokens())\n {\n try { token=new StringTokenizer(reader.readLine()); }\n catch(IOException e){ throw new RuntimeException(e); }\n }\n return Long.parseLong(token.nextToken());\n }\n\n static String next()\n {\n while(token==null||!token.hasMoreTokens())\n {\n try { token=new StringTokenizer(reader.readLine()); }\n catch(IOException e){ throw new RuntimeException(e); }\n }\n return token.nextToken();\n }\n\n}", "import java.io.*;", "io.*", "java", "import java.util.*;", "util.*", "java", "public class Main {\n public static void main(String args[]) {\n Scanner in=new Scanner(System.in);\n int n=in.nextInt();\n long a[]=new long[n];\n for(int i=0;i<n;i++){\n a[i]=in.nextLong();\n }\n long sum=0;\n for(int i=1;i<n;i++){\n if(a[i]<a[i-1]){\n sum=sum+a[i-1]-a[i];\n a[i]=a[i-1];\n }\n }\n System.out.println(sum);\n }\n}", "Main", "public static void main(String args[]) {\n Scanner in=new Scanner(System.in);\n int n=in.nextInt();\n long a[]=new long[n];\n for(int i=0;i<n;i++){\n a[i]=in.nextLong();\n }\n long sum=0;\n for(int i=1;i<n;i++){\n if(a[i]<a[i-1]){\n sum=sum+a[i-1]-a[i];\n a[i]=a[i-1];\n }\n }\n System.out.println(sum);\n }", "main", "{\n Scanner in=new Scanner(System.in);\n int n=in.nextInt();\n long a[]=new long[n];\n for(int i=0;i<n;i++){\n a[i]=in.nextLong();\n }\n long sum=0;\n for(int i=1;i<n;i++){\n if(a[i]<a[i-1]){\n sum=sum+a[i-1]-a[i];\n a[i]=a[i-1];\n }\n }\n System.out.println(sum);\n }", "Scanner in=new Scanner(System.in);", "in", "new Scanner(System.in)", "int n=in.nextInt();", "n", "in.nextInt()", "in.nextInt", "in", "long a[]=new long[n];", "a", "new long[n]", "n", "for(int i=0;i<n;i++){\n a[i]=in.nextLong();\n }", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\n a[i]=in.nextLong();\n }", "{\n a[i]=in.nextLong();\n }", "a[i]=in.nextLong()", "a[i]", "a", "i", "in.nextLong()", "in.nextLong", "in", "long sum=0;", "sum", "0", "for(int i=1;i<n;i++){\n if(a[i]<a[i-1]){\n sum=sum+a[i-1]-a[i];\n a[i]=a[i-1];\n }\n }", "int i=1;", "int i=1;", "i", "1", "i<n", "i", "n", "i++", "i++", "i", "{\n if(a[i]<a[i-1]){\n sum=sum+a[i-1]-a[i];\n a[i]=a[i-1];\n }\n }", "{\n if(a[i]<a[i-1]){\n sum=sum+a[i-1]-a[i];\n a[i]=a[i-1];\n }\n }", "if(a[i]<a[i-1]){\n sum=sum+a[i-1]-a[i];\n a[i]=a[i-1];\n }", "a[i]<a[i-1]", "a[i]", "a", "i", "a[i-1]", "a", "i-1", "i", "1", "{\n sum=sum+a[i-1]-a[i];\n a[i]=a[i-1];\n }", "sum=sum+a[i-1]-a[i]", "sum", "sum+a[i-1]-a[i]", "sum+a[i-1]", "sum", "a[i-1]", "a", "i-1", "i", "1", "a[i]", "a", "i", "a[i]=a[i-1]", "a[i]", "a", "i", "a[i-1]", "a", "i-1", "i", "1", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "String args[]", "args", "class scan\n{\n public static BufferedReader reader;\n public static StringTokenizer token;\n\n scan(InputStream str)\n {\n reader=new BufferedReader(new InputStreamReader(str));\n token=null;\n }\n\n static int nextInt()\n {\n while(token==null||!token.hasMoreTokens())\n {\n try { token=new StringTokenizer(reader.readLine()); }\n catch(IOException e){ throw new RuntimeException(e); }\n }\n return Integer.parseInt(token.nextToken());\n }\n\n static long nextLong()\n {\n while(token==null||!token.hasMoreTokens())\n {\n try { token=new StringTokenizer(reader.readLine()); }\n catch(IOException e){ throw new RuntimeException(e); }\n }\n return Long.parseLong(token.nextToken());\n }\n\n static String next()\n {\n while(token==null||!token.hasMoreTokens())\n {\n try { token=new StringTokenizer(reader.readLine()); }\n catch(IOException e){ throw new RuntimeException(e); }\n }\n return token.nextToken();\n }\n\n}", "scan", "public static BufferedReader reader;", "reader", "public static StringTokenizer token;", "token", "scan(InputStream str)\n {\n reader=new BufferedReader(new InputStreamReader(str));\n token=null;\n }", "scan", "{\n reader=new BufferedReader(new InputStreamReader(str));\n token=null;\n }", "reader=new BufferedReader(new InputStreamReader(str))", "reader", "new BufferedReader(new InputStreamReader(str))", "token=null", "token", "null", "InputStream str", "str", "static int nextInt()\n {\n while(token==null||!token.hasMoreTokens())\n {\n try { token=new StringTokenizer(reader.readLine()); }\n catch(IOException e){ throw new RuntimeException(e); }\n }\n return Integer.parseInt(token.nextToken());\n }", "nextInt", "{\n while(token==null||!token.hasMoreTokens())\n {\n try { token=new StringTokenizer(reader.readLine()); }\n catch(IOException e){ throw new RuntimeException(e); }\n }\n return Integer.parseInt(token.nextToken());\n }", "while(token==null||!token.hasMoreTokens())\n {\n try { token=new StringTokenizer(reader.readLine()); }\n catch(IOException e){ throw new RuntimeException(e); }\n }", "token==null||!token.hasMoreTokens()", "token==null", "token", "null", "!token.hasMoreTokens()", "token.hasMoreTokens()", "token.hasMoreTokens", "token", "{\n try { token=new StringTokenizer(reader.readLine()); }\n catch(IOException e){ throw new RuntimeException(e); }\n }", "try { token=new StringTokenizer(reader.readLine()); }\n catch(IOException e){ throw new RuntimeException(e); }", "catch(IOException e){ throw new RuntimeException(e); }", "IOException e", "{ throw new RuntimeException(e); }", "throw new RuntimeException(e);", "new RuntimeException(e)", "{ token=new StringTokenizer(reader.readLine()); }", "token=new StringTokenizer(reader.readLine())", "token", "new StringTokenizer(reader.readLine())", "return Integer.parseInt(token.nextToken());", "Integer.parseInt(token.nextToken())", "Integer.parseInt", "Integer", "token.nextToken()", "token.nextToken", "token", "static long nextLong()\n {\n while(token==null||!token.hasMoreTokens())\n {\n try { token=new StringTokenizer(reader.readLine()); }\n catch(IOException e){ throw new RuntimeException(e); }\n }\n return Long.parseLong(token.nextToken());\n }", "nextLong", "{\n while(token==null||!token.hasMoreTokens())\n {\n try { token=new StringTokenizer(reader.readLine()); }\n catch(IOException e){ throw new RuntimeException(e); }\n }\n return Long.parseLong(token.nextToken());\n }", "while(token==null||!token.hasMoreTokens())\n {\n try { token=new StringTokenizer(reader.readLine()); }\n catch(IOException e){ throw new RuntimeException(e); }\n }", "token==null||!token.hasMoreTokens()", "token==null", "token", "null", "!token.hasMoreTokens()", "token.hasMoreTokens()", "token.hasMoreTokens", "token", "{\n try { token=new StringTokenizer(reader.readLine()); }\n catch(IOException e){ throw new RuntimeException(e); }\n }", "try { token=new StringTokenizer(reader.readLine()); }\n catch(IOException e){ throw new RuntimeException(e); }", "catch(IOException e){ throw new RuntimeException(e); }", "IOException e", "{ throw new RuntimeException(e); }", "throw new RuntimeException(e);", "new RuntimeException(e)", "{ token=new StringTokenizer(reader.readLine()); }", "token=new StringTokenizer(reader.readLine())", "token", "new StringTokenizer(reader.readLine())", "return Long.parseLong(token.nextToken());", "Long.parseLong(token.nextToken())", "Long.parseLong", "Long", "token.nextToken()", "token.nextToken", "token", "static String next()\n {\n while(token==null||!token.hasMoreTokens())\n {\n try { token=new StringTokenizer(reader.readLine()); }\n catch(IOException e){ throw new RuntimeException(e); }\n }\n return token.nextToken();\n }", "next", "{\n while(token==null||!token.hasMoreTokens())\n {\n try { token=new StringTokenizer(reader.readLine()); }\n catch(IOException e){ throw new RuntimeException(e); }\n }\n return token.nextToken();\n }", "while(token==null||!token.hasMoreTokens())\n {\n try { token=new StringTokenizer(reader.readLine()); }\n catch(IOException e){ throw new RuntimeException(e); }\n }", "token==null||!token.hasMoreTokens()", "token==null", "token", "null", "!token.hasMoreTokens()", "token.hasMoreTokens()", "token.hasMoreTokens", "token", "{\n try { token=new StringTokenizer(reader.readLine()); }\n catch(IOException e){ throw new RuntimeException(e); }\n }", "try { token=new StringTokenizer(reader.readLine()); }\n catch(IOException e){ throw new RuntimeException(e); }", "catch(IOException e){ throw new RuntimeException(e); }", "IOException e", "{ throw new RuntimeException(e); }", "throw new RuntimeException(e);", "new RuntimeException(e)", "{ token=new StringTokenizer(reader.readLine()); }", "token=new StringTokenizer(reader.readLine())", "token", "new StringTokenizer(reader.readLine())", "return token.nextToken();", "token.nextToken()", "token.nextToken", "token", "public class Main {\n public static void main(String args[]) {\n Scanner in=new Scanner(System.in);\n int n=in.nextInt();\n long a[]=new long[n];\n for(int i=0;i<n;i++){\n a[i]=in.nextLong();\n }\n long sum=0;\n for(int i=1;i<n;i++){\n if(a[i]<a[i-1]){\n sum=sum+a[i-1]-a[i];\n a[i]=a[i-1];\n }\n }\n System.out.println(sum);\n }\n}", "public class Main {\n public static void main(String args[]) {\n Scanner in=new Scanner(System.in);\n int n=in.nextInt();\n long a[]=new long[n];\n for(int i=0;i<n;i++){\n a[i]=in.nextLong();\n }\n long sum=0;\n for(int i=1;i<n;i++){\n if(a[i]<a[i-1]){\n sum=sum+a[i-1]-a[i];\n a[i]=a[i-1];\n }\n }\n System.out.println(sum);\n }\n}", "Main" ]
import java.io.*; import java.util.*; public class Main { public static void main(String args[]) { Scanner in=new Scanner(System.in); int n=in.nextInt(); long a[]=new long[n]; for(int i=0;i<n;i++){ a[i]=in.nextLong(); } long sum=0; for(int i=1;i<n;i++){ if(a[i]<a[i-1]){ sum=sum+a[i-1]-a[i]; a[i]=a[i-1]; } } System.out.println(sum); } } class scan { public static BufferedReader reader; public static StringTokenizer token; scan(InputStream str) { reader=new BufferedReader(new InputStreamReader(str)); token=null; } static int nextInt() { while(token==null||!token.hasMoreTokens()) { try { token=new StringTokenizer(reader.readLine()); } catch(IOException e){ throw new RuntimeException(e); } } return Integer.parseInt(token.nextToken()); } static long nextLong() { while(token==null||!token.hasMoreTokens()) { try { token=new StringTokenizer(reader.readLine()); } catch(IOException e){ throw new RuntimeException(e); } } return Long.parseLong(token.nextToken()); } static String next() { while(token==null||!token.hasMoreTokens()) { try { token=new StringTokenizer(reader.readLine()); } catch(IOException e){ throw new RuntimeException(e); } } return token.nextToken(); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 17, 41, 13, 4, 18, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 41, 13, 4, 18, 13, 0, 13, 4, 18, 13, 13, 13, 0, 13, 2, 13, 13, 4, 18, 18, 13, 13, 13, 4, 18, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 67, 5 ], [ 67, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 8, 20 ], [ 20, 21 ], [ 20, 22 ], [ 22, 23 ], [ 23, 24 ], [ 8, 25 ], [ 25, 26 ], [ 26, 27 ], [ 27, 28 ], [ 27, 29 ], [ 25, 30 ], [ 30, 31 ], [ 30, 32 ], [ 25, 33 ], [ 33, 34 ], [ 34, 35 ], [ 25, 36 ], [ 37, 37 ], [ 37, 38 ], [ 38, 39 ], [ 38, 40 ], [ 40, 41 ], [ 41, 42 ], [ 37, 43 ], [ 43, 44 ], [ 43, 45 ], [ 45, 46 ], [ 46, 47 ], [ 45, 48 ], [ 45, 49 ], [ 37, 50 ], [ 50, 51 ], [ 50, 52 ], [ 52, 53 ], [ 52, 54 ], [ 8, 55 ], [ 55, 56 ], [ 56, 57 ], [ 57, 58 ], [ 57, 59 ], [ 55, 60 ], [ 8, 61 ], [ 61, 62 ], [ 62, 63 ], [ 6, 64 ], [ 64, 65 ], [ 0, 66 ], [ 66, 67 ], [ 66, 68 ] ]
[ "import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\t\n\t\tlong sumStep = 0;\n\t\tint maxA = sc.nextInt();\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tint a = sc.nextInt();\n\t\t\tmaxA = Math.max(maxA, a);\n\t\t\tsumStep += maxA - a;\n\t\t}\n\t\t\n\t\tSystem.out.println(sumStep);\n\t\t\n\t\tsc.close();\n\t}\n}\n\n", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\t\n\t\tlong sumStep = 0;\n\t\tint maxA = sc.nextInt();\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tint a = sc.nextInt();\n\t\t\tmaxA = Math.max(maxA, a);\n\t\t\tsumStep += maxA - a;\n\t\t}\n\t\t\n\t\tSystem.out.println(sumStep);\n\t\t\n\t\tsc.close();\n\t}\n}", "Main", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\t\n\t\tlong sumStep = 0;\n\t\tint maxA = sc.nextInt();\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tint a = sc.nextInt();\n\t\t\tmaxA = Math.max(maxA, a);\n\t\t\tsumStep += maxA - a;\n\t\t}\n\t\t\n\t\tSystem.out.println(sumStep);\n\t\t\n\t\tsc.close();\n\t}", "main", "{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\t\n\t\tlong sumStep = 0;\n\t\tint maxA = sc.nextInt();\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tint a = sc.nextInt();\n\t\t\tmaxA = Math.max(maxA, a);\n\t\t\tsumStep += maxA - a;\n\t\t}\n\t\t\n\t\tSystem.out.println(sumStep);\n\t\t\n\t\tsc.close();\n\t}", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "long sumStep = 0;", "sumStep", "0", "int maxA = sc.nextInt();", "maxA", "sc.nextInt()", "sc.nextInt", "sc", "for (int i = 1; i < n; i++) {\n\t\t\tint a = sc.nextInt();\n\t\t\tmaxA = Math.max(maxA, a);\n\t\t\tsumStep += maxA - a;\n\t\t}", "int i = 1;", "int i = 1;", "i", "1", "i < n", "i", "n", "i++", "i++", "i", "{\n\t\t\tint a = sc.nextInt();\n\t\t\tmaxA = Math.max(maxA, a);\n\t\t\tsumStep += maxA - a;\n\t\t}", "{\n\t\t\tint a = sc.nextInt();\n\t\t\tmaxA = Math.max(maxA, a);\n\t\t\tsumStep += maxA - a;\n\t\t}", "int a = sc.nextInt();", "a", "sc.nextInt()", "sc.nextInt", "sc", "maxA = Math.max(maxA, a)", "maxA", "Math.max(maxA, a)", "Math.max", "Math", "maxA", "a", "sumStep += maxA - a", "sumStep", "maxA - a", "maxA", "a", "System.out.println(sumStep)", "System.out.println", "System.out", "System", "System.out", "sumStep", "sc.close()", "sc.close", "sc", "String[] args", "args", "public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\t\n\t\tlong sumStep = 0;\n\t\tint maxA = sc.nextInt();\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tint a = sc.nextInt();\n\t\t\tmaxA = Math.max(maxA, a);\n\t\t\tsumStep += maxA - a;\n\t\t}\n\t\t\n\t\tSystem.out.println(sumStep);\n\t\t\n\t\tsc.close();\n\t}\n}", "public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\t\n\t\tlong sumStep = 0;\n\t\tint maxA = sc.nextInt();\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tint a = sc.nextInt();\n\t\t\tmaxA = Math.max(maxA, a);\n\t\t\tsumStep += maxA - a;\n\t\t}\n\t\t\n\t\tSystem.out.println(sumStep);\n\t\t\n\t\tsc.close();\n\t}\n}", "Main" ]
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long sumStep = 0; int maxA = sc.nextInt(); for (int i = 1; i < n; i++) { int a = sc.nextInt(); maxA = Math.max(maxA, a); sumStep += maxA - a; } System.out.println(sumStep); sc.close(); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 20, 41, 13, 17, 42, 2, 40, 13, 17, 30, 41, 13, 4, 18, 13, 41, 13, 20, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 18, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 18, 13, 2, 13, 17, 18, 13, 13, 30, 0, 13, 2, 18, 13, 2, 13, 17, 18, 13, 13, 0, 18, 13, 13, 2, 18, 13, 2, 13, 17, 18, 13, 13, 4, 18, 13, 13, 4, 18, 13, 23, 13, 6, 13, 41, 13, 41, 13, 12, 13, 30, 0, 13, 20, 12, 13, 30, 42, 2, 2, 13, 17, 40, 4, 18, 13, 30, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 20, 29, 4, 18, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 41, 13, 17, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 4, 18, 13, 29, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 13, 14 ], [ 13, 15 ], [ 0, 16 ], [ 16, 17 ], [ 16, 18 ], [ 0, 19 ], [ 19, 20 ], [ 19, 21 ], [ 0, 22 ], [ 219, 23 ], [ 219, 24 ], [ 24, 25 ], [ 24, 26 ], [ 26, 27 ], [ 27, 28 ], [ 27, 29 ], [ 26, 30 ], [ 30, 31 ], [ 30, 32 ], [ 26, 33 ], [ 33, 34 ], [ 33, 35 ], [ 26, 36 ], [ 36, 37 ], [ 37, 38 ], [ 38, 39 ], [ 37, 40 ], [ 36, 41 ], [ 41, 42 ], [ 42, 43 ], [ 42, 44 ], [ 44, 45 ], [ 45, 46 ], [ 41, 47 ], [ 47, 48 ], [ 47, 49 ], [ 41, 51 ], [ 51, 52 ], [ 51, 53 ], [ 41, 54 ], [ 54, 55 ], [ 55, 56 ], [ 56, 57 ], [ 56, 58 ], [ 54, 59 ], [ 59, 60 ], [ 59, 61 ], [ 54, 62 ], [ 62, 63 ], [ 63, 64 ], [ 54, 65 ], [ 65, 66 ], [ 66, 67 ], [ 67, 68 ], [ 67, 69 ], [ 66, 70 ], [ 70, 71 ], [ 71, 72 ], [ 41, 73 ], [ 73, 74 ], [ 74, 75 ], [ 75, 76 ], [ 75, 77 ], [ 73, 78 ], [ 78, 79 ], [ 78, 80 ], [ 73, 81 ], [ 81, 82 ], [ 82, 83 ], [ 73, 84 ], [ 84, 85 ], [ 85, 86 ], [ 86, 87 ], [ 87, 88 ], [ 88, 89 ], [ 88, 90 ], [ 90, 91 ], [ 90, 92 ], [ 87, 93 ], [ 93, 94 ], [ 93, 95 ], [ 86, 96 ], [ 96, 97 ], [ 97, 98 ], [ 97, 99 ], [ 99, 100 ], [ 100, 101 ], [ 100, 102 ], [ 102, 103 ], [ 102, 104 ], [ 99, 105 ], [ 105, 106 ], [ 105, 107 ], [ 96, 108 ], [ 108, 109 ], [ 109, 110 ], [ 109, 111 ], [ 108, 112 ], [ 112, 113 ], [ 113, 114 ], [ 113, 115 ], [ 115, 116 ], [ 115, 117 ], [ 112, 118 ], [ 118, 119 ], [ 118, 120 ], [ 41, 121 ], [ 121, 122 ], [ 122, 123 ], [ 121, 124 ], [ 26, 125 ], [ 125, 126 ], [ 126, 127 ], [ 24, 128 ], [ 128, 129 ], [ 219, 130 ], [ 130, 131 ], [ 130, 132 ], [ 132, 133 ], [ 130, 134 ], [ 134, 135 ], [ 130, 136 ], [ 136, 137 ], [ 136, 138 ], [ 138, 139 ], [ 139, 140 ], [ 139, 141 ], [ 130, 142 ], [ 142, 143 ], [ 142, 144 ], [ 144, 145 ], [ 145, 146 ], [ 146, 147 ], [ 147, 148 ], [ 147, 149 ], [ 146, 150 ], [ 150, 151 ], [ 151, 152 ], [ 152, 153 ], [ 145, 154 ], [ 154, 155 ], [ 155, 156 ], [ 156, 157 ], [ 156, 158 ], [ 158, 159 ], [ 159, 160 ], [ 160, 161 ], [ 155, 162 ], [ 162, 163 ], [ 163, 164 ], [ 163, 165 ], [ 144, 166 ], [ 166, 167 ], [ 167, 168 ], [ 168, 169 ], [ 130, 170 ], [ 170, 171 ], [ 170, 172 ], [ 172, 173 ], [ 173, 174 ], [ 174, 175 ], [ 175, 176 ], [ 174, 177 ], [ 177, 178 ], [ 130, 179 ], [ 179, 180 ], [ 179, 181 ], [ 181, 182 ], [ 182, 183 ], [ 183, 184 ], [ 184, 185 ], [ 183, 186 ], [ 186, 187 ], [ 130, 188 ], [ 188, 189 ], [ 188, 190 ], [ 190, 191 ], [ 191, 192 ], [ 192, 193 ], [ 193, 194 ], [ 192, 195 ], [ 195, 196 ], [ 130, 197 ], [ 197, 198 ], [ 197, 199 ], [ 199, 200 ], [ 200, 201 ], [ 200, 202 ], [ 199, 203 ], [ 203, 204 ], [ 204, 205 ], [ 204, 206 ], [ 206, 207 ], [ 207, 208 ], [ 208, 209 ], [ 203, 210 ], [ 210, 211 ], [ 211, 212 ], [ 211, 213 ], [ 213, 214 ], [ 214, 215 ], [ 199, 216 ], [ 216, 217 ], [ 0, 218 ], [ 218, 219 ], [ 218, 220 ] ]
[ "import java.io.BufferedReader; \nimport java.io.*;\nimport java.io.InputStreamReader; \nimport java.util.Scanner; \nimport java.util.StringTokenizer; \nimport java.util.*;\nimport java.math.*;\npublic class Main \n{ \n static class FastReader \n { \n BufferedReader br; \n StringTokenizer st; \n \n public FastReader()\n { \n br = new BufferedReader(new\n InputStreamReader(System.in)); \n } \n \n String next()\n { \n while (st == null || !st.hasMoreElements()) \n { \n try\n { \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n } \n return st.nextToken(); \n } \n \n int nextInt() \n { \n return Integer.parseInt(next()); \n } \n \n long nextLong() \n { \n return Long.parseLong(next()); \n } \n \n double nextDouble() \n { \n return Double.parseDouble(next()); \n } \n \n String nextLine() \n { \n String str = \"\"; \n try\n { \n str = br.readLine();\n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n return str; \n } \n } \n public static void main(String args[]) throws Exception\n {\n FastReader sc=new FastReader();\n PrintWriter pw=new PrintWriter(System.out);\n int t=1;//sc.nextInt();\n while(t-->0)\n {\n int n=sc.nextInt();long a[]=new long[n];long ans=0;\n for(int i=0;i<n;i++) a[i]=sc.nextLong();\n for(int i=1;i<n;i++)\n {\n if(a[i-1]>a[i]) {ans+=(a[i-1]-a[i]);a[i]+=(a[i-1]-a[i]);}\n }//for(int w:a) pw.println(w);\n pw.println(ans);\n }\n pw.close();\n }\n}\n ", "import java.io.BufferedReader;", "BufferedReader", "java.io", "import java.io.*;", "io.*", "java", "import java.io.InputStreamReader;", "InputStreamReader", "java.io", "import java.util.Scanner;", "Scanner", "java.util", "import java.util.StringTokenizer;", "StringTokenizer", "java.util", "import java.util.*;", "util.*", "java", "import java.math.*;", "math.*", "java", "public class Main \n{ \n static class FastReader \n { \n BufferedReader br; \n StringTokenizer st; \n \n public FastReader()\n { \n br = new BufferedReader(new\n InputStreamReader(System.in)); \n } \n \n String next()\n { \n while (st == null || !st.hasMoreElements()) \n { \n try\n { \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n } \n return st.nextToken(); \n } \n \n int nextInt() \n { \n return Integer.parseInt(next()); \n } \n \n long nextLong() \n { \n return Long.parseLong(next()); \n } \n \n double nextDouble() \n { \n return Double.parseDouble(next()); \n } \n \n String nextLine() \n { \n String str = \"\"; \n try\n { \n str = br.readLine();\n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n return str; \n } \n } \n public static void main(String args[]) throws Exception\n {\n FastReader sc=new FastReader();\n PrintWriter pw=new PrintWriter(System.out);\n int t=1;//sc.nextInt();\n while(t-->0)\n {\n int n=sc.nextInt();long a[]=new long[n];long ans=0;\n for(int i=0;i<n;i++) a[i]=sc.nextLong();\n for(int i=1;i<n;i++)\n {\n if(a[i-1]>a[i]) {ans+=(a[i-1]-a[i]);a[i]+=(a[i-1]-a[i]);}\n }//for(int w:a) pw.println(w);\n pw.println(ans);\n }\n pw.close();\n }\n}", "Main", "public static void main(String args[]) throws Exception\n {\n FastReader sc=new FastReader();\n PrintWriter pw=new PrintWriter(System.out);\n int t=1;//sc.nextInt();\n while(t-->0)\n {\n int n=sc.nextInt();long a[]=new long[n];long ans=0;\n for(int i=0;i<n;i++) a[i]=sc.nextLong();\n for(int i=1;i<n;i++)\n {\n if(a[i-1]>a[i]) {ans+=(a[i-1]-a[i]);a[i]+=(a[i-1]-a[i]);}\n }//for(int w:a) pw.println(w);\n pw.println(ans);\n }\n pw.close();\n }", "main", "{\n FastReader sc=new FastReader();\n PrintWriter pw=new PrintWriter(System.out);\n int t=1;//sc.nextInt();\n while(t-->0)\n {\n int n=sc.nextInt();long a[]=new long[n];long ans=0;\n for(int i=0;i<n;i++) a[i]=sc.nextLong();\n for(int i=1;i<n;i++)\n {\n if(a[i-1]>a[i]) {ans+=(a[i-1]-a[i]);a[i]+=(a[i-1]-a[i]);}\n }//for(int w:a) pw.println(w);\n pw.println(ans);\n }\n pw.close();\n }", "FastReader sc=new FastReader();", "sc", "new FastReader()", "PrintWriter pw=new PrintWriter(System.out);", "pw", "new PrintWriter(System.out)", "int t=1;", "t", "1", "while(t-->0)\n {\n int n=sc.nextInt();long a[]=new long[n];long ans=0;\n for(int i=0;i<n;i++) a[i]=sc.nextLong();\n for(int i=1;i<n;i++)\n {\n if(a[i-1]>a[i]) {ans+=(a[i-1]-a[i]);a[i]+=(a[i-1]-a[i]);}\n }//for(int w:a) pw.println(w);\n pw.println(ans);\n }", "t-->0", "t--", "t", "0", "{\n int n=sc.nextInt();long a[]=new long[n];long ans=0;\n for(int i=0;i<n;i++) a[i]=sc.nextLong();\n for(int i=1;i<n;i++)\n {\n if(a[i-1]>a[i]) {ans+=(a[i-1]-a[i]);a[i]+=(a[i-1]-a[i]);}\n }//for(int w:a) pw.println(w);\n pw.println(ans);\n }", "int n=sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "long a[]=new long[n];", "a", "new long[n]", "n", "long ans=0;", "ans", "0", "for(int i=0;i<n;i++) a[i]=sc.nextLong();", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "a[i]=sc.nextLong();", "a[i]=sc.nextLong()", "a[i]", "a", "i", "sc.nextLong()", "sc.nextLong", "sc", "for(int i=1;i<n;i++)\n {\n if(a[i-1]>a[i]) {ans+=(a[i-1]-a[i]);a[i]+=(a[i-1]-a[i]);}\n }//for(int w:a) pw.println(w);", "int i=1;", "int i=1;", "i", "1", "i<n", "i", "n", "i++", "i++", "i", "{\n if(a[i-1]>a[i]) {ans+=(a[i-1]-a[i]);a[i]+=(a[i-1]-a[i]);}\n }//for(int w:a) pw.println(w);", "{\n if(a[i-1]>a[i]) {ans+=(a[i-1]-a[i]);a[i]+=(a[i-1]-a[i]);}\n }", "if(a[i-1]>a[i]) {ans+=(a[i-1]-a[i]);a[i]+=(a[i-1]-a[i]);}", "a[i-1]>a[i]", "a[i-1]", "a", "i-1", "i", "1", "a[i]", "a", "i", "{ans+=(a[i-1]-a[i]);a[i]+=(a[i-1]-a[i]);}", "ans+=(a[i-1]-a[i])", "ans", "(a[i-1]-a[i])", "a[i-1]", "a", "i-1", "i", "1", "a[i]", "a", "i", "a[i]+=(a[i-1]-a[i])", "a[i]", "a", "i", "(a[i-1]-a[i])", "a[i-1]", "a", "i-1", "i", "1", "a[i]", "a", "i", "pw.println(ans)", "pw.println", "pw", "ans", "pw.close()", "pw.close", "pw", "String args[]", "args", "static class FastReader \n { \n BufferedReader br; \n StringTokenizer st; \n \n public FastReader()\n { \n br = new BufferedReader(new\n InputStreamReader(System.in)); \n } \n \n String next()\n { \n while (st == null || !st.hasMoreElements()) \n { \n try\n { \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n } \n return st.nextToken(); \n } \n \n int nextInt() \n { \n return Integer.parseInt(next()); \n } \n \n long nextLong() \n { \n return Long.parseLong(next()); \n } \n \n double nextDouble() \n { \n return Double.parseDouble(next()); \n } \n \n String nextLine() \n { \n String str = \"\"; \n try\n { \n str = br.readLine();\n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n return str; \n } \n }", "FastReader", "BufferedReader br;", "br", "StringTokenizer st;", "st", "public FastReader()\n { \n br = new BufferedReader(new\n InputStreamReader(System.in)); \n }", "FastReader", "{ \n br = new BufferedReader(new\n InputStreamReader(System.in)); \n }", "br = new BufferedReader(new\n InputStreamReader(System.in))", "br", "new BufferedReader(new\n InputStreamReader(System.in))", "String next()\n { \n while (st == null || !st.hasMoreElements()) \n { \n try\n { \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n } \n return st.nextToken(); \n }", "next", "{ \n while (st == null || !st.hasMoreElements()) \n { \n try\n { \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n } \n return st.nextToken(); \n }", "while (st == null || !st.hasMoreElements()) \n { \n try\n { \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n }", "st == null || !st.hasMoreElements()", "st == null", "st", "null", "!st.hasMoreElements()", "st.hasMoreElements()", "st.hasMoreElements", "st", "{ \n try\n { \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n }", "try\n { \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n }", "catch (IOException e) \n { \n e.printStackTrace(); \n }", "IOException e", "{ \n e.printStackTrace(); \n }", "e.printStackTrace()", "e.printStackTrace", "e", "{ \n st = new StringTokenizer(br.readLine()); \n }", "st = new StringTokenizer(br.readLine())", "st", "new StringTokenizer(br.readLine())", "return st.nextToken();", "st.nextToken()", "st.nextToken", "st", "int nextInt() \n { \n return Integer.parseInt(next()); \n }", "nextInt", "{ \n return Integer.parseInt(next()); \n }", "return Integer.parseInt(next());", "Integer.parseInt(next())", "Integer.parseInt", "Integer", "next()", "next", "long nextLong() \n { \n return Long.parseLong(next()); \n }", "nextLong", "{ \n return Long.parseLong(next()); \n }", "return Long.parseLong(next());", "Long.parseLong(next())", "Long.parseLong", "Long", "next()", "next", "double nextDouble() \n { \n return Double.parseDouble(next()); \n }", "nextDouble", "{ \n return Double.parseDouble(next()); \n }", "return Double.parseDouble(next());", "Double.parseDouble(next())", "Double.parseDouble", "Double", "next()", "next", "String nextLine() \n { \n String str = \"\"; \n try\n { \n str = br.readLine();\n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n return str; \n }", "nextLine", "{ \n String str = \"\"; \n try\n { \n str = br.readLine();\n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n return str; \n }", "String str = \"\";", "str", "\"\"", "try\n { \n str = br.readLine();\n } \n catch (IOException e) \n { \n e.printStackTrace(); \n }", "catch (IOException e) \n { \n e.printStackTrace(); \n }", "IOException e", "{ \n e.printStackTrace(); \n }", "e.printStackTrace()", "e.printStackTrace", "e", "{ \n str = br.readLine();\n }", "str = br.readLine()", "str", "br.readLine()", "br.readLine", "br", "return str;", "str", "public class Main \n{ \n static class FastReader \n { \n BufferedReader br; \n StringTokenizer st; \n \n public FastReader()\n { \n br = new BufferedReader(new\n InputStreamReader(System.in)); \n } \n \n String next()\n { \n while (st == null || !st.hasMoreElements()) \n { \n try\n { \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n } \n return st.nextToken(); \n } \n \n int nextInt() \n { \n return Integer.parseInt(next()); \n } \n \n long nextLong() \n { \n return Long.parseLong(next()); \n } \n \n double nextDouble() \n { \n return Double.parseDouble(next()); \n } \n \n String nextLine() \n { \n String str = \"\"; \n try\n { \n str = br.readLine();\n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n return str; \n } \n } \n public static void main(String args[]) throws Exception\n {\n FastReader sc=new FastReader();\n PrintWriter pw=new PrintWriter(System.out);\n int t=1;//sc.nextInt();\n while(t-->0)\n {\n int n=sc.nextInt();long a[]=new long[n];long ans=0;\n for(int i=0;i<n;i++) a[i]=sc.nextLong();\n for(int i=1;i<n;i++)\n {\n if(a[i-1]>a[i]) {ans+=(a[i-1]-a[i]);a[i]+=(a[i-1]-a[i]);}\n }//for(int w:a) pw.println(w);\n pw.println(ans);\n }\n pw.close();\n }\n}", "public class Main \n{ \n static class FastReader \n { \n BufferedReader br; \n StringTokenizer st; \n \n public FastReader()\n { \n br = new BufferedReader(new\n InputStreamReader(System.in)); \n } \n \n String next()\n { \n while (st == null || !st.hasMoreElements()) \n { \n try\n { \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n } \n return st.nextToken(); \n } \n \n int nextInt() \n { \n return Integer.parseInt(next()); \n } \n \n long nextLong() \n { \n return Long.parseLong(next()); \n } \n \n double nextDouble() \n { \n return Double.parseDouble(next()); \n } \n \n String nextLine() \n { \n String str = \"\"; \n try\n { \n str = br.readLine();\n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n return str; \n } \n } \n public static void main(String args[]) throws Exception\n {\n FastReader sc=new FastReader();\n PrintWriter pw=new PrintWriter(System.out);\n int t=1;//sc.nextInt();\n while(t-->0)\n {\n int n=sc.nextInt();long a[]=new long[n];long ans=0;\n for(int i=0;i<n;i++) a[i]=sc.nextLong();\n for(int i=1;i<n;i++)\n {\n if(a[i-1]>a[i]) {ans+=(a[i-1]-a[i]);a[i]+=(a[i-1]-a[i]);}\n }//for(int w:a) pw.println(w);\n pw.println(ans);\n }\n pw.close();\n }\n}", "Main" ]
import java.io.BufferedReader; import java.io.*; import java.io.InputStreamReader; import java.util.Scanner; import java.util.StringTokenizer; import java.util.*; import java.math.*; public class Main { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while (st == null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } String nextLine() { String str = ""; try { str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } } public static void main(String args[]) throws Exception { FastReader sc=new FastReader(); PrintWriter pw=new PrintWriter(System.out); int t=1;//sc.nextInt(); while(t-->0) { int n=sc.nextInt();long a[]=new long[n];long ans=0; for(int i=0;i<n;i++) a[i]=sc.nextLong(); for(int i=1;i<n;i++) { if(a[i-1]>a[i]) {ans+=(a[i-1]-a[i]);a[i]+=(a[i-1]-a[i]);} }//for(int w:a) pw.println(w); pw.println(ans); } pw.close(); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 17, 41, 13, 17, 42, 2, 40, 13, 17, 30, 41, 13, 4, 18, 13, 14, 2, 13, 13, 30, 0, 13, 2, 13, 13, 0, 13, 4, 18, 13, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 6, 13, 41, 13, 41, 13, 12, 13, 30, 0, 13, 20, 12, 13, 30, 42, 2, 2, 13, 17, 40, 4, 18, 13, 30, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 20, 29, 4, 18, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 41, 13, 17, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 4, 18, 13, 29, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 151, 8 ], [ 151, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 11, 23 ], [ 23, 24 ], [ 23, 25 ], [ 11, 26 ], [ 26, 27 ], [ 27, 28 ], [ 28, 29 ], [ 27, 30 ], [ 26, 31 ], [ 31, 32 ], [ 32, 33 ], [ 32, 34 ], [ 34, 35 ], [ 35, 36 ], [ 31, 37 ], [ 37, 38 ], [ 38, 39 ], [ 38, 40 ], [ 37, 41 ], [ 41, 42 ], [ 42, 43 ], [ 42, 44 ], [ 44, 45 ], [ 44, 46 ], [ 31, 47 ], [ 47, 48 ], [ 47, 49 ], [ 49, 50 ], [ 50, 51 ], [ 49, 52 ], [ 49, 53 ], [ 11, 54 ], [ 54, 55 ], [ 55, 56 ], [ 56, 57 ], [ 56, 58 ], [ 54, 59 ], [ 9, 60 ], [ 60, 61 ], [ 151, 62 ], [ 62, 63 ], [ 62, 64 ], [ 64, 65 ], [ 62, 66 ], [ 66, 67 ], [ 62, 68 ], [ 68, 69 ], [ 68, 70 ], [ 70, 71 ], [ 71, 72 ], [ 71, 73 ], [ 62, 74 ], [ 74, 75 ], [ 74, 76 ], [ 76, 77 ], [ 77, 78 ], [ 78, 79 ], [ 79, 80 ], [ 79, 81 ], [ 78, 82 ], [ 82, 83 ], [ 83, 84 ], [ 84, 85 ], [ 77, 86 ], [ 86, 87 ], [ 87, 88 ], [ 88, 89 ], [ 88, 90 ], [ 90, 91 ], [ 91, 92 ], [ 92, 93 ], [ 87, 94 ], [ 94, 95 ], [ 95, 96 ], [ 95, 97 ], [ 76, 98 ], [ 98, 99 ], [ 99, 100 ], [ 100, 101 ], [ 62, 102 ], [ 102, 103 ], [ 102, 104 ], [ 104, 105 ], [ 105, 106 ], [ 106, 107 ], [ 107, 108 ], [ 106, 109 ], [ 109, 110 ], [ 62, 111 ], [ 111, 112 ], [ 111, 113 ], [ 113, 114 ], [ 114, 115 ], [ 115, 116 ], [ 116, 117 ], [ 115, 118 ], [ 118, 119 ], [ 62, 120 ], [ 120, 121 ], [ 120, 122 ], [ 122, 123 ], [ 123, 124 ], [ 124, 125 ], [ 125, 126 ], [ 124, 127 ], [ 127, 128 ], [ 62, 129 ], [ 129, 130 ], [ 129, 131 ], [ 131, 132 ], [ 132, 133 ], [ 132, 134 ], [ 131, 135 ], [ 135, 136 ], [ 136, 137 ], [ 136, 138 ], [ 138, 139 ], [ 139, 140 ], [ 140, 141 ], [ 135, 142 ], [ 142, 143 ], [ 143, 144 ], [ 143, 145 ], [ 145, 146 ], [ 146, 147 ], [ 131, 148 ], [ 148, 149 ], [ 0, 150 ], [ 150, 151 ], [ 150, 152 ] ]
[ "import java.io.*;\nimport java.util.*;\n\npublic class Main {\n public static void main(final String[] args) {\n final FastReader s=new FastReader();\n int n = s.nextInt();\n int last = 0;\n long sum = 0;\n while (n-- > 0)\n {\n int x = s.nextInt();\n if(x<last) {\n sum+= last-x;\n }\n last = Math.max(last, x);\n }\n System.out.println(sum);\n }\n\n static class FastReader\n {\n BufferedReader br;\n StringTokenizer st;\n public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); }\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try { st = new StringTokenizer(br.readLine()); }\n catch (final IOException e) { e.printStackTrace(); }\n }\n return st.nextToken();\n }\n int nextInt() { return Integer.parseInt(next()); }\n long nextLong() { return Long.parseLong(next()); }\n double nextDouble() { return Double.parseDouble(next()); }\n String nextLine() {\n String str = \"\";\n try { str = br.readLine(); }\n catch (final IOException e) { e.printStackTrace(); }\n return str;\n }\n }\n}", "import java.io.*;", "io.*", "java", "import java.util.*;", "util.*", "java", "public class Main {\n public static void main(final String[] args) {\n final FastReader s=new FastReader();\n int n = s.nextInt();\n int last = 0;\n long sum = 0;\n while (n-- > 0)\n {\n int x = s.nextInt();\n if(x<last) {\n sum+= last-x;\n }\n last = Math.max(last, x);\n }\n System.out.println(sum);\n }\n\n static class FastReader\n {\n BufferedReader br;\n StringTokenizer st;\n public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); }\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try { st = new StringTokenizer(br.readLine()); }\n catch (final IOException e) { e.printStackTrace(); }\n }\n return st.nextToken();\n }\n int nextInt() { return Integer.parseInt(next()); }\n long nextLong() { return Long.parseLong(next()); }\n double nextDouble() { return Double.parseDouble(next()); }\n String nextLine() {\n String str = \"\";\n try { str = br.readLine(); }\n catch (final IOException e) { e.printStackTrace(); }\n return str;\n }\n }\n}", "Main", "public static void main(final String[] args) {\n final FastReader s=new FastReader();\n int n = s.nextInt();\n int last = 0;\n long sum = 0;\n while (n-- > 0)\n {\n int x = s.nextInt();\n if(x<last) {\n sum+= last-x;\n }\n last = Math.max(last, x);\n }\n System.out.println(sum);\n }", "main", "{\n final FastReader s=new FastReader();\n int n = s.nextInt();\n int last = 0;\n long sum = 0;\n while (n-- > 0)\n {\n int x = s.nextInt();\n if(x<last) {\n sum+= last-x;\n }\n last = Math.max(last, x);\n }\n System.out.println(sum);\n }", "final FastReader s=new FastReader();", "s", "new FastReader()", "int n = s.nextInt();", "n", "s.nextInt()", "s.nextInt", "s", "int last = 0;", "last", "0", "long sum = 0;", "sum", "0", "while (n-- > 0)\n {\n int x = s.nextInt();\n if(x<last) {\n sum+= last-x;\n }\n last = Math.max(last, x);\n }", "n-- > 0", "n--", "n", "0", "{\n int x = s.nextInt();\n if(x<last) {\n sum+= last-x;\n }\n last = Math.max(last, x);\n }", "int x = s.nextInt();", "x", "s.nextInt()", "s.nextInt", "s", "if(x<last) {\n sum+= last-x;\n }", "x<last", "x", "last", "{\n sum+= last-x;\n }", "sum+= last-x", "sum", "last-x", "last", "x", "last = Math.max(last, x)", "last", "Math.max(last, x)", "Math.max", "Math", "last", "x", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "final String[] args", "args", "static class FastReader\n {\n BufferedReader br;\n StringTokenizer st;\n public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); }\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try { st = new StringTokenizer(br.readLine()); }\n catch (final IOException e) { e.printStackTrace(); }\n }\n return st.nextToken();\n }\n int nextInt() { return Integer.parseInt(next()); }\n long nextLong() { return Long.parseLong(next()); }\n double nextDouble() { return Double.parseDouble(next()); }\n String nextLine() {\n String str = \"\";\n try { str = br.readLine(); }\n catch (final IOException e) { e.printStackTrace(); }\n return str;\n }\n }", "FastReader", "BufferedReader br;", "br", "StringTokenizer st;", "st", "public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); }", "FastReader", "{ br = new BufferedReader(new InputStreamReader(System.in)); }", "br = new BufferedReader(new InputStreamReader(System.in))", "br", "new BufferedReader(new InputStreamReader(System.in))", "String next() {\n while (st == null || !st.hasMoreElements()) {\n try { st = new StringTokenizer(br.readLine()); }\n catch (final IOException e) { e.printStackTrace(); }\n }\n return st.nextToken();\n }", "next", "{\n while (st == null || !st.hasMoreElements()) {\n try { st = new StringTokenizer(br.readLine()); }\n catch (final IOException e) { e.printStackTrace(); }\n }\n return st.nextToken();\n }", "while (st == null || !st.hasMoreElements()) {\n try { st = new StringTokenizer(br.readLine()); }\n catch (final IOException e) { e.printStackTrace(); }\n }", "st == null || !st.hasMoreElements()", "st == null", "st", "null", "!st.hasMoreElements()", "st.hasMoreElements()", "st.hasMoreElements", "st", "{\n try { st = new StringTokenizer(br.readLine()); }\n catch (final IOException e) { e.printStackTrace(); }\n }", "try { st = new StringTokenizer(br.readLine()); }\n catch (final IOException e) { e.printStackTrace(); }", "catch (final IOException e) { e.printStackTrace(); }", "final IOException e", "{ e.printStackTrace(); }", "e.printStackTrace()", "e.printStackTrace", "e", "{ st = new StringTokenizer(br.readLine()); }", "st = new StringTokenizer(br.readLine())", "st", "new StringTokenizer(br.readLine())", "return st.nextToken();", "st.nextToken()", "st.nextToken", "st", "int nextInt() { return Integer.parseInt(next()); }", "nextInt", "{ return Integer.parseInt(next()); }", "return Integer.parseInt(next());", "Integer.parseInt(next())", "Integer.parseInt", "Integer", "next()", "next", "long nextLong() { return Long.parseLong(next()); }", "nextLong", "{ return Long.parseLong(next()); }", "return Long.parseLong(next());", "Long.parseLong(next())", "Long.parseLong", "Long", "next()", "next", "double nextDouble() { return Double.parseDouble(next()); }", "nextDouble", "{ return Double.parseDouble(next()); }", "return Double.parseDouble(next());", "Double.parseDouble(next())", "Double.parseDouble", "Double", "next()", "next", "String nextLine() {\n String str = \"\";\n try { str = br.readLine(); }\n catch (final IOException e) { e.printStackTrace(); }\n return str;\n }", "nextLine", "{\n String str = \"\";\n try { str = br.readLine(); }\n catch (final IOException e) { e.printStackTrace(); }\n return str;\n }", "String str = \"\";", "str", "\"\"", "try { str = br.readLine(); }\n catch (final IOException e) { e.printStackTrace(); }", "catch (final IOException e) { e.printStackTrace(); }", "final IOException e", "{ e.printStackTrace(); }", "e.printStackTrace()", "e.printStackTrace", "e", "{ str = br.readLine(); }", "str = br.readLine()", "str", "br.readLine()", "br.readLine", "br", "return str;", "str", "public class Main {\n public static void main(final String[] args) {\n final FastReader s=new FastReader();\n int n = s.nextInt();\n int last = 0;\n long sum = 0;\n while (n-- > 0)\n {\n int x = s.nextInt();\n if(x<last) {\n sum+= last-x;\n }\n last = Math.max(last, x);\n }\n System.out.println(sum);\n }\n\n static class FastReader\n {\n BufferedReader br;\n StringTokenizer st;\n public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); }\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try { st = new StringTokenizer(br.readLine()); }\n catch (final IOException e) { e.printStackTrace(); }\n }\n return st.nextToken();\n }\n int nextInt() { return Integer.parseInt(next()); }\n long nextLong() { return Long.parseLong(next()); }\n double nextDouble() { return Double.parseDouble(next()); }\n String nextLine() {\n String str = \"\";\n try { str = br.readLine(); }\n catch (final IOException e) { e.printStackTrace(); }\n return str;\n }\n }\n}", "public class Main {\n public static void main(final String[] args) {\n final FastReader s=new FastReader();\n int n = s.nextInt();\n int last = 0;\n long sum = 0;\n while (n-- > 0)\n {\n int x = s.nextInt();\n if(x<last) {\n sum+= last-x;\n }\n last = Math.max(last, x);\n }\n System.out.println(sum);\n }\n\n static class FastReader\n {\n BufferedReader br;\n StringTokenizer st;\n public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); }\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try { st = new StringTokenizer(br.readLine()); }\n catch (final IOException e) { e.printStackTrace(); }\n }\n return st.nextToken();\n }\n int nextInt() { return Integer.parseInt(next()); }\n long nextLong() { return Long.parseLong(next()); }\n double nextDouble() { return Double.parseDouble(next()); }\n String nextLine() {\n String str = \"\";\n try { str = br.readLine(); }\n catch (final IOException e) { e.printStackTrace(); }\n return str;\n }\n }\n}", "Main" ]
import java.io.*; import java.util.*; public class Main { public static void main(final String[] args) { final FastReader s=new FastReader(); int n = s.nextInt(); int last = 0; long sum = 0; while (n-- > 0) { int x = s.nextInt(); if(x<last) { sum+= last-x; } last = Math.max(last, x); } System.out.println(sum); } static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while (st == null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch (final IOException e) { e.printStackTrace(); } } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } String nextLine() { String str = ""; try { str = br.readLine(); } catch (final IOException e) { e.printStackTrace(); } return str; } } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 18, 13, 13, 18, 13, 2, 13, 17, 30, 0, 13, 2, 18, 13, 2, 13, 17, 18, 13, 13, 0, 18, 13, 13, 2, 18, 13, 2, 13, 17, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 107, 11 ], [ 107, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 15, 17 ], [ 14, 18 ], [ 18, 19 ], [ 18, 20 ], [ 20, 21 ], [ 21, 22 ], [ 14, 23 ], [ 23, 24 ], [ 23, 25 ], [ 14, 27 ], [ 27, 28 ], [ 28, 29 ], [ 29, 30 ], [ 29, 31 ], [ 27, 32 ], [ 32, 33 ], [ 32, 34 ], [ 27, 35 ], [ 35, 36 ], [ 36, 37 ], [ 27, 38 ], [ 39, 39 ], [ 39, 40 ], [ 40, 41 ], [ 41, 42 ], [ 41, 43 ], [ 40, 44 ], [ 44, 45 ], [ 45, 46 ], [ 14, 47 ], [ 47, 48 ], [ 47, 49 ], [ 14, 50 ], [ 50, 51 ], [ 51, 52 ], [ 52, 53 ], [ 52, 54 ], [ 50, 55 ], [ 55, 56 ], [ 55, 57 ], [ 50, 58 ], [ 58, 59 ], [ 59, 60 ], [ 50, 61 ], [ 62, 62 ], [ 62, 63 ], [ 63, 64 ], [ 64, 65 ], [ 65, 66 ], [ 65, 67 ], [ 64, 68 ], [ 68, 69 ], [ 68, 70 ], [ 70, 71 ], [ 70, 72 ], [ 63, 73 ], [ 73, 74 ], [ 74, 75 ], [ 74, 76 ], [ 76, 77 ], [ 77, 78 ], [ 77, 79 ], [ 79, 80 ], [ 79, 81 ], [ 76, 82 ], [ 82, 83 ], [ 82, 84 ], [ 73, 85 ], [ 85, 86 ], [ 86, 87 ], [ 86, 88 ], [ 85, 89 ], [ 89, 90 ], [ 90, 91 ], [ 90, 92 ], [ 92, 93 ], [ 92, 94 ], [ 89, 95 ], [ 95, 96 ], [ 95, 97 ], [ 14, 98 ], [ 98, 99 ], [ 99, 100 ], [ 100, 101 ], [ 100, 102 ], [ 98, 103 ], [ 12, 104 ], [ 104, 105 ], [ 0, 106 ], [ 106, 107 ], [ 106, 108 ] ]
[ "/* package whatever; // don't place package name! */\n\nimport java.util.*;\nimport java.lang.*;\nimport java.io.*;\n\n/* Name of the class has to be \"Main\" only if the class is public. */\npublic class Main\n{\n\tpublic static void main (String[] args) throws java.lang.Exception\n\t{\n\t\t// your code goes here\n\t\tScanner scanner = new Scanner(System.in);\n\t int n = scanner.nextInt();\n\t \n\t long [] arr = new long[n];\n\t for(int i = 0; i < n; i++){\n\t \tarr[i] = scanner.nextLong();\n\t }\n\t \n\t long res = 0;\n\t for(int i = 1; i < n ; i++){\n\t \tif(arr[i] < arr[i-1]){\n\t \t\tres += arr[i-1] - arr[i];\n\t \t\tarr[i] += arr[i-1] - arr[i]; \n\t \t}\n\t }\n\t \n\t System.out.println(res);\n\t}\n}", "import java.util.*;", "util.*", "java", "import java.lang.*;", "lang.*", "java", "import java.io.*;", "io.*", "java", "public class Main\n{\n\tpublic static void main (String[] args) throws java.lang.Exception\n\t{\n\t\t// your code goes here\n\t\tScanner scanner = new Scanner(System.in);\n\t int n = scanner.nextInt();\n\t \n\t long [] arr = new long[n];\n\t for(int i = 0; i < n; i++){\n\t \tarr[i] = scanner.nextLong();\n\t }\n\t \n\t long res = 0;\n\t for(int i = 1; i < n ; i++){\n\t \tif(arr[i] < arr[i-1]){\n\t \t\tres += arr[i-1] - arr[i];\n\t \t\tarr[i] += arr[i-1] - arr[i]; \n\t \t}\n\t }\n\t \n\t System.out.println(res);\n\t}\n}", "Main", "public static void main (String[] args) throws java.lang.Exception\n\t{\n\t\t// your code goes here\n\t\tScanner scanner = new Scanner(System.in);\n\t int n = scanner.nextInt();\n\t \n\t long [] arr = new long[n];\n\t for(int i = 0; i < n; i++){\n\t \tarr[i] = scanner.nextLong();\n\t }\n\t \n\t long res = 0;\n\t for(int i = 1; i < n ; i++){\n\t \tif(arr[i] < arr[i-1]){\n\t \t\tres += arr[i-1] - arr[i];\n\t \t\tarr[i] += arr[i-1] - arr[i]; \n\t \t}\n\t }\n\t \n\t System.out.println(res);\n\t}", "main", "{\n\t\t// your code goes here\n\t\tScanner scanner = new Scanner(System.in);\n\t int n = scanner.nextInt();\n\t \n\t long [] arr = new long[n];\n\t for(int i = 0; i < n; i++){\n\t \tarr[i] = scanner.nextLong();\n\t }\n\t \n\t long res = 0;\n\t for(int i = 1; i < n ; i++){\n\t \tif(arr[i] < arr[i-1]){\n\t \t\tres += arr[i-1] - arr[i];\n\t \t\tarr[i] += arr[i-1] - arr[i]; \n\t \t}\n\t }\n\t \n\t System.out.println(res);\n\t}", "Scanner scanner = new Scanner(System.in);", "scanner", "new Scanner(System.in)", "int n = scanner.nextInt();", "n", "scanner.nextInt()", "scanner.nextInt", "scanner", "long [] arr = new long[n];", "arr", "new long[n]", "n", "for(int i = 0; i < n; i++){\n\t \tarr[i] = scanner.nextLong();\n\t }", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n\t \tarr[i] = scanner.nextLong();\n\t }", "{\n\t \tarr[i] = scanner.nextLong();\n\t }", "arr[i] = scanner.nextLong()", "arr[i]", "arr", "i", "scanner.nextLong()", "scanner.nextLong", "scanner", "long res = 0;", "res", "0", "for(int i = 1; i < n ; i++){\n\t \tif(arr[i] < arr[i-1]){\n\t \t\tres += arr[i-1] - arr[i];\n\t \t\tarr[i] += arr[i-1] - arr[i]; \n\t \t}\n\t }", "int i = 1;", "int i = 1;", "i", "1", "i < n", "i", "n", "i++", "i++", "i", "{\n\t \tif(arr[i] < arr[i-1]){\n\t \t\tres += arr[i-1] - arr[i];\n\t \t\tarr[i] += arr[i-1] - arr[i]; \n\t \t}\n\t }", "{\n\t \tif(arr[i] < arr[i-1]){\n\t \t\tres += arr[i-1] - arr[i];\n\t \t\tarr[i] += arr[i-1] - arr[i]; \n\t \t}\n\t }", "if(arr[i] < arr[i-1]){\n\t \t\tres += arr[i-1] - arr[i];\n\t \t\tarr[i] += arr[i-1] - arr[i]; \n\t \t}", "arr[i] < arr[i-1]", "arr[i]", "arr", "i", "arr[i-1]", "arr", "i-1", "i", "1", "{\n\t \t\tres += arr[i-1] - arr[i];\n\t \t\tarr[i] += arr[i-1] - arr[i]; \n\t \t}", "res += arr[i-1] - arr[i]", "res", "arr[i-1] - arr[i]", "arr[i-1]", "arr", "i-1", "i", "1", "arr[i]", "arr", "i", "arr[i] += arr[i-1] - arr[i]", "arr[i]", "arr", "i", "arr[i-1] - arr[i]", "arr[i-1]", "arr", "i-1", "i", "1", "arr[i]", "arr", "i", "System.out.println(res)", "System.out.println", "System.out", "System", "System.out", "res", "String[] args", "args", "public class Main\n{\n\tpublic static void main (String[] args) throws java.lang.Exception\n\t{\n\t\t// your code goes here\n\t\tScanner scanner = new Scanner(System.in);\n\t int n = scanner.nextInt();\n\t \n\t long [] arr = new long[n];\n\t for(int i = 0; i < n; i++){\n\t \tarr[i] = scanner.nextLong();\n\t }\n\t \n\t long res = 0;\n\t for(int i = 1; i < n ; i++){\n\t \tif(arr[i] < arr[i-1]){\n\t \t\tres += arr[i-1] - arr[i];\n\t \t\tarr[i] += arr[i-1] - arr[i]; \n\t \t}\n\t }\n\t \n\t System.out.println(res);\n\t}\n}", "public class Main\n{\n\tpublic static void main (String[] args) throws java.lang.Exception\n\t{\n\t\t// your code goes here\n\t\tScanner scanner = new Scanner(System.in);\n\t int n = scanner.nextInt();\n\t \n\t long [] arr = new long[n];\n\t for(int i = 0; i < n; i++){\n\t \tarr[i] = scanner.nextLong();\n\t }\n\t \n\t long res = 0;\n\t for(int i = 1; i < n ; i++){\n\t \tif(arr[i] < arr[i-1]){\n\t \t\tres += arr[i-1] - arr[i];\n\t \t\tarr[i] += arr[i-1] - arr[i]; \n\t \t}\n\t }\n\t \n\t System.out.println(res);\n\t}\n}", "Main" ]
/* package whatever; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ public class Main { public static void main (String[] args) throws java.lang.Exception { // your code goes here Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); long [] arr = new long[n]; for(int i = 0; i < n; i++){ arr[i] = scanner.nextLong(); } long res = 0; for(int i = 1; i < n ; i++){ if(arr[i] < arr[i-1]){ res += arr[i-1] - arr[i]; arr[i] += arr[i-1] - arr[i]; } } System.out.println(res); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 4, 18, 13, 41, 13, 4, 18, 4, 18, 13, 17, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 18, 13, 18, 13, 13, 41, 13, 18, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 18, 13, 13, 13, 0, 13, 2, 13, 18, 13, 13, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 108, 11 ], [ 108, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 15, 17 ], [ 14, 18 ], [ 18, 19 ], [ 18, 20 ], [ 20, 21 ], [ 21, 22 ], [ 20, 23 ], [ 23, 24 ], [ 24, 25 ], [ 14, 26 ], [ 26, 27 ], [ 26, 28 ], [ 28, 29 ], [ 29, 30 ], [ 30, 31 ], [ 31, 32 ], [ 28, 33 ], [ 14, 34 ], [ 34, 35 ], [ 34, 36 ], [ 14, 38 ], [ 38, 39 ], [ 39, 40 ], [ 40, 41 ], [ 40, 42 ], [ 38, 43 ], [ 43, 44 ], [ 43, 45 ], [ 38, 46 ], [ 46, 47 ], [ 47, 48 ], [ 38, 49 ], [ 49, 50 ], [ 50, 51 ], [ 51, 52 ], [ 51, 53 ], [ 50, 54 ], [ 54, 55 ], [ 55, 56 ], [ 54, 57 ], [ 57, 58 ], [ 57, 59 ], [ 14, 60 ], [ 60, 61 ], [ 60, 62 ], [ 62, 63 ], [ 62, 64 ], [ 14, 65 ], [ 65, 66 ], [ 65, 67 ], [ 14, 68 ], [ 68, 69 ], [ 69, 70 ], [ 70, 71 ], [ 70, 72 ], [ 68, 73 ], [ 73, 74 ], [ 73, 75 ], [ 68, 76 ], [ 76, 77 ], [ 77, 78 ], [ 68, 79 ], [ 80, 80 ], [ 80, 81 ], [ 81, 82 ], [ 82, 83 ], [ 83, 84 ], [ 83, 85 ], [ 82, 86 ], [ 81, 87 ], [ 87, 88 ], [ 87, 89 ], [ 89, 90 ], [ 89, 91 ], [ 91, 92 ], [ 91, 93 ], [ 81, 94 ], [ 94, 95 ], [ 94, 96 ], [ 96, 97 ], [ 96, 98 ], [ 14, 99 ], [ 99, 100 ], [ 100, 101 ], [ 101, 102 ], [ 101, 103 ], [ 99, 104 ], [ 12, 105 ], [ 105, 106 ], [ 0, 107 ], [ 107, 108 ], [ 107, 109 ] ]
[ "import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\tpublic static void main(String[] args) throws NumberFormatException, IOException {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tint n = Integer.parseInt(in.readLine());\n\t\tString[] tokens = in.readLine().split(\" \");\n\t\tint[] a = new int[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = Integer.parseInt(tokens[i]);\n\t\tint h = a[0];\n\t\tlong ans = 0;\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tif (a[i] <= h)\n\t\t\t\tans += h-a[i];\n\t\t\telse\n\t\t\t\th = a[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}", "import java.io.BufferedReader;", "BufferedReader", "java.io", "import java.io.IOException;", "IOException", "java.io", "import java.io.InputStreamReader;", "InputStreamReader", "java.io", "public class Main {\n\tpublic static void main(String[] args) throws NumberFormatException, IOException {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tint n = Integer.parseInt(in.readLine());\n\t\tString[] tokens = in.readLine().split(\" \");\n\t\tint[] a = new int[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = Integer.parseInt(tokens[i]);\n\t\tint h = a[0];\n\t\tlong ans = 0;\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tif (a[i] <= h)\n\t\t\t\tans += h-a[i];\n\t\t\telse\n\t\t\t\th = a[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}", "Main", "public static void main(String[] args) throws NumberFormatException, IOException {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tint n = Integer.parseInt(in.readLine());\n\t\tString[] tokens = in.readLine().split(\" \");\n\t\tint[] a = new int[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = Integer.parseInt(tokens[i]);\n\t\tint h = a[0];\n\t\tlong ans = 0;\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tif (a[i] <= h)\n\t\t\t\tans += h-a[i];\n\t\t\telse\n\t\t\t\th = a[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}", "main", "{\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tint n = Integer.parseInt(in.readLine());\n\t\tString[] tokens = in.readLine().split(\" \");\n\t\tint[] a = new int[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = Integer.parseInt(tokens[i]);\n\t\tint h = a[0];\n\t\tlong ans = 0;\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tif (a[i] <= h)\n\t\t\t\tans += h-a[i];\n\t\t\telse\n\t\t\t\th = a[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}", "BufferedReader in = new BufferedReader(new InputStreamReader(System.in));", "in", "new BufferedReader(new InputStreamReader(System.in))", "int n = Integer.parseInt(in.readLine());", "n", "Integer.parseInt(in.readLine())", "Integer.parseInt", "Integer", "in.readLine()", "in.readLine", "in", "String[] tokens = in.readLine().split(\" \");", "tokens", "in.readLine().split(\" \")", "in.readLine().split", "in.readLine()", "in.readLine", "in", "\" \"", "int[] a = new int[n];", "a", "new int[n]", "n", "for (int i = 0; i < n; i++)\n\t\t\ta[i] = Integer.parseInt(tokens[i]);", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "a[i] = Integer.parseInt(tokens[i]);", "a[i] = Integer.parseInt(tokens[i])", "a[i]", "a", "i", "Integer.parseInt(tokens[i])", "Integer.parseInt", "Integer", "tokens[i]", "tokens", "i", "int h = a[0];", "h", "a[0]", "a", "0", "long ans = 0;", "ans", "0", "for (int i = 1; i < n; i++) {\n\t\t\tif (a[i] <= h)\n\t\t\t\tans += h-a[i];\n\t\t\telse\n\t\t\t\th = a[i];\n\t\t}", "int i = 1;", "int i = 1;", "i", "1", "i < n", "i", "n", "i++", "i++", "i", "{\n\t\t\tif (a[i] <= h)\n\t\t\t\tans += h-a[i];\n\t\t\telse\n\t\t\t\th = a[i];\n\t\t}", "{\n\t\t\tif (a[i] <= h)\n\t\t\t\tans += h-a[i];\n\t\t\telse\n\t\t\t\th = a[i];\n\t\t}", "if (a[i] <= h)\n\t\t\t\tans += h-a[i];\n\t\t\telse\n\t\t\t\th = a[i];", "a[i] <= h", "a[i]", "a", "i", "h", "ans += h-a[i]", "ans", "h-a[i]", "h", "a[i]", "a", "i", "h = a[i]", "h", "a[i]", "a", "i", "System.out.println(ans)", "System.out.println", "System.out", "System", "System.out", "ans", "String[] args", "args", "public class Main {\n\tpublic static void main(String[] args) throws NumberFormatException, IOException {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tint n = Integer.parseInt(in.readLine());\n\t\tString[] tokens = in.readLine().split(\" \");\n\t\tint[] a = new int[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = Integer.parseInt(tokens[i]);\n\t\tint h = a[0];\n\t\tlong ans = 0;\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tif (a[i] <= h)\n\t\t\t\tans += h-a[i];\n\t\t\telse\n\t\t\t\th = a[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}", "public class Main {\n\tpublic static void main(String[] args) throws NumberFormatException, IOException {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tint n = Integer.parseInt(in.readLine());\n\t\tString[] tokens = in.readLine().split(\" \");\n\t\tint[] a = new int[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = Integer.parseInt(tokens[i]);\n\t\tint h = a[0];\n\t\tlong ans = 0;\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tif (a[i] <= h)\n\t\t\t\tans += h-a[i];\n\t\t\telse\n\t\t\t\th = a[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}", "Main" ]
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(in.readLine()); String[] tokens = in.readLine().split(" "); int[] a = new int[n]; for (int i = 0; i < n; i++) a[i] = Integer.parseInt(tokens[i]); int h = a[0]; long ans = 0; for (int i = 1; i < n; i++) { if (a[i] <= h) ans += h-a[i]; else h = a[i]; } System.out.println(ans); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 41, 13, 18, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 18, 13, 13, 13, 30, 0, 13, 18, 13, 13, 30, 0, 13, 2, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 94, 8 ], [ 94, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 11, 24 ], [ 24, 25 ], [ 25, 26 ], [ 26, 27 ], [ 26, 28 ], [ 24, 29 ], [ 29, 30 ], [ 29, 31 ], [ 24, 32 ], [ 32, 33 ], [ 33, 34 ], [ 24, 35 ], [ 36, 36 ], [ 36, 37 ], [ 37, 38 ], [ 38, 39 ], [ 38, 40 ], [ 37, 41 ], [ 41, 42 ], [ 42, 43 ], [ 11, 44 ], [ 44, 45 ], [ 44, 46 ], [ 46, 47 ], [ 46, 48 ], [ 11, 49 ], [ 49, 50 ], [ 49, 51 ], [ 11, 52 ], [ 52, 53 ], [ 53, 54 ], [ 54, 55 ], [ 54, 56 ], [ 52, 57 ], [ 57, 58 ], [ 57, 59 ], [ 52, 60 ], [ 60, 61 ], [ 61, 62 ], [ 52, 63 ], [ 64, 64 ], [ 64, 65 ], [ 65, 66 ], [ 66, 67 ], [ 67, 68 ], [ 67, 69 ], [ 66, 70 ], [ 65, 71 ], [ 71, 72 ], [ 72, 73 ], [ 72, 74 ], [ 74, 75 ], [ 74, 76 ], [ 65, 77 ], [ 77, 78 ], [ 78, 79 ], [ 78, 80 ], [ 80, 81 ], [ 80, 82 ], [ 82, 83 ], [ 82, 84 ], [ 11, 85 ], [ 85, 86 ], [ 86, 87 ], [ 87, 88 ], [ 87, 89 ], [ 85, 90 ], [ 9, 91 ], [ 91, 92 ], [ 0, 93 ], [ 93, 94 ], [ 93, 95 ] ]
[ "import java.io.FileNotFoundException;\nimport java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) throws FileNotFoundException {\n\n\t\t// \tFile file = new File(\"src/in.txt\");\n\t\t// \tScanner sc = new Scanner(file);\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint N = sc.nextInt();\n\t\tint[] A = new int[N];\n\n\t\tfor(int i=0;i<N;i++) {\n\t\t\tA[i] = sc.nextInt();\n\t\t}\n\t\tint height = A[0];\n\t\tlong ans = 0;\n\t\tfor(int i=1;i<N;i++) {\n\t\t\tif(A[i]>height) {\n\t\t\t\theight = A[i];\n\t\t\t} else {\n\t\t\t\tans += height - A[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\n\t}\n}", "import java.io.FileNotFoundException;", "FileNotFoundException", "java.io", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\tpublic static void main(String[] args) throws FileNotFoundException {\n\n\t\t// \tFile file = new File(\"src/in.txt\");\n\t\t// \tScanner sc = new Scanner(file);\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint N = sc.nextInt();\n\t\tint[] A = new int[N];\n\n\t\tfor(int i=0;i<N;i++) {\n\t\t\tA[i] = sc.nextInt();\n\t\t}\n\t\tint height = A[0];\n\t\tlong ans = 0;\n\t\tfor(int i=1;i<N;i++) {\n\t\t\tif(A[i]>height) {\n\t\t\t\theight = A[i];\n\t\t\t} else {\n\t\t\t\tans += height - A[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\n\t}\n}", "Main", "public static void main(String[] args) throws FileNotFoundException {\n\n\t\t// \tFile file = new File(\"src/in.txt\");\n\t\t// \tScanner sc = new Scanner(file);\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint N = sc.nextInt();\n\t\tint[] A = new int[N];\n\n\t\tfor(int i=0;i<N;i++) {\n\t\t\tA[i] = sc.nextInt();\n\t\t}\n\t\tint height = A[0];\n\t\tlong ans = 0;\n\t\tfor(int i=1;i<N;i++) {\n\t\t\tif(A[i]>height) {\n\t\t\t\theight = A[i];\n\t\t\t} else {\n\t\t\t\tans += height - A[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\n\t}", "main", "{\n\n\t\t// \tFile file = new File(\"src/in.txt\");\n\t\t// \tScanner sc = new Scanner(file);\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint N = sc.nextInt();\n\t\tint[] A = new int[N];\n\n\t\tfor(int i=0;i<N;i++) {\n\t\t\tA[i] = sc.nextInt();\n\t\t}\n\t\tint height = A[0];\n\t\tlong ans = 0;\n\t\tfor(int i=1;i<N;i++) {\n\t\t\tif(A[i]>height) {\n\t\t\t\theight = A[i];\n\t\t\t} else {\n\t\t\t\tans += height - A[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\n\t}", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int N = sc.nextInt();", "N", "sc.nextInt()", "sc.nextInt", "sc", "int[] A = new int[N];", "A", "new int[N]", "N", "for(int i=0;i<N;i++) {\n\t\t\tA[i] = sc.nextInt();\n\t\t}", "int i=0;", "int i=0;", "i", "0", "i<N", "i", "N", "i++", "i++", "i", "{\n\t\t\tA[i] = sc.nextInt();\n\t\t}", "{\n\t\t\tA[i] = sc.nextInt();\n\t\t}", "A[i] = sc.nextInt()", "A[i]", "A", "i", "sc.nextInt()", "sc.nextInt", "sc", "int height = A[0];", "height", "A[0]", "A", "0", "long ans = 0;", "ans", "0", "for(int i=1;i<N;i++) {\n\t\t\tif(A[i]>height) {\n\t\t\t\theight = A[i];\n\t\t\t} else {\n\t\t\t\tans += height - A[i];\n\t\t\t}\n\t\t}", "int i=1;", "int i=1;", "i", "1", "i<N", "i", "N", "i++", "i++", "i", "{\n\t\t\tif(A[i]>height) {\n\t\t\t\theight = A[i];\n\t\t\t} else {\n\t\t\t\tans += height - A[i];\n\t\t\t}\n\t\t}", "{\n\t\t\tif(A[i]>height) {\n\t\t\t\theight = A[i];\n\t\t\t} else {\n\t\t\t\tans += height - A[i];\n\t\t\t}\n\t\t}", "if(A[i]>height) {\n\t\t\t\theight = A[i];\n\t\t\t} else {\n\t\t\t\tans += height - A[i];\n\t\t\t}", "A[i]>height", "A[i]", "A", "i", "height", "{\n\t\t\t\theight = A[i];\n\t\t\t}", "height = A[i]", "height", "A[i]", "A", "i", "{\n\t\t\t\tans += height - A[i];\n\t\t\t}", "ans += height - A[i]", "ans", "height - A[i]", "height", "A[i]", "A", "i", "System.out.println(ans)", "System.out.println", "System.out", "System", "System.out", "ans", "String[] args", "args", "public class Main {\n\tpublic static void main(String[] args) throws FileNotFoundException {\n\n\t\t// \tFile file = new File(\"src/in.txt\");\n\t\t// \tScanner sc = new Scanner(file);\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint N = sc.nextInt();\n\t\tint[] A = new int[N];\n\n\t\tfor(int i=0;i<N;i++) {\n\t\t\tA[i] = sc.nextInt();\n\t\t}\n\t\tint height = A[0];\n\t\tlong ans = 0;\n\t\tfor(int i=1;i<N;i++) {\n\t\t\tif(A[i]>height) {\n\t\t\t\theight = A[i];\n\t\t\t} else {\n\t\t\t\tans += height - A[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\n\t}\n}", "public class Main {\n\tpublic static void main(String[] args) throws FileNotFoundException {\n\n\t\t// \tFile file = new File(\"src/in.txt\");\n\t\t// \tScanner sc = new Scanner(file);\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint N = sc.nextInt();\n\t\tint[] A = new int[N];\n\n\t\tfor(int i=0;i<N;i++) {\n\t\t\tA[i] = sc.nextInt();\n\t\t}\n\t\tint height = A[0];\n\t\tlong ans = 0;\n\t\tfor(int i=1;i<N;i++) {\n\t\t\tif(A[i]>height) {\n\t\t\t\theight = A[i];\n\t\t\t} else {\n\t\t\t\tans += height - A[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\n\t}\n}", "Main" ]
import java.io.FileNotFoundException; import java.util.Scanner; public class Main { public static void main(String[] args) throws FileNotFoundException { // File file = new File("src/in.txt"); // Scanner sc = new Scanner(file); Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int[] A = new int[N]; for(int i=0;i<N;i++) { A[i] = sc.nextInt(); } int height = A[0]; long ans = 0; for(int i=1;i<N;i++) { if(A[i]>height) { height = A[i]; } else { ans += height - A[i]; } } System.out.println(ans); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 17, 41, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 4, 18, 13, 14, 2, 13, 13, 30, 0, 13, 2, 13, 13, 0, 13, 13, 0, 13, 13, 4, 18, 18, 13, 13, 13, 4, 18, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 72, 5 ], [ 72, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 8, 20 ], [ 20, 21 ], [ 20, 22 ], [ 8, 23 ], [ 23, 24 ], [ 23, 25 ], [ 8, 26 ], [ 26, 27 ], [ 27, 28 ], [ 28, 29 ], [ 28, 30 ], [ 26, 31 ], [ 31, 32 ], [ 31, 33 ], [ 26, 34 ], [ 34, 35 ], [ 35, 36 ], [ 26, 37 ], [ 38, 38 ], [ 38, 39 ], [ 39, 40 ], [ 39, 41 ], [ 41, 42 ], [ 42, 43 ], [ 38, 44 ], [ 44, 45 ], [ 45, 46 ], [ 45, 47 ], [ 44, 48 ], [ 48, 49 ], [ 49, 50 ], [ 49, 51 ], [ 51, 52 ], [ 51, 53 ], [ 48, 54 ], [ 54, 55 ], [ 54, 56 ], [ 38, 57 ], [ 57, 58 ], [ 57, 59 ], [ 8, 60 ], [ 60, 61 ], [ 61, 62 ], [ 62, 63 ], [ 62, 64 ], [ 60, 65 ], [ 8, 66 ], [ 66, 67 ], [ 67, 68 ], [ 6, 69 ], [ 69, 70 ], [ 0, 71 ], [ 71, 72 ], [ 71, 73 ] ]
[ "import java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n\n int N = scan.nextInt();\n\n long sum = 0;\n\n long mae = 0;\n long now = 0;\n\n for (int i = 0; i < N; i++) {\n \tnow = scan.nextLong();\n \tif (now < mae) {\n \t\tsum += mae - now;\n \t\tnow = mae;\n \t}\n \tmae = now;\n }\n\n System.out.println(sum);\n\n scan.close();\n\n }\n\n}", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n\n int N = scan.nextInt();\n\n long sum = 0;\n\n long mae = 0;\n long now = 0;\n\n for (int i = 0; i < N; i++) {\n \tnow = scan.nextLong();\n \tif (now < mae) {\n \t\tsum += mae - now;\n \t\tnow = mae;\n \t}\n \tmae = now;\n }\n\n System.out.println(sum);\n\n scan.close();\n\n }\n\n}", "Main", "public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n\n int N = scan.nextInt();\n\n long sum = 0;\n\n long mae = 0;\n long now = 0;\n\n for (int i = 0; i < N; i++) {\n \tnow = scan.nextLong();\n \tif (now < mae) {\n \t\tsum += mae - now;\n \t\tnow = mae;\n \t}\n \tmae = now;\n }\n\n System.out.println(sum);\n\n scan.close();\n\n }", "main", "{\n Scanner scan = new Scanner(System.in);\n\n int N = scan.nextInt();\n\n long sum = 0;\n\n long mae = 0;\n long now = 0;\n\n for (int i = 0; i < N; i++) {\n \tnow = scan.nextLong();\n \tif (now < mae) {\n \t\tsum += mae - now;\n \t\tnow = mae;\n \t}\n \tmae = now;\n }\n\n System.out.println(sum);\n\n scan.close();\n\n }", "Scanner scan = new Scanner(System.in);", "scan", "new Scanner(System.in)", "int N = scan.nextInt();", "N", "scan.nextInt()", "scan.nextInt", "scan", "long sum = 0;", "sum", "0", "long mae = 0;", "mae", "0", "long now = 0;", "now", "0", "for (int i = 0; i < N; i++) {\n \tnow = scan.nextLong();\n \tif (now < mae) {\n \t\tsum += mae - now;\n \t\tnow = mae;\n \t}\n \tmae = now;\n }", "int i = 0;", "int i = 0;", "i", "0", "i < N", "i", "N", "i++", "i++", "i", "{\n \tnow = scan.nextLong();\n \tif (now < mae) {\n \t\tsum += mae - now;\n \t\tnow = mae;\n \t}\n \tmae = now;\n }", "{\n \tnow = scan.nextLong();\n \tif (now < mae) {\n \t\tsum += mae - now;\n \t\tnow = mae;\n \t}\n \tmae = now;\n }", "now = scan.nextLong()", "now", "scan.nextLong()", "scan.nextLong", "scan", "if (now < mae) {\n \t\tsum += mae - now;\n \t\tnow = mae;\n \t}", "now < mae", "now", "mae", "{\n \t\tsum += mae - now;\n \t\tnow = mae;\n \t}", "sum += mae - now", "sum", "mae - now", "mae", "now", "now = mae", "now", "mae", "mae = now", "mae", "now", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "scan.close()", "scan.close", "scan", "String[] args", "args", "public class Main {\n public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n\n int N = scan.nextInt();\n\n long sum = 0;\n\n long mae = 0;\n long now = 0;\n\n for (int i = 0; i < N; i++) {\n \tnow = scan.nextLong();\n \tif (now < mae) {\n \t\tsum += mae - now;\n \t\tnow = mae;\n \t}\n \tmae = now;\n }\n\n System.out.println(sum);\n\n scan.close();\n\n }\n\n}", "public class Main {\n public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n\n int N = scan.nextInt();\n\n long sum = 0;\n\n long mae = 0;\n long now = 0;\n\n for (int i = 0; i < N; i++) {\n \tnow = scan.nextLong();\n \tif (now < mae) {\n \t\tsum += mae - now;\n \t\tnow = mae;\n \t}\n \tmae = now;\n }\n\n System.out.println(sum);\n\n scan.close();\n\n }\n\n}", "Main" ]
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); long sum = 0; long mae = 0; long now = 0; for (int i = 0; i < N; i++) { now = scan.nextLong(); if (now < mae) { sum += mae - now; now = mae; } mae = now; } System.out.println(sum); scan.close(); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 41, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 0, 13, 8, 2, 13, 18, 13, 13, 18, 13, 13, 13, 0, 13, 2, 13, 18, 13, 13, 4, 18, 13, 13, 4, 18, 13, 23, 13, 12, 13, 30, 4, 18, 18, 13, 13, 13, 23, 13, 6, 13, 41, 13, 20, 41, 13, 20, 12, 13, 30, 42, 40, 4, 18, 13, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 20, 29, 4, 18, 13, 12, 13, 30, 38, 5, 13, 30, 4, 18, 13, 30, 29, 4, 18, 13, 29, 17, 23, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 176, 14 ], [ 176, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 18, 20 ], [ 17, 21 ], [ 21, 22 ], [ 21, 23 ], [ 17, 24 ], [ 24, 25 ], [ 24, 26 ], [ 26, 27 ], [ 27, 28 ], [ 17, 29 ], [ 29, 30 ], [ 29, 31 ], [ 17, 33 ], [ 33, 34 ], [ 33, 35 ], [ 17, 36 ], [ 36, 37 ], [ 36, 38 ], [ 17, 39 ], [ 39, 40 ], [ 40, 41 ], [ 41, 42 ], [ 41, 43 ], [ 39, 44 ], [ 44, 45 ], [ 44, 46 ], [ 39, 47 ], [ 47, 48 ], [ 48, 49 ], [ 39, 50 ], [ 51, 51 ], [ 51, 52 ], [ 52, 53 ], [ 53, 54 ], [ 53, 55 ], [ 52, 56 ], [ 56, 57 ], [ 57, 58 ], [ 51, 59 ], [ 59, 60 ], [ 59, 61 ], [ 61, 62 ], [ 62, 63 ], [ 62, 64 ], [ 64, 65 ], [ 64, 66 ], [ 61, 67 ], [ 67, 68 ], [ 67, 69 ], [ 61, 70 ], [ 51, 71 ], [ 71, 72 ], [ 71, 73 ], [ 73, 74 ], [ 73, 75 ], [ 75, 76 ], [ 75, 77 ], [ 17, 78 ], [ 78, 79 ], [ 79, 80 ], [ 78, 81 ], [ 17, 82 ], [ 82, 83 ], [ 83, 84 ], [ 15, 85 ], [ 85, 86 ], [ 176, 87 ], [ 87, 88 ], [ 87, 89 ], [ 89, 90 ], [ 90, 91 ], [ 91, 92 ], [ 92, 93 ], [ 92, 94 ], [ 90, 95 ], [ 87, 96 ], [ 96, 97 ], [ 176, 98 ], [ 98, 99 ], [ 98, 100 ], [ 100, 101 ], [ 100, 102 ], [ 98, 103 ], [ 103, 104 ], [ 103, 105 ], [ 98, 106 ], [ 106, 107 ], [ 106, 108 ], [ 108, 109 ], [ 109, 110 ], [ 110, 111 ], [ 111, 112 ], [ 112, 113 ], [ 109, 114 ], [ 114, 115 ], [ 115, 116 ], [ 115, 117 ], [ 117, 118 ], [ 118, 119 ], [ 119, 120 ], [ 114, 121 ], [ 121, 122 ], [ 122, 123 ], [ 122, 124 ], [ 108, 125 ], [ 125, 126 ], [ 126, 127 ], [ 127, 128 ], [ 98, 129 ], [ 129, 130 ], [ 129, 131 ], [ 131, 132 ], [ 132, 133 ], [ 133, 134 ], [ 133, 135 ], [ 135, 136 ], [ 136, 137 ], [ 137, 138 ], [ 132, 139 ], [ 139, 140 ], [ 140, 141 ], [ 141, 142 ], [ 142, 143 ], [ 131, 144 ], [ 144, 145 ], [ 129, 146 ], [ 146, 147 ], [ 98, 148 ], [ 148, 149 ], [ 148, 150 ], [ 150, 151 ], [ 151, 152 ], [ 152, 153 ], [ 153, 154 ], [ 152, 155 ], [ 155, 156 ], [ 98, 157 ], [ 157, 158 ], [ 157, 159 ], [ 159, 160 ], [ 160, 161 ], [ 161, 162 ], [ 162, 163 ], [ 161, 164 ], [ 164, 165 ], [ 98, 166 ], [ 166, 167 ], [ 166, 168 ], [ 168, 169 ], [ 169, 170 ], [ 170, 171 ], [ 171, 172 ], [ 170, 173 ], [ 173, 174 ], [ 0, 175 ], [ 175, 176 ], [ 175, 177 ] ]
[ "import java.io.*;\nimport java.math.*;\nimport java.util.*;\nimport java.lang.*;\n\n// import java.text.DecimalFormat; \n// import java.text.DecimalFormatSymbols; \n \npublic class Main {\n\n\n \n public static void main(String args[] ) throws Exception {\n PrintWriter pw=new PrintWriter(System.out);\n FastScanner sc = new FastScanner();\n int n = sc.nextInt();\n long[] a = new long[n];\n long ans=0;\n long max=0;\n for(int i=0;i<n;i++){\n a[i] = sc.nextLong();\n max = (max<a[i])?a[i]:max;\n ans+=(max-a[i]);\n }\n \n pw.println(ans);\n \n pw.close();\n }\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n public static <T> void deb(T x){\n System.out.println(x);\n }\n \n \n static class FastScanner {\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tStringTokenizer st=new StringTokenizer(\"\");\n\t\t\n\t\tpublic String next() {\n\t\t\twhile (!st.hasMoreElements())\n\t\t\t\ttry {\n\t\t\t\t\tst=new StringTokenizer(br.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\treturn st.nextToken();\n\t\t}\n\t\tpublic String next(int k) {\n\t\t\ttry {\n\t\t\t\treturn br.readLine();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\treturn \"Not able to read\";\n\t\t}\n\t\t\n\t\tint nextInt() {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n\t\t\n\t\tlong nextLong() {\n\t\t\treturn Long.parseLong(next());\n\t\t}\n\t\t\n\t\tdouble nextDouble() {\n\t\t\treturn Double.parseDouble(next());\n\t\t}\n\t\t\n\t \n\t}\n \n}", "import java.io.*;", "io.*", "java", "import java.math.*;", "math.*", "java", "import java.util.*;", "util.*", "java", "import java.lang.*;", "lang.*", "java", "public class Main {\n\n\n \n public static void main(String args[] ) throws Exception {\n PrintWriter pw=new PrintWriter(System.out);\n FastScanner sc = new FastScanner();\n int n = sc.nextInt();\n long[] a = new long[n];\n long ans=0;\n long max=0;\n for(int i=0;i<n;i++){\n a[i] = sc.nextLong();\n max = (max<a[i])?a[i]:max;\n ans+=(max-a[i]);\n }\n \n pw.println(ans);\n \n pw.close();\n }\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n public static <T> void deb(T x){\n System.out.println(x);\n }\n \n \n static class FastScanner {\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tStringTokenizer st=new StringTokenizer(\"\");\n\t\t\n\t\tpublic String next() {\n\t\t\twhile (!st.hasMoreElements())\n\t\t\t\ttry {\n\t\t\t\t\tst=new StringTokenizer(br.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\treturn st.nextToken();\n\t\t}\n\t\tpublic String next(int k) {\n\t\t\ttry {\n\t\t\t\treturn br.readLine();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\treturn \"Not able to read\";\n\t\t}\n\t\t\n\t\tint nextInt() {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n\t\t\n\t\tlong nextLong() {\n\t\t\treturn Long.parseLong(next());\n\t\t}\n\t\t\n\t\tdouble nextDouble() {\n\t\t\treturn Double.parseDouble(next());\n\t\t}\n\t\t\n\t \n\t}\n \n}", "Main", "public static void main(String args[] ) throws Exception {\n PrintWriter pw=new PrintWriter(System.out);\n FastScanner sc = new FastScanner();\n int n = sc.nextInt();\n long[] a = new long[n];\n long ans=0;\n long max=0;\n for(int i=0;i<n;i++){\n a[i] = sc.nextLong();\n max = (max<a[i])?a[i]:max;\n ans+=(max-a[i]);\n }\n \n pw.println(ans);\n \n pw.close();\n }", "main", "{\n PrintWriter pw=new PrintWriter(System.out);\n FastScanner sc = new FastScanner();\n int n = sc.nextInt();\n long[] a = new long[n];\n long ans=0;\n long max=0;\n for(int i=0;i<n;i++){\n a[i] = sc.nextLong();\n max = (max<a[i])?a[i]:max;\n ans+=(max-a[i]);\n }\n \n pw.println(ans);\n \n pw.close();\n }", "PrintWriter pw=new PrintWriter(System.out);", "pw", "new PrintWriter(System.out)", "FastScanner sc = new FastScanner();", "sc", "new FastScanner()", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "long[] a = new long[n];", "a", "new long[n]", "n", "long ans=0;", "ans", "0", "long max=0;", "max", "0", "for(int i=0;i<n;i++){\n a[i] = sc.nextLong();\n max = (max<a[i])?a[i]:max;\n ans+=(max-a[i]);\n }", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\n a[i] = sc.nextLong();\n max = (max<a[i])?a[i]:max;\n ans+=(max-a[i]);\n }", "{\n a[i] = sc.nextLong();\n max = (max<a[i])?a[i]:max;\n ans+=(max-a[i]);\n }", "a[i] = sc.nextLong()", "a[i]", "a", "i", "sc.nextLong()", "sc.nextLong", "sc", "max = (max<a[i])?a[i]:max", "max", "(max<a[i])?a[i]:max", "(max<a[i])", "max", "a[i]", "a", "i", "a[i]", "a", "i", "max", "ans+=(max-a[i])", "ans", "(max-a[i])", "max", "a[i]", "a", "i", "pw.println(ans)", "pw.println", "pw", "ans", "pw.close()", "pw.close", "pw", "String args[]", "args", "public static <T> void deb(T x){\n System.out.println(x);\n }", "deb", "{\n System.out.println(x);\n }", "System.out.println(x)", "System.out.println", "System.out", "System", "System.out", "x", "T x", "x", "static class FastScanner {\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tStringTokenizer st=new StringTokenizer(\"\");\n\t\t\n\t\tpublic String next() {\n\t\t\twhile (!st.hasMoreElements())\n\t\t\t\ttry {\n\t\t\t\t\tst=new StringTokenizer(br.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\treturn st.nextToken();\n\t\t}\n\t\tpublic String next(int k) {\n\t\t\ttry {\n\t\t\t\treturn br.readLine();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\treturn \"Not able to read\";\n\t\t}\n\t\t\n\t\tint nextInt() {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n\t\t\n\t\tlong nextLong() {\n\t\t\treturn Long.parseLong(next());\n\t\t}\n\t\t\n\t\tdouble nextDouble() {\n\t\t\treturn Double.parseDouble(next());\n\t\t}\n\t\t\n\t \n\t}", "FastScanner", "BufferedReader br=new BufferedReader(new InputStreamReader(System.in));", "br", "new BufferedReader(new InputStreamReader(System.in))", "StringTokenizer st=new StringTokenizer(\"\");", "st", "new StringTokenizer(\"\")", "public String next() {\n\t\t\twhile (!st.hasMoreElements())\n\t\t\t\ttry {\n\t\t\t\t\tst=new StringTokenizer(br.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\treturn st.nextToken();\n\t\t}", "next", "{\n\t\t\twhile (!st.hasMoreElements())\n\t\t\t\ttry {\n\t\t\t\t\tst=new StringTokenizer(br.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\treturn st.nextToken();\n\t\t}", "while (!st.hasMoreElements())\n\t\t\t\ttry {\n\t\t\t\t\tst=new StringTokenizer(br.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}", "!st.hasMoreElements()", "st.hasMoreElements()", "st.hasMoreElements", "st", "try {\n\t\t\t\t\tst=new StringTokenizer(br.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}", "catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}", "IOException e", "{\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}", "e.printStackTrace()", "e.printStackTrace", "e", "{\n\t\t\t\t\tst=new StringTokenizer(br.readLine());\n\t\t\t\t}", "st=new StringTokenizer(br.readLine())", "st", "new StringTokenizer(br.readLine())", "return st.nextToken();", "st.nextToken()", "st.nextToken", "st", "public String next(int k) {\n\t\t\ttry {\n\t\t\t\treturn br.readLine();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\treturn \"Not able to read\";\n\t\t}", "next", "{\n\t\t\ttry {\n\t\t\t\treturn br.readLine();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\treturn \"Not able to read\";\n\t\t}", "try {\n\t\t\t\treturn br.readLine();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}", "catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}", "IOException e", "{\n\t\t\t\te.printStackTrace();\n\t\t\t}", "e.printStackTrace()", "e.printStackTrace", "e", "{\n\t\t\t\treturn br.readLine();\n\t\t\t}", "return br.readLine();", "br.readLine()", "br.readLine", "br", "return \"Not able to read\";", "\"Not able to read\"", "int k", "k", "int nextInt() {\n\t\t\treturn Integer.parseInt(next());\n\t\t}", "nextInt", "{\n\t\t\treturn Integer.parseInt(next());\n\t\t}", "return Integer.parseInt(next());", "Integer.parseInt(next())", "Integer.parseInt", "Integer", "next()", "next", "long nextLong() {\n\t\t\treturn Long.parseLong(next());\n\t\t}", "nextLong", "{\n\t\t\treturn Long.parseLong(next());\n\t\t}", "return Long.parseLong(next());", "Long.parseLong(next())", "Long.parseLong", "Long", "next()", "next", "double nextDouble() {\n\t\t\treturn Double.parseDouble(next());\n\t\t}", "nextDouble", "{\n\t\t\treturn Double.parseDouble(next());\n\t\t}", "return Double.parseDouble(next());", "Double.parseDouble(next())", "Double.parseDouble", "Double", "next()", "next", "public class Main {\n\n\n \n public static void main(String args[] ) throws Exception {\n PrintWriter pw=new PrintWriter(System.out);\n FastScanner sc = new FastScanner();\n int n = sc.nextInt();\n long[] a = new long[n];\n long ans=0;\n long max=0;\n for(int i=0;i<n;i++){\n a[i] = sc.nextLong();\n max = (max<a[i])?a[i]:max;\n ans+=(max-a[i]);\n }\n \n pw.println(ans);\n \n pw.close();\n }\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n public static <T> void deb(T x){\n System.out.println(x);\n }\n \n \n static class FastScanner {\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tStringTokenizer st=new StringTokenizer(\"\");\n\t\t\n\t\tpublic String next() {\n\t\t\twhile (!st.hasMoreElements())\n\t\t\t\ttry {\n\t\t\t\t\tst=new StringTokenizer(br.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\treturn st.nextToken();\n\t\t}\n\t\tpublic String next(int k) {\n\t\t\ttry {\n\t\t\t\treturn br.readLine();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\treturn \"Not able to read\";\n\t\t}\n\t\t\n\t\tint nextInt() {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n\t\t\n\t\tlong nextLong() {\n\t\t\treturn Long.parseLong(next());\n\t\t}\n\t\t\n\t\tdouble nextDouble() {\n\t\t\treturn Double.parseDouble(next());\n\t\t}\n\t\t\n\t \n\t}\n \n}", "public class Main {\n\n\n \n public static void main(String args[] ) throws Exception {\n PrintWriter pw=new PrintWriter(System.out);\n FastScanner sc = new FastScanner();\n int n = sc.nextInt();\n long[] a = new long[n];\n long ans=0;\n long max=0;\n for(int i=0;i<n;i++){\n a[i] = sc.nextLong();\n max = (max<a[i])?a[i]:max;\n ans+=(max-a[i]);\n }\n \n pw.println(ans);\n \n pw.close();\n }\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n public static <T> void deb(T x){\n System.out.println(x);\n }\n \n \n static class FastScanner {\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n\t\tStringTokenizer st=new StringTokenizer(\"\");\n\t\t\n\t\tpublic String next() {\n\t\t\twhile (!st.hasMoreElements())\n\t\t\t\ttry {\n\t\t\t\t\tst=new StringTokenizer(br.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\treturn st.nextToken();\n\t\t}\n\t\tpublic String next(int k) {\n\t\t\ttry {\n\t\t\t\treturn br.readLine();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\treturn \"Not able to read\";\n\t\t}\n\t\t\n\t\tint nextInt() {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n\t\t\n\t\tlong nextLong() {\n\t\t\treturn Long.parseLong(next());\n\t\t}\n\t\t\n\t\tdouble nextDouble() {\n\t\t\treturn Double.parseDouble(next());\n\t\t}\n\t\t\n\t \n\t}\n \n}", "Main" ]
import java.io.*; import java.math.*; import java.util.*; import java.lang.*; // import java.text.DecimalFormat; // import java.text.DecimalFormatSymbols; public class Main { public static void main(String args[] ) throws Exception { PrintWriter pw=new PrintWriter(System.out); FastScanner sc = new FastScanner(); int n = sc.nextInt(); long[] a = new long[n]; long ans=0; long max=0; for(int i=0;i<n;i++){ a[i] = sc.nextLong(); max = (max<a[i])?a[i]:max; ans+=(max-a[i]); } pw.println(ans); pw.close(); } public static <T> void deb(T x){ System.out.println(x); } static class FastScanner { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st=new StringTokenizer(""); public String next() { while (!st.hasMoreElements()) try { st=new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } return st.nextToken(); } public String next(int k) { try { return br.readLine(); } catch (IOException e) { e.printStackTrace(); } return "Not able to read"; } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 17, 41, 13, 4, 18, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 41, 13, 4, 18, 13, 14, 2, 13, 13, 30, 0, 13, 2, 13, 13, 0, 13, 13, 0, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 68, 5 ], [ 68, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 8, 20 ], [ 20, 21 ], [ 20, 22 ], [ 22, 23 ], [ 23, 24 ], [ 8, 25 ], [ 25, 26 ], [ 26, 27 ], [ 27, 28 ], [ 27, 29 ], [ 25, 30 ], [ 30, 31 ], [ 30, 32 ], [ 25, 33 ], [ 33, 34 ], [ 34, 35 ], [ 25, 36 ], [ 37, 37 ], [ 37, 38 ], [ 38, 39 ], [ 38, 40 ], [ 40, 41 ], [ 41, 42 ], [ 37, 43 ], [ 43, 44 ], [ 44, 45 ], [ 44, 46 ], [ 43, 47 ], [ 47, 48 ], [ 48, 49 ], [ 48, 50 ], [ 50, 51 ], [ 50, 52 ], [ 47, 53 ], [ 53, 54 ], [ 53, 55 ], [ 37, 56 ], [ 56, 57 ], [ 56, 58 ], [ 8, 59 ], [ 59, 60 ], [ 60, 61 ], [ 61, 62 ], [ 61, 63 ], [ 59, 64 ], [ 6, 65 ], [ 65, 66 ], [ 0, 67 ], [ 67, 68 ], [ 67, 69 ] ]
[ "import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tlong ans = 0;\n\t\tint p = sc.nextInt();\n\t\tfor (int i = 1; i < N; i++) {\n\t\t\tint c = sc.nextInt();\n\t\t\tif (p > c) {\n\t\t\t\tans += p - c;\n\t\t\t\tc = p;\n\t\t\t}\n\t\t\tp = c;\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tlong ans = 0;\n\t\tint p = sc.nextInt();\n\t\tfor (int i = 1; i < N; i++) {\n\t\t\tint c = sc.nextInt();\n\t\t\tif (p > c) {\n\t\t\t\tans += p - c;\n\t\t\t\tc = p;\n\t\t\t}\n\t\t\tp = c;\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}", "Main", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tlong ans = 0;\n\t\tint p = sc.nextInt();\n\t\tfor (int i = 1; i < N; i++) {\n\t\t\tint c = sc.nextInt();\n\t\t\tif (p > c) {\n\t\t\t\tans += p - c;\n\t\t\t\tc = p;\n\t\t\t}\n\t\t\tp = c;\n\t\t}\n\t\tSystem.out.println(ans);\n\t}", "main", "{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tlong ans = 0;\n\t\tint p = sc.nextInt();\n\t\tfor (int i = 1; i < N; i++) {\n\t\t\tint c = sc.nextInt();\n\t\t\tif (p > c) {\n\t\t\t\tans += p - c;\n\t\t\t\tc = p;\n\t\t\t}\n\t\t\tp = c;\n\t\t}\n\t\tSystem.out.println(ans);\n\t}", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int N = sc.nextInt();", "N", "sc.nextInt()", "sc.nextInt", "sc", "long ans = 0;", "ans", "0", "int p = sc.nextInt();", "p", "sc.nextInt()", "sc.nextInt", "sc", "for (int i = 1; i < N; i++) {\n\t\t\tint c = sc.nextInt();\n\t\t\tif (p > c) {\n\t\t\t\tans += p - c;\n\t\t\t\tc = p;\n\t\t\t}\n\t\t\tp = c;\n\t\t}", "int i = 1;", "int i = 1;", "i", "1", "i < N", "i", "N", "i++", "i++", "i", "{\n\t\t\tint c = sc.nextInt();\n\t\t\tif (p > c) {\n\t\t\t\tans += p - c;\n\t\t\t\tc = p;\n\t\t\t}\n\t\t\tp = c;\n\t\t}", "{\n\t\t\tint c = sc.nextInt();\n\t\t\tif (p > c) {\n\t\t\t\tans += p - c;\n\t\t\t\tc = p;\n\t\t\t}\n\t\t\tp = c;\n\t\t}", "int c = sc.nextInt();", "c", "sc.nextInt()", "sc.nextInt", "sc", "if (p > c) {\n\t\t\t\tans += p - c;\n\t\t\t\tc = p;\n\t\t\t}", "p > c", "p", "c", "{\n\t\t\t\tans += p - c;\n\t\t\t\tc = p;\n\t\t\t}", "ans += p - c", "ans", "p - c", "p", "c", "c = p", "c", "p", "p = c", "p", "c", "System.out.println(ans)", "System.out.println", "System.out", "System", "System.out", "ans", "String[] args", "args", "public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tlong ans = 0;\n\t\tint p = sc.nextInt();\n\t\tfor (int i = 1; i < N; i++) {\n\t\t\tint c = sc.nextInt();\n\t\t\tif (p > c) {\n\t\t\t\tans += p - c;\n\t\t\t\tc = p;\n\t\t\t}\n\t\t\tp = c;\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}", "public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tlong ans = 0;\n\t\tint p = sc.nextInt();\n\t\tfor (int i = 1; i < N; i++) {\n\t\t\tint c = sc.nextInt();\n\t\t\tif (p > c) {\n\t\t\t\tans += p - c;\n\t\t\t\tc = p;\n\t\t\t}\n\t\t\tp = c;\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}", "Main" ]
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); long ans = 0; int p = sc.nextInt(); for (int i = 1; i < N; i++) { int c = sc.nextInt(); if (p > c) { ans += p - c; c = p; } p = c; } System.out.println(ans); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 41, 13, 41, 13, 41, 13, 12, 13, 30, 41, 13, 4, 13, 41, 13, 17, 41, 13, 4, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 41, 13, 4, 13, 14, 2, 13, 13, 30, 0, 13, 2, 13, 13, 30, 0, 13, 13, 4, 18, 13, 13, 12, 13, 30, 29, 4, 13, 4, 13, 12, 13, 30, 29, 4, 13, 4, 13, 12, 13, 30, 42, 2, 2, 13, 17, 40, 4, 18, 13, 30, 0, 13, 20, 29, 4, 18, 13, 12, 13, 30, 38, 5, 13, 30, 4, 18, 13, 4, 13, 17, 30, 0, 13, 20, 0, 13, 20, 4, 13, 4, 18, 13, 4, 18, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 13, 14 ], [ 13, 15 ], [ 0, 16 ], [ 16, 17 ], [ 16, 18 ], [ 0, 19 ], [ 19, 20 ], [ 19, 21 ], [ 0, 22 ], [ 22, 23 ], [ 22, 24 ], [ 0, 25 ], [ 149, 26 ], [ 149, 27 ], [ 27, 28 ], [ 149, 29 ], [ 29, 30 ], [ 149, 31 ], [ 31, 32 ], [ 149, 33 ], [ 33, 34 ], [ 33, 35 ], [ 35, 36 ], [ 36, 37 ], [ 36, 38 ], [ 38, 39 ], [ 35, 40 ], [ 40, 41 ], [ 40, 42 ], [ 35, 43 ], [ 43, 44 ], [ 43, 45 ], [ 45, 46 ], [ 35, 47 ], [ 47, 48 ], [ 48, 49 ], [ 49, 50 ], [ 49, 51 ], [ 47, 52 ], [ 52, 53 ], [ 52, 54 ], [ 47, 55 ], [ 55, 56 ], [ 56, 57 ], [ 47, 58 ], [ 59, 59 ], [ 59, 60 ], [ 60, 61 ], [ 60, 62 ], [ 62, 63 ], [ 59, 64 ], [ 64, 65 ], [ 65, 66 ], [ 65, 67 ], [ 64, 68 ], [ 68, 69 ], [ 69, 70 ], [ 69, 71 ], [ 71, 72 ], [ 71, 73 ], [ 64, 74 ], [ 74, 75 ], [ 75, 76 ], [ 75, 77 ], [ 35, 78 ], [ 78, 79 ], [ 79, 80 ], [ 78, 81 ], [ 149, 82 ], [ 82, 83 ], [ 82, 84 ], [ 84, 85 ], [ 85, 86 ], [ 86, 87 ], [ 86, 88 ], [ 88, 89 ], [ 149, 90 ], [ 90, 91 ], [ 90, 92 ], [ 92, 93 ], [ 93, 94 ], [ 94, 95 ], [ 94, 96 ], [ 96, 97 ], [ 149, 98 ], [ 98, 99 ], [ 98, 100 ], [ 100, 101 ], [ 101, 102 ], [ 102, 103 ], [ 103, 104 ], [ 103, 105 ], [ 102, 106 ], [ 106, 107 ], [ 107, 108 ], [ 108, 109 ], [ 101, 110 ], [ 110, 111 ], [ 111, 112 ], [ 111, 113 ], [ 100, 114 ], [ 114, 115 ], [ 115, 116 ], [ 116, 117 ], [ 149, 118 ], [ 118, 119 ], [ 118, 120 ], [ 120, 121 ], [ 121, 122 ], [ 122, 123 ], [ 122, 124 ], [ 124, 125 ], [ 125, 126 ], [ 126, 127 ], [ 124, 128 ], [ 128, 129 ], [ 128, 130 ], [ 121, 131 ], [ 131, 132 ], [ 132, 133 ], [ 132, 134 ], [ 131, 135 ], [ 135, 136 ], [ 135, 137 ], [ 131, 138 ], [ 138, 139 ], [ 131, 140 ], [ 140, 141 ], [ 141, 142 ], [ 131, 143 ], [ 143, 144 ], [ 144, 145 ], [ 118, 146 ], [ 146, 147 ], [ 0, 148 ], [ 148, 149 ], [ 148, 150 ] ]
[ "import static java.lang.Integer.*;\nimport static java.lang.Long.*;\nimport static java.lang.System.*;\n\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.io.PrintWriter;\nimport java.util.StringTokenizer;\n\npublic class Main {\n\n static void solve() throws Exception {\n int n = scanInt();\n long ans = 0;\n long tmp = scanLong();\n for (int i = 1; i < n; i++) {\n long a = scanLong();\n if (tmp > a) {\n ans += tmp - a;\n } else {\n tmp = a;\n }\n }\n out.print(ans);\n }\n\n static int scanInt() throws IOException {\n return parseInt(scanString());\n }\n\n static long scanLong() throws IOException {\n return parseLong(scanString());\n }\n\n static String scanString() throws IOException {\n while (tok == null || !tok.hasMoreTokens()) {\n tok = new StringTokenizer(in.readLine());\n }\n return tok.nextToken();\n }\n\n static BufferedReader in;\n static PrintWriter out;\n static StringTokenizer tok;\n\n public static void main(String[] args) {\n try {\n in = new BufferedReader(new InputStreamReader(System.in));\n out = new PrintWriter(System.out);\n solve();\n in.close();\n out.close();\n }\n catch (Throwable e) {\n e.printStackTrace();\n exit(1);\n }\n }\n}", "import static java.lang.Integer.*;", "import static java.lang.Integer.*;", "import static java.lang.Integer.*;", "import static java.lang.Long.*;", "import static java.lang.Long.*;", "import static java.lang.Long.*;", "import static java.lang.System.*;", "import static java.lang.System.*;", "import static java.lang.System.*;", "import java.io.BufferedReader;", "BufferedReader", "java.io", "import java.io.IOException;", "IOException", "java.io", "import java.io.InputStreamReader;", "InputStreamReader", "java.io", "import java.io.PrintWriter;", "PrintWriter", "java.io", "import java.util.StringTokenizer;", "StringTokenizer", "java.util", "public class Main {\n\n static void solve() throws Exception {\n int n = scanInt();\n long ans = 0;\n long tmp = scanLong();\n for (int i = 1; i < n; i++) {\n long a = scanLong();\n if (tmp > a) {\n ans += tmp - a;\n } else {\n tmp = a;\n }\n }\n out.print(ans);\n }\n\n static int scanInt() throws IOException {\n return parseInt(scanString());\n }\n\n static long scanLong() throws IOException {\n return parseLong(scanString());\n }\n\n static String scanString() throws IOException {\n while (tok == null || !tok.hasMoreTokens()) {\n tok = new StringTokenizer(in.readLine());\n }\n return tok.nextToken();\n }\n\n static BufferedReader in;\n static PrintWriter out;\n static StringTokenizer tok;\n\n public static void main(String[] args) {\n try {\n in = new BufferedReader(new InputStreamReader(System.in));\n out = new PrintWriter(System.out);\n solve();\n in.close();\n out.close();\n }\n catch (Throwable e) {\n e.printStackTrace();\n exit(1);\n }\n }\n}", "Main", "static BufferedReader in;", "in", "static PrintWriter out;", "out", "static StringTokenizer tok;", "tok", "static void solve() throws Exception {\n int n = scanInt();\n long ans = 0;\n long tmp = scanLong();\n for (int i = 1; i < n; i++) {\n long a = scanLong();\n if (tmp > a) {\n ans += tmp - a;\n } else {\n tmp = a;\n }\n }\n out.print(ans);\n }", "solve", "{\n int n = scanInt();\n long ans = 0;\n long tmp = scanLong();\n for (int i = 1; i < n; i++) {\n long a = scanLong();\n if (tmp > a) {\n ans += tmp - a;\n } else {\n tmp = a;\n }\n }\n out.print(ans);\n }", "int n = scanInt();", "n", "scanInt()", "scanInt", "long ans = 0;", "ans", "0", "long tmp = scanLong();", "tmp", "scanLong()", "scanLong", "for (int i = 1; i < n; i++) {\n long a = scanLong();\n if (tmp > a) {\n ans += tmp - a;\n } else {\n tmp = a;\n }\n }", "int i = 1;", "int i = 1;", "i", "1", "i < n", "i", "n", "i++", "i++", "i", "{\n long a = scanLong();\n if (tmp > a) {\n ans += tmp - a;\n } else {\n tmp = a;\n }\n }", "{\n long a = scanLong();\n if (tmp > a) {\n ans += tmp - a;\n } else {\n tmp = a;\n }\n }", "long a = scanLong();", "a", "scanLong()", "scanLong", "if (tmp > a) {\n ans += tmp - a;\n } else {\n tmp = a;\n }", "tmp > a", "tmp", "a", "{\n ans += tmp - a;\n }", "ans += tmp - a", "ans", "tmp - a", "tmp", "a", "{\n tmp = a;\n }", "tmp = a", "tmp", "a", "out.print(ans)", "out.print", "out", "ans", "static int scanInt() throws IOException {\n return parseInt(scanString());\n }", "scanInt", "{\n return parseInt(scanString());\n }", "return parseInt(scanString());", "parseInt(scanString())", "parseInt", "scanString()", "scanString", "static long scanLong() throws IOException {\n return parseLong(scanString());\n }", "scanLong", "{\n return parseLong(scanString());\n }", "return parseLong(scanString());", "parseLong(scanString())", "parseLong", "scanString()", "scanString", "static String scanString() throws IOException {\n while (tok == null || !tok.hasMoreTokens()) {\n tok = new StringTokenizer(in.readLine());\n }\n return tok.nextToken();\n }", "scanString", "{\n while (tok == null || !tok.hasMoreTokens()) {\n tok = new StringTokenizer(in.readLine());\n }\n return tok.nextToken();\n }", "while (tok == null || !tok.hasMoreTokens()) {\n tok = new StringTokenizer(in.readLine());\n }", "tok == null || !tok.hasMoreTokens()", "tok == null", "tok", "null", "!tok.hasMoreTokens()", "tok.hasMoreTokens()", "tok.hasMoreTokens", "tok", "{\n tok = new StringTokenizer(in.readLine());\n }", "tok = new StringTokenizer(in.readLine())", "tok", "new StringTokenizer(in.readLine())", "return tok.nextToken();", "tok.nextToken()", "tok.nextToken", "tok", "public static void main(String[] args) {\n try {\n in = new BufferedReader(new InputStreamReader(System.in));\n out = new PrintWriter(System.out);\n solve();\n in.close();\n out.close();\n }\n catch (Throwable e) {\n e.printStackTrace();\n exit(1);\n }\n }", "main", "{\n try {\n in = new BufferedReader(new InputStreamReader(System.in));\n out = new PrintWriter(System.out);\n solve();\n in.close();\n out.close();\n }\n catch (Throwable e) {\n e.printStackTrace();\n exit(1);\n }\n }", "try {\n in = new BufferedReader(new InputStreamReader(System.in));\n out = new PrintWriter(System.out);\n solve();\n in.close();\n out.close();\n }\n catch (Throwable e) {\n e.printStackTrace();\n exit(1);\n }", "catch (Throwable e) {\n e.printStackTrace();\n exit(1);\n }", "Throwable e", "{\n e.printStackTrace();\n exit(1);\n }", "e.printStackTrace()", "e.printStackTrace", "e", "exit(1)", "exit", "1", "{\n in = new BufferedReader(new InputStreamReader(System.in));\n out = new PrintWriter(System.out);\n solve();\n in.close();\n out.close();\n }", "in = new BufferedReader(new InputStreamReader(System.in))", "in", "new BufferedReader(new InputStreamReader(System.in))", "out = new PrintWriter(System.out)", "out", "new PrintWriter(System.out)", "solve()", "solve", "in.close()", "in.close", "in", "out.close()", "out.close", "out", "String[] args", "args", "public class Main {\n\n static void solve() throws Exception {\n int n = scanInt();\n long ans = 0;\n long tmp = scanLong();\n for (int i = 1; i < n; i++) {\n long a = scanLong();\n if (tmp > a) {\n ans += tmp - a;\n } else {\n tmp = a;\n }\n }\n out.print(ans);\n }\n\n static int scanInt() throws IOException {\n return parseInt(scanString());\n }\n\n static long scanLong() throws IOException {\n return parseLong(scanString());\n }\n\n static String scanString() throws IOException {\n while (tok == null || !tok.hasMoreTokens()) {\n tok = new StringTokenizer(in.readLine());\n }\n return tok.nextToken();\n }\n\n static BufferedReader in;\n static PrintWriter out;\n static StringTokenizer tok;\n\n public static void main(String[] args) {\n try {\n in = new BufferedReader(new InputStreamReader(System.in));\n out = new PrintWriter(System.out);\n solve();\n in.close();\n out.close();\n }\n catch (Throwable e) {\n e.printStackTrace();\n exit(1);\n }\n }\n}", "public class Main {\n\n static void solve() throws Exception {\n int n = scanInt();\n long ans = 0;\n long tmp = scanLong();\n for (int i = 1; i < n; i++) {\n long a = scanLong();\n if (tmp > a) {\n ans += tmp - a;\n } else {\n tmp = a;\n }\n }\n out.print(ans);\n }\n\n static int scanInt() throws IOException {\n return parseInt(scanString());\n }\n\n static long scanLong() throws IOException {\n return parseLong(scanString());\n }\n\n static String scanString() throws IOException {\n while (tok == null || !tok.hasMoreTokens()) {\n tok = new StringTokenizer(in.readLine());\n }\n return tok.nextToken();\n }\n\n static BufferedReader in;\n static PrintWriter out;\n static StringTokenizer tok;\n\n public static void main(String[] args) {\n try {\n in = new BufferedReader(new InputStreamReader(System.in));\n out = new PrintWriter(System.out);\n solve();\n in.close();\n out.close();\n }\n catch (Throwable e) {\n e.printStackTrace();\n exit(1);\n }\n }\n}", "Main" ]
import static java.lang.Integer.*; import static java.lang.Long.*; import static java.lang.System.*; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class Main { static void solve() throws Exception { int n = scanInt(); long ans = 0; long tmp = scanLong(); for (int i = 1; i < n; i++) { long a = scanLong(); if (tmp > a) { ans += tmp - a; } else { tmp = a; } } out.print(ans); } static int scanInt() throws IOException { return parseInt(scanString()); } static long scanLong() throws IOException { return parseLong(scanString()); } static String scanString() throws IOException { while (tok == null || !tok.hasMoreTokens()) { tok = new StringTokenizer(in.readLine()); } return tok.nextToken(); } static BufferedReader in; static PrintWriter out; static StringTokenizer tok; public static void main(String[] args) { try { in = new BufferedReader(new InputStreamReader(System.in)); out = new PrintWriter(System.out); solve(); in.close(); out.close(); } catch (Throwable e) { e.printStackTrace(); exit(1); } } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 20, 41, 13, 4, 18, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 4, 18, 13, 4, 18, 13, 41, 13, 4, 18, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 13, 4, 18, 13, 13, 30, 0, 13, 2, 13, 4, 18, 13, 13, 30, 0, 13, 4, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 13, 14 ], [ 13, 15 ], [ 0, 16 ], [ 16, 17 ], [ 16, 18 ], [ 0, 19 ], [ 19, 20 ], [ 19, 21 ], [ 0, 22 ], [ 22, 23 ], [ 22, 24 ], [ 0, 25 ], [ 114, 26 ], [ 114, 27 ], [ 27, 28 ], [ 27, 29 ], [ 29, 30 ], [ 30, 31 ], [ 30, 32 ], [ 29, 33 ], [ 33, 34 ], [ 33, 35 ], [ 29, 36 ], [ 36, 37 ], [ 36, 38 ], [ 38, 39 ], [ 39, 40 ], [ 29, 41 ], [ 41, 42 ], [ 42, 43 ], [ 43, 44 ], [ 43, 45 ], [ 41, 46 ], [ 46, 47 ], [ 46, 48 ], [ 41, 49 ], [ 49, 50 ], [ 50, 51 ], [ 41, 52 ], [ 53, 53 ], [ 53, 54 ], [ 54, 55 ], [ 55, 56 ], [ 54, 57 ], [ 57, 58 ], [ 58, 59 ], [ 29, 60 ], [ 60, 61 ], [ 60, 62 ], [ 62, 63 ], [ 63, 64 ], [ 62, 65 ], [ 29, 66 ], [ 66, 67 ], [ 66, 68 ], [ 29, 69 ], [ 69, 70 ], [ 70, 71 ], [ 71, 72 ], [ 71, 73 ], [ 69, 74 ], [ 74, 75 ], [ 74, 76 ], [ 69, 77 ], [ 77, 78 ], [ 78, 79 ], [ 69, 80 ], [ 81, 81 ], [ 81, 82 ], [ 82, 83 ], [ 83, 84 ], [ 83, 85 ], [ 85, 86 ], [ 86, 87 ], [ 85, 88 ], [ 82, 89 ], [ 89, 90 ], [ 90, 91 ], [ 90, 92 ], [ 92, 93 ], [ 92, 94 ], [ 94, 95 ], [ 95, 96 ], [ 94, 97 ], [ 82, 98 ], [ 98, 99 ], [ 99, 100 ], [ 99, 101 ], [ 101, 102 ], [ 102, 103 ], [ 101, 104 ], [ 29, 105 ], [ 105, 106 ], [ 106, 107 ], [ 107, 108 ], [ 107, 109 ], [ 105, 110 ], [ 27, 111 ], [ 111, 112 ], [ 0, 113 ], [ 113, 114 ], [ 113, 115 ] ]
[ "import java.io.BufferedReader;\nimport java.io.*;\nimport java.util.*;\nimport java.util.ArrayList;\nimport java.util.Iterator;\nimport java.util.List;\nimport java.util.Collections;\nimport java.util.Arrays;\n\npublic class Main {\n\tpublic static void main(final String[] args){\n \n final Scanner sc = new Scanner(System.in);\n final List<Long> list = new ArrayList<>();\n //final List<Long> list2 = new ArrayList<>();\n\n int n = sc.nextInt();\n for(int i = 0; i < n ; i++){\n list.add(sc.nextLong());\n }\n\n long max = list.get(0);\n long sum = 0;\n\n for(int i = 1; i < n ; i++){\n if(max > list.get(i)){\n sum += max - list.get(i);\n }else{\n max = list.get(i);\n }\n\n //System.out.println(sum + \" \" + max);\n }\n System.out.println(sum);\n\n \n\n \n\n\n\n\n\n}\n}", "import java.io.BufferedReader;", "BufferedReader", "java.io", "import java.io.*;", "io.*", "java", "import java.util.*;", "util.*", "java", "import java.util.ArrayList;", "ArrayList", "java.util", "import java.util.Iterator;", "Iterator", "java.util", "import java.util.List;", "List", "java.util", "import java.util.Collections;", "Collections", "java.util", "import java.util.Arrays;", "Arrays", "java.util", "public class Main {\n\tpublic static void main(final String[] args){\n \n final Scanner sc = new Scanner(System.in);\n final List<Long> list = new ArrayList<>();\n //final List<Long> list2 = new ArrayList<>();\n\n int n = sc.nextInt();\n for(int i = 0; i < n ; i++){\n list.add(sc.nextLong());\n }\n\n long max = list.get(0);\n long sum = 0;\n\n for(int i = 1; i < n ; i++){\n if(max > list.get(i)){\n sum += max - list.get(i);\n }else{\n max = list.get(i);\n }\n\n //System.out.println(sum + \" \" + max);\n }\n System.out.println(sum);\n\n \n\n \n\n\n\n\n\n}\n}", "Main", "public static void main(final String[] args){\n \n final Scanner sc = new Scanner(System.in);\n final List<Long> list = new ArrayList<>();\n //final List<Long> list2 = new ArrayList<>();\n\n int n = sc.nextInt();\n for(int i = 0; i < n ; i++){\n list.add(sc.nextLong());\n }\n\n long max = list.get(0);\n long sum = 0;\n\n for(int i = 1; i < n ; i++){\n if(max > list.get(i)){\n sum += max - list.get(i);\n }else{\n max = list.get(i);\n }\n\n //System.out.println(sum + \" \" + max);\n }\n System.out.println(sum);\n\n \n\n \n\n\n\n\n\n}", "main", "{\n \n final Scanner sc = new Scanner(System.in);\n final List<Long> list = new ArrayList<>();\n //final List<Long> list2 = new ArrayList<>();\n\n int n = sc.nextInt();\n for(int i = 0; i < n ; i++){\n list.add(sc.nextLong());\n }\n\n long max = list.get(0);\n long sum = 0;\n\n for(int i = 1; i < n ; i++){\n if(max > list.get(i)){\n sum += max - list.get(i);\n }else{\n max = list.get(i);\n }\n\n //System.out.println(sum + \" \" + max);\n }\n System.out.println(sum);\n\n \n\n \n\n\n\n\n\n}", "final Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "final List<Long> list = new ArrayList<>();", "list", "new ArrayList<>()", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "for(int i = 0; i < n ; i++){\n list.add(sc.nextLong());\n }", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n list.add(sc.nextLong());\n }", "{\n list.add(sc.nextLong());\n }", "list.add(sc.nextLong())", "list.add", "list", "sc.nextLong()", "sc.nextLong", "sc", "long max = list.get(0);", "max", "list.get(0)", "list.get", "list", "0", "long sum = 0;", "sum", "0", "for(int i = 1; i < n ; i++){\n if(max > list.get(i)){\n sum += max - list.get(i);\n }else{\n max = list.get(i);\n }\n\n //System.out.println(sum + \" \" + max);\n }", "int i = 1;", "int i = 1;", "i", "1", "i < n", "i", "n", "i++", "i++", "i", "{\n if(max > list.get(i)){\n sum += max - list.get(i);\n }else{\n max = list.get(i);\n }\n\n //System.out.println(sum + \" \" + max);\n }", "{\n if(max > list.get(i)){\n sum += max - list.get(i);\n }else{\n max = list.get(i);\n }\n\n //System.out.println(sum + \" \" + max);\n }", "if(max > list.get(i)){\n sum += max - list.get(i);\n }else{\n max = list.get(i);\n }", "max > list.get(i)", "max", "list.get(i)", "list.get", "list", "i", "{\n sum += max - list.get(i);\n }", "sum += max - list.get(i)", "sum", "max - list.get(i)", "max", "list.get(i)", "list.get", "list", "i", "{\n max = list.get(i);\n }", "max = list.get(i)", "max", "list.get(i)", "list.get", "list", "i", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "final String[] args", "args", "public class Main {\n\tpublic static void main(final String[] args){\n \n final Scanner sc = new Scanner(System.in);\n final List<Long> list = new ArrayList<>();\n //final List<Long> list2 = new ArrayList<>();\n\n int n = sc.nextInt();\n for(int i = 0; i < n ; i++){\n list.add(sc.nextLong());\n }\n\n long max = list.get(0);\n long sum = 0;\n\n for(int i = 1; i < n ; i++){\n if(max > list.get(i)){\n sum += max - list.get(i);\n }else{\n max = list.get(i);\n }\n\n //System.out.println(sum + \" \" + max);\n }\n System.out.println(sum);\n\n \n\n \n\n\n\n\n\n}\n}", "public class Main {\n\tpublic static void main(final String[] args){\n \n final Scanner sc = new Scanner(System.in);\n final List<Long> list = new ArrayList<>();\n //final List<Long> list2 = new ArrayList<>();\n\n int n = sc.nextInt();\n for(int i = 0; i < n ; i++){\n list.add(sc.nextLong());\n }\n\n long max = list.get(0);\n long sum = 0;\n\n for(int i = 1; i < n ; i++){\n if(max > list.get(i)){\n sum += max - list.get(i);\n }else{\n max = list.get(i);\n }\n\n //System.out.println(sum + \" \" + max);\n }\n System.out.println(sum);\n\n \n\n \n\n\n\n\n\n}\n}", "Main" ]
import java.io.BufferedReader; import java.io.*; import java.util.*; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Collections; import java.util.Arrays; public class Main { public static void main(final String[] args){ final Scanner sc = new Scanner(System.in); final List<Long> list = new ArrayList<>(); //final List<Long> list2 = new ArrayList<>(); int n = sc.nextInt(); for(int i = 0; i < n ; i++){ list.add(sc.nextLong()); } long max = list.get(0); long sum = 0; for(int i = 1; i < n ; i++){ if(max > list.get(i)){ sum += max - list.get(i); }else{ max = list.get(i); } //System.out.println(sum + " " + max); } System.out.println(sum); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 14, 2, 13, 17, 30, 14, 2, 18, 13, 13, 18, 13, 2, 13, 17, 30, 0, 13, 2, 18, 13, 2, 13, 17, 18, 13, 13, 0, 18, 13, 13, 18, 13, 2, 13, 17, 4, 18, 18, 13, 13, 13, 23, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 8, 21 ], [ 21, 22 ], [ 21, 23 ], [ 8, 24 ], [ 24, 25 ], [ 25, 26 ], [ 26, 27 ], [ 26, 28 ], [ 24, 29 ], [ 29, 30 ], [ 29, 31 ], [ 24, 32 ], [ 32, 33 ], [ 33, 34 ], [ 24, 35 ], [ 36, 36 ], [ 36, 37 ], [ 37, 38 ], [ 38, 39 ], [ 38, 40 ], [ 37, 41 ], [ 41, 42 ], [ 42, 43 ], [ 36, 44 ], [ 44, 45 ], [ 45, 46 ], [ 45, 47 ], [ 44, 48 ], [ 48, 49 ], [ 49, 50 ], [ 50, 51 ], [ 51, 52 ], [ 51, 53 ], [ 50, 54 ], [ 54, 55 ], [ 54, 56 ], [ 56, 57 ], [ 56, 58 ], [ 49, 59 ], [ 59, 60 ], [ 60, 61 ], [ 60, 62 ], [ 62, 63 ], [ 63, 64 ], [ 63, 65 ], [ 65, 66 ], [ 65, 67 ], [ 62, 68 ], [ 68, 69 ], [ 68, 70 ], [ 59, 71 ], [ 71, 72 ], [ 72, 73 ], [ 72, 74 ], [ 71, 75 ], [ 75, 76 ], [ 75, 77 ], [ 77, 78 ], [ 77, 79 ], [ 8, 80 ], [ 80, 81 ], [ 81, 82 ], [ 82, 83 ], [ 82, 84 ], [ 80, 85 ], [ 6, 86 ], [ 86, 87 ] ]
[ "import java.util.*;\n \nclass Main{\n public static void main(String[] args){\n Scanner sc=new Scanner(System.in);\n int n=sc.nextInt();\n int[] a=new int [n];\n long ans=0;\n for(int i=0;i<n;i++){\n a[i]=sc.nextInt();\n if(i!=0){\n if(a[i]<a[i-1]){\n ans+=(long)a[i-1]-a[i];\n a[i]=a[i-1];\n }\n }\n }\n System.out.println(ans);\n }\n}", "import java.util.*;", "util.*", "java", "class Main{\n public static void main(String[] args){\n Scanner sc=new Scanner(System.in);\n int n=sc.nextInt();\n int[] a=new int [n];\n long ans=0;\n for(int i=0;i<n;i++){\n a[i]=sc.nextInt();\n if(i!=0){\n if(a[i]<a[i-1]){\n ans+=(long)a[i-1]-a[i];\n a[i]=a[i-1];\n }\n }\n }\n System.out.println(ans);\n }\n}", "Main", "public static void main(String[] args){\n Scanner sc=new Scanner(System.in);\n int n=sc.nextInt();\n int[] a=new int [n];\n long ans=0;\n for(int i=0;i<n;i++){\n a[i]=sc.nextInt();\n if(i!=0){\n if(a[i]<a[i-1]){\n ans+=(long)a[i-1]-a[i];\n a[i]=a[i-1];\n }\n }\n }\n System.out.println(ans);\n }", "main", "{\n Scanner sc=new Scanner(System.in);\n int n=sc.nextInt();\n int[] a=new int [n];\n long ans=0;\n for(int i=0;i<n;i++){\n a[i]=sc.nextInt();\n if(i!=0){\n if(a[i]<a[i-1]){\n ans+=(long)a[i-1]-a[i];\n a[i]=a[i-1];\n }\n }\n }\n System.out.println(ans);\n }", "Scanner sc=new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n=sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "int[] a=new int [n];", "a", "new int [n]", "n", "long ans=0;", "ans", "0", "for(int i=0;i<n;i++){\n a[i]=sc.nextInt();\n if(i!=0){\n if(a[i]<a[i-1]){\n ans+=(long)a[i-1]-a[i];\n a[i]=a[i-1];\n }\n }\n }", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\n a[i]=sc.nextInt();\n if(i!=0){\n if(a[i]<a[i-1]){\n ans+=(long)a[i-1]-a[i];\n a[i]=a[i-1];\n }\n }\n }", "{\n a[i]=sc.nextInt();\n if(i!=0){\n if(a[i]<a[i-1]){\n ans+=(long)a[i-1]-a[i];\n a[i]=a[i-1];\n }\n }\n }", "a[i]=sc.nextInt()", "a[i]", "a", "i", "sc.nextInt()", "sc.nextInt", "sc", "if(i!=0){\n if(a[i]<a[i-1]){\n ans+=(long)a[i-1]-a[i];\n a[i]=a[i-1];\n }\n }", "i!=0", "i", "0", "{\n if(a[i]<a[i-1]){\n ans+=(long)a[i-1]-a[i];\n a[i]=a[i-1];\n }\n }", "if(a[i]<a[i-1]){\n ans+=(long)a[i-1]-a[i];\n a[i]=a[i-1];\n }", "a[i]<a[i-1]", "a[i]", "a", "i", "a[i-1]", "a", "i-1", "i", "1", "{\n ans+=(long)a[i-1]-a[i];\n a[i]=a[i-1];\n }", "ans+=(long)a[i-1]-a[i]", "ans", "(long)a[i-1]-a[i]", "(long)a[i-1]", "a", "i-1", "i", "1", "a[i]", "a", "i", "a[i]=a[i-1]", "a[i]", "a", "i", "a[i-1]", "a", "i-1", "i", "1", "System.out.println(ans)", "System.out.println", "System.out", "System", "System.out", "ans", "String[] args", "args" ]
import java.util.*; class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int[] a=new int [n]; long ans=0; for(int i=0;i<n;i++){ a[i]=sc.nextInt(); if(i!=0){ if(a[i]<a[i-1]){ ans+=(long)a[i-1]-a[i]; a[i]=a[i-1]; } } } System.out.println(ans); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 18, 13, 4, 13, 13, 13, 23, 13, 12, 13, 30, 41, 13, 17, 41, 13, 18, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 4, 18, 13, 13, 18, 13, 13, 14, 2, 18, 13, 13, 13, 30, 0, 13, 2, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 104, 5 ], [ 104, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 8, 21 ], [ 21, 22 ], [ 22, 23 ], [ 23, 24 ], [ 23, 25 ], [ 21, 26 ], [ 26, 27 ], [ 26, 28 ], [ 21, 29 ], [ 29, 30 ], [ 30, 31 ], [ 21, 32 ], [ 32, 33 ], [ 33, 34 ], [ 34, 35 ], [ 34, 36 ], [ 33, 37 ], [ 37, 38 ], [ 38, 39 ], [ 8, 40 ], [ 40, 41 ], [ 40, 42 ], [ 40, 43 ], [ 6, 44 ], [ 44, 45 ], [ 104, 46 ], [ 46, 47 ], [ 46, 48 ], [ 48, 49 ], [ 49, 50 ], [ 49, 51 ], [ 48, 52 ], [ 52, 53 ], [ 52, 54 ], [ 54, 55 ], [ 54, 56 ], [ 48, 57 ], [ 57, 58 ], [ 58, 59 ], [ 59, 60 ], [ 59, 61 ], [ 57, 62 ], [ 62, 63 ], [ 62, 64 ], [ 57, 65 ], [ 65, 66 ], [ 66, 67 ], [ 57, 68 ], [ 69, 69 ], [ 69, 70 ], [ 70, 71 ], [ 70, 72 ], [ 72, 73 ], [ 73, 74 ], [ 72, 75 ], [ 72, 76 ], [ 76, 77 ], [ 76, 78 ], [ 69, 79 ], [ 79, 80 ], [ 80, 81 ], [ 81, 82 ], [ 81, 83 ], [ 80, 84 ], [ 79, 85 ], [ 85, 86 ], [ 86, 87 ], [ 86, 88 ], [ 88, 89 ], [ 88, 90 ], [ 90, 91 ], [ 90, 92 ], [ 48, 93 ], [ 93, 94 ], [ 94, 95 ], [ 95, 96 ], [ 95, 97 ], [ 93, 98 ], [ 46, 99 ], [ 99, 100 ], [ 46, 101 ], [ 101, 102 ], [ 0, 103 ], [ 103, 104 ], [ 103, 105 ] ]
[ "import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] hts = new long[n];\n\t\tfor (int i = 0; i < n; i++) hts[i] = sc.nextLong();\n\t\tsolve(hts, n);\n\t}\n\n\tprivate static void solve(long[] hts, int n) {\n\t\t// TODO Auto-generated method stub\n\t\tlong rht = 0, lm = hts[0];\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tlm = Math.max(lm, hts[i]);\n\t\t\tif (hts[i] < lm) {\n\t\t\t\trht += lm - hts[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(rht);\n\t}\n\n}", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] hts = new long[n];\n\t\tfor (int i = 0; i < n; i++) hts[i] = sc.nextLong();\n\t\tsolve(hts, n);\n\t}\n\n\tprivate static void solve(long[] hts, int n) {\n\t\t// TODO Auto-generated method stub\n\t\tlong rht = 0, lm = hts[0];\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tlm = Math.max(lm, hts[i]);\n\t\t\tif (hts[i] < lm) {\n\t\t\t\trht += lm - hts[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(rht);\n\t}\n\n}", "Main", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] hts = new long[n];\n\t\tfor (int i = 0; i < n; i++) hts[i] = sc.nextLong();\n\t\tsolve(hts, n);\n\t}", "main", "{\n\t\t// TODO Auto-generated method stub\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] hts = new long[n];\n\t\tfor (int i = 0; i < n; i++) hts[i] = sc.nextLong();\n\t\tsolve(hts, n);\n\t}", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "long[] hts = new long[n];", "hts", "new long[n]", "n", "for (int i = 0; i < n; i++) hts[i] = sc.nextLong();", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "hts[i] = sc.nextLong();", "hts[i] = sc.nextLong()", "hts[i]", "hts", "i", "sc.nextLong()", "sc.nextLong", "sc", "solve(hts, n)", "solve", "hts", "n", "String[] args", "args", "private static void solve(long[] hts, int n) {\n\t\t// TODO Auto-generated method stub\n\t\tlong rht = 0, lm = hts[0];\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tlm = Math.max(lm, hts[i]);\n\t\t\tif (hts[i] < lm) {\n\t\t\t\trht += lm - hts[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(rht);\n\t}", "solve", "{\n\t\t// TODO Auto-generated method stub\n\t\tlong rht = 0, lm = hts[0];\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tlm = Math.max(lm, hts[i]);\n\t\t\tif (hts[i] < lm) {\n\t\t\t\trht += lm - hts[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(rht);\n\t}", "long rht = 0", "rht", "0", "lm = hts[0];", "lm", "hts[0]", "hts", "0", "for (int i = 1; i < n; i++) {\n\t\t\tlm = Math.max(lm, hts[i]);\n\t\t\tif (hts[i] < lm) {\n\t\t\t\trht += lm - hts[i];\n\t\t\t}\n\t\t}", "int i = 1;", "int i = 1;", "i", "1", "i < n", "i", "n", "i++", "i++", "i", "{\n\t\t\tlm = Math.max(lm, hts[i]);\n\t\t\tif (hts[i] < lm) {\n\t\t\t\trht += lm - hts[i];\n\t\t\t}\n\t\t}", "{\n\t\t\tlm = Math.max(lm, hts[i]);\n\t\t\tif (hts[i] < lm) {\n\t\t\t\trht += lm - hts[i];\n\t\t\t}\n\t\t}", "lm = Math.max(lm, hts[i])", "lm", "Math.max(lm, hts[i])", "Math.max", "Math", "lm", "hts[i]", "hts", "i", "if (hts[i] < lm) {\n\t\t\t\trht += lm - hts[i];\n\t\t\t}", "hts[i] < lm", "hts[i]", "hts", "i", "lm", "{\n\t\t\t\trht += lm - hts[i];\n\t\t\t}", "rht += lm - hts[i]", "rht", "lm - hts[i]", "lm", "hts[i]", "hts", "i", "System.out.println(rht)", "System.out.println", "System.out", "System", "System.out", "rht", "long[] hts", "hts", "int n", "n", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] hts = new long[n];\n\t\tfor (int i = 0; i < n; i++) hts[i] = sc.nextLong();\n\t\tsolve(hts, n);\n\t}\n\n\tprivate static void solve(long[] hts, int n) {\n\t\t// TODO Auto-generated method stub\n\t\tlong rht = 0, lm = hts[0];\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tlm = Math.max(lm, hts[i]);\n\t\t\tif (hts[i] < lm) {\n\t\t\t\trht += lm - hts[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(rht);\n\t}\n\n}", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] hts = new long[n];\n\t\tfor (int i = 0; i < n; i++) hts[i] = sc.nextLong();\n\t\tsolve(hts, n);\n\t}\n\n\tprivate static void solve(long[] hts, int n) {\n\t\t// TODO Auto-generated method stub\n\t\tlong rht = 0, lm = hts[0];\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tlm = Math.max(lm, hts[i]);\n\t\t\tif (hts[i] < lm) {\n\t\t\t\trht += lm - hts[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(rht);\n\t}\n\n}", "Main" ]
import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long[] hts = new long[n]; for (int i = 0; i < n; i++) hts[i] = sc.nextLong(); solve(hts, n); } private static void solve(long[] hts, int n) { // TODO Auto-generated method stub long rht = 0, lm = hts[0]; for (int i = 1; i < n; i++) { lm = Math.max(lm, hts[i]); if (hts[i] < lm) { rht += lm - hts[i]; } } System.out.println(rht); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 41, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 0, 13, 18, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 18, 13, 13, 13, 0, 13, 2, 13, 4, 18, 13, 2, 18, 13, 13, 13, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 100, 8 ], [ 100, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 11, 24 ], [ 24, 25 ], [ 24, 26 ], [ 11, 27 ], [ 27, 28 ], [ 27, 29 ], [ 11, 30 ], [ 30, 31 ], [ 31, 32 ], [ 32, 33 ], [ 32, 34 ], [ 30, 35 ], [ 35, 36 ], [ 35, 37 ], [ 30, 38 ], [ 38, 39 ], [ 39, 40 ], [ 30, 41 ], [ 42, 42 ], [ 42, 43 ], [ 43, 44 ], [ 44, 45 ], [ 44, 46 ], [ 43, 47 ], [ 47, 48 ], [ 48, 49 ], [ 11, 50 ], [ 50, 51 ], [ 50, 52 ], [ 52, 53 ], [ 52, 54 ], [ 11, 55 ], [ 55, 56 ], [ 56, 57 ], [ 57, 58 ], [ 57, 59 ], [ 55, 60 ], [ 60, 61 ], [ 60, 62 ], [ 55, 63 ], [ 63, 64 ], [ 64, 65 ], [ 55, 66 ], [ 67, 67 ], [ 67, 68 ], [ 68, 69 ], [ 69, 70 ], [ 70, 71 ], [ 70, 72 ], [ 69, 73 ], [ 68, 74 ], [ 74, 75 ], [ 74, 76 ], [ 76, 77 ], [ 76, 78 ], [ 78, 79 ], [ 79, 80 ], [ 78, 81 ], [ 81, 82 ], [ 82, 83 ], [ 82, 84 ], [ 81, 85 ], [ 68, 86 ], [ 86, 87 ], [ 86, 88 ], [ 88, 89 ], [ 88, 90 ], [ 11, 91 ], [ 91, 92 ], [ 92, 93 ], [ 93, 94 ], [ 93, 95 ], [ 91, 96 ], [ 9, 97 ], [ 97, 98 ], [ 0, 99 ], [ 99, 100 ], [ 99, 101 ] ]
[ "import java.util.*;\nimport java.lang.*;\n\npublic class Main\n{\n\tpublic static void main(String args[])\n\t{\n\t\tScanner sc=new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tint a[]=new int [n];\n\t\tint temp=0;\n\t\tlong ans=0;\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t\ta[i]=sc.nextInt();\n\t\t}\n\t\ttemp=a[0];\n\t\tfor(int i=1;i<n;i++)\n\t\t{\n\t\t\tif(a[i]<=temp)\n\t\t\t\tans=ans+Math.abs(a[i]-temp);\n\t\t\telse\n\t\t\t\ttemp=a[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}", "import java.util.*;", "util.*", "java", "import java.lang.*;", "lang.*", "java", "public class Main\n{\n\tpublic static void main(String args[])\n\t{\n\t\tScanner sc=new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tint a[]=new int [n];\n\t\tint temp=0;\n\t\tlong ans=0;\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t\ta[i]=sc.nextInt();\n\t\t}\n\t\ttemp=a[0];\n\t\tfor(int i=1;i<n;i++)\n\t\t{\n\t\t\tif(a[i]<=temp)\n\t\t\t\tans=ans+Math.abs(a[i]-temp);\n\t\t\telse\n\t\t\t\ttemp=a[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}", "Main", "public static void main(String args[])\n\t{\n\t\tScanner sc=new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tint a[]=new int [n];\n\t\tint temp=0;\n\t\tlong ans=0;\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t\ta[i]=sc.nextInt();\n\t\t}\n\t\ttemp=a[0];\n\t\tfor(int i=1;i<n;i++)\n\t\t{\n\t\t\tif(a[i]<=temp)\n\t\t\t\tans=ans+Math.abs(a[i]-temp);\n\t\t\telse\n\t\t\t\ttemp=a[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}", "main", "{\n\t\tScanner sc=new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tint a[]=new int [n];\n\t\tint temp=0;\n\t\tlong ans=0;\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t\ta[i]=sc.nextInt();\n\t\t}\n\t\ttemp=a[0];\n\t\tfor(int i=1;i<n;i++)\n\t\t{\n\t\t\tif(a[i]<=temp)\n\t\t\t\tans=ans+Math.abs(a[i]-temp);\n\t\t\telse\n\t\t\t\ttemp=a[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}", "Scanner sc=new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n=sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "int a[]=new int [n];", "a", "new int [n]", "n", "int temp=0;", "temp", "0", "long ans=0;", "ans", "0", "for(int i=0;i<n;i++)\n\t\t{\n\t\t\ta[i]=sc.nextInt();\n\t\t}", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\n\t\t\ta[i]=sc.nextInt();\n\t\t}", "{\n\t\t\ta[i]=sc.nextInt();\n\t\t}", "a[i]=sc.nextInt()", "a[i]", "a", "i", "sc.nextInt()", "sc.nextInt", "sc", "temp=a[0]", "temp", "a[0]", "a", "0", "for(int i=1;i<n;i++)\n\t\t{\n\t\t\tif(a[i]<=temp)\n\t\t\t\tans=ans+Math.abs(a[i]-temp);\n\t\t\telse\n\t\t\t\ttemp=a[i];\n\t\t}", "int i=1;", "int i=1;", "i", "1", "i<n", "i", "n", "i++", "i++", "i", "{\n\t\t\tif(a[i]<=temp)\n\t\t\t\tans=ans+Math.abs(a[i]-temp);\n\t\t\telse\n\t\t\t\ttemp=a[i];\n\t\t}", "{\n\t\t\tif(a[i]<=temp)\n\t\t\t\tans=ans+Math.abs(a[i]-temp);\n\t\t\telse\n\t\t\t\ttemp=a[i];\n\t\t}", "if(a[i]<=temp)\n\t\t\t\tans=ans+Math.abs(a[i]-temp);\n\t\t\telse\n\t\t\t\ttemp=a[i];", "a[i]<=temp", "a[i]", "a", "i", "temp", "ans=ans+Math.abs(a[i]-temp)", "ans", "ans+Math.abs(a[i]-temp)", "ans", "Math.abs(a[i]-temp)", "Math.abs", "Math", "a[i]-temp", "a[i]", "a", "i", "temp", "temp=a[i]", "temp", "a[i]", "a", "i", "System.out.println(ans)", "System.out.println", "System.out", "System", "System.out", "ans", "String args[]", "args", "public class Main\n{\n\tpublic static void main(String args[])\n\t{\n\t\tScanner sc=new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tint a[]=new int [n];\n\t\tint temp=0;\n\t\tlong ans=0;\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t\ta[i]=sc.nextInt();\n\t\t}\n\t\ttemp=a[0];\n\t\tfor(int i=1;i<n;i++)\n\t\t{\n\t\t\tif(a[i]<=temp)\n\t\t\t\tans=ans+Math.abs(a[i]-temp);\n\t\t\telse\n\t\t\t\ttemp=a[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}", "public class Main\n{\n\tpublic static void main(String args[])\n\t{\n\t\tScanner sc=new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tint a[]=new int [n];\n\t\tint temp=0;\n\t\tlong ans=0;\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t\ta[i]=sc.nextInt();\n\t\t}\n\t\ttemp=a[0];\n\t\tfor(int i=1;i<n;i++)\n\t\t{\n\t\t\tif(a[i]<=temp)\n\t\t\t\tans=ans+Math.abs(a[i]-temp);\n\t\t\telse\n\t\t\t\ttemp=a[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}", "Main" ]
import java.util.*; import java.lang.*; public class Main { public static void main(String args[]) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int a[]=new int [n]; int temp=0; long ans=0; for(int i=0;i<n;i++) { a[i]=sc.nextInt(); } temp=a[0]; for(int i=1;i<n;i++) { if(a[i]<=temp) ans=ans+Math.abs(a[i]-temp); else temp=a[i]; } System.out.println(ans); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 41, 13, 4, 18, 17, 41, 13, 20, 12, 13, 30, 42, 2, 13, 13, 30, 14, 2, 13, 13, 0, 13, 13, 0, 13, 13, 29, 13, 23, 13, 23, 13, 12, 13, 30, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 18, 13, 13, 18, 13, 2, 13, 17, 29, 17, 29, 17, 23, 13, 23, 13, 12, 13, 30, 14, 2, 13, 17, 29, 17, 14, 2, 2, 13, 17, 17, 29, 17, 11, 1, 41, 13, 17, 2, 13, 2, 13, 17, 1, 0, 13, 17, 30, 30, 14, 2, 2, 13, 13, 17, 29, 17, 29, 17, 23, 13, 12, 13, 30, 14, 2, 13, 17, 29, 17, 14, 2, 2, 13, 17, 17, 29, 17, 11, 1, 41, 13, 17, 2, 13, 2, 13, 17, 1, 0, 13, 17, 30, 30, 14, 2, 2, 13, 13, 17, 29, 17, 29, 17, 23, 13, 12, 13, 30, 28, 13, 13, 30, 30, 4, 18, 18, 13, 13, 2, 13, 17, 4, 18, 18, 13, 13, 23, 13, 12, 13, 30, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 13, 2, 13, 13, 29, 13, 23, 13, 12, 13, 30, 41, 13, 18, 13, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 41, 13, 4, 18, 13, 13, 41, 13, 18, 13, 13, 0, 18, 13, 13, 18, 13, 13, 0, 18, 13, 13, 13, 4, 18, 13, 13, 23, 13, 12, 13, 30, 41, 13, 20, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 18, 13, 13, 18, 13, 2, 13, 17, 30, 0, 13, 2, 18, 13, 2, 13, 17, 18, 13, 13, 0, 18, 13, 13, 18, 13, 2, 13, 17, 4, 18, 13, 13, 23, 13, 6, 13, 41, 13, 41, 13, 12, 13, 30, 0, 13, 20, 12, 13, 30, 42, 2, 2, 13, 17, 40, 4, 18, 13, 30, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 20, 29, 4, 18, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 13, 29, 13, 23, 13, 12, 13, 30, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 13, 29, 13, 23, 13, 12, 13, 30, 41, 13, 17, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 4, 18, 13, 29, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 485, 8 ], [ 485, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 485, 14 ], [ 14, 15 ], [ 14, 16 ], [ 485, 17 ], [ 17, 18 ], [ 17, 19 ], [ 19, 20 ], [ 20, 21 ], [ 21, 22 ], [ 21, 23 ], [ 20, 24 ], [ 24, 25 ], [ 25, 26 ], [ 26, 27 ], [ 26, 28 ], [ 25, 29 ], [ 29, 30 ], [ 29, 31 ], [ 25, 32 ], [ 32, 33 ], [ 32, 34 ], [ 19, 35 ], [ 35, 36 ], [ 17, 37 ], [ 37, 38 ], [ 17, 39 ], [ 39, 40 ], [ 485, 41 ], [ 41, 42 ], [ 41, 43 ], [ 43, 44 ], [ 44, 45 ], [ 45, 46 ], [ 46, 47 ], [ 46, 48 ], [ 44, 49 ], [ 49, 50 ], [ 49, 51 ], [ 44, 52 ], [ 52, 53 ], [ 53, 54 ], [ 44, 55 ], [ 56, 56 ], [ 56, 57 ], [ 57, 58 ], [ 58, 59 ], [ 59, 60 ], [ 59, 61 ], [ 58, 62 ], [ 62, 63 ], [ 62, 64 ], [ 64, 65 ], [ 64, 66 ], [ 57, 67 ], [ 67, 68 ], [ 43, 69 ], [ 69, 70 ], [ 41, 71 ], [ 71, 72 ], [ 41, 73 ], [ 73, 74 ], [ 485, 75 ], [ 75, 76 ], [ 75, 77 ], [ 77, 78 ], [ 78, 79 ], [ 79, 80 ], [ 79, 81 ], [ 78, 82 ], [ 82, 83 ], [ 78, 84 ], [ 84, 85 ], [ 85, 86 ], [ 86, 87 ], [ 86, 88 ], [ 85, 89 ], [ 84, 90 ], [ 90, 91 ], [ 77, 92 ], [ 92, 93 ], [ 93, 94 ], [ 94, 95 ], [ 94, 96 ], [ 92, 97 ], [ 97, 98 ], [ 97, 99 ], [ 99, 100 ], [ 99, 101 ], [ 92, 102 ], [ 102, 103 ], [ 103, 104 ], [ 103, 105 ], [ 92, 106 ], [ 107, 107 ], [ 107, 108 ], [ 108, 109 ], [ 109, 110 ], [ 110, 111 ], [ 110, 112 ], [ 109, 113 ], [ 108, 114 ], [ 114, 115 ], [ 77, 116 ], [ 116, 117 ], [ 75, 118 ], [ 118, 119 ], [ 485, 120 ], [ 120, 121 ], [ 120, 122 ], [ 122, 123 ], [ 123, 124 ], [ 124, 125 ], [ 124, 126 ], [ 123, 127 ], [ 127, 128 ], [ 123, 129 ], [ 129, 130 ], [ 130, 131 ], [ 131, 132 ], [ 131, 133 ], [ 130, 134 ], [ 129, 135 ], [ 135, 136 ], [ 122, 137 ], [ 137, 138 ], [ 138, 139 ], [ 139, 140 ], [ 139, 141 ], [ 137, 142 ], [ 142, 143 ], [ 142, 144 ], [ 144, 145 ], [ 144, 146 ], [ 137, 147 ], [ 147, 148 ], [ 148, 149 ], [ 148, 150 ], [ 137, 151 ], [ 152, 152 ], [ 152, 153 ], [ 153, 154 ], [ 154, 155 ], [ 155, 156 ], [ 155, 157 ], [ 154, 158 ], [ 153, 159 ], [ 159, 160 ], [ 122, 161 ], [ 161, 162 ], [ 120, 163 ], [ 163, 164 ], [ 485, 165 ], [ 165, 166 ], [ 165, 167 ], [ 167, 168 ], [ 168, 169 ], [ 168, 170 ], [ 168, 171 ], [ 172, 172 ], [ 172, 173 ], [ 173, 174 ], [ 174, 175 ], [ 175, 176 ], [ 175, 177 ], [ 173, 178 ], [ 178, 179 ], [ 178, 180 ], [ 167, 181 ], [ 181, 182 ], [ 182, 183 ], [ 183, 184 ], [ 183, 185 ], [ 165, 186 ], [ 186, 187 ], [ 485, 188 ], [ 188, 189 ], [ 188, 190 ], [ 190, 191 ], [ 191, 192 ], [ 191, 193 ], [ 190, 194 ], [ 194, 195 ], [ 195, 196 ], [ 196, 197 ], [ 196, 198 ], [ 194, 199 ], [ 199, 200 ], [ 199, 201 ], [ 194, 202 ], [ 202, 203 ], [ 203, 204 ], [ 194, 205 ], [ 205, 206 ], [ 206, 207 ], [ 206, 208 ], [ 208, 209 ], [ 208, 210 ], [ 190, 211 ], [ 211, 212 ], [ 188, 213 ], [ 213, 214 ], [ 485, 215 ], [ 215, 216 ], [ 215, 217 ], [ 217, 218 ], [ 218, 219 ], [ 218, 220 ], [ 220, 221 ], [ 220, 222 ], [ 217, 223 ], [ 223, 224 ], [ 224, 225 ], [ 225, 226 ], [ 225, 227 ], [ 223, 228 ], [ 228, 229 ], [ 228, 230 ], [ 223, 231 ], [ 231, 232 ], [ 232, 233 ], [ 223, 234 ], [ 235, 235 ], [ 235, 236 ], [ 236, 237 ], [ 236, 238 ], [ 238, 239 ], [ 239, 240 ], [ 238, 241 ], [ 235, 242 ], [ 242, 243 ], [ 242, 244 ], [ 244, 245 ], [ 244, 246 ], [ 235, 247 ], [ 247, 248 ], [ 248, 249 ], [ 248, 250 ], [ 247, 251 ], [ 251, 252 ], [ 251, 253 ], [ 235, 254 ], [ 254, 255 ], [ 255, 256 ], [ 255, 257 ], [ 254, 258 ], [ 217, 259 ], [ 259, 260 ], [ 260, 261 ], [ 259, 262 ], [ 215, 263 ], [ 263, 264 ], [ 485, 265 ], [ 265, 266 ], [ 265, 267 ], [ 267, 268 ], [ 268, 269 ], [ 268, 270 ], [ 267, 271 ], [ 271, 272 ], [ 271, 273 ], [ 267, 274 ], [ 274, 275 ], [ 274, 276 ], [ 276, 277 ], [ 277, 278 ], [ 267, 279 ], [ 279, 280 ], [ 279, 281 ], [ 281, 282 ], [ 282, 283 ], [ 281, 284 ], [ 267, 285 ], [ 285, 286 ], [ 285, 287 ], [ 267, 288 ], [ 288, 289 ], [ 289, 290 ], [ 290, 291 ], [ 290, 292 ], [ 288, 293 ], [ 293, 294 ], [ 293, 295 ], [ 288, 296 ], [ 296, 297 ], [ 297, 298 ], [ 288, 299 ], [ 300, 300 ], [ 300, 301 ], [ 301, 302 ], [ 302, 303 ], [ 303, 304 ], [ 303, 305 ], [ 302, 306 ], [ 306, 307 ], [ 306, 308 ], [ 308, 309 ], [ 308, 310 ], [ 301, 311 ], [ 311, 312 ], [ 312, 313 ], [ 312, 314 ], [ 314, 315 ], [ 315, 316 ], [ 315, 317 ], [ 317, 318 ], [ 317, 319 ], [ 314, 320 ], [ 320, 321 ], [ 320, 322 ], [ 311, 323 ], [ 323, 324 ], [ 324, 325 ], [ 324, 326 ], [ 323, 327 ], [ 327, 328 ], [ 327, 329 ], [ 329, 330 ], [ 329, 331 ], [ 267, 332 ], [ 332, 333 ], [ 333, 334 ], [ 332, 335 ], [ 265, 336 ], [ 336, 337 ], [ 485, 338 ], [ 338, 339 ], [ 338, 340 ], [ 340, 341 ], [ 338, 342 ], [ 342, 343 ], [ 338, 344 ], [ 344, 345 ], [ 344, 346 ], [ 346, 347 ], [ 347, 348 ], [ 347, 349 ], [ 338, 350 ], [ 350, 351 ], [ 350, 352 ], [ 352, 353 ], [ 353, 354 ], [ 354, 355 ], [ 355, 356 ], [ 355, 357 ], [ 354, 358 ], [ 358, 359 ], [ 359, 360 ], [ 360, 361 ], [ 353, 362 ], [ 362, 363 ], [ 363, 364 ], [ 364, 365 ], [ 364, 366 ], [ 366, 367 ], [ 367, 368 ], [ 368, 369 ], [ 363, 370 ], [ 370, 371 ], [ 371, 372 ], [ 371, 373 ], [ 352, 374 ], [ 374, 375 ], [ 375, 376 ], [ 376, 377 ], [ 338, 378 ], [ 378, 379 ], [ 378, 380 ], [ 380, 381 ], [ 381, 382 ], [ 382, 383 ], [ 383, 384 ], [ 382, 385 ], [ 385, 386 ], [ 338, 387 ], [ 387, 388 ], [ 387, 389 ], [ 389, 390 ], [ 390, 391 ], [ 391, 392 ], [ 392, 393 ], [ 391, 394 ], [ 394, 395 ], [ 338, 396 ], [ 396, 397 ], [ 396, 398 ], [ 398, 399 ], [ 399, 400 ], [ 400, 401 ], [ 401, 402 ], [ 400, 403 ], [ 403, 404 ], [ 338, 405 ], [ 405, 406 ], [ 405, 407 ], [ 407, 408 ], [ 408, 409 ], [ 408, 410 ], [ 407, 412 ], [ 412, 413 ], [ 413, 414 ], [ 414, 415 ], [ 414, 416 ], [ 412, 417 ], [ 417, 418 ], [ 417, 419 ], [ 412, 420 ], [ 420, 421 ], [ 421, 422 ], [ 412, 423 ], [ 423, 424 ], [ 424, 425 ], [ 425, 426 ], [ 425, 427 ], [ 424, 428 ], [ 428, 429 ], [ 407, 430 ], [ 430, 431 ], [ 405, 432 ], [ 432, 433 ], [ 338, 434 ], [ 434, 435 ], [ 434, 436 ], [ 436, 437 ], [ 437, 438 ], [ 437, 439 ], [ 436, 441 ], [ 441, 442 ], [ 442, 443 ], [ 443, 444 ], [ 443, 445 ], [ 441, 446 ], [ 446, 447 ], [ 446, 448 ], [ 441, 449 ], [ 449, 450 ], [ 450, 451 ], [ 441, 452 ], [ 452, 453 ], [ 453, 454 ], [ 454, 455 ], [ 454, 456 ], [ 453, 457 ], [ 457, 458 ], [ 436, 459 ], [ 459, 460 ], [ 434, 461 ], [ 461, 462 ], [ 338, 463 ], [ 463, 464 ], [ 463, 465 ], [ 465, 466 ], [ 466, 467 ], [ 466, 468 ], [ 465, 469 ], [ 469, 470 ], [ 470, 471 ], [ 470, 472 ], [ 472, 473 ], [ 473, 474 ], [ 474, 475 ], [ 469, 476 ], [ 476, 477 ], [ 477, 478 ], [ 477, 479 ], [ 479, 480 ], [ 480, 481 ], [ 465, 482 ], [ 482, 483 ], [ 0, 484 ], [ 484, 485 ], [ 484, 486 ] ]
[ "import java.io.*;\nimport java.util.*;\n\npublic class Main{\n final static String alpha = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\".toLowerCase();//.toCharArray();\n static class FastReader{\n BufferedReader br;\n StringTokenizer st;\n public FastReader(){br = new BufferedReader(new InputStreamReader(System.in));}\n String next(){while (st == null || !st.hasMoreElements()){try{st = new StringTokenizer(br.readLine());}catch (IOException e){e.printStackTrace();}}return st.nextToken();}\n int nextInt(){return Integer.parseInt(next());}\n long nextLong(){return Long.parseLong(next());}\n double nextDouble(){return Double.parseDouble(next());}\n int[] readArray(int n){int[] a=new int[n];for (int i=0; i<n; i++) a[i]=nextInt();return a;}\n long[] readLongArray(int n){long[] a=new long[n];for (int i=0; i<n; i++) a[i]=nextLong();return a;}\n String nextLine(){String str = \"\";try{str = br.readLine();}catch (IOException e){e.printStackTrace();}return str;}\n }\n static int getGcd(int n1,int n2){\n while(n1 != n2){\n if(n1 > n2) n1 -= n2;\n else n2 -= n1;\n }\n return n1;\n }\n static boolean isSorted(int[] arr, int n){\n for(int i=1;i<n;i++){\n if(arr[i]<arr[i-1]) return false;\n }\n return true;\n }\n static boolean isPrime(long n){\n if(n==2) return true;\n else if(n%2==0) return false;\n for(int i=3;i<=n/2;i+=2){\n if(n%i==0) return false;\n }\n return true;\n }\n static boolean isPrime(int n){\n if(n==2) return true;\n else if(n%2==0) return false;\n for(int i=3;i<=n/2;i+=2){\n if(n%i==0) return false;\n }\n return true;\n }\n static void printArray(int[] arr){\n for(int x:arr){\n System.out.print(x+\" \");\n }\n System.out.println();\n }\n static long Fact(int n){\n //int p=1000000007;\n long result = 1;\n for (int i = 1; i <= n; i++) result = (result*i);\n //for (int i = 1; i <= n; i++) result = (result*i)%p;\n return result;\n }\n static final Random random=new Random();\n static void ruffleSort(int[] a) {\n int n=a.length;//shuffle, then sort\n for (int i=0; i<n; i++) {\n int oi=random.nextInt(n), temp=a[oi];\n a[oi]=a[i]; a[i]=temp;\n }\n Arrays.sort(a);\n }\n public static void main(String[] args) throws NumberFormatException, IOException {\n FastReader s = new FastReader();\n PrintWriter pw = new PrintWriter(System.out,true);\n int n=s.nextInt();\n int[] a = s.readArray(n);\n long sum=0;\n for(int i=1;i<n;i++){\n if(a[i]<a[i-1]){\n sum+=a[i-1]-a[i];a[i]=a[i-1];\n }\n }pw.println(sum);\n }\n}", "import java.io.*;", "io.*", "java", "import java.util.*;", "util.*", "java", "public class Main{\n final static String alpha = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\".toLowerCase();//.toCharArray();\n static class FastReader{\n BufferedReader br;\n StringTokenizer st;\n public FastReader(){br = new BufferedReader(new InputStreamReader(System.in));}\n String next(){while (st == null || !st.hasMoreElements()){try{st = new StringTokenizer(br.readLine());}catch (IOException e){e.printStackTrace();}}return st.nextToken();}\n int nextInt(){return Integer.parseInt(next());}\n long nextLong(){return Long.parseLong(next());}\n double nextDouble(){return Double.parseDouble(next());}\n int[] readArray(int n){int[] a=new int[n];for (int i=0; i<n; i++) a[i]=nextInt();return a;}\n long[] readLongArray(int n){long[] a=new long[n];for (int i=0; i<n; i++) a[i]=nextLong();return a;}\n String nextLine(){String str = \"\";try{str = br.readLine();}catch (IOException e){e.printStackTrace();}return str;}\n }\n static int getGcd(int n1,int n2){\n while(n1 != n2){\n if(n1 > n2) n1 -= n2;\n else n2 -= n1;\n }\n return n1;\n }\n static boolean isSorted(int[] arr, int n){\n for(int i=1;i<n;i++){\n if(arr[i]<arr[i-1]) return false;\n }\n return true;\n }\n static boolean isPrime(long n){\n if(n==2) return true;\n else if(n%2==0) return false;\n for(int i=3;i<=n/2;i+=2){\n if(n%i==0) return false;\n }\n return true;\n }\n static boolean isPrime(int n){\n if(n==2) return true;\n else if(n%2==0) return false;\n for(int i=3;i<=n/2;i+=2){\n if(n%i==0) return false;\n }\n return true;\n }\n static void printArray(int[] arr){\n for(int x:arr){\n System.out.print(x+\" \");\n }\n System.out.println();\n }\n static long Fact(int n){\n //int p=1000000007;\n long result = 1;\n for (int i = 1; i <= n; i++) result = (result*i);\n //for (int i = 1; i <= n; i++) result = (result*i)%p;\n return result;\n }\n static final Random random=new Random();\n static void ruffleSort(int[] a) {\n int n=a.length;//shuffle, then sort\n for (int i=0; i<n; i++) {\n int oi=random.nextInt(n), temp=a[oi];\n a[oi]=a[i]; a[i]=temp;\n }\n Arrays.sort(a);\n }\n public static void main(String[] args) throws NumberFormatException, IOException {\n FastReader s = new FastReader();\n PrintWriter pw = new PrintWriter(System.out,true);\n int n=s.nextInt();\n int[] a = s.readArray(n);\n long sum=0;\n for(int i=1;i<n;i++){\n if(a[i]<a[i-1]){\n sum+=a[i-1]-a[i];a[i]=a[i-1];\n }\n }pw.println(sum);\n }\n}", "Main", "final static String alpha = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\".toLowerCase();//.toCharArray();", "alpha", "\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\".toLowerCase()", "\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\".toLowerCase", "\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"", "static final Random random=new Random();", "random", "new Random()", "static int getGcd(int n1,int n2){\n while(n1 != n2){\n if(n1 > n2) n1 -= n2;\n else n2 -= n1;\n }\n return n1;\n }", "getGcd", "{\n while(n1 != n2){\n if(n1 > n2) n1 -= n2;\n else n2 -= n1;\n }\n return n1;\n }", "while(n1 != n2){\n if(n1 > n2) n1 -= n2;\n else n2 -= n1;\n }", "n1 != n2", "n1", "n2", "{\n if(n1 > n2) n1 -= n2;\n else n2 -= n1;\n }", "if(n1 > n2) n1 -= n2;\n else n2 -= n1;", "n1 > n2", "n1", "n2", "n1 -= n2", "n1", "n2", "n2 -= n1", "n2", "n1", "return n1;", "n1", "int n1", "n1", "int n2", "n2", "static boolean isSorted(int[] arr, int n){\n for(int i=1;i<n;i++){\n if(arr[i]<arr[i-1]) return false;\n }\n return true;\n }", "isSorted", "{\n for(int i=1;i<n;i++){\n if(arr[i]<arr[i-1]) return false;\n }\n return true;\n }", "for(int i=1;i<n;i++){\n if(arr[i]<arr[i-1]) return false;\n }", "int i=1;", "int i=1;", "i", "1", "i<n", "i", "n", "i++", "i++", "i", "{\n if(arr[i]<arr[i-1]) return false;\n }", "{\n if(arr[i]<arr[i-1]) return false;\n }", "if(arr[i]<arr[i-1]) return false;", "arr[i]<arr[i-1]", "arr[i]", "arr", "i", "arr[i-1]", "arr", "i-1", "i", "1", "return false;", "false", "return true;", "true", "int[] arr", "arr", "int n", "n", "static boolean isPrime(long n){\n if(n==2) return true;\n else if(n%2==0) return false;\n for(int i=3;i<=n/2;i+=2){\n if(n%i==0) return false;\n }\n return true;\n }", "isPrime", "{\n if(n==2) return true;\n else if(n%2==0) return false;\n for(int i=3;i<=n/2;i+=2){\n if(n%i==0) return false;\n }\n return true;\n }", "if(n==2) return true;\n else if(n%2==0) return false;", "n==2", "n", "2", "return true;", "true", "if(n%2==0) return false;", "n%2==0", "n%2", "n", "2", "0", "return false;", "false", "for(int i=3;i<=n/2;i+=2){\n if(n%i==0) return false;\n }", "int i=3;", "int i=3;", "i", "3", "i<=n/2", "i", "n/2", "n", "2", "i+=2", "i+=2", "i", "2", "{\n if(n%i==0) return false;\n }", "{\n if(n%i==0) return false;\n }", "if(n%i==0) return false;", "n%i==0", "n%i", "n", "i", "0", "return false;", "false", "return true;", "true", "long n", "n", "static boolean isPrime(int n){\n if(n==2) return true;\n else if(n%2==0) return false;\n for(int i=3;i<=n/2;i+=2){\n if(n%i==0) return false;\n }\n return true;\n }", "isPrime", "{\n if(n==2) return true;\n else if(n%2==0) return false;\n for(int i=3;i<=n/2;i+=2){\n if(n%i==0) return false;\n }\n return true;\n }", "if(n==2) return true;\n else if(n%2==0) return false;", "n==2", "n", "2", "return true;", "true", "if(n%2==0) return false;", "n%2==0", "n%2", "n", "2", "0", "return false;", "false", "for(int i=3;i<=n/2;i+=2){\n if(n%i==0) return false;\n }", "int i=3;", "int i=3;", "i", "3", "i<=n/2", "i", "n/2", "n", "2", "i+=2", "i+=2", "i", "2", "{\n if(n%i==0) return false;\n }", "{\n if(n%i==0) return false;\n }", "if(n%i==0) return false;", "n%i==0", "n%i", "n", "i", "0", "return false;", "false", "return true;", "true", "int n", "n", "static void printArray(int[] arr){\n for(int x:arr){\n System.out.print(x+\" \");\n }\n System.out.println();\n }", "printArray", "{\n for(int x:arr){\n System.out.print(x+\" \");\n }\n System.out.println();\n }", "for(int x:arr){\n System.out.print(x+\" \");\n }", "int x", "arr", "{\n System.out.print(x+\" \");\n }", "{\n System.out.print(x+\" \");\n }", "System.out.print(x+\" \")", "System.out.print", "System.out", "System", "System.out", "x+\" \"", "x", "\" \"", "System.out.println()", "System.out.println", "System.out", "System", "System.out", "int[] arr", "arr", "static long Fact(int n){\n //int p=1000000007;\n long result = 1;\n for (int i = 1; i <= n; i++) result = (result*i);\n //for (int i = 1; i <= n; i++) result = (result*i)%p;\n return result;\n }", "Fact", "{\n //int p=1000000007;\n long result = 1;\n for (int i = 1; i <= n; i++) result = (result*i);\n //for (int i = 1; i <= n; i++) result = (result*i)%p;\n return result;\n }", "long result = 1;", "result", "1", "for (int i = 1; i <= n; i++) result = (result*i);", "int i = 1;", "int i = 1;", "i", "1", "i <= n", "i", "n", "i++", "i++", "i", "result = (result*i);", "result = (result*i)", "result", "(result*i)", "result", "i", "return result;", "result", "int n", "n", "static void ruffleSort(int[] a) {\n int n=a.length;//shuffle, then sort\n for (int i=0; i<n; i++) {\n int oi=random.nextInt(n), temp=a[oi];\n a[oi]=a[i]; a[i]=temp;\n }\n Arrays.sort(a);\n }", "ruffleSort", "{\n int n=a.length;//shuffle, then sort\n for (int i=0; i<n; i++) {\n int oi=random.nextInt(n), temp=a[oi];\n a[oi]=a[i]; a[i]=temp;\n }\n Arrays.sort(a);\n }", "int n=a.length;", "n", "a.length", "a", "a.length", "for (int i=0; i<n; i++) {\n int oi=random.nextInt(n), temp=a[oi];\n a[oi]=a[i]; a[i]=temp;\n }", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\n int oi=random.nextInt(n), temp=a[oi];\n a[oi]=a[i]; a[i]=temp;\n }", "{\n int oi=random.nextInt(n), temp=a[oi];\n a[oi]=a[i]; a[i]=temp;\n }", "int oi=random.nextInt(n)", "oi", "random.nextInt(n)", "random.nextInt", "random", "n", "temp=a[oi];", "temp", "a[oi]", "a", "oi", "a[oi]=a[i]", "a[oi]", "a", "oi", "a[i]", "a", "i", "a[i]=temp", "a[i]", "a", "i", "temp", "Arrays.sort(a)", "Arrays.sort", "Arrays", "a", "int[] a", "a", "public static void main(String[] args) throws NumberFormatException, IOException {\n FastReader s = new FastReader();\n PrintWriter pw = new PrintWriter(System.out,true);\n int n=s.nextInt();\n int[] a = s.readArray(n);\n long sum=0;\n for(int i=1;i<n;i++){\n if(a[i]<a[i-1]){\n sum+=a[i-1]-a[i];a[i]=a[i-1];\n }\n }pw.println(sum);\n }", "main", "{\n FastReader s = new FastReader();\n PrintWriter pw = new PrintWriter(System.out,true);\n int n=s.nextInt();\n int[] a = s.readArray(n);\n long sum=0;\n for(int i=1;i<n;i++){\n if(a[i]<a[i-1]){\n sum+=a[i-1]-a[i];a[i]=a[i-1];\n }\n }pw.println(sum);\n }", "FastReader s = new FastReader();", "s", "new FastReader()", "PrintWriter pw = new PrintWriter(System.out,true);", "pw", "new PrintWriter(System.out,true)", "int n=s.nextInt();", "n", "s.nextInt()", "s.nextInt", "s", "int[] a = s.readArray(n);", "a", "s.readArray(n)", "s.readArray", "s", "n", "long sum=0;", "sum", "0", "for(int i=1;i<n;i++){\n if(a[i]<a[i-1]){\n sum+=a[i-1]-a[i];a[i]=a[i-1];\n }\n }", "int i=1;", "int i=1;", "i", "1", "i<n", "i", "n", "i++", "i++", "i", "{\n if(a[i]<a[i-1]){\n sum+=a[i-1]-a[i];a[i]=a[i-1];\n }\n }", "{\n if(a[i]<a[i-1]){\n sum+=a[i-1]-a[i];a[i]=a[i-1];\n }\n }", "if(a[i]<a[i-1]){\n sum+=a[i-1]-a[i];a[i]=a[i-1];\n }", "a[i]<a[i-1]", "a[i]", "a", "i", "a[i-1]", "a", "i-1", "i", "1", "{\n sum+=a[i-1]-a[i];a[i]=a[i-1];\n }", "sum+=a[i-1]-a[i]", "sum", "a[i-1]-a[i]", "a[i-1]", "a", "i-1", "i", "1", "a[i]", "a", "i", "a[i]=a[i-1]", "a[i]", "a", "i", "a[i-1]", "a", "i-1", "i", "1", "pw.println(sum)", "pw.println", "pw", "sum", "String[] args", "args", "static class FastReader{\n BufferedReader br;\n StringTokenizer st;\n public FastReader(){br = new BufferedReader(new InputStreamReader(System.in));}\n String next(){while (st == null || !st.hasMoreElements()){try{st = new StringTokenizer(br.readLine());}catch (IOException e){e.printStackTrace();}}return st.nextToken();}\n int nextInt(){return Integer.parseInt(next());}\n long nextLong(){return Long.parseLong(next());}\n double nextDouble(){return Double.parseDouble(next());}\n int[] readArray(int n){int[] a=new int[n];for (int i=0; i<n; i++) a[i]=nextInt();return a;}\n long[] readLongArray(int n){long[] a=new long[n];for (int i=0; i<n; i++) a[i]=nextLong();return a;}\n String nextLine(){String str = \"\";try{str = br.readLine();}catch (IOException e){e.printStackTrace();}return str;}\n }", "FastReader", "BufferedReader br;", "br", "StringTokenizer st;", "st", "public FastReader(){br = new BufferedReader(new InputStreamReader(System.in));}", "FastReader", "{br = new BufferedReader(new InputStreamReader(System.in));}", "br = new BufferedReader(new InputStreamReader(System.in))", "br", "new BufferedReader(new InputStreamReader(System.in))", "String next(){while (st == null || !st.hasMoreElements()){try{st = new StringTokenizer(br.readLine());}catch (IOException e){e.printStackTrace();}}return st.nextToken();}", "next", "{while (st == null || !st.hasMoreElements()){try{st = new StringTokenizer(br.readLine());}catch (IOException e){e.printStackTrace();}}return st.nextToken();}", "while (st == null || !st.hasMoreElements()){try{st = new StringTokenizer(br.readLine());}catch (IOException e){e.printStackTrace();}}", "st == null || !st.hasMoreElements()", "st == null", "st", "null", "!st.hasMoreElements()", "st.hasMoreElements()", "st.hasMoreElements", "st", "{try{st = new StringTokenizer(br.readLine());}catch (IOException e){e.printStackTrace();}}", "try{st = new StringTokenizer(br.readLine());}catch (IOException e){e.printStackTrace();}", "catch (IOException e){e.printStackTrace();}", "IOException e", "{e.printStackTrace();}", "e.printStackTrace()", "e.printStackTrace", "e", "{st = new StringTokenizer(br.readLine());}", "st = new StringTokenizer(br.readLine())", "st", "new StringTokenizer(br.readLine())", "return st.nextToken();", "st.nextToken()", "st.nextToken", "st", "int nextInt(){return Integer.parseInt(next());}", "nextInt", "{return Integer.parseInt(next());}", "return Integer.parseInt(next());", "Integer.parseInt(next())", "Integer.parseInt", "Integer", "next()", "next", "long nextLong(){return Long.parseLong(next());}", "nextLong", "{return Long.parseLong(next());}", "return Long.parseLong(next());", "Long.parseLong(next())", "Long.parseLong", "Long", "next()", "next", "double nextDouble(){return Double.parseDouble(next());}", "nextDouble", "{return Double.parseDouble(next());}", "return Double.parseDouble(next());", "Double.parseDouble(next())", "Double.parseDouble", "Double", "next()", "next", "int[] readArray(int n){int[] a=new int[n];for (int i=0; i<n; i++) a[i]=nextInt();return a;}", "readArray", "{int[] a=new int[n];for (int i=0; i<n; i++) a[i]=nextInt();return a;}", "int[] a=new int[n];", "a", "new int[n]", "n", "for (int i=0; i<n; i++) a[i]=nextInt();", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "a[i]=nextInt();", "a[i]=nextInt()", "a[i]", "a", "i", "nextInt()", "nextInt", "return a;", "a", "int n", "n", "long[] readLongArray(int n){long[] a=new long[n];for (int i=0; i<n; i++) a[i]=nextLong();return a;}", "readLongArray", "{long[] a=new long[n];for (int i=0; i<n; i++) a[i]=nextLong();return a;}", "long[] a=new long[n];", "a", "new long[n]", "n", "for (int i=0; i<n; i++) a[i]=nextLong();", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "a[i]=nextLong();", "a[i]=nextLong()", "a[i]", "a", "i", "nextLong()", "nextLong", "return a;", "a", "int n", "n", "String nextLine(){String str = \"\";try{str = br.readLine();}catch (IOException e){e.printStackTrace();}return str;}", "nextLine", "{String str = \"\";try{str = br.readLine();}catch (IOException e){e.printStackTrace();}return str;}", "String str = \"\";", "str", "\"\"", "try{str = br.readLine();}catch (IOException e){e.printStackTrace();}", "catch (IOException e){e.printStackTrace();}", "IOException e", "{e.printStackTrace();}", "e.printStackTrace()", "e.printStackTrace", "e", "{str = br.readLine();}", "str = br.readLine()", "str", "br.readLine()", "br.readLine", "br", "return str;", "str", "public class Main{\n final static String alpha = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\".toLowerCase();//.toCharArray();\n static class FastReader{\n BufferedReader br;\n StringTokenizer st;\n public FastReader(){br = new BufferedReader(new InputStreamReader(System.in));}\n String next(){while (st == null || !st.hasMoreElements()){try{st = new StringTokenizer(br.readLine());}catch (IOException e){e.printStackTrace();}}return st.nextToken();}\n int nextInt(){return Integer.parseInt(next());}\n long nextLong(){return Long.parseLong(next());}\n double nextDouble(){return Double.parseDouble(next());}\n int[] readArray(int n){int[] a=new int[n];for (int i=0; i<n; i++) a[i]=nextInt();return a;}\n long[] readLongArray(int n){long[] a=new long[n];for (int i=0; i<n; i++) a[i]=nextLong();return a;}\n String nextLine(){String str = \"\";try{str = br.readLine();}catch (IOException e){e.printStackTrace();}return str;}\n }\n static int getGcd(int n1,int n2){\n while(n1 != n2){\n if(n1 > n2) n1 -= n2;\n else n2 -= n1;\n }\n return n1;\n }\n static boolean isSorted(int[] arr, int n){\n for(int i=1;i<n;i++){\n if(arr[i]<arr[i-1]) return false;\n }\n return true;\n }\n static boolean isPrime(long n){\n if(n==2) return true;\n else if(n%2==0) return false;\n for(int i=3;i<=n/2;i+=2){\n if(n%i==0) return false;\n }\n return true;\n }\n static boolean isPrime(int n){\n if(n==2) return true;\n else if(n%2==0) return false;\n for(int i=3;i<=n/2;i+=2){\n if(n%i==0) return false;\n }\n return true;\n }\n static void printArray(int[] arr){\n for(int x:arr){\n System.out.print(x+\" \");\n }\n System.out.println();\n }\n static long Fact(int n){\n //int p=1000000007;\n long result = 1;\n for (int i = 1; i <= n; i++) result = (result*i);\n //for (int i = 1; i <= n; i++) result = (result*i)%p;\n return result;\n }\n static final Random random=new Random();\n static void ruffleSort(int[] a) {\n int n=a.length;//shuffle, then sort\n for (int i=0; i<n; i++) {\n int oi=random.nextInt(n), temp=a[oi];\n a[oi]=a[i]; a[i]=temp;\n }\n Arrays.sort(a);\n }\n public static void main(String[] args) throws NumberFormatException, IOException {\n FastReader s = new FastReader();\n PrintWriter pw = new PrintWriter(System.out,true);\n int n=s.nextInt();\n int[] a = s.readArray(n);\n long sum=0;\n for(int i=1;i<n;i++){\n if(a[i]<a[i-1]){\n sum+=a[i-1]-a[i];a[i]=a[i-1];\n }\n }pw.println(sum);\n }\n}", "public class Main{\n final static String alpha = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\".toLowerCase();//.toCharArray();\n static class FastReader{\n BufferedReader br;\n StringTokenizer st;\n public FastReader(){br = new BufferedReader(new InputStreamReader(System.in));}\n String next(){while (st == null || !st.hasMoreElements()){try{st = new StringTokenizer(br.readLine());}catch (IOException e){e.printStackTrace();}}return st.nextToken();}\n int nextInt(){return Integer.parseInt(next());}\n long nextLong(){return Long.parseLong(next());}\n double nextDouble(){return Double.parseDouble(next());}\n int[] readArray(int n){int[] a=new int[n];for (int i=0; i<n; i++) a[i]=nextInt();return a;}\n long[] readLongArray(int n){long[] a=new long[n];for (int i=0; i<n; i++) a[i]=nextLong();return a;}\n String nextLine(){String str = \"\";try{str = br.readLine();}catch (IOException e){e.printStackTrace();}return str;}\n }\n static int getGcd(int n1,int n2){\n while(n1 != n2){\n if(n1 > n2) n1 -= n2;\n else n2 -= n1;\n }\n return n1;\n }\n static boolean isSorted(int[] arr, int n){\n for(int i=1;i<n;i++){\n if(arr[i]<arr[i-1]) return false;\n }\n return true;\n }\n static boolean isPrime(long n){\n if(n==2) return true;\n else if(n%2==0) return false;\n for(int i=3;i<=n/2;i+=2){\n if(n%i==0) return false;\n }\n return true;\n }\n static boolean isPrime(int n){\n if(n==2) return true;\n else if(n%2==0) return false;\n for(int i=3;i<=n/2;i+=2){\n if(n%i==0) return false;\n }\n return true;\n }\n static void printArray(int[] arr){\n for(int x:arr){\n System.out.print(x+\" \");\n }\n System.out.println();\n }\n static long Fact(int n){\n //int p=1000000007;\n long result = 1;\n for (int i = 1; i <= n; i++) result = (result*i);\n //for (int i = 1; i <= n; i++) result = (result*i)%p;\n return result;\n }\n static final Random random=new Random();\n static void ruffleSort(int[] a) {\n int n=a.length;//shuffle, then sort\n for (int i=0; i<n; i++) {\n int oi=random.nextInt(n), temp=a[oi];\n a[oi]=a[i]; a[i]=temp;\n }\n Arrays.sort(a);\n }\n public static void main(String[] args) throws NumberFormatException, IOException {\n FastReader s = new FastReader();\n PrintWriter pw = new PrintWriter(System.out,true);\n int n=s.nextInt();\n int[] a = s.readArray(n);\n long sum=0;\n for(int i=1;i<n;i++){\n if(a[i]<a[i-1]){\n sum+=a[i-1]-a[i];a[i]=a[i-1];\n }\n }pw.println(sum);\n }\n}", "Main" ]
import java.io.*; import java.util.*; public class Main{ final static String alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".toLowerCase();//.toCharArray(); static class FastReader{ BufferedReader br; StringTokenizer st; public FastReader(){br = new BufferedReader(new InputStreamReader(System.in));} String next(){while (st == null || !st.hasMoreElements()){try{st = new StringTokenizer(br.readLine());}catch (IOException e){e.printStackTrace();}}return st.nextToken();} int nextInt(){return Integer.parseInt(next());} long nextLong(){return Long.parseLong(next());} double nextDouble(){return Double.parseDouble(next());} int[] readArray(int n){int[] a=new int[n];for (int i=0; i<n; i++) a[i]=nextInt();return a;} long[] readLongArray(int n){long[] a=new long[n];for (int i=0; i<n; i++) a[i]=nextLong();return a;} String nextLine(){String str = "";try{str = br.readLine();}catch (IOException e){e.printStackTrace();}return str;} } static int getGcd(int n1,int n2){ while(n1 != n2){ if(n1 > n2) n1 -= n2; else n2 -= n1; } return n1; } static boolean isSorted(int[] arr, int n){ for(int i=1;i<n;i++){ if(arr[i]<arr[i-1]) return false; } return true; } static boolean isPrime(long n){ if(n==2) return true; else if(n%2==0) return false; for(int i=3;i<=n/2;i+=2){ if(n%i==0) return false; } return true; } static boolean isPrime(int n){ if(n==2) return true; else if(n%2==0) return false; for(int i=3;i<=n/2;i+=2){ if(n%i==0) return false; } return true; } static void printArray(int[] arr){ for(int x:arr){ System.out.print(x+" "); } System.out.println(); } static long Fact(int n){ //int p=1000000007; long result = 1; for (int i = 1; i <= n; i++) result = (result*i); //for (int i = 1; i <= n; i++) result = (result*i)%p; return result; } static final Random random=new Random(); static void ruffleSort(int[] a) { int n=a.length;//shuffle, then sort for (int i=0; i<n; i++) { int oi=random.nextInt(n), temp=a[oi]; a[oi]=a[i]; a[i]=temp; } Arrays.sort(a); } public static void main(String[] args) throws NumberFormatException, IOException { FastReader s = new FastReader(); PrintWriter pw = new PrintWriter(System.out,true); int n=s.nextInt(); int[] a = s.readArray(n); long sum=0; for(int i=1;i<n;i++){ if(a[i]<a[i-1]){ sum+=a[i-1]-a[i];a[i]=a[i-1]; } }pw.println(sum); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 38, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 41, 13, 2, 18, 13, 13, 18, 13, 2, 13, 17, 0, 13, 8, 2, 13, 17, 40, 13, 17, 0, 18, 13, 13, 4, 18, 13, 2, 18, 13, 13, 8, 2, 13, 17, 40, 13, 17, 18, 13, 2, 13, 17, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 111, 5 ], [ 111, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 10, 11 ], [ 11, 12 ], [ 11, 13 ], [ 10, 14 ], [ 14, 15 ], [ 14, 16 ], [ 16, 17 ], [ 17, 18 ], [ 10, 19 ], [ 19, 20 ], [ 19, 21 ], [ 10, 23 ], [ 23, 24 ], [ 24, 25 ], [ 25, 26 ], [ 25, 27 ], [ 23, 28 ], [ 28, 29 ], [ 28, 30 ], [ 23, 31 ], [ 31, 32 ], [ 32, 33 ], [ 23, 34 ], [ 35, 35 ], [ 35, 36 ], [ 36, 37 ], [ 37, 38 ], [ 37, 39 ], [ 36, 40 ], [ 40, 41 ], [ 41, 42 ], [ 10, 43 ], [ 43, 44 ], [ 43, 45 ], [ 10, 46 ], [ 46, 47 ], [ 47, 48 ], [ 48, 49 ], [ 48, 50 ], [ 46, 51 ], [ 51, 52 ], [ 51, 53 ], [ 46, 54 ], [ 54, 55 ], [ 55, 56 ], [ 46, 57 ], [ 58, 58 ], [ 58, 59 ], [ 59, 60 ], [ 59, 61 ], [ 61, 62 ], [ 62, 63 ], [ 62, 64 ], [ 61, 65 ], [ 65, 66 ], [ 65, 67 ], [ 67, 68 ], [ 67, 69 ], [ 58, 70 ], [ 70, 71 ], [ 70, 72 ], [ 72, 73 ], [ 73, 74 ], [ 73, 75 ], [ 72, 76 ], [ 76, 77 ], [ 72, 78 ], [ 58, 79 ], [ 79, 80 ], [ 80, 81 ], [ 80, 82 ], [ 79, 83 ], [ 83, 84 ], [ 84, 85 ], [ 83, 86 ], [ 86, 87 ], [ 87, 88 ], [ 87, 89 ], [ 86, 90 ], [ 90, 91 ], [ 91, 92 ], [ 91, 93 ], [ 90, 94 ], [ 94, 95 ], [ 90, 96 ], [ 83, 97 ], [ 97, 98 ], [ 97, 99 ], [ 99, 100 ], [ 99, 101 ], [ 10, 102 ], [ 102, 103 ], [ 103, 104 ], [ 104, 105 ], [ 104, 106 ], [ 102, 107 ], [ 6, 108 ], [ 108, 109 ], [ 0, 110 ], [ 110, 111 ], [ 110, 112 ] ]
[ "import java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n try (Scanner sc = new Scanner(System.in)) {\n int N = sc.nextInt();\n int[] A = new int[N];\n for (int i = 0; i < N; i++) {\n A[i] = sc.nextInt();\n }\n\n long sum = 0;\n for (int i = 1; i < N; i++) {\n int diff = A[i] - A[i - 1];\n sum += diff < 0 ? -diff : 0;\n A[i] = Math.max(A[i] + (diff < 0 ? -diff : 0), A[i - 1]);\n }\n System.out.println(sum);\n }\n }\n}", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n public static void main(String[] args) {\n try (Scanner sc = new Scanner(System.in)) {\n int N = sc.nextInt();\n int[] A = new int[N];\n for (int i = 0; i < N; i++) {\n A[i] = sc.nextInt();\n }\n\n long sum = 0;\n for (int i = 1; i < N; i++) {\n int diff = A[i] - A[i - 1];\n sum += diff < 0 ? -diff : 0;\n A[i] = Math.max(A[i] + (diff < 0 ? -diff : 0), A[i - 1]);\n }\n System.out.println(sum);\n }\n }\n}", "Main", "public static void main(String[] args) {\n try (Scanner sc = new Scanner(System.in)) {\n int N = sc.nextInt();\n int[] A = new int[N];\n for (int i = 0; i < N; i++) {\n A[i] = sc.nextInt();\n }\n\n long sum = 0;\n for (int i = 1; i < N; i++) {\n int diff = A[i] - A[i - 1];\n sum += diff < 0 ? -diff : 0;\n A[i] = Math.max(A[i] + (diff < 0 ? -diff : 0), A[i - 1]);\n }\n System.out.println(sum);\n }\n }", "main", "{\n try (Scanner sc = new Scanner(System.in)) {\n int N = sc.nextInt();\n int[] A = new int[N];\n for (int i = 0; i < N; i++) {\n A[i] = sc.nextInt();\n }\n\n long sum = 0;\n for (int i = 1; i < N; i++) {\n int diff = A[i] - A[i - 1];\n sum += diff < 0 ? -diff : 0;\n A[i] = Math.max(A[i] + (diff < 0 ? -diff : 0), A[i - 1]);\n }\n System.out.println(sum);\n }\n }", "try (Scanner sc = new Scanner(System.in)) {\n int N = sc.nextInt();\n int[] A = new int[N];\n for (int i = 0; i < N; i++) {\n A[i] = sc.nextInt();\n }\n\n long sum = 0;\n for (int i = 1; i < N; i++) {\n int diff = A[i] - A[i - 1];\n sum += diff < 0 ? -diff : 0;\n A[i] = Math.max(A[i] + (diff < 0 ? -diff : 0), A[i - 1]);\n }\n System.out.println(sum);\n }", "{\n int N = sc.nextInt();\n int[] A = new int[N];\n for (int i = 0; i < N; i++) {\n A[i] = sc.nextInt();\n }\n\n long sum = 0;\n for (int i = 1; i < N; i++) {\n int diff = A[i] - A[i - 1];\n sum += diff < 0 ? -diff : 0;\n A[i] = Math.max(A[i] + (diff < 0 ? -diff : 0), A[i - 1]);\n }\n System.out.println(sum);\n }", "Scanner sc = new Scanner(System.in)", "Scanner sc = new Scanner(System.in)", "new Scanner(System.in)", "int N = sc.nextInt();", "N", "sc.nextInt()", "sc.nextInt", "sc", "int[] A = new int[N];", "A", "new int[N]", "N", "for (int i = 0; i < N; i++) {\n A[i] = sc.nextInt();\n }", "int i = 0;", "int i = 0;", "i", "0", "i < N", "i", "N", "i++", "i++", "i", "{\n A[i] = sc.nextInt();\n }", "{\n A[i] = sc.nextInt();\n }", "A[i] = sc.nextInt()", "A[i]", "A", "i", "sc.nextInt()", "sc.nextInt", "sc", "long sum = 0;", "sum", "0", "for (int i = 1; i < N; i++) {\n int diff = A[i] - A[i - 1];\n sum += diff < 0 ? -diff : 0;\n A[i] = Math.max(A[i] + (diff < 0 ? -diff : 0), A[i - 1]);\n }", "int i = 1;", "int i = 1;", "i", "1", "i < N", "i", "N", "i++", "i++", "i", "{\n int diff = A[i] - A[i - 1];\n sum += diff < 0 ? -diff : 0;\n A[i] = Math.max(A[i] + (diff < 0 ? -diff : 0), A[i - 1]);\n }", "{\n int diff = A[i] - A[i - 1];\n sum += diff < 0 ? -diff : 0;\n A[i] = Math.max(A[i] + (diff < 0 ? -diff : 0), A[i - 1]);\n }", "int diff = A[i] - A[i - 1];", "diff", "A[i] - A[i - 1]", "A[i]", "A", "i", "A[i - 1]", "A", "i - 1", "i", "1", "sum += diff < 0 ? -diff : 0", "sum", "diff < 0 ? -diff : 0", "diff < 0", "diff", "0", "-diff", "diff", "0", "A[i] = Math.max(A[i] + (diff < 0 ? -diff : 0), A[i - 1])", "A[i]", "A", "i", "Math.max(A[i] + (diff < 0 ? -diff : 0), A[i - 1])", "Math.max", "Math", "A[i] + (diff < 0 ? -diff : 0)", "A[i]", "A", "i", "(diff < 0 ? -diff : 0)", "diff < 0", "diff", "0", "-diff", "diff", "0", "A[i - 1]", "A", "i - 1", "i", "1", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "String[] args", "args", "public class Main {\n public static void main(String[] args) {\n try (Scanner sc = new Scanner(System.in)) {\n int N = sc.nextInt();\n int[] A = new int[N];\n for (int i = 0; i < N; i++) {\n A[i] = sc.nextInt();\n }\n\n long sum = 0;\n for (int i = 1; i < N; i++) {\n int diff = A[i] - A[i - 1];\n sum += diff < 0 ? -diff : 0;\n A[i] = Math.max(A[i] + (diff < 0 ? -diff : 0), A[i - 1]);\n }\n System.out.println(sum);\n }\n }\n}", "public class Main {\n public static void main(String[] args) {\n try (Scanner sc = new Scanner(System.in)) {\n int N = sc.nextInt();\n int[] A = new int[N];\n for (int i = 0; i < N; i++) {\n A[i] = sc.nextInt();\n }\n\n long sum = 0;\n for (int i = 1; i < N; i++) {\n int diff = A[i] - A[i - 1];\n sum += diff < 0 ? -diff : 0;\n A[i] = Math.max(A[i] + (diff < 0 ? -diff : 0), A[i - 1]);\n }\n System.out.println(sum);\n }\n }\n}", "Main" ]
import java.util.Scanner; public class Main { public static void main(String[] args) { try (Scanner sc = new Scanner(System.in)) { int N = sc.nextInt(); int[] A = new int[N]; for (int i = 0; i < N; i++) { A[i] = sc.nextInt(); } long sum = 0; for (int i = 1; i < N; i++) { int diff = A[i] - A[i - 1]; sum += diff < 0 ? -diff : 0; A[i] = Math.max(A[i] + (diff < 0 ? -diff : 0), A[i - 1]); } System.out.println(sum); } } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 4, 18, 13, 41, 13, 4, 18, 4, 18, 13, 17, 41, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 41, 13, 4, 18, 13, 18, 13, 13, 14, 2, 13, 17, 30, 14, 2, 13, 13, 30, 0, 13, 2, 13, 13, 30, 0, 13, 13, 9, 30, 0, 13, 13, 9, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 89, 5 ], [ 89, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 14, 17 ], [ 17, 18 ], [ 18, 19 ], [ 8, 20 ], [ 20, 21 ], [ 20, 22 ], [ 22, 23 ], [ 23, 24 ], [ 24, 25 ], [ 25, 26 ], [ 22, 27 ], [ 8, 28 ], [ 28, 29 ], [ 28, 30 ], [ 8, 31 ], [ 31, 32 ], [ 31, 33 ], [ 8, 34 ], [ 34, 35 ], [ 35, 36 ], [ 36, 37 ], [ 36, 38 ], [ 34, 39 ], [ 39, 40 ], [ 39, 41 ], [ 34, 42 ], [ 42, 43 ], [ 43, 44 ], [ 34, 45 ], [ 46, 46 ], [ 46, 47 ], [ 47, 48 ], [ 47, 49 ], [ 49, 50 ], [ 50, 51 ], [ 49, 52 ], [ 52, 53 ], [ 52, 54 ], [ 46, 55 ], [ 55, 56 ], [ 56, 57 ], [ 56, 58 ], [ 55, 59 ], [ 59, 60 ], [ 60, 61 ], [ 61, 62 ], [ 61, 63 ], [ 60, 64 ], [ 64, 65 ], [ 65, 66 ], [ 65, 67 ], [ 67, 68 ], [ 67, 69 ], [ 60, 70 ], [ 70, 71 ], [ 71, 72 ], [ 71, 73 ], [ 70, 74 ], [ 55, 75 ], [ 75, 76 ], [ 76, 77 ], [ 76, 78 ], [ 75, 79 ], [ 8, 80 ], [ 80, 81 ], [ 81, 82 ], [ 82, 83 ], [ 82, 84 ], [ 80, 85 ], [ 6, 86 ], [ 86, 87 ], [ 0, 88 ], [ 88, 89 ], [ 88, 90 ] ]
[ "import java.util.*;\npublic class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n \n // 入力値(人数)\n int ninzuu = Integer.parseInt(sc.nextLine());\n // 入力値(身長)\n String height[] = sc.nextLine().split(\" \");\n\n long sum = 0;\n long preHeight = 0;\n for (int i=0; i<ninzuu; i++) {\n long nowHeight = Long.parseLong(height[i]);\n if (preHeight >= 0) {\n // 2人目以降は身長差を計算する\n if (preHeight > nowHeight) {\n // 前の人の方が大きい場合\n sum += preHeight - nowHeight;\n } else {\n // 変数の中身を更新する\n preHeight = nowHeight;\n continue;\n }\n } else {\n // 1人目なのでスキップ\n preHeight = nowHeight;\n continue;\n }\n }\n\n System.out.println(sum);\n }\n}", "import java.util.*;", "util.*", "java", "public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n \n // 入力値(人数)\n int ninzuu = Integer.parseInt(sc.nextLine());\n // 入力値(身長)\n String height[] = sc.nextLine().split(\" \");\n\n long sum = 0;\n long preHeight = 0;\n for (int i=0; i<ninzuu; i++) {\n long nowHeight = Long.parseLong(height[i]);\n if (preHeight >= 0) {\n // 2人目以降は身長差を計算する\n if (preHeight > nowHeight) {\n // 前の人の方が大きい場合\n sum += preHeight - nowHeight;\n } else {\n // 変数の中身を更新する\n preHeight = nowHeight;\n continue;\n }\n } else {\n // 1人目なのでスキップ\n preHeight = nowHeight;\n continue;\n }\n }\n\n System.out.println(sum);\n }\n}", "Main", "public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n \n // 入力値(人数)\n int ninzuu = Integer.parseInt(sc.nextLine());\n // 入力値(身長)\n String height[] = sc.nextLine().split(\" \");\n\n long sum = 0;\n long preHeight = 0;\n for (int i=0; i<ninzuu; i++) {\n long nowHeight = Long.parseLong(height[i]);\n if (preHeight >= 0) {\n // 2人目以降は身長差を計算する\n if (preHeight > nowHeight) {\n // 前の人の方が大きい場合\n sum += preHeight - nowHeight;\n } else {\n // 変数の中身を更新する\n preHeight = nowHeight;\n continue;\n }\n } else {\n // 1人目なのでスキップ\n preHeight = nowHeight;\n continue;\n }\n }\n\n System.out.println(sum);\n }", "main", "{\n Scanner sc = new Scanner(System.in);\n \n // 入力値(人数)\n int ninzuu = Integer.parseInt(sc.nextLine());\n // 入力値(身長)\n String height[] = sc.nextLine().split(\" \");\n\n long sum = 0;\n long preHeight = 0;\n for (int i=0; i<ninzuu; i++) {\n long nowHeight = Long.parseLong(height[i]);\n if (preHeight >= 0) {\n // 2人目以降は身長差を計算する\n if (preHeight > nowHeight) {\n // 前の人の方が大きい場合\n sum += preHeight - nowHeight;\n } else {\n // 変数の中身を更新する\n preHeight = nowHeight;\n continue;\n }\n } else {\n // 1人目なのでスキップ\n preHeight = nowHeight;\n continue;\n }\n }\n\n System.out.println(sum);\n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int ninzuu = Integer.parseInt(sc.nextLine());", "ninzuu", "Integer.parseInt(sc.nextLine())", "Integer.parseInt", "Integer", "sc.nextLine()", "sc.nextLine", "sc", "String height[] = sc.nextLine().split(\" \");", "height", "sc.nextLine().split(\" \")", "sc.nextLine().split", "sc.nextLine()", "sc.nextLine", "sc", "\" \"", "long sum = 0;", "sum", "0", "long preHeight = 0;", "preHeight", "0", "for (int i=0; i<ninzuu; i++) {\n long nowHeight = Long.parseLong(height[i]);\n if (preHeight >= 0) {\n // 2人目以降は身長差を計算する\n if (preHeight > nowHeight) {\n // 前の人の方が大きい場合\n sum += preHeight - nowHeight;\n } else {\n // 変数の中身を更新する\n preHeight = nowHeight;\n continue;\n }\n } else {\n // 1人目なのでスキップ\n preHeight = nowHeight;\n continue;\n }\n }", "int i=0;", "int i=0;", "i", "0", "i<ninzuu", "i", "ninzuu", "i++", "i++", "i", "{\n long nowHeight = Long.parseLong(height[i]);\n if (preHeight >= 0) {\n // 2人目以降は身長差を計算する\n if (preHeight > nowHeight) {\n // 前の人の方が大きい場合\n sum += preHeight - nowHeight;\n } else {\n // 変数の中身を更新する\n preHeight = nowHeight;\n continue;\n }\n } else {\n // 1人目なのでスキップ\n preHeight = nowHeight;\n continue;\n }\n }", "{\n long nowHeight = Long.parseLong(height[i]);\n if (preHeight >= 0) {\n // 2人目以降は身長差を計算する\n if (preHeight > nowHeight) {\n // 前の人の方が大きい場合\n sum += preHeight - nowHeight;\n } else {\n // 変数の中身を更新する\n preHeight = nowHeight;\n continue;\n }\n } else {\n // 1人目なのでスキップ\n preHeight = nowHeight;\n continue;\n }\n }", "long nowHeight = Long.parseLong(height[i]);", "nowHeight", "Long.parseLong(height[i])", "Long.parseLong", "Long", "height[i]", "height", "i", "if (preHeight >= 0) {\n // 2人目以降は身長差を計算する\n if (preHeight > nowHeight) {\n // 前の人の方が大きい場合\n sum += preHeight - nowHeight;\n } else {\n // 変数の中身を更新する\n preHeight = nowHeight;\n continue;\n }\n } else {\n // 1人目なのでスキップ\n preHeight = nowHeight;\n continue;\n }", "preHeight >= 0", "preHeight", "0", "{\n // 2人目以降は身長差を計算する\n if (preHeight > nowHeight) {\n // 前の人の方が大きい場合\n sum += preHeight - nowHeight;\n } else {\n // 変数の中身を更新する\n preHeight = nowHeight;\n continue;\n }\n }", "if (preHeight > nowHeight) {\n // 前の人の方が大きい場合\n sum += preHeight - nowHeight;\n } else {\n // 変数の中身を更新する\n preHeight = nowHeight;\n continue;\n }", "preHeight > nowHeight", "preHeight", "nowHeight", "{\n // 前の人の方が大きい場合\n sum += preHeight - nowHeight;\n }", "sum += preHeight - nowHeight", "sum", "preHeight - nowHeight", "preHeight", "nowHeight", "{\n // 変数の中身を更新する\n preHeight = nowHeight;\n continue;\n }", "preHeight = nowHeight", "preHeight", "nowHeight", "continue;", "{\n // 1人目なのでスキップ\n preHeight = nowHeight;\n continue;\n }", "preHeight = nowHeight", "preHeight", "nowHeight", "continue;", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "String[] args", "args", "public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n \n // 入力値(人数)\n int ninzuu = Integer.parseInt(sc.nextLine());\n // 入力値(身長)\n String height[] = sc.nextLine().split(\" \");\n\n long sum = 0;\n long preHeight = 0;\n for (int i=0; i<ninzuu; i++) {\n long nowHeight = Long.parseLong(height[i]);\n if (preHeight >= 0) {\n // 2人目以降は身長差を計算する\n if (preHeight > nowHeight) {\n // 前の人の方が大きい場合\n sum += preHeight - nowHeight;\n } else {\n // 変数の中身を更新する\n preHeight = nowHeight;\n continue;\n }\n } else {\n // 1人目なのでスキップ\n preHeight = nowHeight;\n continue;\n }\n }\n\n System.out.println(sum);\n }\n}", "public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n \n // 入力値(人数)\n int ninzuu = Integer.parseInt(sc.nextLine());\n // 入力値(身長)\n String height[] = sc.nextLine().split(\" \");\n\n long sum = 0;\n long preHeight = 0;\n for (int i=0; i<ninzuu; i++) {\n long nowHeight = Long.parseLong(height[i]);\n if (preHeight >= 0) {\n // 2人目以降は身長差を計算する\n if (preHeight > nowHeight) {\n // 前の人の方が大きい場合\n sum += preHeight - nowHeight;\n } else {\n // 変数の中身を更新する\n preHeight = nowHeight;\n continue;\n }\n } else {\n // 1人目なのでスキップ\n preHeight = nowHeight;\n continue;\n }\n }\n\n System.out.println(sum);\n }\n}", "Main" ]
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); // 入力値(人数) int ninzuu = Integer.parseInt(sc.nextLine()); // 入力値(身長) String height[] = sc.nextLine().split(" "); long sum = 0; long preHeight = 0; for (int i=0; i<ninzuu; i++) { long nowHeight = Long.parseLong(height[i]); if (preHeight >= 0) { // 2人目以降は身長差を計算する if (preHeight > nowHeight) { // 前の人の方が大きい場合 sum += preHeight - nowHeight; } else { // 変数の中身を更新する preHeight = nowHeight; continue; } } else { // 1人目なのでスキップ preHeight = nowHeight; continue; } } System.out.println(sum); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 41, 13, 17, 0, 18, 13, 17, 4, 18, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 14, 2, 18, 13, 2, 13, 17, 18, 13, 13, 30, 0, 13, 2, 18, 13, 2, 13, 17, 18, 13, 13, 0, 18, 13, 13, 18, 13, 2, 13, 17, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 91, 5 ], [ 91, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 8, 21 ], [ 21, 22 ], [ 21, 23 ], [ 8, 24 ], [ 24, 25 ], [ 25, 26 ], [ 25, 27 ], [ 24, 28 ], [ 28, 29 ], [ 29, 30 ], [ 8, 31 ], [ 31, 32 ], [ 32, 33 ], [ 33, 34 ], [ 33, 35 ], [ 31, 36 ], [ 36, 37 ], [ 36, 38 ], [ 31, 39 ], [ 39, 40 ], [ 40, 41 ], [ 31, 42 ], [ 43, 43 ], [ 43, 44 ], [ 44, 45 ], [ 45, 46 ], [ 45, 47 ], [ 44, 48 ], [ 48, 49 ], [ 49, 50 ], [ 43, 51 ], [ 51, 52 ], [ 52, 53 ], [ 53, 54 ], [ 53, 55 ], [ 55, 56 ], [ 55, 57 ], [ 52, 58 ], [ 58, 59 ], [ 58, 60 ], [ 51, 61 ], [ 61, 62 ], [ 62, 63 ], [ 62, 64 ], [ 64, 65 ], [ 65, 66 ], [ 65, 67 ], [ 67, 68 ], [ 67, 69 ], [ 64, 70 ], [ 70, 71 ], [ 70, 72 ], [ 61, 73 ], [ 73, 74 ], [ 74, 75 ], [ 74, 76 ], [ 73, 77 ], [ 77, 78 ], [ 77, 79 ], [ 79, 80 ], [ 79, 81 ], [ 8, 82 ], [ 82, 83 ], [ 83, 84 ], [ 84, 85 ], [ 84, 86 ], [ 82, 87 ], [ 6, 88 ], [ 88, 89 ], [ 0, 90 ], [ 90, 91 ], [ 90, 92 ] ]
[ "import java.util.*;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner s = new Scanner(System.in);\n int N = s.nextInt();\n long[] A = new long[N];\n long count = 0;\n\n A[0] = s.nextLong();\n for (int i = 1; i < N; i++) {\n A[i] = s.nextLong();\n if (A[i - 1] > A[i]) {\n count += (A[i - 1] - A[i]);\n A[i] = A[i - 1];\n }\n }\n\n System.out.println(count);\n }\n}", "import java.util.*;", "util.*", "java", "public class Main {\n public static void main(String[] args) {\n Scanner s = new Scanner(System.in);\n int N = s.nextInt();\n long[] A = new long[N];\n long count = 0;\n\n A[0] = s.nextLong();\n for (int i = 1; i < N; i++) {\n A[i] = s.nextLong();\n if (A[i - 1] > A[i]) {\n count += (A[i - 1] - A[i]);\n A[i] = A[i - 1];\n }\n }\n\n System.out.println(count);\n }\n}", "Main", "public static void main(String[] args) {\n Scanner s = new Scanner(System.in);\n int N = s.nextInt();\n long[] A = new long[N];\n long count = 0;\n\n A[0] = s.nextLong();\n for (int i = 1; i < N; i++) {\n A[i] = s.nextLong();\n if (A[i - 1] > A[i]) {\n count += (A[i - 1] - A[i]);\n A[i] = A[i - 1];\n }\n }\n\n System.out.println(count);\n }", "main", "{\n Scanner s = new Scanner(System.in);\n int N = s.nextInt();\n long[] A = new long[N];\n long count = 0;\n\n A[0] = s.nextLong();\n for (int i = 1; i < N; i++) {\n A[i] = s.nextLong();\n if (A[i - 1] > A[i]) {\n count += (A[i - 1] - A[i]);\n A[i] = A[i - 1];\n }\n }\n\n System.out.println(count);\n }", "Scanner s = new Scanner(System.in);", "s", "new Scanner(System.in)", "int N = s.nextInt();", "N", "s.nextInt()", "s.nextInt", "s", "long[] A = new long[N];", "A", "new long[N]", "N", "long count = 0;", "count", "0", "A[0] = s.nextLong()", "A[0]", "A", "0", "s.nextLong()", "s.nextLong", "s", "for (int i = 1; i < N; i++) {\n A[i] = s.nextLong();\n if (A[i - 1] > A[i]) {\n count += (A[i - 1] - A[i]);\n A[i] = A[i - 1];\n }\n }", "int i = 1;", "int i = 1;", "i", "1", "i < N", "i", "N", "i++", "i++", "i", "{\n A[i] = s.nextLong();\n if (A[i - 1] > A[i]) {\n count += (A[i - 1] - A[i]);\n A[i] = A[i - 1];\n }\n }", "{\n A[i] = s.nextLong();\n if (A[i - 1] > A[i]) {\n count += (A[i - 1] - A[i]);\n A[i] = A[i - 1];\n }\n }", "A[i] = s.nextLong()", "A[i]", "A", "i", "s.nextLong()", "s.nextLong", "s", "if (A[i - 1] > A[i]) {\n count += (A[i - 1] - A[i]);\n A[i] = A[i - 1];\n }", "A[i - 1] > A[i]", "A[i - 1]", "A", "i - 1", "i", "1", "A[i]", "A", "i", "{\n count += (A[i - 1] - A[i]);\n A[i] = A[i - 1];\n }", "count += (A[i - 1] - A[i])", "count", "(A[i - 1] - A[i])", "A[i - 1]", "A", "i - 1", "i", "1", "A[i]", "A", "i", "A[i] = A[i - 1]", "A[i]", "A", "i", "A[i - 1]", "A", "i - 1", "i", "1", "System.out.println(count)", "System.out.println", "System.out", "System", "System.out", "count", "String[] args", "args", "public class Main {\n public static void main(String[] args) {\n Scanner s = new Scanner(System.in);\n int N = s.nextInt();\n long[] A = new long[N];\n long count = 0;\n\n A[0] = s.nextLong();\n for (int i = 1; i < N; i++) {\n A[i] = s.nextLong();\n if (A[i - 1] > A[i]) {\n count += (A[i - 1] - A[i]);\n A[i] = A[i - 1];\n }\n }\n\n System.out.println(count);\n }\n}", "public class Main {\n public static void main(String[] args) {\n Scanner s = new Scanner(System.in);\n int N = s.nextInt();\n long[] A = new long[N];\n long count = 0;\n\n A[0] = s.nextLong();\n for (int i = 1; i < N; i++) {\n A[i] = s.nextLong();\n if (A[i - 1] > A[i]) {\n count += (A[i - 1] - A[i]);\n A[i] = A[i - 1];\n }\n }\n\n System.out.println(count);\n }\n}", "Main" ]
import java.util.*; public class Main { public static void main(String[] args) { Scanner s = new Scanner(System.in); int N = s.nextInt(); long[] A = new long[N]; long count = 0; A[0] = s.nextLong(); for (int i = 1; i < N; i++) { A[i] = s.nextLong(); if (A[i - 1] > A[i]) { count += (A[i - 1] - A[i]); A[i] = A[i - 1]; } } System.out.println(count); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 18, 13, 13, 18, 13, 2, 13, 17, 30, 0, 18, 13, 13, 2, 18, 13, 2, 13, 17, 18, 13, 13, 0, 18, 13, 13, 18, 13, 2, 13, 17, 30, 0, 18, 13, 13, 17, 41, 13, 0, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 2, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 131, 5 ], [ 131, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 8, 21 ], [ 21, 22 ], [ 22, 23 ], [ 23, 24 ], [ 23, 25 ], [ 21, 26 ], [ 26, 27 ], [ 26, 28 ], [ 21, 29 ], [ 29, 30 ], [ 30, 31 ], [ 21, 32 ], [ 33, 33 ], [ 33, 34 ], [ 34, 35 ], [ 35, 36 ], [ 35, 37 ], [ 34, 38 ], [ 38, 39 ], [ 39, 40 ], [ 8, 41 ], [ 41, 42 ], [ 41, 43 ], [ 8, 45 ], [ 45, 46 ], [ 46, 47 ], [ 47, 48 ], [ 47, 49 ], [ 45, 50 ], [ 50, 51 ], [ 50, 52 ], [ 45, 53 ], [ 53, 54 ], [ 54, 55 ], [ 45, 56 ], [ 57, 57 ], [ 57, 58 ], [ 58, 59 ], [ 59, 60 ], [ 60, 61 ], [ 60, 62 ], [ 59, 63 ], [ 63, 64 ], [ 63, 65 ], [ 65, 66 ], [ 65, 67 ], [ 58, 68 ], [ 68, 69 ], [ 69, 70 ], [ 70, 71 ], [ 70, 72 ], [ 69, 73 ], [ 73, 74 ], [ 74, 75 ], [ 74, 76 ], [ 76, 77 ], [ 76, 78 ], [ 73, 79 ], [ 79, 80 ], [ 79, 81 ], [ 68, 82 ], [ 82, 83 ], [ 83, 84 ], [ 83, 85 ], [ 82, 86 ], [ 86, 87 ], [ 86, 88 ], [ 88, 89 ], [ 88, 90 ], [ 58, 91 ], [ 91, 92 ], [ 92, 93 ], [ 93, 94 ], [ 93, 95 ], [ 92, 96 ], [ 8, 97 ], [ 97, 98 ], [ 8, 99 ], [ 99, 100 ], [ 99, 101 ], [ 8, 102 ], [ 102, 103 ], [ 103, 104 ], [ 104, 105 ], [ 104, 106 ], [ 102, 107 ], [ 107, 108 ], [ 107, 109 ], [ 102, 110 ], [ 110, 111 ], [ 111, 112 ], [ 102, 113 ], [ 114, 114 ], [ 114, 115 ], [ 115, 116 ], [ 115, 117 ], [ 117, 118 ], [ 117, 119 ], [ 119, 120 ], [ 119, 121 ], [ 8, 122 ], [ 122, 123 ], [ 123, 124 ], [ 124, 125 ], [ 124, 126 ], [ 122, 127 ], [ 6, 128 ], [ 128, 129 ], [ 0, 130 ], [ 130, 131 ], [ 130, 132 ] ]
[ "import java.util.*;\npublic class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n // 整数の入力\n int N = sc.nextInt();\n // スペース区切りの整数の入力\n int [] A = new int [N];\n for(int i=0; i<N; i++){\n \tA[i] = sc.nextInt();\n }\n \n long [] L = new long [N];\n for(int i=1; i<N; i++){\n \tif(A[i]<A[i-1]){\n \tL[i]=A[i-1]-A[i];\n A[i]=A[i-1];\n } else{\n \tL[i]=0;\n }\n }\n \t\n \tlong S;\n \t\tS=0;\n \tfor(int i=1; i<N; i++){\n \tS=S+L[i];\n } \t\n // 出力\n System.out.println(S);\n }\n}", "import java.util.*;", "util.*", "java", "public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n // 整数の入力\n int N = sc.nextInt();\n // スペース区切りの整数の入力\n int [] A = new int [N];\n for(int i=0; i<N; i++){\n \tA[i] = sc.nextInt();\n }\n \n long [] L = new long [N];\n for(int i=1; i<N; i++){\n \tif(A[i]<A[i-1]){\n \tL[i]=A[i-1]-A[i];\n A[i]=A[i-1];\n } else{\n \tL[i]=0;\n }\n }\n \t\n \tlong S;\n \t\tS=0;\n \tfor(int i=1; i<N; i++){\n \tS=S+L[i];\n } \t\n // 出力\n System.out.println(S);\n }\n}", "Main", "public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n // 整数の入力\n int N = sc.nextInt();\n // スペース区切りの整数の入力\n int [] A = new int [N];\n for(int i=0; i<N; i++){\n \tA[i] = sc.nextInt();\n }\n \n long [] L = new long [N];\n for(int i=1; i<N; i++){\n \tif(A[i]<A[i-1]){\n \tL[i]=A[i-1]-A[i];\n A[i]=A[i-1];\n } else{\n \tL[i]=0;\n }\n }\n \t\n \tlong S;\n \t\tS=0;\n \tfor(int i=1; i<N; i++){\n \tS=S+L[i];\n } \t\n // 出力\n System.out.println(S);\n }", "main", "{\n Scanner sc = new Scanner(System.in);\n // 整数の入力\n int N = sc.nextInt();\n // スペース区切りの整数の入力\n int [] A = new int [N];\n for(int i=0; i<N; i++){\n \tA[i] = sc.nextInt();\n }\n \n long [] L = new long [N];\n for(int i=1; i<N; i++){\n \tif(A[i]<A[i-1]){\n \tL[i]=A[i-1]-A[i];\n A[i]=A[i-1];\n } else{\n \tL[i]=0;\n }\n }\n \t\n \tlong S;\n \t\tS=0;\n \tfor(int i=1; i<N; i++){\n \tS=S+L[i];\n } \t\n // 出力\n System.out.println(S);\n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int N = sc.nextInt();", "N", "sc.nextInt()", "sc.nextInt", "sc", "int [] A = new int [N];", "A", "new int [N]", "N", "for(int i=0; i<N; i++){\n \tA[i] = sc.nextInt();\n }", "int i=0;", "int i=0;", "i", "0", "i<N", "i", "N", "i++", "i++", "i", "{\n \tA[i] = sc.nextInt();\n }", "{\n \tA[i] = sc.nextInt();\n }", "A[i] = sc.nextInt()", "A[i]", "A", "i", "sc.nextInt()", "sc.nextInt", "sc", "long [] L = new long [N];", "L", "new long [N]", "N", "for(int i=1; i<N; i++){\n \tif(A[i]<A[i-1]){\n \tL[i]=A[i-1]-A[i];\n A[i]=A[i-1];\n } else{\n \tL[i]=0;\n }\n }", "int i=1;", "int i=1;", "i", "1", "i<N", "i", "N", "i++", "i++", "i", "{\n \tif(A[i]<A[i-1]){\n \tL[i]=A[i-1]-A[i];\n A[i]=A[i-1];\n } else{\n \tL[i]=0;\n }\n }", "{\n \tif(A[i]<A[i-1]){\n \tL[i]=A[i-1]-A[i];\n A[i]=A[i-1];\n } else{\n \tL[i]=0;\n }\n }", "if(A[i]<A[i-1]){\n \tL[i]=A[i-1]-A[i];\n A[i]=A[i-1];\n } else{\n \tL[i]=0;\n }", "A[i]<A[i-1]", "A[i]", "A", "i", "A[i-1]", "A", "i-1", "i", "1", "{\n \tL[i]=A[i-1]-A[i];\n A[i]=A[i-1];\n }", "L[i]=A[i-1]-A[i]", "L[i]", "L", "i", "A[i-1]-A[i]", "A[i-1]", "A", "i-1", "i", "1", "A[i]", "A", "i", "A[i]=A[i-1]", "A[i]", "A", "i", "A[i-1]", "A", "i-1", "i", "1", "{\n \tL[i]=0;\n }", "L[i]=0", "L[i]", "L", "i", "0", "long S;", "S", "S=0", "S", "0", "for(int i=1; i<N; i++){\n \tS=S+L[i];\n }", "int i=1;", "int i=1;", "i", "1", "i<N", "i", "N", "i++", "i++", "i", "{\n \tS=S+L[i];\n }", "{\n \tS=S+L[i];\n }", "S=S+L[i]", "S", "S+L[i]", "S", "L[i]", "L", "i", "System.out.println(S)", "System.out.println", "System.out", "System", "System.out", "S", "String[] args", "args", "public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n // 整数の入力\n int N = sc.nextInt();\n // スペース区切りの整数の入力\n int [] A = new int [N];\n for(int i=0; i<N; i++){\n \tA[i] = sc.nextInt();\n }\n \n long [] L = new long [N];\n for(int i=1; i<N; i++){\n \tif(A[i]<A[i-1]){\n \tL[i]=A[i-1]-A[i];\n A[i]=A[i-1];\n } else{\n \tL[i]=0;\n }\n }\n \t\n \tlong S;\n \t\tS=0;\n \tfor(int i=1; i<N; i++){\n \tS=S+L[i];\n } \t\n // 出力\n System.out.println(S);\n }\n}", "public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n // 整数の入力\n int N = sc.nextInt();\n // スペース区切りの整数の入力\n int [] A = new int [N];\n for(int i=0; i<N; i++){\n \tA[i] = sc.nextInt();\n }\n \n long [] L = new long [N];\n for(int i=1; i<N; i++){\n \tif(A[i]<A[i-1]){\n \tL[i]=A[i-1]-A[i];\n A[i]=A[i-1];\n } else{\n \tL[i]=0;\n }\n }\n \t\n \tlong S;\n \t\tS=0;\n \tfor(int i=1; i<N; i++){\n \tS=S+L[i];\n } \t\n // 出力\n System.out.println(S);\n }\n}", "Main" ]
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); // 整数の入力 int N = sc.nextInt(); // スペース区切りの整数の入力 int [] A = new int [N]; for(int i=0; i<N; i++){ A[i] = sc.nextInt(); } long [] L = new long [N]; for(int i=1; i<N; i++){ if(A[i]<A[i-1]){ L[i]=A[i-1]-A[i]; A[i]=A[i-1]; } else{ L[i]=0; } } long S; S=0; for(int i=1; i<N; i++){ S=S+L[i]; } // 出力 System.out.println(S); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 41, 13, 17, 41, 13, 17, 41, 13, 41, 13, 41, 13, 17, 41, 13, 17, 41, 13, 17, 41, 13, 20, 17, 41, 13, 17, 41, 13, 17, 41, 13, 12, 13, 30, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 4, 13, 13, 12, 13, 30, 41, 13, 4, 13, 41, 13, 40, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 41, 13, 4, 13, 14, 2, 13, 13, 30, 0, 13, 2, 13, 13, 0, 13, 13, 4, 18, 13, 13, 23, 13, 12, 13, 30, 41, 13, 17, 41, 13, 13, 42, 2, 13, 17, 30, 14, 2, 2, 13, 17, 17, 30, 0, 13, 2, 2, 13, 13, 13, 0, 13, 2, 2, 13, 13, 13, 0, 13, 17, 29, 2, 13, 13, 23, 13, 23, 13, 12, 13, 30, 42, 2, 13, 17, 30, 41, 13, 2, 13, 13, 0, 13, 13, 0, 13, 13, 29, 13, 23, 13, 23, 13, 12, 13, 30, 0, 13, 8, 4, 18, 13, 18, 13, 13, 20, 0, 13, 20, 41, 13, 4, 18, 13, 4, 13, 4, 18, 13, 14, 40, 4, 18, 13, 4, 13, 2, 2, 4, 18, 13, 13, 17, 12, 13, 30, 4, 18, 20, 23, 13, 12, 13, 30, 14, 2, 13, 40, 17, 37, 20, 14, 2, 13, 13, 30, 0, 13, 17, 38, 5, 13, 30, 37, 20, 30, 0, 13, 4, 18, 13, 13, 14, 2, 13, 17, 29, 40, 17, 29, 18, 13, 40, 13, 12, 13, 30, 29, 40, 2, 2, 13, 17, 2, 13, 17, 23, 13, 12, 13, 30, 41, 13, 42, 2, 2, 0, 13, 4, 13, 40, 17, 4, 13, 13, 29, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 13, 12, 13, 30, 41, 13, 4, 13, 41, 13, 20, 42, 40, 4, 13, 13, 30, 4, 18, 13, 13, 0, 13, 4, 13, 29, 4, 18, 13, 12, 13, 30, 41, 13, 20, 13, 41, 13, 4, 13, 41, 13, 17, 42, 2, 13, 13, 30, 14, 40, 4, 13, 13, 0, 18, 13, 40, 13, 13, 0, 13, 4, 13, 29, 8, 2, 13, 13, 13, 4, 18, 13, 13, 13, 23, 13, 12, 13, 30, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 13, 13, 29, 13, 23, 13, 23, 13, 12, 13, 30, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 13, 29, 13, 23, 13, 12, 13, 30, 41, 13, 20, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 4, 18, 13, 4, 13, 29, 13, 23, 13, 12, 13, 30, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 13, 13, 29, 13, 23, 13, 23, 13, 12, 13, 30, 41, 13, 17, 41, 13, 41, 13, 17, 42, 2, 2, 0, 13, 4, 13, 40, 17, 40, 2, 2, 2, 13, 17, 2, 13, 17, 2, 13, 17, 14, 2, 13, 17, 30, 0, 13, 17, 0, 13, 4, 13, 42, 17, 30, 14, 2, 2, 13, 17, 2, 13, 17, 30, 0, 13, 2, 2, 13, 17, 2, 13, 17, 30, 29, 8, 13, 40, 13, 13, 0, 13, 4, 13, 12, 13, 30, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 13, 29, 13, 23, 13, 12, 13, 30, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 13, 13, 29, 13, 23, 13, 23, 13, 12, 13, 30, 41, 13, 17, 41, 13, 41, 13, 17, 42, 2, 2, 0, 13, 4, 13, 40, 17, 40, 2, 2, 2, 13, 17, 2, 13, 17, 2, 13, 17, 14, 2, 13, 17, 30, 0, 13, 17, 0, 13, 4, 13, 42, 17, 30, 14, 2, 2, 13, 17, 2, 13, 17, 30, 0, 13, 2, 2, 13, 17, 2, 13, 17, 30, 29, 8, 13, 40, 13, 13, 0, 13, 4, 13, 12, 13, 30, 4, 18, 18, 13, 13, 4, 18, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 13, 14 ], [ 13, 15 ], [ 0, 16 ], [ 16, 17 ], [ 16, 18 ], [ 0, 19 ], [ 19, 20 ], [ 19, 21 ], [ 0, 22 ], [ 22, 23 ], [ 22, 24 ], [ 0, 25 ], [ 762, 26 ], [ 762, 27 ], [ 27, 28 ], [ 27, 29 ], [ 762, 30 ], [ 30, 31 ], [ 30, 32 ], [ 762, 33 ], [ 33, 34 ], [ 762, 35 ], [ 35, 36 ], [ 762, 37 ], [ 37, 38 ], [ 37, 39 ], [ 762, 40 ], [ 40, 41 ], [ 40, 42 ], [ 762, 43 ], [ 43, 44 ], [ 43, 45 ], [ 762, 46 ], [ 46, 47 ], [ 46, 48 ], [ 762, 50 ], [ 50, 51 ], [ 50, 52 ], [ 762, 53 ], [ 53, 54 ], [ 53, 55 ], [ 762, 56 ], [ 56, 57 ], [ 762, 58 ], [ 58, 59 ], [ 58, 60 ], [ 60, 61 ], [ 61, 62 ], [ 61, 63 ], [ 60, 64 ], [ 64, 65 ], [ 65, 66 ], [ 66, 67 ], [ 66, 68 ], [ 64, 69 ], [ 69, 70 ], [ 69, 71 ], [ 64, 72 ], [ 72, 73 ], [ 73, 74 ], [ 64, 75 ], [ 75, 76 ], [ 76, 77 ], [ 76, 78 ], [ 762, 79 ], [ 79, 80 ], [ 79, 81 ], [ 81, 82 ], [ 82, 83 ], [ 82, 84 ], [ 84, 85 ], [ 81, 86 ], [ 86, 87 ], [ 86, 88 ], [ 88, 89 ], [ 81, 90 ], [ 90, 91 ], [ 90, 92 ], [ 81, 93 ], [ 93, 94 ], [ 94, 95 ], [ 95, 96 ], [ 95, 97 ], [ 93, 98 ], [ 98, 99 ], [ 98, 100 ], [ 93, 101 ], [ 101, 102 ], [ 102, 103 ], [ 93, 104 ], [ 105, 105 ], [ 105, 106 ], [ 106, 107 ], [ 106, 108 ], [ 108, 109 ], [ 105, 110 ], [ 110, 111 ], [ 111, 112 ], [ 111, 113 ], [ 110, 114 ], [ 114, 115 ], [ 115, 116 ], [ 115, 117 ], [ 117, 118 ], [ 117, 119 ], [ 110, 120 ], [ 120, 121 ], [ 120, 122 ], [ 81, 123 ], [ 123, 124 ], [ 124, 125 ], [ 123, 126 ], [ 79, 127 ], [ 127, 128 ], [ 762, 129 ], [ 129, 130 ], [ 129, 131 ], [ 131, 132 ], [ 132, 133 ], [ 132, 134 ], [ 131, 135 ], [ 135, 136 ], [ 135, 137 ], [ 131, 138 ], [ 138, 139 ], [ 139, 140 ], [ 139, 141 ], [ 138, 142 ], [ 142, 143 ], [ 143, 144 ], [ 144, 145 ], [ 145, 146 ], [ 145, 147 ], [ 144, 148 ], [ 143, 149 ], [ 149, 150 ], [ 150, 151 ], [ 150, 152 ], [ 152, 153 ], [ 153, 154 ], [ 153, 155 ], [ 152, 156 ], [ 142, 157 ], [ 157, 158 ], [ 157, 159 ], [ 159, 160 ], [ 160, 161 ], [ 160, 162 ], [ 159, 163 ], [ 142, 164 ], [ 164, 165 ], [ 164, 166 ], [ 131, 167 ], [ 167, 168 ], [ 168, 169 ], [ 168, 170 ], [ 129, 171 ], [ 171, 172 ], [ 129, 173 ], [ 173, 174 ], [ 762, 175 ], [ 175, 176 ], [ 175, 177 ], [ 177, 178 ], [ 178, 179 ], [ 179, 180 ], [ 179, 181 ], [ 178, 182 ], [ 182, 183 ], [ 183, 184 ], [ 183, 185 ], [ 185, 186 ], [ 185, 187 ], [ 182, 188 ], [ 188, 189 ], [ 188, 190 ], [ 182, 191 ], [ 191, 192 ], [ 191, 193 ], [ 177, 194 ], [ 194, 195 ], [ 175, 196 ], [ 196, 197 ], [ 175, 198 ], [ 198, 199 ], [ 762, 200 ], [ 200, 201 ], [ 200, 202 ], [ 202, 203 ], [ 203, 204 ], [ 203, 205 ], [ 205, 206 ], [ 206, 207 ], [ 207, 208 ], [ 205, 209 ], [ 209, 210 ], [ 209, 211 ], [ 205, 212 ], [ 202, 213 ], [ 213, 214 ], [ 213, 215 ], [ 202, 216 ], [ 216, 217 ], [ 216, 218 ], [ 218, 219 ], [ 219, 220 ], [ 202, 221 ], [ 221, 222 ], [ 202, 223 ], [ 223, 224 ], [ 224, 225 ], [ 202, 226 ], [ 226, 227 ], [ 227, 228 ], [ 228, 229 ], [ 229, 230 ], [ 226, 231 ], [ 231, 232 ], [ 231, 233 ], [ 233, 234 ], [ 234, 235 ], [ 235, 236 ], [ 236, 237 ], [ 234, 238 ], [ 233, 239 ], [ 762, 240 ], [ 240, 241 ], [ 240, 242 ], [ 242, 243 ], [ 243, 244 ], [ 244, 245 ], [ 240, 246 ], [ 246, 247 ], [ 762, 248 ], [ 248, 249 ], [ 248, 250 ], [ 250, 251 ], [ 251, 252 ], [ 252, 253 ], [ 252, 254 ], [ 254, 255 ], [ 251, 256 ], [ 256, 257 ], [ 250, 258 ], [ 258, 259 ], [ 259, 260 ], [ 259, 261 ], [ 258, 262 ], [ 262, 263 ], [ 263, 264 ], [ 263, 265 ], [ 262, 266 ], [ 266, 267 ], [ 267, 268 ], [ 267, 269 ], [ 269, 270 ], [ 270, 271 ], [ 266, 272 ], [ 272, 273 ], [ 273, 274 ], [ 273, 275 ], [ 275, 276 ], [ 276, 277 ], [ 275, 278 ], [ 262, 279 ], [ 279, 280 ], [ 280, 281 ], [ 280, 282 ], [ 279, 283 ], [ 283, 284 ], [ 284, 285 ], [ 250, 286 ], [ 286, 287 ], [ 287, 288 ], [ 287, 289 ], [ 289, 290 ], [ 762, 291 ], [ 291, 292 ], [ 291, 293 ], [ 293, 294 ], [ 294, 295 ], [ 295, 296 ], [ 296, 297 ], [ 297, 298 ], [ 297, 299 ], [ 296, 300 ], [ 300, 301 ], [ 300, 302 ], [ 291, 303 ], [ 303, 304 ], [ 762, 305 ], [ 305, 306 ], [ 305, 307 ], [ 307, 308 ], [ 308, 309 ], [ 307, 310 ], [ 310, 311 ], [ 311, 312 ], [ 312, 313 ], [ 313, 314 ], [ 313, 315 ], [ 315, 316 ], [ 312, 317 ], [ 317, 318 ], [ 311, 319 ], [ 319, 320 ], [ 319, 321 ], [ 307, 322 ], [ 322, 323 ], [ 762, 324 ], [ 324, 325 ], [ 324, 326 ], [ 326, 327 ], [ 327, 328 ], [ 328, 329 ], [ 329, 330 ], [ 328, 331 ], [ 331, 332 ], [ 762, 333 ], [ 333, 334 ], [ 333, 335 ], [ 335, 336 ], [ 336, 337 ], [ 337, 338 ], [ 762, 339 ], [ 339, 340 ], [ 339, 341 ], [ 341, 342 ], [ 342, 343 ], [ 342, 344 ], [ 344, 345 ], [ 341, 346 ], [ 346, 347 ], [ 346, 348 ], [ 341, 349 ], [ 349, 350 ], [ 350, 351 ], [ 351, 352 ], [ 351, 353 ], [ 349, 354 ], [ 354, 355 ], [ 355, 356 ], [ 356, 357 ], [ 355, 358 ], [ 354, 359 ], [ 359, 360 ], [ 359, 361 ], [ 361, 362 ], [ 341, 363 ], [ 363, 364 ], [ 364, 365 ], [ 365, 366 ], [ 762, 367 ], [ 367, 368 ], [ 367, 369 ], [ 369, 370 ], [ 370, 371 ], [ 370, 372 ], [ 369, 374 ], [ 374, 375 ], [ 374, 376 ], [ 376, 377 ], [ 369, 378 ], [ 378, 379 ], [ 378, 380 ], [ 369, 381 ], [ 381, 382 ], [ 382, 383 ], [ 382, 384 ], [ 381, 385 ], [ 385, 386 ], [ 386, 387 ], [ 387, 388 ], [ 388, 389 ], [ 388, 390 ], [ 386, 391 ], [ 391, 392 ], [ 392, 393 ], [ 392, 394 ], [ 394, 395 ], [ 391, 396 ], [ 385, 397 ], [ 397, 398 ], [ 397, 399 ], [ 399, 400 ], [ 369, 401 ], [ 401, 402 ], [ 402, 403 ], [ 403, 404 ], [ 403, 405 ], [ 402, 406 ], [ 402, 407 ], [ 407, 408 ], [ 408, 409 ], [ 407, 410 ], [ 407, 411 ], [ 367, 412 ], [ 412, 413 ], [ 762, 414 ], [ 414, 415 ], [ 414, 416 ], [ 416, 417 ], [ 417, 418 ], [ 417, 419 ], [ 416, 421 ], [ 421, 422 ], [ 422, 423 ], [ 423, 424 ], [ 423, 425 ], [ 421, 426 ], [ 426, 427 ], [ 426, 428 ], [ 421, 429 ], [ 429, 430 ], [ 430, 431 ], [ 421, 432 ], [ 432, 433 ], [ 433, 434 ], [ 434, 435 ], [ 434, 436 ], [ 433, 437 ], [ 437, 438 ], [ 437, 439 ], [ 416, 440 ], [ 440, 441 ], [ 414, 442 ], [ 442, 443 ], [ 414, 444 ], [ 444, 445 ], [ 762, 446 ], [ 446, 447 ], [ 446, 448 ], [ 448, 449 ], [ 449, 450 ], [ 449, 451 ], [ 448, 453 ], [ 453, 454 ], [ 454, 455 ], [ 455, 456 ], [ 455, 457 ], [ 453, 458 ], [ 458, 459 ], [ 458, 460 ], [ 453, 461 ], [ 461, 462 ], [ 462, 463 ], [ 453, 464 ], [ 464, 465 ], [ 465, 466 ], [ 466, 467 ], [ 466, 468 ], [ 465, 469 ], [ 469, 470 ], [ 448, 471 ], [ 471, 472 ], [ 446, 473 ], [ 473, 474 ], [ 762, 475 ], [ 475, 476 ], [ 475, 477 ], [ 477, 478 ], [ 478, 479 ], [ 478, 480 ], [ 477, 481 ], [ 481, 482 ], [ 482, 483 ], [ 483, 484 ], [ 483, 485 ], [ 481, 486 ], [ 486, 487 ], [ 486, 488 ], [ 481, 489 ], [ 489, 490 ], [ 490, 491 ], [ 481, 492 ], [ 492, 493 ], [ 493, 494 ], [ 494, 495 ], [ 493, 496 ], [ 496, 497 ], [ 477, 498 ], [ 498, 499 ], [ 475, 500 ], [ 500, 501 ], [ 762, 502 ], [ 502, 503 ], [ 502, 504 ], [ 504, 505 ], [ 505, 506 ], [ 505, 507 ], [ 504, 509 ], [ 509, 510 ], [ 510, 511 ], [ 511, 512 ], [ 511, 513 ], [ 509, 514 ], [ 514, 515 ], [ 514, 516 ], [ 509, 517 ], [ 517, 518 ], [ 518, 519 ], [ 509, 520 ], [ 520, 521 ], [ 521, 522 ], [ 522, 523 ], [ 522, 524 ], [ 521, 525 ], [ 525, 526 ], [ 525, 527 ], [ 504, 528 ], [ 528, 529 ], [ 502, 530 ], [ 530, 531 ], [ 502, 532 ], [ 532, 533 ], [ 762, 534 ], [ 534, 535 ], [ 534, 536 ], [ 536, 537 ], [ 537, 538 ], [ 537, 539 ], [ 536, 540 ], [ 540, 541 ], [ 536, 542 ], [ 542, 543 ], [ 542, 544 ], [ 536, 545 ], [ 545, 546 ], [ 546, 547 ], [ 547, 548 ], [ 548, 549 ], [ 548, 550 ], [ 550, 551 ], [ 547, 552 ], [ 552, 553 ], [ 546, 554 ], [ 554, 555 ], [ 555, 556 ], [ 556, 557 ], [ 557, 558 ], [ 557, 559 ], [ 556, 560 ], [ 560, 561 ], [ 560, 562 ], [ 555, 563 ], [ 563, 564 ], [ 563, 565 ], [ 536, 566 ], [ 566, 567 ], [ 567, 568 ], [ 567, 569 ], [ 566, 570 ], [ 570, 571 ], [ 571, 572 ], [ 571, 573 ], [ 570, 574 ], [ 574, 575 ], [ 574, 576 ], [ 576, 577 ], [ 536, 578 ], [ 578, 579 ], [ 578, 580 ], [ 580, 581 ], [ 581, 582 ], [ 582, 583 ], [ 583, 584 ], [ 583, 585 ], [ 582, 586 ], [ 586, 587 ], [ 586, 588 ], [ 581, 589 ], [ 589, 590 ], [ 590, 591 ], [ 590, 592 ], [ 592, 593 ], [ 593, 594 ], [ 593, 595 ], [ 592, 596 ], [ 596, 597 ], [ 596, 598 ], [ 581, 599 ], [ 599, 600 ], [ 600, 601 ], [ 601, 602 ], [ 601, 603 ], [ 603, 604 ], [ 601, 605 ], [ 580, 606 ], [ 606, 607 ], [ 606, 608 ], [ 608, 609 ], [ 762, 610 ], [ 610, 611 ], [ 610, 612 ], [ 612, 613 ], [ 613, 614 ], [ 613, 615 ], [ 612, 617 ], [ 617, 618 ], [ 618, 619 ], [ 619, 620 ], [ 619, 621 ], [ 617, 622 ], [ 622, 623 ], [ 622, 624 ], [ 617, 625 ], [ 625, 626 ], [ 626, 627 ], [ 617, 628 ], [ 628, 629 ], [ 629, 630 ], [ 630, 631 ], [ 630, 632 ], [ 629, 633 ], [ 633, 634 ], [ 612, 635 ], [ 635, 636 ], [ 610, 637 ], [ 637, 638 ], [ 762, 639 ], [ 639, 640 ], [ 639, 641 ], [ 641, 642 ], [ 642, 643 ], [ 642, 644 ], [ 641, 646 ], [ 646, 647 ], [ 647, 648 ], [ 648, 649 ], [ 648, 650 ], [ 646, 651 ], [ 651, 652 ], [ 651, 653 ], [ 646, 654 ], [ 654, 655 ], [ 655, 656 ], [ 646, 657 ], [ 657, 658 ], [ 658, 659 ], [ 659, 660 ], [ 659, 661 ], [ 658, 662 ], [ 662, 663 ], [ 662, 664 ], [ 641, 665 ], [ 665, 666 ], [ 639, 667 ], [ 667, 668 ], [ 639, 669 ], [ 669, 670 ], [ 762, 671 ], [ 671, 672 ], [ 671, 673 ], [ 673, 674 ], [ 674, 675 ], [ 674, 676 ], [ 673, 677 ], [ 677, 678 ], [ 673, 679 ], [ 679, 680 ], [ 679, 681 ], [ 673, 682 ], [ 682, 683 ], [ 683, 684 ], [ 684, 685 ], [ 685, 686 ], [ 685, 687 ], [ 687, 688 ], [ 684, 689 ], [ 689, 690 ], [ 683, 691 ], [ 691, 692 ], [ 692, 693 ], [ 693, 694 ], [ 694, 695 ], [ 694, 696 ], [ 693, 697 ], [ 697, 698 ], [ 697, 699 ], [ 692, 700 ], [ 700, 701 ], [ 700, 702 ], [ 673, 703 ], [ 703, 704 ], [ 704, 705 ], [ 704, 706 ], [ 703, 707 ], [ 707, 708 ], [ 708, 709 ], [ 708, 710 ], [ 707, 711 ], [ 711, 712 ], [ 711, 713 ], [ 713, 714 ], [ 673, 715 ], [ 715, 716 ], [ 715, 717 ], [ 717, 718 ], [ 718, 719 ], [ 719, 720 ], [ 720, 721 ], [ 720, 722 ], [ 719, 723 ], [ 723, 724 ], [ 723, 725 ], [ 718, 726 ], [ 726, 727 ], [ 727, 728 ], [ 727, 729 ], [ 729, 730 ], [ 730, 731 ], [ 730, 732 ], [ 729, 733 ], [ 733, 734 ], [ 733, 735 ], [ 718, 736 ], [ 736, 737 ], [ 737, 738 ], [ 738, 739 ], [ 738, 740 ], [ 740, 741 ], [ 738, 742 ], [ 717, 743 ], [ 743, 744 ], [ 743, 745 ], [ 745, 746 ], [ 762, 747 ], [ 747, 748 ], [ 747, 749 ], [ 749, 750 ], [ 750, 751 ], [ 751, 752 ], [ 752, 753 ], [ 752, 754 ], [ 750, 755 ], [ 755, 756 ], [ 756, 757 ], [ 755, 758 ], [ 747, 759 ], [ 759, 760 ], [ 0, 761 ], [ 761, 762 ], [ 761, 763 ] ]
[ "import java.io.ByteArrayInputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.PrintWriter;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.InputMismatchException;\nimport java.util.List;\n\npublic class Main {\n\n\tprivate static final String NO = \"NO\";\n\tprivate static final String YES = \"YES\";\n\tInputStream is;\n\tPrintWriter out;\n\tString INPUT = \"\";\n\n\tprivate static final long MOD = 1000000007;\n\tprivate static final int MAXN = 200001;\n\n\tvoid solve() {\n\t\tint T = 1;\n\t\tfor (int i = 0; i < T; i++)\n\t\t\tsolve(i);\n\t}\n\n\tvoid solve(int T) {\n\t\tint n = ni();\n\t\tint pre = -1;\n\t\tlong ans = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tint v = ni();\n\t\t\tif (pre > v) {\n\t\t\t\tans += pre - v;\n\t\t\t} else\n\t\t\t\tpre = v;\n\t\t}\n\t\tout.println(ans);\n\t}\n\n\t// a^b\n\tlong power(long a, long b) {\n\t\tlong x = 1, y = a;\n\t\twhile (b > 0) {\n\t\t\tif (b % 2 != 0) {\n\t\t\t\tx = (x * y) % MOD;\n\t\t\t}\n\t\t\ty = (y * y) % MOD;\n\t\t\tb /= 2;\n\t\t}\n\t\treturn x % MOD;\n\t}\n\n\tprivate long gcd(long a, long b) {\n\t\twhile (a != 0) {\n\t\t\tlong tmp = b % a;\n\t\t\tb = a;\n\t\t\ta = tmp;\n\t\t}\n\t\treturn b;\n\t}\n\n\tvoid run() throws Exception {\n\t\tis = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());\n\t\tout = new PrintWriter(System.out);\n\n\t\tlong s = System.currentTimeMillis();\n\t\tsolve();\n\t\tout.flush();\n\t\tif (!INPUT.isEmpty())\n\t\t\ttr(System.currentTimeMillis() - s + \"ms\");\n\t}\n\n\tpublic static void main(String[] args) throws Exception {\n\t\tnew Main().run();\n\t}\n\n\tprivate byte[] inbuf = new byte[1024];\n\tpublic int lenbuf = 0, ptrbuf = 0;\n\tprivate boolean vis[];\n\n\tprivate int readByte() {\n\t\tif (lenbuf == -1)\n\t\t\tthrow new InputMismatchException();\n\t\tif (ptrbuf >= lenbuf) {\n\t\t\tptrbuf = 0;\n\t\t\ttry {\n\t\t\t\tlenbuf = is.read(inbuf);\n\t\t\t} catch (IOException e) {\n\t\t\t\tthrow new InputMismatchException();\n\t\t\t}\n\t\t\tif (lenbuf <= 0)\n\t\t\t\treturn -1;\n\t\t}\n\t\treturn inbuf[ptrbuf++];\n\t}\n\n\tprivate boolean isSpaceChar(int c) {\n\t\treturn !(c >= 33 && c <= 126);\n\t}\n\n\tprivate int skip() {\n\t\tint b;\n\t\twhile ((b = readByte()) != -1 && isSpaceChar(b))\n\t\t\t;\n\t\treturn b;\n\t}\n\n\tprivate double nd() {\n\t\treturn Double.parseDouble(ns());\n\t}\n\n\tprivate char nc() {\n\t\treturn (char) skip();\n\t}\n\n\tprivate String ns() {\n\t\tint b = skip();\n\t\tStringBuilder sb = new StringBuilder();\n\t\twhile (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != '\n\t\t\t\t\t\t\t\t\t// ')\n\t\t\tsb.appendCodePoint(b);\n\t\t\tb = readByte();\n\t\t}\n\t\treturn sb.toString();\n\t}\n\n\tprivate char[] ns(int n) {\n\t\tchar[] buf = new char[n];\n\t\tint b = skip(), p = 0;\n\t\twhile (p < n) {\n\t\t\tif (!(isSpaceChar(b)))\n\t\t\t\tbuf[p++] = (char) b;\n\t\t\tb = readByte();\n\t\t}\n\t\treturn n == p ? buf : Arrays.copyOf(buf, p);\n\t}\n\n\tprivate char[][] nm(int n, int m) {\n\t\tchar[][] map = new char[n][];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tmap[i] = ns(m);\n\t\treturn map;\n\t}\n\n\tprivate int[] na(int n) {\n\t\tint[] a = new int[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = ni();\n\t\treturn a;\n\t}\n\n\tprivate List<Integer> na2(int n) {\n\t\tList<Integer> a = new ArrayList<Integer>();\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta.add(ni());\n\t\treturn a;\n\t}\n\n\tprivate int[][] na(int n, int m) {\n\t\tint[][] a = new int[n][];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = na(m);\n\t\treturn a;\n\t}\n\n\tprivate int ni() {\n\t\tint num = 0, b;\n\t\tboolean minus = false;\n\t\twhile ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))\n\t\t\t;\n\t\tif (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}\n\n\t\twhile (true) {\n\t\t\tif (b >= '0' && b <= '9') {\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t} else {\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}\n\t}\n\n\tprivate long[] nl(int n) {\n\t\tlong[] a = new long[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = nl();\n\t\treturn a;\n\t}\n\n\tprivate long[][] nl(int n, int m) {\n\t\tlong[][] a = new long[n][];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = nl(m);\n\t\treturn a;\n\t}\n\n\tprivate long nl() {\n\t\tlong num = 0;\n\t\tint b;\n\t\tboolean minus = false;\n\t\twhile ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))\n\t\t\t;\n\t\tif (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}\n\n\t\twhile (true) {\n\t\t\tif (b >= '0' && b <= '9') {\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t} else {\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}\n\t}\n\n\tprivate static void tr(Object... o) {\n\t\tSystem.out.println(Arrays.deepToString(o));\n\t}\n\n}", "import java.io.ByteArrayInputStream;", "ByteArrayInputStream", "java.io", "import java.io.IOException;", "IOException", "java.io", "import java.io.InputStream;", "InputStream", "java.io", "import java.io.PrintWriter;", "PrintWriter", "java.io", "import java.util.ArrayList;", "ArrayList", "java.util", "import java.util.Arrays;", "Arrays", "java.util", "import java.util.InputMismatchException;", "InputMismatchException", "java.util", "import java.util.List;", "List", "java.util", "public class Main {\n\n\tprivate static final String NO = \"NO\";\n\tprivate static final String YES = \"YES\";\n\tInputStream is;\n\tPrintWriter out;\n\tString INPUT = \"\";\n\n\tprivate static final long MOD = 1000000007;\n\tprivate static final int MAXN = 200001;\n\n\tvoid solve() {\n\t\tint T = 1;\n\t\tfor (int i = 0; i < T; i++)\n\t\t\tsolve(i);\n\t}\n\n\tvoid solve(int T) {\n\t\tint n = ni();\n\t\tint pre = -1;\n\t\tlong ans = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tint v = ni();\n\t\t\tif (pre > v) {\n\t\t\t\tans += pre - v;\n\t\t\t} else\n\t\t\t\tpre = v;\n\t\t}\n\t\tout.println(ans);\n\t}\n\n\t// a^b\n\tlong power(long a, long b) {\n\t\tlong x = 1, y = a;\n\t\twhile (b > 0) {\n\t\t\tif (b % 2 != 0) {\n\t\t\t\tx = (x * y) % MOD;\n\t\t\t}\n\t\t\ty = (y * y) % MOD;\n\t\t\tb /= 2;\n\t\t}\n\t\treturn x % MOD;\n\t}\n\n\tprivate long gcd(long a, long b) {\n\t\twhile (a != 0) {\n\t\t\tlong tmp = b % a;\n\t\t\tb = a;\n\t\t\ta = tmp;\n\t\t}\n\t\treturn b;\n\t}\n\n\tvoid run() throws Exception {\n\t\tis = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());\n\t\tout = new PrintWriter(System.out);\n\n\t\tlong s = System.currentTimeMillis();\n\t\tsolve();\n\t\tout.flush();\n\t\tif (!INPUT.isEmpty())\n\t\t\ttr(System.currentTimeMillis() - s + \"ms\");\n\t}\n\n\tpublic static void main(String[] args) throws Exception {\n\t\tnew Main().run();\n\t}\n\n\tprivate byte[] inbuf = new byte[1024];\n\tpublic int lenbuf = 0, ptrbuf = 0;\n\tprivate boolean vis[];\n\n\tprivate int readByte() {\n\t\tif (lenbuf == -1)\n\t\t\tthrow new InputMismatchException();\n\t\tif (ptrbuf >= lenbuf) {\n\t\t\tptrbuf = 0;\n\t\t\ttry {\n\t\t\t\tlenbuf = is.read(inbuf);\n\t\t\t} catch (IOException e) {\n\t\t\t\tthrow new InputMismatchException();\n\t\t\t}\n\t\t\tif (lenbuf <= 0)\n\t\t\t\treturn -1;\n\t\t}\n\t\treturn inbuf[ptrbuf++];\n\t}\n\n\tprivate boolean isSpaceChar(int c) {\n\t\treturn !(c >= 33 && c <= 126);\n\t}\n\n\tprivate int skip() {\n\t\tint b;\n\t\twhile ((b = readByte()) != -1 && isSpaceChar(b))\n\t\t\t;\n\t\treturn b;\n\t}\n\n\tprivate double nd() {\n\t\treturn Double.parseDouble(ns());\n\t}\n\n\tprivate char nc() {\n\t\treturn (char) skip();\n\t}\n\n\tprivate String ns() {\n\t\tint b = skip();\n\t\tStringBuilder sb = new StringBuilder();\n\t\twhile (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != '\n\t\t\t\t\t\t\t\t\t// ')\n\t\t\tsb.appendCodePoint(b);\n\t\t\tb = readByte();\n\t\t}\n\t\treturn sb.toString();\n\t}\n\n\tprivate char[] ns(int n) {\n\t\tchar[] buf = new char[n];\n\t\tint b = skip(), p = 0;\n\t\twhile (p < n) {\n\t\t\tif (!(isSpaceChar(b)))\n\t\t\t\tbuf[p++] = (char) b;\n\t\t\tb = readByte();\n\t\t}\n\t\treturn n == p ? buf : Arrays.copyOf(buf, p);\n\t}\n\n\tprivate char[][] nm(int n, int m) {\n\t\tchar[][] map = new char[n][];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tmap[i] = ns(m);\n\t\treturn map;\n\t}\n\n\tprivate int[] na(int n) {\n\t\tint[] a = new int[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = ni();\n\t\treturn a;\n\t}\n\n\tprivate List<Integer> na2(int n) {\n\t\tList<Integer> a = new ArrayList<Integer>();\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta.add(ni());\n\t\treturn a;\n\t}\n\n\tprivate int[][] na(int n, int m) {\n\t\tint[][] a = new int[n][];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = na(m);\n\t\treturn a;\n\t}\n\n\tprivate int ni() {\n\t\tint num = 0, b;\n\t\tboolean minus = false;\n\t\twhile ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))\n\t\t\t;\n\t\tif (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}\n\n\t\twhile (true) {\n\t\t\tif (b >= '0' && b <= '9') {\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t} else {\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}\n\t}\n\n\tprivate long[] nl(int n) {\n\t\tlong[] a = new long[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = nl();\n\t\treturn a;\n\t}\n\n\tprivate long[][] nl(int n, int m) {\n\t\tlong[][] a = new long[n][];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = nl(m);\n\t\treturn a;\n\t}\n\n\tprivate long nl() {\n\t\tlong num = 0;\n\t\tint b;\n\t\tboolean minus = false;\n\t\twhile ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))\n\t\t\t;\n\t\tif (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}\n\n\t\twhile (true) {\n\t\t\tif (b >= '0' && b <= '9') {\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t} else {\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}\n\t}\n\n\tprivate static void tr(Object... o) {\n\t\tSystem.out.println(Arrays.deepToString(o));\n\t}\n\n}", "Main", "private static final String NO = \"NO\";", "NO", "\"NO\"", "private static final String YES = \"YES\";", "YES", "\"YES\"", "InputStream is;", "is", "PrintWriter out;", "out", "String INPUT = \"\";", "INPUT", "\"\"", "private static final long MOD = 1000000007;", "MOD", "1000000007", "private static final int MAXN = 200001;", "MAXN", "200001", "private byte[] inbuf = new byte[1024];", "inbuf", "new byte[1024]", "1024", "public int lenbuf = 0", "lenbuf", "0", "ptrbuf = 0;", "ptrbuf", "0", "private boolean vis[];", "vis", "void solve() {\n\t\tint T = 1;\n\t\tfor (int i = 0; i < T; i++)\n\t\t\tsolve(i);\n\t}", "solve", "{\n\t\tint T = 1;\n\t\tfor (int i = 0; i < T; i++)\n\t\t\tsolve(i);\n\t}", "int T = 1;", "T", "1", "for (int i = 0; i < T; i++)\n\t\t\tsolve(i);", "int i = 0;", "int i = 0;", "i", "0", "i < T", "i", "T", "i++", "i++", "i", "solve(i);", "solve(i)", "solve", "i", "void solve(int T) {\n\t\tint n = ni();\n\t\tint pre = -1;\n\t\tlong ans = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tint v = ni();\n\t\t\tif (pre > v) {\n\t\t\t\tans += pre - v;\n\t\t\t} else\n\t\t\t\tpre = v;\n\t\t}\n\t\tout.println(ans);\n\t}", "solve", "{\n\t\tint n = ni();\n\t\tint pre = -1;\n\t\tlong ans = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tint v = ni();\n\t\t\tif (pre > v) {\n\t\t\t\tans += pre - v;\n\t\t\t} else\n\t\t\t\tpre = v;\n\t\t}\n\t\tout.println(ans);\n\t}", "int n = ni();", "n", "ni()", "ni", "int pre = -1;", "pre", "-1", "1", "long ans = 0;", "ans", "0", "for (int i = 0; i < n; i++) {\n\t\t\tint v = ni();\n\t\t\tif (pre > v) {\n\t\t\t\tans += pre - v;\n\t\t\t} else\n\t\t\t\tpre = v;\n\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n\t\t\tint v = ni();\n\t\t\tif (pre > v) {\n\t\t\t\tans += pre - v;\n\t\t\t} else\n\t\t\t\tpre = v;\n\t\t}", "{\n\t\t\tint v = ni();\n\t\t\tif (pre > v) {\n\t\t\t\tans += pre - v;\n\t\t\t} else\n\t\t\t\tpre = v;\n\t\t}", "int v = ni();", "v", "ni()", "ni", "if (pre > v) {\n\t\t\t\tans += pre - v;\n\t\t\t} else\n\t\t\t\tpre = v;", "pre > v", "pre", "v", "{\n\t\t\t\tans += pre - v;\n\t\t\t}", "ans += pre - v", "ans", "pre - v", "pre", "v", "pre = v", "pre", "v", "out.println(ans)", "out.println", "out", "ans", "int T", "T", "// a^b\n\tlong power(long a, long b) {\n\t\tlong x = 1, y = a;\n\t\twhile (b > 0) {\n\t\t\tif (b % 2 != 0) {\n\t\t\t\tx = (x * y) % MOD;\n\t\t\t}\n\t\t\ty = (y * y) % MOD;\n\t\t\tb /= 2;\n\t\t}\n\t\treturn x % MOD;\n\t}", "power", "{\n\t\tlong x = 1, y = a;\n\t\twhile (b > 0) {\n\t\t\tif (b % 2 != 0) {\n\t\t\t\tx = (x * y) % MOD;\n\t\t\t}\n\t\t\ty = (y * y) % MOD;\n\t\t\tb /= 2;\n\t\t}\n\t\treturn x % MOD;\n\t}", "long x = 1", "x", "1", "y = a;", "y", "a", "while (b > 0) {\n\t\t\tif (b % 2 != 0) {\n\t\t\t\tx = (x * y) % MOD;\n\t\t\t}\n\t\t\ty = (y * y) % MOD;\n\t\t\tb /= 2;\n\t\t}", "b > 0", "b", "0", "{\n\t\t\tif (b % 2 != 0) {\n\t\t\t\tx = (x * y) % MOD;\n\t\t\t}\n\t\t\ty = (y * y) % MOD;\n\t\t\tb /= 2;\n\t\t}", "if (b % 2 != 0) {\n\t\t\t\tx = (x * y) % MOD;\n\t\t\t}", "b % 2 != 0", "b % 2", "b", "2", "0", "{\n\t\t\t\tx = (x * y) % MOD;\n\t\t\t}", "x = (x * y) % MOD", "x", "(x * y) % MOD", "(x * y)", "x", "y", "MOD", "y = (y * y) % MOD", "y", "(y * y) % MOD", "(y * y)", "y", "y", "MOD", "b /= 2", "b", "2", "return x % MOD;", "x % MOD", "x", "MOD", "long a", "a", "long b", "b", "private long gcd(long a, long b) {\n\t\twhile (a != 0) {\n\t\t\tlong tmp = b % a;\n\t\t\tb = a;\n\t\t\ta = tmp;\n\t\t}\n\t\treturn b;\n\t}", "gcd", "{\n\t\twhile (a != 0) {\n\t\t\tlong tmp = b % a;\n\t\t\tb = a;\n\t\t\ta = tmp;\n\t\t}\n\t\treturn b;\n\t}", "while (a != 0) {\n\t\t\tlong tmp = b % a;\n\t\t\tb = a;\n\t\t\ta = tmp;\n\t\t}", "a != 0", "a", "0", "{\n\t\t\tlong tmp = b % a;\n\t\t\tb = a;\n\t\t\ta = tmp;\n\t\t}", "long tmp = b % a;", "tmp", "b % a", "b", "a", "b = a", "b", "a", "a = tmp", "a", "tmp", "return b;", "b", "long a", "a", "long b", "b", "void run() throws Exception {\n\t\tis = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());\n\t\tout = new PrintWriter(System.out);\n\n\t\tlong s = System.currentTimeMillis();\n\t\tsolve();\n\t\tout.flush();\n\t\tif (!INPUT.isEmpty())\n\t\t\ttr(System.currentTimeMillis() - s + \"ms\");\n\t}", "run", "{\n\t\tis = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());\n\t\tout = new PrintWriter(System.out);\n\n\t\tlong s = System.currentTimeMillis();\n\t\tsolve();\n\t\tout.flush();\n\t\tif (!INPUT.isEmpty())\n\t\t\ttr(System.currentTimeMillis() - s + \"ms\");\n\t}", "is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes())", "is", "INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes())", "INPUT.isEmpty()", "INPUT.isEmpty", "INPUT", "System.in", "System", "System.in", "new ByteArrayInputStream(INPUT.getBytes())", "out = new PrintWriter(System.out)", "out", "new PrintWriter(System.out)", "long s = System.currentTimeMillis();", "s", "System.currentTimeMillis()", "System.currentTimeMillis", "System", "solve()", "solve", "out.flush()", "out.flush", "out", "if (!INPUT.isEmpty())\n\t\t\ttr(System.currentTimeMillis() - s + \"ms\");", "!INPUT.isEmpty()", "INPUT.isEmpty()", "INPUT.isEmpty", "INPUT", "tr(System.currentTimeMillis() - s + \"ms\")", "tr", "System.currentTimeMillis() - s + \"ms\"", "System.currentTimeMillis() - s", "System.currentTimeMillis()", "System.currentTimeMillis", "System", "s", "\"ms\"", "public static void main(String[] args) throws Exception {\n\t\tnew Main().run();\n\t}", "main", "{\n\t\tnew Main().run();\n\t}", "new Main().run()", "new Main().run", "new Main()", "String[] args", "args", "private int readByte() {\n\t\tif (lenbuf == -1)\n\t\t\tthrow new InputMismatchException();\n\t\tif (ptrbuf >= lenbuf) {\n\t\t\tptrbuf = 0;\n\t\t\ttry {\n\t\t\t\tlenbuf = is.read(inbuf);\n\t\t\t} catch (IOException e) {\n\t\t\t\tthrow new InputMismatchException();\n\t\t\t}\n\t\t\tif (lenbuf <= 0)\n\t\t\t\treturn -1;\n\t\t}\n\t\treturn inbuf[ptrbuf++];\n\t}", "readByte", "{\n\t\tif (lenbuf == -1)\n\t\t\tthrow new InputMismatchException();\n\t\tif (ptrbuf >= lenbuf) {\n\t\t\tptrbuf = 0;\n\t\t\ttry {\n\t\t\t\tlenbuf = is.read(inbuf);\n\t\t\t} catch (IOException e) {\n\t\t\t\tthrow new InputMismatchException();\n\t\t\t}\n\t\t\tif (lenbuf <= 0)\n\t\t\t\treturn -1;\n\t\t}\n\t\treturn inbuf[ptrbuf++];\n\t}", "if (lenbuf == -1)\n\t\t\tthrow new InputMismatchException();", "lenbuf == -1", "lenbuf", "-1", "1", "throw new InputMismatchException();", "new InputMismatchException()", "if (ptrbuf >= lenbuf) {\n\t\t\tptrbuf = 0;\n\t\t\ttry {\n\t\t\t\tlenbuf = is.read(inbuf);\n\t\t\t} catch (IOException e) {\n\t\t\t\tthrow new InputMismatchException();\n\t\t\t}\n\t\t\tif (lenbuf <= 0)\n\t\t\t\treturn -1;\n\t\t}", "ptrbuf >= lenbuf", "ptrbuf", "lenbuf", "{\n\t\t\tptrbuf = 0;\n\t\t\ttry {\n\t\t\t\tlenbuf = is.read(inbuf);\n\t\t\t} catch (IOException e) {\n\t\t\t\tthrow new InputMismatchException();\n\t\t\t}\n\t\t\tif (lenbuf <= 0)\n\t\t\t\treturn -1;\n\t\t}", "ptrbuf = 0", "ptrbuf", "0", "try {\n\t\t\t\tlenbuf = is.read(inbuf);\n\t\t\t} catch (IOException e) {\n\t\t\t\tthrow new InputMismatchException();\n\t\t\t}", "catch (IOException e) {\n\t\t\t\tthrow new InputMismatchException();\n\t\t\t}", "IOException e", "{\n\t\t\t\tthrow new InputMismatchException();\n\t\t\t}", "throw new InputMismatchException();", "new InputMismatchException()", "{\n\t\t\t\tlenbuf = is.read(inbuf);\n\t\t\t}", "lenbuf = is.read(inbuf)", "lenbuf", "is.read(inbuf)", "is.read", "is", "inbuf", "if (lenbuf <= 0)\n\t\t\t\treturn -1;", "lenbuf <= 0", "lenbuf", "0", "return -1;", "-1", "1", "return inbuf[ptrbuf++];", "inbuf[ptrbuf++]", "inbuf", "ptrbuf++", "ptrbuf", "private boolean isSpaceChar(int c) {\n\t\treturn !(c >= 33 && c <= 126);\n\t}", "isSpaceChar", "{\n\t\treturn !(c >= 33 && c <= 126);\n\t}", "return !(c >= 33 && c <= 126);", "!(c >= 33 && c <= 126)", "(c >= 33 && c <= 126)", "c >= 33", "c", "33", "c <= 126", "c", "126", "int c", "c", "private int skip() {\n\t\tint b;\n\t\twhile ((b = readByte()) != -1 && isSpaceChar(b))\n\t\t\t;\n\t\treturn b;\n\t}", "skip", "{\n\t\tint b;\n\t\twhile ((b = readByte()) != -1 && isSpaceChar(b))\n\t\t\t;\n\t\treturn b;\n\t}", "int b;", "b", "while ((b = readByte()) != -1 && isSpaceChar(b))\n\t\t\t;", "(b = readByte()) != -1 && isSpaceChar(b)", "(b = readByte()) != -1", "(b = readByte())", "b", "readByte()", "readByte", "-1", "1", "isSpaceChar(b)", "isSpaceChar", "b", "return b;", "b", "private double nd() {\n\t\treturn Double.parseDouble(ns());\n\t}", "nd", "{\n\t\treturn Double.parseDouble(ns());\n\t}", "return Double.parseDouble(ns());", "Double.parseDouble(ns())", "Double.parseDouble", "Double", "ns()", "ns", "private char nc() {\n\t\treturn (char) skip();\n\t}", "nc", "{\n\t\treturn (char) skip();\n\t}", "return (char) skip();", "(char) skip()", "skip", "private String ns() {\n\t\tint b = skip();\n\t\tStringBuilder sb = new StringBuilder();\n\t\twhile (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != '\n\t\t\t\t\t\t\t\t\t// ')\n\t\t\tsb.appendCodePoint(b);\n\t\t\tb = readByte();\n\t\t}\n\t\treturn sb.toString();\n\t}", "ns", "{\n\t\tint b = skip();\n\t\tStringBuilder sb = new StringBuilder();\n\t\twhile (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != '\n\t\t\t\t\t\t\t\t\t// ')\n\t\t\tsb.appendCodePoint(b);\n\t\t\tb = readByte();\n\t\t}\n\t\treturn sb.toString();\n\t}", "int b = skip();", "b", "skip()", "skip", "StringBuilder sb = new StringBuilder();", "sb", "new StringBuilder()", "while (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != '\n\t\t\t\t\t\t\t\t\t// ')\n\t\t\tsb.appendCodePoint(b);\n\t\t\tb = readByte();\n\t\t}", "!(isSpaceChar(b))", "(isSpaceChar(b))", "isSpaceChar", "b", "{ // when nextLine, (isSpaceChar(b) && b != '\n\t\t\t\t\t\t\t\t\t// ')\n\t\t\tsb.appendCodePoint(b);\n\t\t\tb = readByte();\n\t\t}", "sb.appendCodePoint(b)", "sb.appendCodePoint", "sb", "b", "b = readByte()", "b", "readByte()", "readByte", "return sb.toString();", "sb.toString()", "sb.toString", "sb", "private char[] ns(int n) {\n\t\tchar[] buf = new char[n];\n\t\tint b = skip(), p = 0;\n\t\twhile (p < n) {\n\t\t\tif (!(isSpaceChar(b)))\n\t\t\t\tbuf[p++] = (char) b;\n\t\t\tb = readByte();\n\t\t}\n\t\treturn n == p ? buf : Arrays.copyOf(buf, p);\n\t}", "ns", "{\n\t\tchar[] buf = new char[n];\n\t\tint b = skip(), p = 0;\n\t\twhile (p < n) {\n\t\t\tif (!(isSpaceChar(b)))\n\t\t\t\tbuf[p++] = (char) b;\n\t\t\tb = readByte();\n\t\t}\n\t\treturn n == p ? buf : Arrays.copyOf(buf, p);\n\t}", "char[] buf = new char[n];", "buf", "new char[n]", "n", "int b = skip()", "b", "skip()", "skip", "p = 0;", "p", "0", "while (p < n) {\n\t\t\tif (!(isSpaceChar(b)))\n\t\t\t\tbuf[p++] = (char) b;\n\t\t\tb = readByte();\n\t\t}", "p < n", "p", "n", "{\n\t\t\tif (!(isSpaceChar(b)))\n\t\t\t\tbuf[p++] = (char) b;\n\t\t\tb = readByte();\n\t\t}", "if (!(isSpaceChar(b)))\n\t\t\t\tbuf[p++] = (char) b;", "!(isSpaceChar(b))", "(isSpaceChar(b))", "isSpaceChar", "b", "buf[p++] = (char) b", "buf[p++]", "buf", "p++", "p", "(char) b", "b = readByte()", "b", "readByte()", "readByte", "return n == p ? buf : Arrays.copyOf(buf, p);", "n == p ? buf : Arrays.copyOf(buf, p)", "n == p", "n", "p", "buf", "Arrays.copyOf(buf, p)", "Arrays.copyOf", "Arrays", "buf", "p", "int n", "n", "private char[][] nm(int n, int m) {\n\t\tchar[][] map = new char[n][];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tmap[i] = ns(m);\n\t\treturn map;\n\t}", "nm", "{\n\t\tchar[][] map = new char[n][];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tmap[i] = ns(m);\n\t\treturn map;\n\t}", "char[][] map = new char[n][];", "map", "new char[n][]", "n", "for (int i = 0; i < n; i++)\n\t\t\tmap[i] = ns(m);", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "map[i] = ns(m);", "map[i] = ns(m)", "map[i]", "map", "i", "ns(m)", "ns", "m", "return map;", "map", "int n", "n", "int m", "m", "private int[] na(int n) {\n\t\tint[] a = new int[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = ni();\n\t\treturn a;\n\t}", "na", "{\n\t\tint[] a = new int[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = ni();\n\t\treturn a;\n\t}", "int[] a = new int[n];", "a", "new int[n]", "n", "for (int i = 0; i < n; i++)\n\t\t\ta[i] = ni();", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "a[i] = ni();", "a[i] = ni()", "a[i]", "a", "i", "ni()", "ni", "return a;", "a", "int n", "n", "private List<Integer> na2(int n) {\n\t\tList<Integer> a = new ArrayList<Integer>();\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta.add(ni());\n\t\treturn a;\n\t}", "na2", "{\n\t\tList<Integer> a = new ArrayList<Integer>();\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta.add(ni());\n\t\treturn a;\n\t}", "List<Integer> a = new ArrayList<Integer>();", "a", "new ArrayList<Integer>()", "for (int i = 0; i < n; i++)\n\t\t\ta.add(ni());", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "a.add(ni());", "a.add(ni())", "a.add", "a", "ni()", "ni", "return a;", "a", "int n", "n", "private int[][] na(int n, int m) {\n\t\tint[][] a = new int[n][];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = na(m);\n\t\treturn a;\n\t}", "na", "{\n\t\tint[][] a = new int[n][];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = na(m);\n\t\treturn a;\n\t}", "int[][] a = new int[n][];", "a", "new int[n][]", "n", "for (int i = 0; i < n; i++)\n\t\t\ta[i] = na(m);", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "a[i] = na(m);", "a[i] = na(m)", "a[i]", "a", "i", "na(m)", "na", "m", "return a;", "a", "int n", "n", "int m", "m", "private int ni() {\n\t\tint num = 0, b;\n\t\tboolean minus = false;\n\t\twhile ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))\n\t\t\t;\n\t\tif (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}\n\n\t\twhile (true) {\n\t\t\tif (b >= '0' && b <= '9') {\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t} else {\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}\n\t}", "ni", "{\n\t\tint num = 0, b;\n\t\tboolean minus = false;\n\t\twhile ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))\n\t\t\t;\n\t\tif (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}\n\n\t\twhile (true) {\n\t\t\tif (b >= '0' && b <= '9') {\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t} else {\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}\n\t}", "int num = 0", "num", "0", "b;", "b", "boolean minus = false;", "minus", "false", "while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))\n\t\t\t;", "(b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')", "(b = readByte()) != -1", "(b = readByte())", "b", "readByte()", "readByte", "-1", "1", "!((b >= '0' && b <= '9') || b == '-')", "((b >= '0' && b <= '9') || b == '-')", "(b >= '0' && b <= '9')", "b >= '0'", "b", "'0'", "b <= '9'", "b", "'9'", "b == '-'", "b", "'-'", "if (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}", "b == '-'", "b", "'-'", "{\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}", "minus = true", "minus", "true", "b = readByte()", "b", "readByte()", "readByte", "while (true) {\n\t\t\tif (b >= '0' && b <= '9') {\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t} else {\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}", "true", "{\n\t\t\tif (b >= '0' && b <= '9') {\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t} else {\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}", "if (b >= '0' && b <= '9') {\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t} else {\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}", "b >= '0' && b <= '9'", "b >= '0'", "b", "'0'", "b <= '9'", "b", "'9'", "{\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t}", "num = num * 10 + (b - '0')", "num", "num * 10 + (b - '0')", "num * 10", "num", "10", "(b - '0')", "b", "'0'", "{\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}", "return minus ? -num : num;", "minus ? -num : num", "minus", "-num", "num", "num", "b = readByte()", "b", "readByte()", "readByte", "private long[] nl(int n) {\n\t\tlong[] a = new long[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = nl();\n\t\treturn a;\n\t}", "nl", "{\n\t\tlong[] a = new long[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = nl();\n\t\treturn a;\n\t}", "long[] a = new long[n];", "a", "new long[n]", "n", "for (int i = 0; i < n; i++)\n\t\t\ta[i] = nl();", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "a[i] = nl();", "a[i] = nl()", "a[i]", "a", "i", "nl()", "nl", "return a;", "a", "int n", "n", "private long[][] nl(int n, int m) {\n\t\tlong[][] a = new long[n][];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = nl(m);\n\t\treturn a;\n\t}", "nl", "{\n\t\tlong[][] a = new long[n][];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = nl(m);\n\t\treturn a;\n\t}", "long[][] a = new long[n][];", "a", "new long[n][]", "n", "for (int i = 0; i < n; i++)\n\t\t\ta[i] = nl(m);", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "a[i] = nl(m);", "a[i] = nl(m)", "a[i]", "a", "i", "nl(m)", "nl", "m", "return a;", "a", "int n", "n", "int m", "m", "private long nl() {\n\t\tlong num = 0;\n\t\tint b;\n\t\tboolean minus = false;\n\t\twhile ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))\n\t\t\t;\n\t\tif (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}\n\n\t\twhile (true) {\n\t\t\tif (b >= '0' && b <= '9') {\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t} else {\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}\n\t}", "nl", "{\n\t\tlong num = 0;\n\t\tint b;\n\t\tboolean minus = false;\n\t\twhile ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))\n\t\t\t;\n\t\tif (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}\n\n\t\twhile (true) {\n\t\t\tif (b >= '0' && b <= '9') {\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t} else {\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}\n\t}", "long num = 0;", "num", "0", "int b;", "b", "boolean minus = false;", "minus", "false", "while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))\n\t\t\t;", "(b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')", "(b = readByte()) != -1", "(b = readByte())", "b", "readByte()", "readByte", "-1", "1", "!((b >= '0' && b <= '9') || b == '-')", "((b >= '0' && b <= '9') || b == '-')", "(b >= '0' && b <= '9')", "b >= '0'", "b", "'0'", "b <= '9'", "b", "'9'", "b == '-'", "b", "'-'", "if (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}", "b == '-'", "b", "'-'", "{\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}", "minus = true", "minus", "true", "b = readByte()", "b", "readByte()", "readByte", "while (true) {\n\t\t\tif (b >= '0' && b <= '9') {\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t} else {\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}", "true", "{\n\t\t\tif (b >= '0' && b <= '9') {\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t} else {\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}", "if (b >= '0' && b <= '9') {\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t} else {\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}", "b >= '0' && b <= '9'", "b >= '0'", "b", "'0'", "b <= '9'", "b", "'9'", "{\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t}", "num = num * 10 + (b - '0')", "num", "num * 10 + (b - '0')", "num * 10", "num", "10", "(b - '0')", "b", "'0'", "{\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}", "return minus ? -num : num;", "minus ? -num : num", "minus", "-num", "num", "num", "b = readByte()", "b", "readByte()", "readByte", "private static void tr(Object... o) {\n\t\tSystem.out.println(Arrays.deepToString(o));\n\t}", "tr", "{\n\t\tSystem.out.println(Arrays.deepToString(o));\n\t}", "System.out.println(Arrays.deepToString(o))", "System.out.println", "System.out", "System", "System.out", "Arrays.deepToString(o)", "Arrays.deepToString", "Arrays", "o", "Object... o", "o", "public class Main {\n\n\tprivate static final String NO = \"NO\";\n\tprivate static final String YES = \"YES\";\n\tInputStream is;\n\tPrintWriter out;\n\tString INPUT = \"\";\n\n\tprivate static final long MOD = 1000000007;\n\tprivate static final int MAXN = 200001;\n\n\tvoid solve() {\n\t\tint T = 1;\n\t\tfor (int i = 0; i < T; i++)\n\t\t\tsolve(i);\n\t}\n\n\tvoid solve(int T) {\n\t\tint n = ni();\n\t\tint pre = -1;\n\t\tlong ans = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tint v = ni();\n\t\t\tif (pre > v) {\n\t\t\t\tans += pre - v;\n\t\t\t} else\n\t\t\t\tpre = v;\n\t\t}\n\t\tout.println(ans);\n\t}\n\n\t// a^b\n\tlong power(long a, long b) {\n\t\tlong x = 1, y = a;\n\t\twhile (b > 0) {\n\t\t\tif (b % 2 != 0) {\n\t\t\t\tx = (x * y) % MOD;\n\t\t\t}\n\t\t\ty = (y * y) % MOD;\n\t\t\tb /= 2;\n\t\t}\n\t\treturn x % MOD;\n\t}\n\n\tprivate long gcd(long a, long b) {\n\t\twhile (a != 0) {\n\t\t\tlong tmp = b % a;\n\t\t\tb = a;\n\t\t\ta = tmp;\n\t\t}\n\t\treturn b;\n\t}\n\n\tvoid run() throws Exception {\n\t\tis = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());\n\t\tout = new PrintWriter(System.out);\n\n\t\tlong s = System.currentTimeMillis();\n\t\tsolve();\n\t\tout.flush();\n\t\tif (!INPUT.isEmpty())\n\t\t\ttr(System.currentTimeMillis() - s + \"ms\");\n\t}\n\n\tpublic static void main(String[] args) throws Exception {\n\t\tnew Main().run();\n\t}\n\n\tprivate byte[] inbuf = new byte[1024];\n\tpublic int lenbuf = 0, ptrbuf = 0;\n\tprivate boolean vis[];\n\n\tprivate int readByte() {\n\t\tif (lenbuf == -1)\n\t\t\tthrow new InputMismatchException();\n\t\tif (ptrbuf >= lenbuf) {\n\t\t\tptrbuf = 0;\n\t\t\ttry {\n\t\t\t\tlenbuf = is.read(inbuf);\n\t\t\t} catch (IOException e) {\n\t\t\t\tthrow new InputMismatchException();\n\t\t\t}\n\t\t\tif (lenbuf <= 0)\n\t\t\t\treturn -1;\n\t\t}\n\t\treturn inbuf[ptrbuf++];\n\t}\n\n\tprivate boolean isSpaceChar(int c) {\n\t\treturn !(c >= 33 && c <= 126);\n\t}\n\n\tprivate int skip() {\n\t\tint b;\n\t\twhile ((b = readByte()) != -1 && isSpaceChar(b))\n\t\t\t;\n\t\treturn b;\n\t}\n\n\tprivate double nd() {\n\t\treturn Double.parseDouble(ns());\n\t}\n\n\tprivate char nc() {\n\t\treturn (char) skip();\n\t}\n\n\tprivate String ns() {\n\t\tint b = skip();\n\t\tStringBuilder sb = new StringBuilder();\n\t\twhile (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != '\n\t\t\t\t\t\t\t\t\t// ')\n\t\t\tsb.appendCodePoint(b);\n\t\t\tb = readByte();\n\t\t}\n\t\treturn sb.toString();\n\t}\n\n\tprivate char[] ns(int n) {\n\t\tchar[] buf = new char[n];\n\t\tint b = skip(), p = 0;\n\t\twhile (p < n) {\n\t\t\tif (!(isSpaceChar(b)))\n\t\t\t\tbuf[p++] = (char) b;\n\t\t\tb = readByte();\n\t\t}\n\t\treturn n == p ? buf : Arrays.copyOf(buf, p);\n\t}\n\n\tprivate char[][] nm(int n, int m) {\n\t\tchar[][] map = new char[n][];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tmap[i] = ns(m);\n\t\treturn map;\n\t}\n\n\tprivate int[] na(int n) {\n\t\tint[] a = new int[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = ni();\n\t\treturn a;\n\t}\n\n\tprivate List<Integer> na2(int n) {\n\t\tList<Integer> a = new ArrayList<Integer>();\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta.add(ni());\n\t\treturn a;\n\t}\n\n\tprivate int[][] na(int n, int m) {\n\t\tint[][] a = new int[n][];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = na(m);\n\t\treturn a;\n\t}\n\n\tprivate int ni() {\n\t\tint num = 0, b;\n\t\tboolean minus = false;\n\t\twhile ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))\n\t\t\t;\n\t\tif (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}\n\n\t\twhile (true) {\n\t\t\tif (b >= '0' && b <= '9') {\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t} else {\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}\n\t}\n\n\tprivate long[] nl(int n) {\n\t\tlong[] a = new long[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = nl();\n\t\treturn a;\n\t}\n\n\tprivate long[][] nl(int n, int m) {\n\t\tlong[][] a = new long[n][];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = nl(m);\n\t\treturn a;\n\t}\n\n\tprivate long nl() {\n\t\tlong num = 0;\n\t\tint b;\n\t\tboolean minus = false;\n\t\twhile ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))\n\t\t\t;\n\t\tif (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}\n\n\t\twhile (true) {\n\t\t\tif (b >= '0' && b <= '9') {\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t} else {\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}\n\t}\n\n\tprivate static void tr(Object... o) {\n\t\tSystem.out.println(Arrays.deepToString(o));\n\t}\n\n}", "public class Main {\n\n\tprivate static final String NO = \"NO\";\n\tprivate static final String YES = \"YES\";\n\tInputStream is;\n\tPrintWriter out;\n\tString INPUT = \"\";\n\n\tprivate static final long MOD = 1000000007;\n\tprivate static final int MAXN = 200001;\n\n\tvoid solve() {\n\t\tint T = 1;\n\t\tfor (int i = 0; i < T; i++)\n\t\t\tsolve(i);\n\t}\n\n\tvoid solve(int T) {\n\t\tint n = ni();\n\t\tint pre = -1;\n\t\tlong ans = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tint v = ni();\n\t\t\tif (pre > v) {\n\t\t\t\tans += pre - v;\n\t\t\t} else\n\t\t\t\tpre = v;\n\t\t}\n\t\tout.println(ans);\n\t}\n\n\t// a^b\n\tlong power(long a, long b) {\n\t\tlong x = 1, y = a;\n\t\twhile (b > 0) {\n\t\t\tif (b % 2 != 0) {\n\t\t\t\tx = (x * y) % MOD;\n\t\t\t}\n\t\t\ty = (y * y) % MOD;\n\t\t\tb /= 2;\n\t\t}\n\t\treturn x % MOD;\n\t}\n\n\tprivate long gcd(long a, long b) {\n\t\twhile (a != 0) {\n\t\t\tlong tmp = b % a;\n\t\t\tb = a;\n\t\t\ta = tmp;\n\t\t}\n\t\treturn b;\n\t}\n\n\tvoid run() throws Exception {\n\t\tis = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());\n\t\tout = new PrintWriter(System.out);\n\n\t\tlong s = System.currentTimeMillis();\n\t\tsolve();\n\t\tout.flush();\n\t\tif (!INPUT.isEmpty())\n\t\t\ttr(System.currentTimeMillis() - s + \"ms\");\n\t}\n\n\tpublic static void main(String[] args) throws Exception {\n\t\tnew Main().run();\n\t}\n\n\tprivate byte[] inbuf = new byte[1024];\n\tpublic int lenbuf = 0, ptrbuf = 0;\n\tprivate boolean vis[];\n\n\tprivate int readByte() {\n\t\tif (lenbuf == -1)\n\t\t\tthrow new InputMismatchException();\n\t\tif (ptrbuf >= lenbuf) {\n\t\t\tptrbuf = 0;\n\t\t\ttry {\n\t\t\t\tlenbuf = is.read(inbuf);\n\t\t\t} catch (IOException e) {\n\t\t\t\tthrow new InputMismatchException();\n\t\t\t}\n\t\t\tif (lenbuf <= 0)\n\t\t\t\treturn -1;\n\t\t}\n\t\treturn inbuf[ptrbuf++];\n\t}\n\n\tprivate boolean isSpaceChar(int c) {\n\t\treturn !(c >= 33 && c <= 126);\n\t}\n\n\tprivate int skip() {\n\t\tint b;\n\t\twhile ((b = readByte()) != -1 && isSpaceChar(b))\n\t\t\t;\n\t\treturn b;\n\t}\n\n\tprivate double nd() {\n\t\treturn Double.parseDouble(ns());\n\t}\n\n\tprivate char nc() {\n\t\treturn (char) skip();\n\t}\n\n\tprivate String ns() {\n\t\tint b = skip();\n\t\tStringBuilder sb = new StringBuilder();\n\t\twhile (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != '\n\t\t\t\t\t\t\t\t\t// ')\n\t\t\tsb.appendCodePoint(b);\n\t\t\tb = readByte();\n\t\t}\n\t\treturn sb.toString();\n\t}\n\n\tprivate char[] ns(int n) {\n\t\tchar[] buf = new char[n];\n\t\tint b = skip(), p = 0;\n\t\twhile (p < n) {\n\t\t\tif (!(isSpaceChar(b)))\n\t\t\t\tbuf[p++] = (char) b;\n\t\t\tb = readByte();\n\t\t}\n\t\treturn n == p ? buf : Arrays.copyOf(buf, p);\n\t}\n\n\tprivate char[][] nm(int n, int m) {\n\t\tchar[][] map = new char[n][];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tmap[i] = ns(m);\n\t\treturn map;\n\t}\n\n\tprivate int[] na(int n) {\n\t\tint[] a = new int[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = ni();\n\t\treturn a;\n\t}\n\n\tprivate List<Integer> na2(int n) {\n\t\tList<Integer> a = new ArrayList<Integer>();\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta.add(ni());\n\t\treturn a;\n\t}\n\n\tprivate int[][] na(int n, int m) {\n\t\tint[][] a = new int[n][];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = na(m);\n\t\treturn a;\n\t}\n\n\tprivate int ni() {\n\t\tint num = 0, b;\n\t\tboolean minus = false;\n\t\twhile ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))\n\t\t\t;\n\t\tif (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}\n\n\t\twhile (true) {\n\t\t\tif (b >= '0' && b <= '9') {\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t} else {\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}\n\t}\n\n\tprivate long[] nl(int n) {\n\t\tlong[] a = new long[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = nl();\n\t\treturn a;\n\t}\n\n\tprivate long[][] nl(int n, int m) {\n\t\tlong[][] a = new long[n][];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = nl(m);\n\t\treturn a;\n\t}\n\n\tprivate long nl() {\n\t\tlong num = 0;\n\t\tint b;\n\t\tboolean minus = false;\n\t\twhile ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))\n\t\t\t;\n\t\tif (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}\n\n\t\twhile (true) {\n\t\t\tif (b >= '0' && b <= '9') {\n\t\t\t\tnum = num * 10 + (b - '0');\n\t\t\t} else {\n\t\t\t\treturn minus ? -num : num;\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}\n\t}\n\n\tprivate static void tr(Object... o) {\n\t\tSystem.out.println(Arrays.deepToString(o));\n\t}\n\n}", "Main" ]
import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.InputMismatchException; import java.util.List; public class Main { private static final String NO = "NO"; private static final String YES = "YES"; InputStream is; PrintWriter out; String INPUT = ""; private static final long MOD = 1000000007; private static final int MAXN = 200001; void solve() { int T = 1; for (int i = 0; i < T; i++) solve(i); } void solve(int T) { int n = ni(); int pre = -1; long ans = 0; for (int i = 0; i < n; i++) { int v = ni(); if (pre > v) { ans += pre - v; } else pre = v; } out.println(ans); } // a^b long power(long a, long b) { long x = 1, y = a; while (b > 0) { if (b % 2 != 0) { x = (x * y) % MOD; } y = (y * y) % MOD; b /= 2; } return x % MOD; } private long gcd(long a, long b) { while (a != 0) { long tmp = b % a; b = a; a = tmp; } return b; } void run() throws Exception { is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes()); out = new PrintWriter(System.out); long s = System.currentTimeMillis(); solve(); out.flush(); if (!INPUT.isEmpty()) tr(System.currentTimeMillis() - s + "ms"); } public static void main(String[] args) throws Exception { new Main().run(); } private byte[] inbuf = new byte[1024]; public int lenbuf = 0, ptrbuf = 0; private boolean vis[]; private int readByte() { if (lenbuf == -1) throw new InputMismatchException(); if (ptrbuf >= lenbuf) { ptrbuf = 0; try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); } if (lenbuf <= 0) return -1; } return inbuf[ptrbuf++]; } private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); } private int skip() { int b; while ((b = readByte()) != -1 && isSpaceChar(b)) ; return b; } private double nd() { return Double.parseDouble(ns()); } private char nc() { return (char) skip(); } private String ns() { int b = skip(); StringBuilder sb = new StringBuilder(); while (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != ' // ') sb.appendCodePoint(b); b = readByte(); } return sb.toString(); } private char[] ns(int n) { char[] buf = new char[n]; int b = skip(), p = 0; while (p < n) { if (!(isSpaceChar(b))) buf[p++] = (char) b; b = readByte(); } return n == p ? buf : Arrays.copyOf(buf, p); } private char[][] nm(int n, int m) { char[][] map = new char[n][]; for (int i = 0; i < n; i++) map[i] = ns(m); return map; } private int[] na(int n) { int[] a = new int[n]; for (int i = 0; i < n; i++) a[i] = ni(); return a; } private List<Integer> na2(int n) { List<Integer> a = new ArrayList<Integer>(); for (int i = 0; i < n; i++) a.add(ni()); return a; } private int[][] na(int n, int m) { int[][] a = new int[n][]; for (int i = 0; i < n; i++) a[i] = na(m); return a; } private int ni() { int num = 0, b; boolean minus = false; while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ; if (b == '-') { minus = true; b = readByte(); } while (true) { if (b >= '0' && b <= '9') { num = num * 10 + (b - '0'); } else { return minus ? -num : num; } b = readByte(); } } private long[] nl(int n) { long[] a = new long[n]; for (int i = 0; i < n; i++) a[i] = nl(); return a; } private long[][] nl(int n, int m) { long[][] a = new long[n][]; for (int i = 0; i < n; i++) a[i] = nl(m); return a; } private long nl() { long num = 0; int b; boolean minus = false; while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ; if (b == '-') { minus = true; b = readByte(); } while (true) { if (b >= '0' && b <= '9') { num = num * 10 + (b - '0'); } else { return minus ? -num : num; } b = readByte(); } } private static void tr(Object... o) { System.out.println(Arrays.deepToString(o)); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 17, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 41, 13, 20, 13, 0, 18, 13, 17, 4, 18, 13, 0, 18, 13, 17, 18, 13, 17, 41, 13, 18, 13, 17, 41, 13, 18, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 0, 13, 18, 13, 13, 0, 18, 13, 13, 18, 13, 13, 14, 2, 18, 13, 13, 18, 13, 2, 13, 17, 30, 0, 18, 13, 13, 18, 13, 2, 13, 17, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 2, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 123, 8 ], [ 123, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 11, 18 ], [ 18, 19 ], [ 18, 20 ], [ 20, 21 ], [ 21, 22 ], [ 11, 23 ], [ 23, 24 ], [ 23, 25 ], [ 11, 27 ], [ 27, 28 ], [ 27, 29 ], [ 11, 31 ], [ 31, 32 ], [ 32, 33 ], [ 32, 34 ], [ 31, 35 ], [ 35, 36 ], [ 36, 37 ], [ 11, 38 ], [ 38, 39 ], [ 39, 40 ], [ 39, 41 ], [ 38, 42 ], [ 42, 43 ], [ 42, 44 ], [ 11, 45 ], [ 45, 46 ], [ 45, 47 ], [ 47, 48 ], [ 47, 49 ], [ 11, 50 ], [ 50, 51 ], [ 50, 52 ], [ 52, 53 ], [ 52, 54 ], [ 11, 55 ], [ 55, 56 ], [ 56, 57 ], [ 57, 58 ], [ 57, 59 ], [ 55, 60 ], [ 60, 61 ], [ 60, 62 ], [ 55, 63 ], [ 63, 64 ], [ 64, 65 ], [ 55, 66 ], [ 67, 67 ], [ 67, 68 ], [ 68, 69 ], [ 69, 70 ], [ 69, 71 ], [ 68, 72 ], [ 72, 73 ], [ 73, 74 ], [ 67, 75 ], [ 75, 76 ], [ 75, 77 ], [ 77, 78 ], [ 77, 79 ], [ 67, 80 ], [ 80, 81 ], [ 81, 82 ], [ 81, 83 ], [ 80, 84 ], [ 84, 85 ], [ 84, 86 ], [ 67, 87 ], [ 87, 88 ], [ 88, 89 ], [ 89, 90 ], [ 89, 91 ], [ 88, 92 ], [ 92, 93 ], [ 92, 94 ], [ 94, 95 ], [ 94, 96 ], [ 87, 97 ], [ 97, 98 ], [ 98, 99 ], [ 99, 100 ], [ 99, 101 ], [ 98, 102 ], [ 102, 103 ], [ 102, 104 ], [ 104, 105 ], [ 104, 106 ], [ 67, 107 ], [ 107, 108 ], [ 107, 109 ], [ 109, 110 ], [ 109, 111 ], [ 11, 112 ], [ 112, 113 ], [ 113, 114 ], [ 114, 115 ], [ 114, 116 ], [ 112, 117 ], [ 117, 118 ], [ 117, 119 ], [ 9, 120 ], [ 120, 121 ], [ 0, 122 ], [ 122, 123 ], [ 122, 124 ] ]
[ "import java.util.*;\nimport java.lang.*;\n\npublic class Main{\n public static void main(String[]args){\n\tint ans=0;\n\t\n Scanner sc = new Scanner(System.in);\n\tint N=sc.nextInt();\n\tint a[]=new int[N];\n\tint b[]=new int[N];\n\ta[0]=sc.nextInt();\n\tb[0]=a[0];\n\tlong a_sum=a[0];\n\tlong b_sum=b[0];\n\t\n\tfor(int i=1; i<N; i++){\n\t a[i]=sc.nextInt();\n\t a_sum+=a[i];\n\t b[i]=a[i];\n\t if(b[i]<b[i-1]){\n\t\tb[i]=b[i-1];\n\t }\n\t b_sum+=b[i];\n\t}\n\t\n\tSystem.out.println(b_sum-a_sum);\n\t\n }\n}", "import java.util.*;", "util.*", "java", "import java.lang.*;", "lang.*", "java", "public class Main{\n public static void main(String[]args){\n\tint ans=0;\n\t\n Scanner sc = new Scanner(System.in);\n\tint N=sc.nextInt();\n\tint a[]=new int[N];\n\tint b[]=new int[N];\n\ta[0]=sc.nextInt();\n\tb[0]=a[0];\n\tlong a_sum=a[0];\n\tlong b_sum=b[0];\n\t\n\tfor(int i=1; i<N; i++){\n\t a[i]=sc.nextInt();\n\t a_sum+=a[i];\n\t b[i]=a[i];\n\t if(b[i]<b[i-1]){\n\t\tb[i]=b[i-1];\n\t }\n\t b_sum+=b[i];\n\t}\n\t\n\tSystem.out.println(b_sum-a_sum);\n\t\n }\n}", "Main", "public static void main(String[]args){\n\tint ans=0;\n\t\n Scanner sc = new Scanner(System.in);\n\tint N=sc.nextInt();\n\tint a[]=new int[N];\n\tint b[]=new int[N];\n\ta[0]=sc.nextInt();\n\tb[0]=a[0];\n\tlong a_sum=a[0];\n\tlong b_sum=b[0];\n\t\n\tfor(int i=1; i<N; i++){\n\t a[i]=sc.nextInt();\n\t a_sum+=a[i];\n\t b[i]=a[i];\n\t if(b[i]<b[i-1]){\n\t\tb[i]=b[i-1];\n\t }\n\t b_sum+=b[i];\n\t}\n\t\n\tSystem.out.println(b_sum-a_sum);\n\t\n }", "main", "{\n\tint ans=0;\n\t\n Scanner sc = new Scanner(System.in);\n\tint N=sc.nextInt();\n\tint a[]=new int[N];\n\tint b[]=new int[N];\n\ta[0]=sc.nextInt();\n\tb[0]=a[0];\n\tlong a_sum=a[0];\n\tlong b_sum=b[0];\n\t\n\tfor(int i=1; i<N; i++){\n\t a[i]=sc.nextInt();\n\t a_sum+=a[i];\n\t b[i]=a[i];\n\t if(b[i]<b[i-1]){\n\t\tb[i]=b[i-1];\n\t }\n\t b_sum+=b[i];\n\t}\n\t\n\tSystem.out.println(b_sum-a_sum);\n\t\n }", "int ans=0;", "ans", "0", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int N=sc.nextInt();", "N", "sc.nextInt()", "sc.nextInt", "sc", "int a[]=new int[N];", "a", "new int[N]", "N", "int b[]=new int[N];", "b", "new int[N]", "N", "a[0]=sc.nextInt()", "a[0]", "a", "0", "sc.nextInt()", "sc.nextInt", "sc", "b[0]=a[0]", "b[0]", "b", "0", "a[0]", "a", "0", "long a_sum=a[0];", "a_sum", "a[0]", "a", "0", "long b_sum=b[0];", "b_sum", "b[0]", "b", "0", "for(int i=1; i<N; i++){\n\t a[i]=sc.nextInt();\n\t a_sum+=a[i];\n\t b[i]=a[i];\n\t if(b[i]<b[i-1]){\n\t\tb[i]=b[i-1];\n\t }\n\t b_sum+=b[i];\n\t}", "int i=1;", "int i=1;", "i", "1", "i<N", "i", "N", "i++", "i++", "i", "{\n\t a[i]=sc.nextInt();\n\t a_sum+=a[i];\n\t b[i]=a[i];\n\t if(b[i]<b[i-1]){\n\t\tb[i]=b[i-1];\n\t }\n\t b_sum+=b[i];\n\t}", "{\n\t a[i]=sc.nextInt();\n\t a_sum+=a[i];\n\t b[i]=a[i];\n\t if(b[i]<b[i-1]){\n\t\tb[i]=b[i-1];\n\t }\n\t b_sum+=b[i];\n\t}", "a[i]=sc.nextInt()", "a[i]", "a", "i", "sc.nextInt()", "sc.nextInt", "sc", "a_sum+=a[i]", "a_sum", "a[i]", "a", "i", "b[i]=a[i]", "b[i]", "b", "i", "a[i]", "a", "i", "if(b[i]<b[i-1]){\n\t\tb[i]=b[i-1];\n\t }", "b[i]<b[i-1]", "b[i]", "b", "i", "b[i-1]", "b", "i-1", "i", "1", "{\n\t\tb[i]=b[i-1];\n\t }", "b[i]=b[i-1]", "b[i]", "b", "i", "b[i-1]", "b", "i-1", "i", "1", "b_sum+=b[i]", "b_sum", "b[i]", "b", "i", "System.out.println(b_sum-a_sum)", "System.out.println", "System.out", "System", "System.out", "b_sum-a_sum", "b_sum", "a_sum", "String[]args", "args", "public class Main{\n public static void main(String[]args){\n\tint ans=0;\n\t\n Scanner sc = new Scanner(System.in);\n\tint N=sc.nextInt();\n\tint a[]=new int[N];\n\tint b[]=new int[N];\n\ta[0]=sc.nextInt();\n\tb[0]=a[0];\n\tlong a_sum=a[0];\n\tlong b_sum=b[0];\n\t\n\tfor(int i=1; i<N; i++){\n\t a[i]=sc.nextInt();\n\t a_sum+=a[i];\n\t b[i]=a[i];\n\t if(b[i]<b[i-1]){\n\t\tb[i]=b[i-1];\n\t }\n\t b_sum+=b[i];\n\t}\n\t\n\tSystem.out.println(b_sum-a_sum);\n\t\n }\n}", "public class Main{\n public static void main(String[]args){\n\tint ans=0;\n\t\n Scanner sc = new Scanner(System.in);\n\tint N=sc.nextInt();\n\tint a[]=new int[N];\n\tint b[]=new int[N];\n\ta[0]=sc.nextInt();\n\tb[0]=a[0];\n\tlong a_sum=a[0];\n\tlong b_sum=b[0];\n\t\n\tfor(int i=1; i<N; i++){\n\t a[i]=sc.nextInt();\n\t a_sum+=a[i];\n\t b[i]=a[i];\n\t if(b[i]<b[i-1]){\n\t\tb[i]=b[i-1];\n\t }\n\t b_sum+=b[i];\n\t}\n\t\n\tSystem.out.println(b_sum-a_sum);\n\t\n }\n}", "Main" ]
import java.util.*; import java.lang.*; public class Main{ public static void main(String[]args){ int ans=0; Scanner sc = new Scanner(System.in); int N=sc.nextInt(); int a[]=new int[N]; int b[]=new int[N]; a[0]=sc.nextInt(); b[0]=a[0]; long a_sum=a[0]; long b_sum=b[0]; for(int i=1; i<N; i++){ a[i]=sc.nextInt(); a_sum+=a[i]; b[i]=a[i]; if(b[i]<b[i-1]){ b[i]=b[i-1]; } b_sum+=b[i]; } System.out.println(b_sum-a_sum); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 18, 13, 2, 13, 17, 18, 13, 13, 30, 30, 0, 13, 2, 13, 2, 18, 13, 2, 13, 17, 18, 13, 13, 0, 18, 13, 13, 18, 13, 2, 13, 17, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 103, 5 ], [ 103, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 8, 21 ], [ 21, 22 ], [ 22, 23 ], [ 23, 24 ], [ 23, 25 ], [ 21, 26 ], [ 26, 27 ], [ 26, 28 ], [ 21, 29 ], [ 29, 30 ], [ 30, 31 ], [ 21, 32 ], [ 33, 33 ], [ 33, 34 ], [ 34, 35 ], [ 35, 36 ], [ 35, 37 ], [ 34, 38 ], [ 38, 39 ], [ 39, 40 ], [ 8, 41 ], [ 41, 42 ], [ 42, 43 ], [ 8, 44 ], [ 44, 45 ], [ 44, 46 ], [ 8, 47 ], [ 47, 48 ], [ 48, 49 ], [ 49, 50 ], [ 49, 51 ], [ 47, 52 ], [ 52, 53 ], [ 52, 54 ], [ 47, 55 ], [ 55, 56 ], [ 56, 57 ], [ 47, 58 ], [ 59, 59 ], [ 59, 60 ], [ 60, 61 ], [ 61, 62 ], [ 62, 63 ], [ 62, 64 ], [ 64, 65 ], [ 64, 66 ], [ 61, 67 ], [ 67, 68 ], [ 67, 69 ], [ 60, 70 ], [ 60, 71 ], [ 71, 72 ], [ 72, 73 ], [ 72, 74 ], [ 74, 75 ], [ 74, 76 ], [ 76, 77 ], [ 77, 78 ], [ 77, 79 ], [ 79, 80 ], [ 79, 81 ], [ 76, 82 ], [ 82, 83 ], [ 82, 84 ], [ 71, 85 ], [ 85, 86 ], [ 86, 87 ], [ 86, 88 ], [ 85, 89 ], [ 89, 90 ], [ 89, 91 ], [ 91, 92 ], [ 91, 93 ], [ 8, 94 ], [ 94, 95 ], [ 95, 96 ], [ 96, 97 ], [ 96, 98 ], [ 94, 99 ], [ 6, 100 ], [ 100, 101 ], [ 0, 102 ], [ 102, 103 ], [ 102, 104 ] ]
[ "import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tlong[] A = new long[N];\n\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tA[i] = sc.nextLong();\n\t\t}\n\n\t\tsc.close();\n\n\t\t//\n\t\tlong result = 0;\n\t\tfor (int i = 1; i < N; i++) {\n\t\t\tif (A[i - 1] <= A[i]) {\n\t\t\t\t// result = result;\n\t\t\t} else {\n\t\t\t\tresult = result + (A[i - 1] - A[i]);\n\t\t\t\tA[i] = A[i - 1];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(result);\n\t}\n}", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tlong[] A = new long[N];\n\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tA[i] = sc.nextLong();\n\t\t}\n\n\t\tsc.close();\n\n\t\t//\n\t\tlong result = 0;\n\t\tfor (int i = 1; i < N; i++) {\n\t\t\tif (A[i - 1] <= A[i]) {\n\t\t\t\t// result = result;\n\t\t\t} else {\n\t\t\t\tresult = result + (A[i - 1] - A[i]);\n\t\t\t\tA[i] = A[i - 1];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(result);\n\t}\n}", "Main", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tlong[] A = new long[N];\n\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tA[i] = sc.nextLong();\n\t\t}\n\n\t\tsc.close();\n\n\t\t//\n\t\tlong result = 0;\n\t\tfor (int i = 1; i < N; i++) {\n\t\t\tif (A[i - 1] <= A[i]) {\n\t\t\t\t// result = result;\n\t\t\t} else {\n\t\t\t\tresult = result + (A[i - 1] - A[i]);\n\t\t\t\tA[i] = A[i - 1];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(result);\n\t}", "main", "{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tlong[] A = new long[N];\n\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tA[i] = sc.nextLong();\n\t\t}\n\n\t\tsc.close();\n\n\t\t//\n\t\tlong result = 0;\n\t\tfor (int i = 1; i < N; i++) {\n\t\t\tif (A[i - 1] <= A[i]) {\n\t\t\t\t// result = result;\n\t\t\t} else {\n\t\t\t\tresult = result + (A[i - 1] - A[i]);\n\t\t\t\tA[i] = A[i - 1];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(result);\n\t}", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int N = sc.nextInt();", "N", "sc.nextInt()", "sc.nextInt", "sc", "long[] A = new long[N];", "A", "new long[N]", "N", "for (int i = 0; i < N; i++) {\n\t\t\tA[i] = sc.nextLong();\n\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < N", "i", "N", "i++", "i++", "i", "{\n\t\t\tA[i] = sc.nextLong();\n\t\t}", "{\n\t\t\tA[i] = sc.nextLong();\n\t\t}", "A[i] = sc.nextLong()", "A[i]", "A", "i", "sc.nextLong()", "sc.nextLong", "sc", "sc.close()", "sc.close", "sc", "long result = 0;", "result", "0", "for (int i = 1; i < N; i++) {\n\t\t\tif (A[i - 1] <= A[i]) {\n\t\t\t\t// result = result;\n\t\t\t} else {\n\t\t\t\tresult = result + (A[i - 1] - A[i]);\n\t\t\t\tA[i] = A[i - 1];\n\t\t\t}\n\t\t}", "int i = 1;", "int i = 1;", "i", "1", "i < N", "i", "N", "i++", "i++", "i", "{\n\t\t\tif (A[i - 1] <= A[i]) {\n\t\t\t\t// result = result;\n\t\t\t} else {\n\t\t\t\tresult = result + (A[i - 1] - A[i]);\n\t\t\t\tA[i] = A[i - 1];\n\t\t\t}\n\t\t}", "{\n\t\t\tif (A[i - 1] <= A[i]) {\n\t\t\t\t// result = result;\n\t\t\t} else {\n\t\t\t\tresult = result + (A[i - 1] - A[i]);\n\t\t\t\tA[i] = A[i - 1];\n\t\t\t}\n\t\t}", "if (A[i - 1] <= A[i]) {\n\t\t\t\t// result = result;\n\t\t\t} else {\n\t\t\t\tresult = result + (A[i - 1] - A[i]);\n\t\t\t\tA[i] = A[i - 1];\n\t\t\t}", "A[i - 1] <= A[i]", "A[i - 1]", "A", "i - 1", "i", "1", "A[i]", "A", "i", "{\n\t\t\t\t// result = result;\n\t\t\t}", "{\n\t\t\t\tresult = result + (A[i - 1] - A[i]);\n\t\t\t\tA[i] = A[i - 1];\n\t\t\t}", "result = result + (A[i - 1] - A[i])", "result", "result + (A[i - 1] - A[i])", "result", "(A[i - 1] - A[i])", "A[i - 1]", "A", "i - 1", "i", "1", "A[i]", "A", "i", "A[i] = A[i - 1]", "A[i]", "A", "i", "A[i - 1]", "A", "i - 1", "i", "1", "System.out.println(result)", "System.out.println", "System.out", "System", "System.out", "result", "String[] args", "args", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tlong[] A = new long[N];\n\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tA[i] = sc.nextLong();\n\t\t}\n\n\t\tsc.close();\n\n\t\t//\n\t\tlong result = 0;\n\t\tfor (int i = 1; i < N; i++) {\n\t\t\tif (A[i - 1] <= A[i]) {\n\t\t\t\t// result = result;\n\t\t\t} else {\n\t\t\t\tresult = result + (A[i - 1] - A[i]);\n\t\t\t\tA[i] = A[i - 1];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(result);\n\t}\n}", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tlong[] A = new long[N];\n\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tA[i] = sc.nextLong();\n\t\t}\n\n\t\tsc.close();\n\n\t\t//\n\t\tlong result = 0;\n\t\tfor (int i = 1; i < N; i++) {\n\t\t\tif (A[i - 1] <= A[i]) {\n\t\t\t\t// result = result;\n\t\t\t} else {\n\t\t\t\tresult = result + (A[i - 1] - A[i]);\n\t\t\t\tA[i] = A[i - 1];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(result);\n\t}\n}", "Main" ]
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); long[] A = new long[N]; for (int i = 0; i < N; i++) { A[i] = sc.nextLong(); } sc.close(); // long result = 0; for (int i = 1; i < N; i++) { if (A[i - 1] <= A[i]) { // result = result; } else { result = result + (A[i - 1] - A[i]); A[i] = A[i - 1]; } } System.out.println(result); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 41, 13, 12, 13, 30, 41, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 18, 13, 13, 13, 0, 13, 2, 13, 18, 13, 13, 0, 13, 18, 13, 13, 4, 18, 13, 13, 23, 13, 23, 13, 12, 13, 30, 41, 13, 20, 41, 13, 20, 0, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 13, 13, 13, 4, 18, 13, 13, 4, 18, 13, 4, 18, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 117, 8 ], [ 117, 9 ], [ 9, 10 ], [ 117, 11 ], [ 11, 12 ], [ 11, 13 ], [ 13, 14 ], [ 14, 15 ], [ 14, 16 ], [ 13, 17 ], [ 17, 18 ], [ 17, 19 ], [ 13, 20 ], [ 20, 21 ], [ 21, 22 ], [ 22, 23 ], [ 22, 24 ], [ 20, 25 ], [ 25, 26 ], [ 25, 27 ], [ 20, 28 ], [ 28, 29 ], [ 29, 30 ], [ 20, 31 ], [ 32, 32 ], [ 32, 33 ], [ 33, 34 ], [ 34, 35 ], [ 35, 36 ], [ 35, 37 ], [ 34, 38 ], [ 33, 39 ], [ 39, 40 ], [ 39, 41 ], [ 41, 42 ], [ 41, 43 ], [ 43, 44 ], [ 43, 45 ], [ 33, 46 ], [ 46, 47 ], [ 46, 48 ], [ 48, 49 ], [ 48, 50 ], [ 13, 51 ], [ 51, 52 ], [ 52, 53 ], [ 51, 54 ], [ 11, 55 ], [ 55, 56 ], [ 11, 57 ], [ 57, 58 ], [ 117, 59 ], [ 59, 60 ], [ 59, 61 ], [ 61, 62 ], [ 62, 63 ], [ 62, 64 ], [ 61, 65 ], [ 65, 66 ], [ 65, 67 ], [ 61, 68 ], [ 68, 69 ], [ 68, 70 ], [ 61, 71 ], [ 71, 72 ], [ 71, 73 ], [ 73, 74 ], [ 74, 75 ], [ 61, 76 ], [ 76, 77 ], [ 76, 78 ], [ 61, 80 ], [ 80, 81 ], [ 81, 82 ], [ 82, 83 ], [ 82, 84 ], [ 80, 85 ], [ 85, 86 ], [ 85, 87 ], [ 80, 88 ], [ 88, 89 ], [ 89, 90 ], [ 80, 91 ], [ 92, 92 ], [ 92, 93 ], [ 93, 94 ], [ 94, 95 ], [ 94, 96 ], [ 93, 97 ], [ 97, 98 ], [ 98, 99 ], [ 61, 100 ], [ 100, 101 ], [ 100, 102 ], [ 100, 103 ], [ 61, 104 ], [ 104, 105 ], [ 105, 106 ], [ 104, 107 ], [ 61, 108 ], [ 108, 109 ], [ 109, 110 ], [ 61, 111 ], [ 111, 112 ], [ 112, 113 ], [ 59, 114 ], [ 114, 115 ], [ 0, 116 ], [ 116, 117 ], [ 116, 118 ] ]
[ "import java.util.*;\nimport java.io.*;\n\npublic class Main {\n static StringBuilder sb;\n\n public static void solve(int n, int[] arr) {\n int highest = 0;\n long sum = 0;\n for (int i = 0; i < n; i++) {\n if (arr[i] < highest) sum += highest - arr[i];\n else highest = arr[i];\n }\n sb.append(sum);\n }\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n PrintWriter pw = new PrintWriter(System.out);\n sb = new StringBuilder();\n\n int n = sc.nextInt();\n int[] arr = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = sc.nextInt();\n }\n\n solve(n, arr);\n\n pw.print(sb);\n pw.flush();\n sc.close();\n }\n}", "import java.util.*;", "util.*", "java", "import java.io.*;", "io.*", "java", "public class Main {\n static StringBuilder sb;\n\n public static void solve(int n, int[] arr) {\n int highest = 0;\n long sum = 0;\n for (int i = 0; i < n; i++) {\n if (arr[i] < highest) sum += highest - arr[i];\n else highest = arr[i];\n }\n sb.append(sum);\n }\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n PrintWriter pw = new PrintWriter(System.out);\n sb = new StringBuilder();\n\n int n = sc.nextInt();\n int[] arr = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = sc.nextInt();\n }\n\n solve(n, arr);\n\n pw.print(sb);\n pw.flush();\n sc.close();\n }\n}", "Main", "static StringBuilder sb;", "sb", "public static void solve(int n, int[] arr) {\n int highest = 0;\n long sum = 0;\n for (int i = 0; i < n; i++) {\n if (arr[i] < highest) sum += highest - arr[i];\n else highest = arr[i];\n }\n sb.append(sum);\n }", "solve", "{\n int highest = 0;\n long sum = 0;\n for (int i = 0; i < n; i++) {\n if (arr[i] < highest) sum += highest - arr[i];\n else highest = arr[i];\n }\n sb.append(sum);\n }", "int highest = 0;", "highest", "0", "long sum = 0;", "sum", "0", "for (int i = 0; i < n; i++) {\n if (arr[i] < highest) sum += highest - arr[i];\n else highest = arr[i];\n }", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n if (arr[i] < highest) sum += highest - arr[i];\n else highest = arr[i];\n }", "{\n if (arr[i] < highest) sum += highest - arr[i];\n else highest = arr[i];\n }", "if (arr[i] < highest) sum += highest - arr[i];\n else highest = arr[i];", "arr[i] < highest", "arr[i]", "arr", "i", "highest", "sum += highest - arr[i]", "sum", "highest - arr[i]", "highest", "arr[i]", "arr", "i", "highest = arr[i]", "highest", "arr[i]", "arr", "i", "sb.append(sum)", "sb.append", "sb", "sum", "int n", "n", "int[] arr", "arr", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n PrintWriter pw = new PrintWriter(System.out);\n sb = new StringBuilder();\n\n int n = sc.nextInt();\n int[] arr = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = sc.nextInt();\n }\n\n solve(n, arr);\n\n pw.print(sb);\n pw.flush();\n sc.close();\n }", "main", "{\n Scanner sc = new Scanner(System.in);\n PrintWriter pw = new PrintWriter(System.out);\n sb = new StringBuilder();\n\n int n = sc.nextInt();\n int[] arr = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = sc.nextInt();\n }\n\n solve(n, arr);\n\n pw.print(sb);\n pw.flush();\n sc.close();\n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "PrintWriter pw = new PrintWriter(System.out);", "pw", "new PrintWriter(System.out)", "sb = new StringBuilder()", "sb", "new StringBuilder()", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "int[] arr = new int[n];", "arr", "new int[n]", "n", "for (int i = 0; i < n; i++) {\n arr[i] = sc.nextInt();\n }", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n arr[i] = sc.nextInt();\n }", "{\n arr[i] = sc.nextInt();\n }", "arr[i] = sc.nextInt()", "arr[i]", "arr", "i", "sc.nextInt()", "sc.nextInt", "sc", "solve(n, arr)", "solve", "n", "arr", "pw.print(sb)", "pw.print", "pw", "sb", "pw.flush()", "pw.flush", "pw", "sc.close()", "sc.close", "sc", "String[] args", "args", "public class Main {\n static StringBuilder sb;\n\n public static void solve(int n, int[] arr) {\n int highest = 0;\n long sum = 0;\n for (int i = 0; i < n; i++) {\n if (arr[i] < highest) sum += highest - arr[i];\n else highest = arr[i];\n }\n sb.append(sum);\n }\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n PrintWriter pw = new PrintWriter(System.out);\n sb = new StringBuilder();\n\n int n = sc.nextInt();\n int[] arr = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = sc.nextInt();\n }\n\n solve(n, arr);\n\n pw.print(sb);\n pw.flush();\n sc.close();\n }\n}", "public class Main {\n static StringBuilder sb;\n\n public static void solve(int n, int[] arr) {\n int highest = 0;\n long sum = 0;\n for (int i = 0; i < n; i++) {\n if (arr[i] < highest) sum += highest - arr[i];\n else highest = arr[i];\n }\n sb.append(sum);\n }\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n PrintWriter pw = new PrintWriter(System.out);\n sb = new StringBuilder();\n\n int n = sc.nextInt();\n int[] arr = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = sc.nextInt();\n }\n\n solve(n, arr);\n\n pw.print(sb);\n pw.flush();\n sc.close();\n }\n}", "Main" ]
import java.util.*; import java.io.*; public class Main { static StringBuilder sb; public static void solve(int n, int[] arr) { int highest = 0; long sum = 0; for (int i = 0; i < n; i++) { if (arr[i] < highest) sum += highest - arr[i]; else highest = arr[i]; } sb.append(sum); } public static void main(String[] args) { Scanner sc = new Scanner(System.in); PrintWriter pw = new PrintWriter(System.out); sb = new StringBuilder(); int n = sc.nextInt(); int[] arr = new int[n]; for (int i = 0; i < n; i++) { arr[i] = sc.nextInt(); } solve(n, arr); pw.print(sb); pw.flush(); sc.close(); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 2, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 41, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 13, 18, 13, 13, 30, 0, 13, 2, 13, 18, 13, 13, 14, 2, 13, 18, 13, 13, 30, 0, 13, 18, 13, 13, 4, 18, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 100, 5 ], [ 100, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 20, 21 ], [ 20, 22 ], [ 8, 23 ], [ 23, 24 ], [ 24, 25 ], [ 25, 26 ], [ 25, 27 ], [ 23, 28 ], [ 28, 29 ], [ 28, 30 ], [ 23, 31 ], [ 31, 32 ], [ 32, 33 ], [ 23, 34 ], [ 35, 35 ], [ 35, 36 ], [ 36, 37 ], [ 37, 38 ], [ 37, 39 ], [ 36, 40 ], [ 40, 41 ], [ 41, 42 ], [ 8, 43 ], [ 43, 44 ], [ 43, 45 ], [ 8, 46 ], [ 46, 47 ], [ 46, 48 ], [ 8, 49 ], [ 49, 50 ], [ 50, 51 ], [ 51, 52 ], [ 51, 53 ], [ 49, 54 ], [ 54, 55 ], [ 54, 56 ], [ 49, 57 ], [ 57, 58 ], [ 58, 59 ], [ 49, 60 ], [ 61, 61 ], [ 61, 62 ], [ 62, 63 ], [ 63, 64 ], [ 63, 65 ], [ 65, 66 ], [ 65, 67 ], [ 62, 68 ], [ 68, 69 ], [ 69, 70 ], [ 69, 71 ], [ 71, 72 ], [ 71, 73 ], [ 73, 74 ], [ 73, 75 ], [ 61, 76 ], [ 76, 77 ], [ 77, 78 ], [ 77, 79 ], [ 79, 80 ], [ 79, 81 ], [ 76, 82 ], [ 82, 83 ], [ 83, 84 ], [ 83, 85 ], [ 85, 86 ], [ 85, 87 ], [ 8, 88 ], [ 88, 89 ], [ 89, 90 ], [ 8, 91 ], [ 91, 92 ], [ 92, 93 ], [ 93, 94 ], [ 93, 95 ], [ 91, 96 ], [ 6, 97 ], [ 97, 98 ], [ 0, 99 ], [ 99, 100 ], [ 99, 101 ] ]
[ "import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tLong[] a = new Long[n + 1];\n\t\tfor(int i = 0 ; i < n ; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t}\n\t\tlong max = 0;\n\t\tlong ans = 0;\n\t\tfor(int i = 0 ; i < n ; i++) {\n\t\t\tif(max > a[i]) {\n\t\t\t\tans += max - a[i];\n\t\t\t}\n\t\t\tif(max < a[i]) {\n\t\t\t\tmax = a[i];\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t\tSystem.out.println(ans);\n\n\t}\n}\n", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tLong[] a = new Long[n + 1];\n\t\tfor(int i = 0 ; i < n ; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t}\n\t\tlong max = 0;\n\t\tlong ans = 0;\n\t\tfor(int i = 0 ; i < n ; i++) {\n\t\t\tif(max > a[i]) {\n\t\t\t\tans += max - a[i];\n\t\t\t}\n\t\t\tif(max < a[i]) {\n\t\t\t\tmax = a[i];\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t\tSystem.out.println(ans);\n\n\t}\n}", "Main", "public static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tLong[] a = new Long[n + 1];\n\t\tfor(int i = 0 ; i < n ; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t}\n\t\tlong max = 0;\n\t\tlong ans = 0;\n\t\tfor(int i = 0 ; i < n ; i++) {\n\t\t\tif(max > a[i]) {\n\t\t\t\tans += max - a[i];\n\t\t\t}\n\t\t\tif(max < a[i]) {\n\t\t\t\tmax = a[i];\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t\tSystem.out.println(ans);\n\n\t}", "main", "{\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tLong[] a = new Long[n + 1];\n\t\tfor(int i = 0 ; i < n ; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t}\n\t\tlong max = 0;\n\t\tlong ans = 0;\n\t\tfor(int i = 0 ; i < n ; i++) {\n\t\t\tif(max > a[i]) {\n\t\t\t\tans += max - a[i];\n\t\t\t}\n\t\t\tif(max < a[i]) {\n\t\t\t\tmax = a[i];\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t\tSystem.out.println(ans);\n\n\t}", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "Long[] a = new Long[n + 1];", "a", "new Long[n + 1]", "n + 1", "n", "1", "for(int i = 0 ; i < n ; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t}", "int i = 0 ;", "int i = 0 ;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n\t\t\ta[i] = sc.nextLong();\n\t\t}", "{\n\t\t\ta[i] = sc.nextLong();\n\t\t}", "a[i] = sc.nextLong()", "a[i]", "a", "i", "sc.nextLong()", "sc.nextLong", "sc", "long max = 0;", "max", "0", "long ans = 0;", "ans", "0", "for(int i = 0 ; i < n ; i++) {\n\t\t\tif(max > a[i]) {\n\t\t\t\tans += max - a[i];\n\t\t\t}\n\t\t\tif(max < a[i]) {\n\t\t\t\tmax = a[i];\n\t\t\t}\n\t\t}", "int i = 0 ;", "int i = 0 ;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n\t\t\tif(max > a[i]) {\n\t\t\t\tans += max - a[i];\n\t\t\t}\n\t\t\tif(max < a[i]) {\n\t\t\t\tmax = a[i];\n\t\t\t}\n\t\t}", "{\n\t\t\tif(max > a[i]) {\n\t\t\t\tans += max - a[i];\n\t\t\t}\n\t\t\tif(max < a[i]) {\n\t\t\t\tmax = a[i];\n\t\t\t}\n\t\t}", "if(max > a[i]) {\n\t\t\t\tans += max - a[i];\n\t\t\t}", "max > a[i]", "max", "a[i]", "a", "i", "{\n\t\t\t\tans += max - a[i];\n\t\t\t}", "ans += max - a[i]", "ans", "max - a[i]", "max", "a[i]", "a", "i", "if(max < a[i]) {\n\t\t\t\tmax = a[i];\n\t\t\t}", "max < a[i]", "max", "a[i]", "a", "i", "{\n\t\t\t\tmax = a[i];\n\t\t\t}", "max = a[i]", "max", "a[i]", "a", "i", "sc.close()", "sc.close", "sc", "System.out.println(ans)", "System.out.println", "System.out", "System", "System.out", "ans", "String[] args", "args", "public class Main {\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tLong[] a = new Long[n + 1];\n\t\tfor(int i = 0 ; i < n ; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t}\n\t\tlong max = 0;\n\t\tlong ans = 0;\n\t\tfor(int i = 0 ; i < n ; i++) {\n\t\t\tif(max > a[i]) {\n\t\t\t\tans += max - a[i];\n\t\t\t}\n\t\t\tif(max < a[i]) {\n\t\t\t\tmax = a[i];\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t\tSystem.out.println(ans);\n\n\t}\n}", "public class Main {\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tLong[] a = new Long[n + 1];\n\t\tfor(int i = 0 ; i < n ; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t}\n\t\tlong max = 0;\n\t\tlong ans = 0;\n\t\tfor(int i = 0 ; i < n ; i++) {\n\t\t\tif(max > a[i]) {\n\t\t\t\tans += max - a[i];\n\t\t\t}\n\t\t\tif(max < a[i]) {\n\t\t\t\tmax = a[i];\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t\tSystem.out.println(ans);\n\n\t}\n}", "Main" ]
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); Long[] a = new Long[n + 1]; for(int i = 0 ; i < n ; i++) { a[i] = sc.nextLong(); } long max = 0; long ans = 0; for(int i = 0 ; i < n ; i++) { if(max > a[i]) { ans += max - a[i]; } if(max < a[i]) { max = a[i]; } } sc.close(); System.out.println(ans); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 13, 17, 30, 0, 13, 18, 13, 13, 9, 14, 2, 13, 18, 13, 13, 30, 0, 13, 2, 13, 2, 13, 18, 13, 13, 14, 2, 18, 13, 13, 13, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 4, 18, 4, 18, 4, 18, 13, 13, 17, 17, 23, 13, 23, 13, 12, 13, 30, 41, 13, 4, 18, 13, 41, 13, 20, 38, 30, 4, 18, 13, 30, 41, 13, 4, 18, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 4, 13, 13, 13, 41, 13, 4, 18, 13, 23, 13, 12, 13, 30, 41, 13, 4, 18, 13, 17, 41, 13, 20, 18, 13, 13, 11, 1, 41, 13, 17, 2, 13, 18, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 18, 13, 13, 29, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 197, 8 ], [ 197, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 11, 18 ], [ 18, 19 ], [ 19, 20 ], [ 20, 21 ], [ 20, 22 ], [ 18, 23 ], [ 23, 24 ], [ 23, 25 ], [ 18, 26 ], [ 26, 27 ], [ 27, 28 ], [ 18, 29 ], [ 30, 30 ], [ 30, 31 ], [ 31, 32 ], [ 32, 33 ], [ 32, 34 ], [ 31, 35 ], [ 35, 36 ], [ 36, 37 ], [ 36, 38 ], [ 38, 39 ], [ 38, 40 ], [ 35, 41 ], [ 30, 42 ], [ 42, 43 ], [ 43, 44 ], [ 43, 45 ], [ 45, 46 ], [ 45, 47 ], [ 42, 48 ], [ 48, 49 ], [ 49, 50 ], [ 49, 51 ], [ 51, 52 ], [ 51, 53 ], [ 53, 54 ], [ 53, 55 ], [ 55, 56 ], [ 55, 57 ], [ 30, 58 ], [ 58, 59 ], [ 59, 60 ], [ 60, 61 ], [ 60, 62 ], [ 59, 63 ], [ 58, 64 ], [ 64, 65 ], [ 65, 66 ], [ 65, 67 ], [ 67, 68 ], [ 67, 69 ], [ 11, 70 ], [ 70, 71 ], [ 71, 72 ], [ 72, 73 ], [ 72, 74 ], [ 70, 75 ], [ 75, 76 ], [ 76, 77 ], [ 77, 78 ], [ 78, 79 ], [ 79, 80 ], [ 80, 81 ], [ 79, 82 ], [ 75, 83 ], [ 75, 84 ], [ 9, 85 ], [ 85, 86 ], [ 9, 87 ], [ 87, 88 ], [ 197, 89 ], [ 89, 90 ], [ 89, 91 ], [ 91, 92 ], [ 92, 93 ], [ 92, 94 ], [ 94, 95 ], [ 95, 96 ], [ 91, 97 ], [ 97, 98 ], [ 97, 99 ], [ 91, 100 ], [ 100, 101 ], [ 101, 102 ], [ 102, 103 ], [ 103, 104 ], [ 100, 105 ], [ 105, 106 ], [ 106, 107 ], [ 106, 108 ], [ 108, 109 ], [ 109, 110 ], [ 105, 111 ], [ 111, 112 ], [ 112, 113 ], [ 105, 114 ], [ 114, 115 ], [ 114, 116 ], [ 105, 118 ], [ 118, 119 ], [ 119, 120 ], [ 120, 121 ], [ 120, 122 ], [ 118, 123 ], [ 123, 124 ], [ 123, 125 ], [ 118, 126 ], [ 126, 127 ], [ 127, 128 ], [ 118, 129 ], [ 130, 130 ], [ 130, 131 ], [ 131, 132 ], [ 132, 133 ], [ 132, 134 ], [ 131, 135 ], [ 135, 136 ], [ 136, 137 ], [ 105, 138 ], [ 138, 139 ], [ 139, 140 ], [ 105, 141 ], [ 141, 142 ], [ 141, 143 ], [ 141, 144 ], [ 91, 145 ], [ 145, 146 ], [ 145, 147 ], [ 147, 148 ], [ 148, 149 ], [ 89, 150 ], [ 150, 151 ], [ 197, 152 ], [ 152, 153 ], [ 152, 154 ], [ 154, 155 ], [ 155, 156 ], [ 155, 157 ], [ 157, 158 ], [ 158, 159 ], [ 157, 160 ], [ 154, 161 ], [ 161, 162 ], [ 161, 163 ], [ 164, 165 ], [ 164, 166 ], [ 154, 167 ], [ 167, 168 ], [ 168, 169 ], [ 169, 170 ], [ 169, 171 ], [ 167, 172 ], [ 172, 173 ], [ 172, 174 ], [ 174, 175 ], [ 174, 176 ], [ 167, 177 ], [ 177, 178 ], [ 178, 179 ], [ 167, 180 ], [ 181, 181 ], [ 181, 182 ], [ 182, 183 ], [ 183, 184 ], [ 183, 185 ], [ 182, 186 ], [ 186, 187 ], [ 187, 188 ], [ 186, 189 ], [ 189, 190 ], [ 189, 191 ], [ 154, 192 ], [ 192, 193 ], [ 152, 194 ], [ 194, 195 ], [ 0, 196 ], [ 196, 197 ], [ 196, 198 ] ]
[ "import java.math.BigDecimal;\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void solve (int n, int[] aArray) {\n\n\t\tint max = 0;\n\t\tdouble step_sum = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\t// 1人目は必ず0\n\t\t\tif (i == 0) {\n\t\t\t\tmax = aArray[i];\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// ステップ足し込む\n\t\t\tif (max > aArray[i]) {\n\t\t\t\tstep_sum = step_sum + (max - aArray[i]);\n\t\t\t}\n\n\t\t\t// 必要であれば最大を入れ替える\n\t\t\tif (aArray[i] > max) {\n\t\t\t\tmax = aArray[i];\n\t\t\t}\n\n\t\t}\n\n//\t\tSystem.out.println((\"\" + step_sum).replaceAll(\"\\\\.0\", \"\"));\n\t\tSystem.out.println(BigDecimal.valueOf(step_sum).toPlainString().replaceAll(\"\\\\.0\", \"\"));\n\n\t}\n\n\tpublic static void main(String[] args) {\n\n\t\tlong start = System.currentTimeMillis();\n\t // 引数で標準入力System.inを指定する\n\t Scanner scanner = new Scanner(System.in);\n\t\ttry {\n\n\t\t // 1行目を取得(a)\n\t\t\tint n = scanner.nextInt();\n\t\t\tscanner.nextLine();\n\n\t\t\tint[] aArray = new int[n];\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\taArray[i] = scanner.nextInt();\n\t\t\t}\n\t\t\tscanner.nextLine();\n\n\t\t\tsolve(n, aArray);\n\n\t\t} finally {\n\t\t // Scannerクラスのインスタンスをクローズ\n\t\t scanner.close();\n\t\t}\n\t\tlong end = System.currentTimeMillis();\n\t\t// System.out.println((end - start) );\n\t}\n\n\n\t// ************************************\n\t// Common\n\t// ************************************\n\n\tprivate static final int[] changeArrayStringToInt(String line) {\n\n\t\tString[] strArray = line.split(\" \");\n\n\t\tint[] intArray = new int[strArray.length];\n\n\t\tfor (int i = 0; i < intArray.length; i++) {\n\t\t\tintArray[i] = Integer.parseInt(strArray[i]);\n\t\t}\n\t\treturn intArray;\n\t}\n\n}", "import java.math.BigDecimal;", "BigDecimal", "java.math", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\n\tpublic static void solve (int n, int[] aArray) {\n\n\t\tint max = 0;\n\t\tdouble step_sum = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\t// 1人目は必ず0\n\t\t\tif (i == 0) {\n\t\t\t\tmax = aArray[i];\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// ステップ足し込む\n\t\t\tif (max > aArray[i]) {\n\t\t\t\tstep_sum = step_sum + (max - aArray[i]);\n\t\t\t}\n\n\t\t\t// 必要であれば最大を入れ替える\n\t\t\tif (aArray[i] > max) {\n\t\t\t\tmax = aArray[i];\n\t\t\t}\n\n\t\t}\n\n//\t\tSystem.out.println((\"\" + step_sum).replaceAll(\"\\\\.0\", \"\"));\n\t\tSystem.out.println(BigDecimal.valueOf(step_sum).toPlainString().replaceAll(\"\\\\.0\", \"\"));\n\n\t}\n\n\tpublic static void main(String[] args) {\n\n\t\tlong start = System.currentTimeMillis();\n\t // 引数で標準入力System.inを指定する\n\t Scanner scanner = new Scanner(System.in);\n\t\ttry {\n\n\t\t // 1行目を取得(a)\n\t\t\tint n = scanner.nextInt();\n\t\t\tscanner.nextLine();\n\n\t\t\tint[] aArray = new int[n];\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\taArray[i] = scanner.nextInt();\n\t\t\t}\n\t\t\tscanner.nextLine();\n\n\t\t\tsolve(n, aArray);\n\n\t\t} finally {\n\t\t // Scannerクラスのインスタンスをクローズ\n\t\t scanner.close();\n\t\t}\n\t\tlong end = System.currentTimeMillis();\n\t\t// System.out.println((end - start) );\n\t}\n\n\n\t// ************************************\n\t// Common\n\t// ************************************\n\n\tprivate static final int[] changeArrayStringToInt(String line) {\n\n\t\tString[] strArray = line.split(\" \");\n\n\t\tint[] intArray = new int[strArray.length];\n\n\t\tfor (int i = 0; i < intArray.length; i++) {\n\t\t\tintArray[i] = Integer.parseInt(strArray[i]);\n\t\t}\n\t\treturn intArray;\n\t}\n\n}", "Main", "public static void solve (int n, int[] aArray) {\n\n\t\tint max = 0;\n\t\tdouble step_sum = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\t// 1人目は必ず0\n\t\t\tif (i == 0) {\n\t\t\t\tmax = aArray[i];\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// ステップ足し込む\n\t\t\tif (max > aArray[i]) {\n\t\t\t\tstep_sum = step_sum + (max - aArray[i]);\n\t\t\t}\n\n\t\t\t// 必要であれば最大を入れ替える\n\t\t\tif (aArray[i] > max) {\n\t\t\t\tmax = aArray[i];\n\t\t\t}\n\n\t\t}\n\n//\t\tSystem.out.println((\"\" + step_sum).replaceAll(\"\\\\.0\", \"\"));\n\t\tSystem.out.println(BigDecimal.valueOf(step_sum).toPlainString().replaceAll(\"\\\\.0\", \"\"));\n\n\t}", "solve", "{\n\n\t\tint max = 0;\n\t\tdouble step_sum = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\t// 1人目は必ず0\n\t\t\tif (i == 0) {\n\t\t\t\tmax = aArray[i];\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// ステップ足し込む\n\t\t\tif (max > aArray[i]) {\n\t\t\t\tstep_sum = step_sum + (max - aArray[i]);\n\t\t\t}\n\n\t\t\t// 必要であれば最大を入れ替える\n\t\t\tif (aArray[i] > max) {\n\t\t\t\tmax = aArray[i];\n\t\t\t}\n\n\t\t}\n\n//\t\tSystem.out.println((\"\" + step_sum).replaceAll(\"\\\\.0\", \"\"));\n\t\tSystem.out.println(BigDecimal.valueOf(step_sum).toPlainString().replaceAll(\"\\\\.0\", \"\"));\n\n\t}", "int max = 0;", "max", "0", "double step_sum = 0;", "step_sum", "0", "for (int i = 0; i < n; i++) {\n\t\t\t// 1人目は必ず0\n\t\t\tif (i == 0) {\n\t\t\t\tmax = aArray[i];\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// ステップ足し込む\n\t\t\tif (max > aArray[i]) {\n\t\t\t\tstep_sum = step_sum + (max - aArray[i]);\n\t\t\t}\n\n\t\t\t// 必要であれば最大を入れ替える\n\t\t\tif (aArray[i] > max) {\n\t\t\t\tmax = aArray[i];\n\t\t\t}\n\n\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n\t\t\t// 1人目は必ず0\n\t\t\tif (i == 0) {\n\t\t\t\tmax = aArray[i];\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// ステップ足し込む\n\t\t\tif (max > aArray[i]) {\n\t\t\t\tstep_sum = step_sum + (max - aArray[i]);\n\t\t\t}\n\n\t\t\t// 必要であれば最大を入れ替える\n\t\t\tif (aArray[i] > max) {\n\t\t\t\tmax = aArray[i];\n\t\t\t}\n\n\t\t}", "{\n\t\t\t// 1人目は必ず0\n\t\t\tif (i == 0) {\n\t\t\t\tmax = aArray[i];\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// ステップ足し込む\n\t\t\tif (max > aArray[i]) {\n\t\t\t\tstep_sum = step_sum + (max - aArray[i]);\n\t\t\t}\n\n\t\t\t// 必要であれば最大を入れ替える\n\t\t\tif (aArray[i] > max) {\n\t\t\t\tmax = aArray[i];\n\t\t\t}\n\n\t\t}", "if (i == 0) {\n\t\t\t\tmax = aArray[i];\n\t\t\t\tcontinue;\n\t\t\t}", "i == 0", "i", "0", "{\n\t\t\t\tmax = aArray[i];\n\t\t\t\tcontinue;\n\t\t\t}", "max = aArray[i]", "max", "aArray[i]", "aArray", "i", "continue;", "if (max > aArray[i]) {\n\t\t\t\tstep_sum = step_sum + (max - aArray[i]);\n\t\t\t}", "max > aArray[i]", "max", "aArray[i]", "aArray", "i", "{\n\t\t\t\tstep_sum = step_sum + (max - aArray[i]);\n\t\t\t}", "step_sum = step_sum + (max - aArray[i])", "step_sum", "step_sum + (max - aArray[i])", "step_sum", "(max - aArray[i])", "max", "aArray[i]", "aArray", "i", "if (aArray[i] > max) {\n\t\t\t\tmax = aArray[i];\n\t\t\t}", "aArray[i] > max", "aArray[i]", "aArray", "i", "max", "{\n\t\t\t\tmax = aArray[i];\n\t\t\t}", "max = aArray[i]", "max", "aArray[i]", "aArray", "i", "System.out.println(BigDecimal.valueOf(step_sum).toPlainString().replaceAll(\"\\\\.0\", \"\"))", "System.out.println", "System.out", "System", "System.out", "BigDecimal.valueOf(step_sum).toPlainString().replaceAll(\"\\\\.0\", \"\")", "BigDecimal.valueOf(step_sum).toPlainString().replaceAll", "BigDecimal.valueOf(step_sum).toPlainString()", "BigDecimal.valueOf(step_sum).toPlainString", "BigDecimal.valueOf(step_sum)", "BigDecimal.valueOf", "BigDecimal", "step_sum", "\"\\\\.0\"", "\"\"", "int n", "n", "int[] aArray", "aArray", "public static void main(String[] args) {\n\n\t\tlong start = System.currentTimeMillis();\n\t // 引数で標準入力System.inを指定する\n\t Scanner scanner = new Scanner(System.in);\n\t\ttry {\n\n\t\t // 1行目を取得(a)\n\t\t\tint n = scanner.nextInt();\n\t\t\tscanner.nextLine();\n\n\t\t\tint[] aArray = new int[n];\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\taArray[i] = scanner.nextInt();\n\t\t\t}\n\t\t\tscanner.nextLine();\n\n\t\t\tsolve(n, aArray);\n\n\t\t} finally {\n\t\t // Scannerクラスのインスタンスをクローズ\n\t\t scanner.close();\n\t\t}\n\t\tlong end = System.currentTimeMillis();\n\t\t// System.out.println((end - start) );\n\t}", "main", "{\n\n\t\tlong start = System.currentTimeMillis();\n\t // 引数で標準入力System.inを指定する\n\t Scanner scanner = new Scanner(System.in);\n\t\ttry {\n\n\t\t // 1行目を取得(a)\n\t\t\tint n = scanner.nextInt();\n\t\t\tscanner.nextLine();\n\n\t\t\tint[] aArray = new int[n];\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\taArray[i] = scanner.nextInt();\n\t\t\t}\n\t\t\tscanner.nextLine();\n\n\t\t\tsolve(n, aArray);\n\n\t\t} finally {\n\t\t // Scannerクラスのインスタンスをクローズ\n\t\t scanner.close();\n\t\t}\n\t\tlong end = System.currentTimeMillis();\n\t\t// System.out.println((end - start) );\n\t}", "long start = System.currentTimeMillis();", "start", "System.currentTimeMillis()", "System.currentTimeMillis", "System", "Scanner scanner = new Scanner(System.in);", "scanner", "new Scanner(System.in)", "try {\n\n\t\t // 1行目を取得(a)\n\t\t\tint n = scanner.nextInt();\n\t\t\tscanner.nextLine();\n\n\t\t\tint[] aArray = new int[n];\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\taArray[i] = scanner.nextInt();\n\t\t\t}\n\t\t\tscanner.nextLine();\n\n\t\t\tsolve(n, aArray);\n\n\t\t} finally {\n\t\t // Scannerクラスのインスタンスをクローズ\n\t\t scanner.close();\n\t\t}", "{\n\t\t // Scannerクラスのインスタンスをクローズ\n\t\t scanner.close();\n\t\t}", "scanner.close()", "scanner.close", "scanner", "{\n\n\t\t // 1行目を取得(a)\n\t\t\tint n = scanner.nextInt();\n\t\t\tscanner.nextLine();\n\n\t\t\tint[] aArray = new int[n];\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\taArray[i] = scanner.nextInt();\n\t\t\t}\n\t\t\tscanner.nextLine();\n\n\t\t\tsolve(n, aArray);\n\n\t\t}", "int n = scanner.nextInt();", "n", "scanner.nextInt()", "scanner.nextInt", "scanner", "scanner.nextLine()", "scanner.nextLine", "scanner", "int[] aArray = new int[n];", "aArray", "new int[n]", "n", "for (int i = 0; i < n; i++) {\n\t\t\t\taArray[i] = scanner.nextInt();\n\t\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n\t\t\t\taArray[i] = scanner.nextInt();\n\t\t\t}", "{\n\t\t\t\taArray[i] = scanner.nextInt();\n\t\t\t}", "aArray[i] = scanner.nextInt()", "aArray[i]", "aArray", "i", "scanner.nextInt()", "scanner.nextInt", "scanner", "scanner.nextLine()", "scanner.nextLine", "scanner", "solve(n, aArray)", "solve", "n", "aArray", "long end = System.currentTimeMillis();", "end", "System.currentTimeMillis()", "System.currentTimeMillis", "System", "String[] args", "args", "private static final int[] changeArrayStringToInt(String line) {\n\n\t\tString[] strArray = line.split(\" \");\n\n\t\tint[] intArray = new int[strArray.length];\n\n\t\tfor (int i = 0; i < intArray.length; i++) {\n\t\t\tintArray[i] = Integer.parseInt(strArray[i]);\n\t\t}\n\t\treturn intArray;\n\t}", "changeArrayStringToInt", "{\n\n\t\tString[] strArray = line.split(\" \");\n\n\t\tint[] intArray = new int[strArray.length];\n\n\t\tfor (int i = 0; i < intArray.length; i++) {\n\t\t\tintArray[i] = Integer.parseInt(strArray[i]);\n\t\t}\n\t\treturn intArray;\n\t}", "String[] strArray = line.split(\" \");", "strArray", "line.split(\" \")", "line.split", "line", "\" \"", "int[] intArray = new int[strArray.length];", "intArray", "new int[strArray.length]", "strArray.length", "strArray", "strArray.length", "for (int i = 0; i < intArray.length; i++) {\n\t\t\tintArray[i] = Integer.parseInt(strArray[i]);\n\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < intArray.length", "i", "intArray.length", "intArray", "intArray.length", "i++", "i++", "i", "{\n\t\t\tintArray[i] = Integer.parseInt(strArray[i]);\n\t\t}", "{\n\t\t\tintArray[i] = Integer.parseInt(strArray[i]);\n\t\t}", "intArray[i] = Integer.parseInt(strArray[i])", "intArray[i]", "intArray", "i", "Integer.parseInt(strArray[i])", "Integer.parseInt", "Integer", "strArray[i]", "strArray", "i", "return intArray;", "intArray", "String line", "line", "public class Main {\n\n\tpublic static void solve (int n, int[] aArray) {\n\n\t\tint max = 0;\n\t\tdouble step_sum = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\t// 1人目は必ず0\n\t\t\tif (i == 0) {\n\t\t\t\tmax = aArray[i];\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// ステップ足し込む\n\t\t\tif (max > aArray[i]) {\n\t\t\t\tstep_sum = step_sum + (max - aArray[i]);\n\t\t\t}\n\n\t\t\t// 必要であれば最大を入れ替える\n\t\t\tif (aArray[i] > max) {\n\t\t\t\tmax = aArray[i];\n\t\t\t}\n\n\t\t}\n\n//\t\tSystem.out.println((\"\" + step_sum).replaceAll(\"\\\\.0\", \"\"));\n\t\tSystem.out.println(BigDecimal.valueOf(step_sum).toPlainString().replaceAll(\"\\\\.0\", \"\"));\n\n\t}\n\n\tpublic static void main(String[] args) {\n\n\t\tlong start = System.currentTimeMillis();\n\t // 引数で標準入力System.inを指定する\n\t Scanner scanner = new Scanner(System.in);\n\t\ttry {\n\n\t\t // 1行目を取得(a)\n\t\t\tint n = scanner.nextInt();\n\t\t\tscanner.nextLine();\n\n\t\t\tint[] aArray = new int[n];\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\taArray[i] = scanner.nextInt();\n\t\t\t}\n\t\t\tscanner.nextLine();\n\n\t\t\tsolve(n, aArray);\n\n\t\t} finally {\n\t\t // Scannerクラスのインスタンスをクローズ\n\t\t scanner.close();\n\t\t}\n\t\tlong end = System.currentTimeMillis();\n\t\t// System.out.println((end - start) );\n\t}\n\n\n\t// ************************************\n\t// Common\n\t// ************************************\n\n\tprivate static final int[] changeArrayStringToInt(String line) {\n\n\t\tString[] strArray = line.split(\" \");\n\n\t\tint[] intArray = new int[strArray.length];\n\n\t\tfor (int i = 0; i < intArray.length; i++) {\n\t\t\tintArray[i] = Integer.parseInt(strArray[i]);\n\t\t}\n\t\treturn intArray;\n\t}\n\n}", "public class Main {\n\n\tpublic static void solve (int n, int[] aArray) {\n\n\t\tint max = 0;\n\t\tdouble step_sum = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\t// 1人目は必ず0\n\t\t\tif (i == 0) {\n\t\t\t\tmax = aArray[i];\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// ステップ足し込む\n\t\t\tif (max > aArray[i]) {\n\t\t\t\tstep_sum = step_sum + (max - aArray[i]);\n\t\t\t}\n\n\t\t\t// 必要であれば最大を入れ替える\n\t\t\tif (aArray[i] > max) {\n\t\t\t\tmax = aArray[i];\n\t\t\t}\n\n\t\t}\n\n//\t\tSystem.out.println((\"\" + step_sum).replaceAll(\"\\\\.0\", \"\"));\n\t\tSystem.out.println(BigDecimal.valueOf(step_sum).toPlainString().replaceAll(\"\\\\.0\", \"\"));\n\n\t}\n\n\tpublic static void main(String[] args) {\n\n\t\tlong start = System.currentTimeMillis();\n\t // 引数で標準入力System.inを指定する\n\t Scanner scanner = new Scanner(System.in);\n\t\ttry {\n\n\t\t // 1行目を取得(a)\n\t\t\tint n = scanner.nextInt();\n\t\t\tscanner.nextLine();\n\n\t\t\tint[] aArray = new int[n];\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\taArray[i] = scanner.nextInt();\n\t\t\t}\n\t\t\tscanner.nextLine();\n\n\t\t\tsolve(n, aArray);\n\n\t\t} finally {\n\t\t // Scannerクラスのインスタンスをクローズ\n\t\t scanner.close();\n\t\t}\n\t\tlong end = System.currentTimeMillis();\n\t\t// System.out.println((end - start) );\n\t}\n\n\n\t// ************************************\n\t// Common\n\t// ************************************\n\n\tprivate static final int[] changeArrayStringToInt(String line) {\n\n\t\tString[] strArray = line.split(\" \");\n\n\t\tint[] intArray = new int[strArray.length];\n\n\t\tfor (int i = 0; i < intArray.length; i++) {\n\t\t\tintArray[i] = Integer.parseInt(strArray[i]);\n\t\t}\n\t\treturn intArray;\n\t}\n\n}", "Main" ]
import java.math.BigDecimal; import java.util.Scanner; public class Main { public static void solve (int n, int[] aArray) { int max = 0; double step_sum = 0; for (int i = 0; i < n; i++) { // 1人目は必ず0 if (i == 0) { max = aArray[i]; continue; } // ステップ足し込む if (max > aArray[i]) { step_sum = step_sum + (max - aArray[i]); } // 必要であれば最大を入れ替える if (aArray[i] > max) { max = aArray[i]; } } // System.out.println(("" + step_sum).replaceAll("\\.0", "")); System.out.println(BigDecimal.valueOf(step_sum).toPlainString().replaceAll("\\.0", "")); } public static void main(String[] args) { long start = System.currentTimeMillis(); // 引数で標準入力System.inを指定する Scanner scanner = new Scanner(System.in); try { // 1行目を取得(a) int n = scanner.nextInt(); scanner.nextLine(); int[] aArray = new int[n]; for (int i = 0; i < n; i++) { aArray[i] = scanner.nextInt(); } scanner.nextLine(); solve(n, aArray); } finally { // Scannerクラスのインスタンスをクローズ scanner.close(); } long end = System.currentTimeMillis(); // System.out.println((end - start) ); } // ************************************ // Common // ************************************ private static final int[] changeArrayStringToInt(String line) { String[] strArray = line.split(" "); int[] intArray = new int[strArray.length]; for (int i = 0; i < intArray.length; i++) { intArray[i] = Integer.parseInt(strArray[i]); } return intArray; } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 41, 13, 20, 41, 13, 20, 12, 13, 30, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 13, 41, 13, 18, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 4, 18, 13, 2, 13, 18, 13, 13, 17, 0, 13, 4, 18, 13, 13, 18, 13, 13, 4, 18, 13, 13, 12, 13, 30, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 4, 13, 4, 18, 13, 23, 13, 12, 13, 30, 4, 18, 18, 13, 13, 17, 4, 18, 18, 13, 13, 4, 18, 13, 13, 23, 13, 6, 13, 41, 13, 20, 41, 13, 20, 12, 13, 30, 42, 40, 4, 18, 13, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 20, 29, 4, 18, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 13, 29, 13, 23, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 13, 14 ], [ 13, 15 ], [ 0, 16 ], [ 223, 17 ], [ 223, 18 ], [ 18, 19 ], [ 18, 20 ], [ 223, 21 ], [ 21, 22 ], [ 21, 23 ], [ 223, 24 ], [ 24, 25 ], [ 24, 26 ], [ 26, 27 ], [ 27, 28 ], [ 27, 29 ], [ 29, 30 ], [ 30, 31 ], [ 26, 32 ], [ 32, 33 ], [ 32, 34 ], [ 34, 35 ], [ 35, 36 ], [ 34, 37 ], [ 26, 38 ], [ 38, 39 ], [ 38, 40 ], [ 40, 41 ], [ 40, 42 ], [ 26, 43 ], [ 43, 44 ], [ 43, 45 ], [ 26, 46 ], [ 46, 47 ], [ 47, 48 ], [ 48, 49 ], [ 48, 50 ], [ 46, 51 ], [ 51, 52 ], [ 51, 53 ], [ 46, 54 ], [ 54, 55 ], [ 55, 56 ], [ 46, 57 ], [ 58, 58 ], [ 58, 59 ], [ 59, 60 ], [ 59, 61 ], [ 61, 62 ], [ 62, 63 ], [ 61, 64 ], [ 64, 65 ], [ 64, 66 ], [ 66, 67 ], [ 66, 68 ], [ 61, 69 ], [ 58, 70 ], [ 70, 71 ], [ 70, 72 ], [ 72, 73 ], [ 73, 74 ], [ 72, 75 ], [ 72, 76 ], [ 76, 77 ], [ 76, 78 ], [ 26, 79 ], [ 79, 80 ], [ 80, 81 ], [ 79, 82 ], [ 223, 83 ], [ 83, 84 ], [ 83, 85 ], [ 85, 86 ], [ 86, 87 ], [ 86, 88 ], [ 85, 89 ], [ 89, 90 ], [ 90, 91 ], [ 91, 92 ], [ 91, 93 ], [ 89, 94 ], [ 94, 95 ], [ 94, 96 ], [ 89, 97 ], [ 97, 98 ], [ 98, 99 ], [ 89, 100 ], [ 101, 101 ], [ 101, 102 ], [ 102, 103 ], [ 85, 104 ], [ 104, 105 ], [ 105, 106 ], [ 83, 107 ], [ 107, 108 ], [ 223, 109 ], [ 109, 110 ], [ 109, 111 ], [ 111, 112 ], [ 112, 113 ], [ 113, 114 ], [ 114, 115 ], [ 114, 116 ], [ 112, 117 ], [ 111, 118 ], [ 118, 119 ], [ 119, 120 ], [ 120, 121 ], [ 120, 122 ], [ 118, 123 ], [ 123, 124 ], [ 124, 125 ], [ 123, 126 ], [ 109, 127 ], [ 127, 128 ], [ 223, 129 ], [ 129, 130 ], [ 129, 131 ], [ 131, 132 ], [ 131, 133 ], [ 129, 134 ], [ 134, 135 ], [ 134, 136 ], [ 129, 137 ], [ 137, 138 ], [ 137, 139 ], [ 139, 140 ], [ 140, 141 ], [ 141, 142 ], [ 142, 143 ], [ 143, 144 ], [ 140, 145 ], [ 145, 146 ], [ 146, 147 ], [ 146, 148 ], [ 148, 149 ], [ 149, 150 ], [ 150, 151 ], [ 145, 152 ], [ 152, 153 ], [ 153, 154 ], [ 153, 155 ], [ 139, 156 ], [ 156, 157 ], [ 157, 158 ], [ 158, 159 ], [ 129, 160 ], [ 160, 161 ], [ 160, 162 ], [ 162, 163 ], [ 163, 164 ], [ 164, 165 ], [ 165, 166 ], [ 164, 167 ], [ 167, 168 ], [ 129, 169 ], [ 169, 170 ], [ 169, 171 ], [ 171, 172 ], [ 172, 173 ], [ 172, 174 ], [ 171, 176 ], [ 176, 177 ], [ 177, 178 ], [ 178, 179 ], [ 178, 180 ], [ 176, 181 ], [ 181, 182 ], [ 181, 183 ], [ 176, 184 ], [ 184, 185 ], [ 185, 186 ], [ 176, 187 ], [ 187, 188 ], [ 188, 189 ], [ 189, 190 ], [ 189, 191 ], [ 188, 192 ], [ 192, 193 ], [ 171, 194 ], [ 194, 195 ], [ 169, 196 ], [ 196, 197 ], [ 129, 198 ], [ 198, 199 ], [ 198, 200 ], [ 200, 201 ], [ 201, 202 ], [ 202, 203 ], [ 203, 204 ], [ 202, 205 ], [ 205, 206 ], [ 129, 207 ], [ 207, 208 ], [ 207, 209 ], [ 209, 210 ], [ 210, 211 ], [ 211, 212 ], [ 212, 213 ], [ 211, 214 ], [ 214, 215 ], [ 129, 216 ], [ 216, 217 ], [ 216, 218 ], [ 218, 219 ], [ 219, 220 ], [ 220, 221 ], [ 0, 222 ], [ 222, 223 ], [ 222, 224 ] ]
[ "import java.io.*;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.BitSet;\nimport java.util.StringTokenizer;\n\npublic class Main {\n private static void solve() throws Exception {\n int n = fs.nextInt();\n int[] A = fs.readArray(n);\n int cur = A[0];\n long ans = 0;\n for (int i = 1; i < n; i ++ ) {\n ans += Math.max(cur-A[i],0);\n cur = Math.max(cur, A[i]);\n }\n out.println(ans);\n }\n\n private static FastScanner fs = new FastScanner();\n private static PrintWriter out = new PrintWriter(System.out);\n\n public static void main(String[] args) throws Exception {\n int T = 1;\n for (int t = 0; t < T; t++) {\n solve();\n }\n out.close();\n }\n\n static void debug(Object... O) {\n System.err.print(\"DEBUG \");\n System.err.println(Arrays.deepToString(O));\n }\n\n static class FastScanner {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer st = new StringTokenizer(\"\");\n\n String next() {\n while (!st.hasMoreTokens())\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n int[] readArray(int n) {\n int[] a = new int[n];\n for (int i = 0; i < n; i++) a[i] = nextInt();\n return a;\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextString() {\n return next();\n }\n }\n}", "import java.io.*;", "io.*", "java", "import java.util.ArrayList;", "ArrayList", "java.util", "import java.util.Arrays;", "Arrays", "java.util", "import java.util.BitSet;", "BitSet", "java.util", "import java.util.StringTokenizer;", "StringTokenizer", "java.util", "public class Main {\n private static void solve() throws Exception {\n int n = fs.nextInt();\n int[] A = fs.readArray(n);\n int cur = A[0];\n long ans = 0;\n for (int i = 1; i < n; i ++ ) {\n ans += Math.max(cur-A[i],0);\n cur = Math.max(cur, A[i]);\n }\n out.println(ans);\n }\n\n private static FastScanner fs = new FastScanner();\n private static PrintWriter out = new PrintWriter(System.out);\n\n public static void main(String[] args) throws Exception {\n int T = 1;\n for (int t = 0; t < T; t++) {\n solve();\n }\n out.close();\n }\n\n static void debug(Object... O) {\n System.err.print(\"DEBUG \");\n System.err.println(Arrays.deepToString(O));\n }\n\n static class FastScanner {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer st = new StringTokenizer(\"\");\n\n String next() {\n while (!st.hasMoreTokens())\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n int[] readArray(int n) {\n int[] a = new int[n];\n for (int i = 0; i < n; i++) a[i] = nextInt();\n return a;\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextString() {\n return next();\n }\n }\n}", "Main", "private static FastScanner fs = new FastScanner();", "fs", "new FastScanner()", "private static PrintWriter out = new PrintWriter(System.out);", "out", "new PrintWriter(System.out)", "private static void solve() throws Exception {\n int n = fs.nextInt();\n int[] A = fs.readArray(n);\n int cur = A[0];\n long ans = 0;\n for (int i = 1; i < n; i ++ ) {\n ans += Math.max(cur-A[i],0);\n cur = Math.max(cur, A[i]);\n }\n out.println(ans);\n }", "solve", "{\n int n = fs.nextInt();\n int[] A = fs.readArray(n);\n int cur = A[0];\n long ans = 0;\n for (int i = 1; i < n; i ++ ) {\n ans += Math.max(cur-A[i],0);\n cur = Math.max(cur, A[i]);\n }\n out.println(ans);\n }", "int n = fs.nextInt();", "n", "fs.nextInt()", "fs.nextInt", "fs", "int[] A = fs.readArray(n);", "A", "fs.readArray(n)", "fs.readArray", "fs", "n", "int cur = A[0];", "cur", "A[0]", "A", "0", "long ans = 0;", "ans", "0", "for (int i = 1; i < n; i ++ ) {\n ans += Math.max(cur-A[i],0);\n cur = Math.max(cur, A[i]);\n }", "int i = 1;", "int i = 1;", "i", "1", "i < n", "i", "n", "i ++", "i ++", "i", "{\n ans += Math.max(cur-A[i],0);\n cur = Math.max(cur, A[i]);\n }", "{\n ans += Math.max(cur-A[i],0);\n cur = Math.max(cur, A[i]);\n }", "ans += Math.max(cur-A[i],0)", "ans", "Math.max(cur-A[i],0)", "Math.max", "Math", "cur-A[i]", "cur", "A[i]", "A", "i", "0", "cur = Math.max(cur, A[i])", "cur", "Math.max(cur, A[i])", "Math.max", "Math", "cur", "A[i]", "A", "i", "out.println(ans)", "out.println", "out", "ans", "public static void main(String[] args) throws Exception {\n int T = 1;\n for (int t = 0; t < T; t++) {\n solve();\n }\n out.close();\n }", "main", "{\n int T = 1;\n for (int t = 0; t < T; t++) {\n solve();\n }\n out.close();\n }", "int T = 1;", "T", "1", "for (int t = 0; t < T; t++) {\n solve();\n }", "int t = 0;", "int t = 0;", "t", "0", "t < T", "t", "T", "t++", "t++", "t", "{\n solve();\n }", "{\n solve();\n }", "solve()", "solve", "out.close()", "out.close", "out", "String[] args", "args", "static void debug(Object... O) {\n System.err.print(\"DEBUG \");\n System.err.println(Arrays.deepToString(O));\n }", "debug", "{\n System.err.print(\"DEBUG \");\n System.err.println(Arrays.deepToString(O));\n }", "System.err.print(\"DEBUG \")", "System.err.print", "System.err", "System", "System.err", "\"DEBUG \"", "System.err.println(Arrays.deepToString(O))", "System.err.println", "System.err", "System", "System.err", "Arrays.deepToString(O)", "Arrays.deepToString", "Arrays", "O", "Object... O", "O", "static class FastScanner {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer st = new StringTokenizer(\"\");\n\n String next() {\n while (!st.hasMoreTokens())\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n int[] readArray(int n) {\n int[] a = new int[n];\n for (int i = 0; i < n; i++) a[i] = nextInt();\n return a;\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextString() {\n return next();\n }\n }", "FastScanner", "BufferedReader br = new BufferedReader(new InputStreamReader(System.in));", "br", "new BufferedReader(new InputStreamReader(System.in))", "StringTokenizer st = new StringTokenizer(\"\");", "st", "new StringTokenizer(\"\")", "String next() {\n while (!st.hasMoreTokens())\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n return st.nextToken();\n }", "next", "{\n while (!st.hasMoreTokens())\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n return st.nextToken();\n }", "while (!st.hasMoreTokens())\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }", "!st.hasMoreTokens()", "st.hasMoreTokens()", "st.hasMoreTokens", "st", "try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }", "catch (IOException e) {\n e.printStackTrace();\n }", "IOException e", "{\n e.printStackTrace();\n }", "e.printStackTrace()", "e.printStackTrace", "e", "{\n st = new StringTokenizer(br.readLine());\n }", "st = new StringTokenizer(br.readLine())", "st", "new StringTokenizer(br.readLine())", "return st.nextToken();", "st.nextToken()", "st.nextToken", "st", "int nextInt() {\n return Integer.parseInt(next());\n }", "nextInt", "{\n return Integer.parseInt(next());\n }", "return Integer.parseInt(next());", "Integer.parseInt(next())", "Integer.parseInt", "Integer", "next()", "next", "int[] readArray(int n) {\n int[] a = new int[n];\n for (int i = 0; i < n; i++) a[i] = nextInt();\n return a;\n }", "readArray", "{\n int[] a = new int[n];\n for (int i = 0; i < n; i++) a[i] = nextInt();\n return a;\n }", "int[] a = new int[n];", "a", "new int[n]", "n", "for (int i = 0; i < n; i++) a[i] = nextInt();", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "a[i] = nextInt();", "a[i] = nextInt()", "a[i]", "a", "i", "nextInt()", "nextInt", "return a;", "a", "int n", "n", "long nextLong() {\n return Long.parseLong(next());\n }", "nextLong", "{\n return Long.parseLong(next());\n }", "return Long.parseLong(next());", "Long.parseLong(next())", "Long.parseLong", "Long", "next()", "next", "double nextDouble() {\n return Double.parseDouble(next());\n }", "nextDouble", "{\n return Double.parseDouble(next());\n }", "return Double.parseDouble(next());", "Double.parseDouble(next())", "Double.parseDouble", "Double", "next()", "next", "String nextString() {\n return next();\n }", "nextString", "{\n return next();\n }", "return next();", "next()", "next", "public class Main {\n private static void solve() throws Exception {\n int n = fs.nextInt();\n int[] A = fs.readArray(n);\n int cur = A[0];\n long ans = 0;\n for (int i = 1; i < n; i ++ ) {\n ans += Math.max(cur-A[i],0);\n cur = Math.max(cur, A[i]);\n }\n out.println(ans);\n }\n\n private static FastScanner fs = new FastScanner();\n private static PrintWriter out = new PrintWriter(System.out);\n\n public static void main(String[] args) throws Exception {\n int T = 1;\n for (int t = 0; t < T; t++) {\n solve();\n }\n out.close();\n }\n\n static void debug(Object... O) {\n System.err.print(\"DEBUG \");\n System.err.println(Arrays.deepToString(O));\n }\n\n static class FastScanner {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer st = new StringTokenizer(\"\");\n\n String next() {\n while (!st.hasMoreTokens())\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n int[] readArray(int n) {\n int[] a = new int[n];\n for (int i = 0; i < n; i++) a[i] = nextInt();\n return a;\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextString() {\n return next();\n }\n }\n}", "public class Main {\n private static void solve() throws Exception {\n int n = fs.nextInt();\n int[] A = fs.readArray(n);\n int cur = A[0];\n long ans = 0;\n for (int i = 1; i < n; i ++ ) {\n ans += Math.max(cur-A[i],0);\n cur = Math.max(cur, A[i]);\n }\n out.println(ans);\n }\n\n private static FastScanner fs = new FastScanner();\n private static PrintWriter out = new PrintWriter(System.out);\n\n public static void main(String[] args) throws Exception {\n int T = 1;\n for (int t = 0; t < T; t++) {\n solve();\n }\n out.close();\n }\n\n static void debug(Object... O) {\n System.err.print(\"DEBUG \");\n System.err.println(Arrays.deepToString(O));\n }\n\n static class FastScanner {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer st = new StringTokenizer(\"\");\n\n String next() {\n while (!st.hasMoreTokens())\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n int[] readArray(int n) {\n int[] a = new int[n];\n for (int i = 0; i < n; i++) a[i] = nextInt();\n return a;\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextString() {\n return next();\n }\n }\n}", "Main" ]
import java.io.*; import java.util.ArrayList; import java.util.Arrays; import java.util.BitSet; import java.util.StringTokenizer; public class Main { private static void solve() throws Exception { int n = fs.nextInt(); int[] A = fs.readArray(n); int cur = A[0]; long ans = 0; for (int i = 1; i < n; i ++ ) { ans += Math.max(cur-A[i],0); cur = Math.max(cur, A[i]); } out.println(ans); } private static FastScanner fs = new FastScanner(); private static PrintWriter out = new PrintWriter(System.out); public static void main(String[] args) throws Exception { int T = 1; for (int t = 0; t < T; t++) { solve(); } out.close(); } static void debug(Object... O) { System.err.print("DEBUG "); System.err.println(Arrays.deepToString(O)); } static class FastScanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); String next() { while (!st.hasMoreTokens()) try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } int[] readArray(int n) { int[] a = new int[n]; for (int i = 0; i < n; i++) a[i] = nextInt(); return a; } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } String nextString() { return next(); } } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 41, 13, 4, 18, 13, 14, 2, 13, 13, 30, 0, 13, 2, 13, 13, 30, 0, 13, 13, 4, 18, 18, 13, 13, 13, 4, 18, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 69, 5 ], [ 69, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 19, 20 ], [ 20, 21 ], [ 8, 22 ], [ 22, 23 ], [ 22, 24 ], [ 8, 25 ], [ 25, 26 ], [ 26, 27 ], [ 27, 28 ], [ 27, 29 ], [ 25, 30 ], [ 30, 31 ], [ 30, 32 ], [ 25, 33 ], [ 33, 34 ], [ 34, 35 ], [ 25, 36 ], [ 37, 37 ], [ 37, 38 ], [ 38, 39 ], [ 38, 40 ], [ 40, 41 ], [ 41, 42 ], [ 37, 43 ], [ 43, 44 ], [ 44, 45 ], [ 44, 46 ], [ 43, 47 ], [ 47, 48 ], [ 48, 49 ], [ 48, 50 ], [ 50, 51 ], [ 50, 52 ], [ 43, 53 ], [ 53, 54 ], [ 54, 55 ], [ 54, 56 ], [ 8, 57 ], [ 57, 58 ], [ 58, 59 ], [ 59, 60 ], [ 59, 61 ], [ 57, 62 ], [ 8, 63 ], [ 63, 64 ], [ 64, 65 ], [ 6, 66 ], [ 66, 67 ], [ 0, 68 ], [ 68, 69 ], [ 68, 70 ] ]
[ "import java.util.*;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\t\n\t\tScanner keyboard = new Scanner(System.in); \n\t\t\n\t\tint N = keyboard.nextInt();\n\t\tlong a1 = keyboard.nextLong();\n\t\tlong sum = 0;\n\t\t\n\t\tfor(int n=1; n<N; n++) {\n\t\t\tlong a = keyboard.nextLong();\n\t\t\tif(a<a1) {\n\t\t\t\tsum += a1-a;\n\t\t\t}else {\n\t\t\t\ta1 = a;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.print(sum);\n\t\tkeyboard.close();\n\t}\n}", "import java.util.*;", "util.*", "java", "public class Main {\n\tpublic static void main(String[] args) {\n\t\t\n\t\tScanner keyboard = new Scanner(System.in); \n\t\t\n\t\tint N = keyboard.nextInt();\n\t\tlong a1 = keyboard.nextLong();\n\t\tlong sum = 0;\n\t\t\n\t\tfor(int n=1; n<N; n++) {\n\t\t\tlong a = keyboard.nextLong();\n\t\t\tif(a<a1) {\n\t\t\t\tsum += a1-a;\n\t\t\t}else {\n\t\t\t\ta1 = a;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.print(sum);\n\t\tkeyboard.close();\n\t}\n}", "Main", "public static void main(String[] args) {\n\t\t\n\t\tScanner keyboard = new Scanner(System.in); \n\t\t\n\t\tint N = keyboard.nextInt();\n\t\tlong a1 = keyboard.nextLong();\n\t\tlong sum = 0;\n\t\t\n\t\tfor(int n=1; n<N; n++) {\n\t\t\tlong a = keyboard.nextLong();\n\t\t\tif(a<a1) {\n\t\t\t\tsum += a1-a;\n\t\t\t}else {\n\t\t\t\ta1 = a;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.print(sum);\n\t\tkeyboard.close();\n\t}", "main", "{\n\t\t\n\t\tScanner keyboard = new Scanner(System.in); \n\t\t\n\t\tint N = keyboard.nextInt();\n\t\tlong a1 = keyboard.nextLong();\n\t\tlong sum = 0;\n\t\t\n\t\tfor(int n=1; n<N; n++) {\n\t\t\tlong a = keyboard.nextLong();\n\t\t\tif(a<a1) {\n\t\t\t\tsum += a1-a;\n\t\t\t}else {\n\t\t\t\ta1 = a;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.print(sum);\n\t\tkeyboard.close();\n\t}", "Scanner keyboard = new Scanner(System.in);", "keyboard", "new Scanner(System.in)", "int N = keyboard.nextInt();", "N", "keyboard.nextInt()", "keyboard.nextInt", "keyboard", "long a1 = keyboard.nextLong();", "a1", "keyboard.nextLong()", "keyboard.nextLong", "keyboard", "long sum = 0;", "sum", "0", "for(int n=1; n<N; n++) {\n\t\t\tlong a = keyboard.nextLong();\n\t\t\tif(a<a1) {\n\t\t\t\tsum += a1-a;\n\t\t\t}else {\n\t\t\t\ta1 = a;\n\t\t\t}\n\t\t}", "int n=1;", "int n=1;", "n", "1", "n<N", "n", "N", "n++", "n++", "n", "{\n\t\t\tlong a = keyboard.nextLong();\n\t\t\tif(a<a1) {\n\t\t\t\tsum += a1-a;\n\t\t\t}else {\n\t\t\t\ta1 = a;\n\t\t\t}\n\t\t}", "{\n\t\t\tlong a = keyboard.nextLong();\n\t\t\tif(a<a1) {\n\t\t\t\tsum += a1-a;\n\t\t\t}else {\n\t\t\t\ta1 = a;\n\t\t\t}\n\t\t}", "long a = keyboard.nextLong();", "a", "keyboard.nextLong()", "keyboard.nextLong", "keyboard", "if(a<a1) {\n\t\t\t\tsum += a1-a;\n\t\t\t}else {\n\t\t\t\ta1 = a;\n\t\t\t}", "a<a1", "a", "a1", "{\n\t\t\t\tsum += a1-a;\n\t\t\t}", "sum += a1-a", "sum", "a1-a", "a1", "a", "{\n\t\t\t\ta1 = a;\n\t\t\t}", "a1 = a", "a1", "a", "System.out.print(sum)", "System.out.print", "System.out", "System", "System.out", "sum", "keyboard.close()", "keyboard.close", "keyboard", "String[] args", "args", "public class Main {\n\tpublic static void main(String[] args) {\n\t\t\n\t\tScanner keyboard = new Scanner(System.in); \n\t\t\n\t\tint N = keyboard.nextInt();\n\t\tlong a1 = keyboard.nextLong();\n\t\tlong sum = 0;\n\t\t\n\t\tfor(int n=1; n<N; n++) {\n\t\t\tlong a = keyboard.nextLong();\n\t\t\tif(a<a1) {\n\t\t\t\tsum += a1-a;\n\t\t\t}else {\n\t\t\t\ta1 = a;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.print(sum);\n\t\tkeyboard.close();\n\t}\n}", "public class Main {\n\tpublic static void main(String[] args) {\n\t\t\n\t\tScanner keyboard = new Scanner(System.in); \n\t\t\n\t\tint N = keyboard.nextInt();\n\t\tlong a1 = keyboard.nextLong();\n\t\tlong sum = 0;\n\t\t\n\t\tfor(int n=1; n<N; n++) {\n\t\t\tlong a = keyboard.nextLong();\n\t\t\tif(a<a1) {\n\t\t\t\tsum += a1-a;\n\t\t\t}else {\n\t\t\t\ta1 = a;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.print(sum);\n\t\tkeyboard.close();\n\t}\n}", "Main" ]
import java.util.*; public class Main { public static void main(String[] args) { Scanner keyboard = new Scanner(System.in); int N = keyboard.nextInt(); long a1 = keyboard.nextLong(); long sum = 0; for(int n=1; n<N; n++) { long a = keyboard.nextLong(); if(a<a1) { sum += a1-a; }else { a1 = a; } } System.out.print(sum); keyboard.close(); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 18, 13, 13, 18, 13, 2, 13, 17, 30, 0, 13, 2, 18, 13, 2, 13, 17, 18, 13, 13, 0, 18, 13, 13, 18, 13, 2, 13, 17, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 103, 5 ], [ 103, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 14, 17 ], [ 17, 18 ], [ 18, 19 ], [ 8, 20 ], [ 20, 21 ], [ 20, 22 ], [ 8, 24 ], [ 24, 25 ], [ 25, 26 ], [ 26, 27 ], [ 26, 28 ], [ 24, 29 ], [ 29, 30 ], [ 29, 31 ], [ 24, 32 ], [ 32, 33 ], [ 33, 34 ], [ 24, 35 ], [ 36, 36 ], [ 36, 37 ], [ 37, 38 ], [ 38, 39 ], [ 38, 40 ], [ 37, 41 ], [ 41, 42 ], [ 42, 43 ], [ 41, 44 ], [ 44, 45 ], [ 45, 46 ], [ 8, 47 ], [ 47, 48 ], [ 47, 49 ], [ 8, 50 ], [ 50, 51 ], [ 51, 52 ], [ 52, 53 ], [ 52, 54 ], [ 50, 55 ], [ 55, 56 ], [ 55, 57 ], [ 50, 58 ], [ 58, 59 ], [ 59, 60 ], [ 50, 61 ], [ 62, 62 ], [ 62, 63 ], [ 63, 64 ], [ 64, 65 ], [ 65, 66 ], [ 65, 67 ], [ 64, 68 ], [ 68, 69 ], [ 68, 70 ], [ 70, 71 ], [ 70, 72 ], [ 63, 73 ], [ 73, 74 ], [ 74, 75 ], [ 74, 76 ], [ 76, 77 ], [ 77, 78 ], [ 77, 79 ], [ 79, 80 ], [ 79, 81 ], [ 76, 82 ], [ 82, 83 ], [ 82, 84 ], [ 73, 85 ], [ 85, 86 ], [ 86, 87 ], [ 86, 88 ], [ 85, 89 ], [ 89, 90 ], [ 89, 91 ], [ 91, 92 ], [ 91, 93 ], [ 8, 94 ], [ 94, 95 ], [ 95, 96 ], [ 96, 97 ], [ 96, 98 ], [ 94, 99 ], [ 6, 100 ], [ 100, 101 ], [ 0, 102 ], [ 102, 103 ], [ 102, 104 ] ]
[ "import java.util.Scanner;\n\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = Integer.parseInt(sc.next());\n\t\tint[] a = new int[n];\n\t\t\n\t\tfor(int i = 0 ; i < n ; i++) {\n\t\t\ta[i] = Integer.parseInt(sc.next());\n\t\t}\n\t\t\n\t\tLong ans = 0l;\n\t\tfor(int i = 1 ; i < n ; i++) {\n\t\t\t\n\t\t\tif(a[i] < a[i-1]) {\n\t\t\t\tans += a[i-1] - a[i];\n\t\t\t\ta[i] = a[i-1];\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(ans);\n\t}\n\n}\n\n", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = Integer.parseInt(sc.next());\n\t\tint[] a = new int[n];\n\t\t\n\t\tfor(int i = 0 ; i < n ; i++) {\n\t\t\ta[i] = Integer.parseInt(sc.next());\n\t\t}\n\t\t\n\t\tLong ans = 0l;\n\t\tfor(int i = 1 ; i < n ; i++) {\n\t\t\t\n\t\t\tif(a[i] < a[i-1]) {\n\t\t\t\tans += a[i-1] - a[i];\n\t\t\t\ta[i] = a[i-1];\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(ans);\n\t}\n\n}", "Main", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = Integer.parseInt(sc.next());\n\t\tint[] a = new int[n];\n\t\t\n\t\tfor(int i = 0 ; i < n ; i++) {\n\t\t\ta[i] = Integer.parseInt(sc.next());\n\t\t}\n\t\t\n\t\tLong ans = 0l;\n\t\tfor(int i = 1 ; i < n ; i++) {\n\t\t\t\n\t\t\tif(a[i] < a[i-1]) {\n\t\t\t\tans += a[i-1] - a[i];\n\t\t\t\ta[i] = a[i-1];\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(ans);\n\t}", "main", "{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = Integer.parseInt(sc.next());\n\t\tint[] a = new int[n];\n\t\t\n\t\tfor(int i = 0 ; i < n ; i++) {\n\t\t\ta[i] = Integer.parseInt(sc.next());\n\t\t}\n\t\t\n\t\tLong ans = 0l;\n\t\tfor(int i = 1 ; i < n ; i++) {\n\t\t\t\n\t\t\tif(a[i] < a[i-1]) {\n\t\t\t\tans += a[i-1] - a[i];\n\t\t\t\ta[i] = a[i-1];\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(ans);\n\t}", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n = Integer.parseInt(sc.next());", "n", "Integer.parseInt(sc.next())", "Integer.parseInt", "Integer", "sc.next()", "sc.next", "sc", "int[] a = new int[n];", "a", "new int[n]", "n", "for(int i = 0 ; i < n ; i++) {\n\t\t\ta[i] = Integer.parseInt(sc.next());\n\t\t}", "int i = 0 ;", "int i = 0 ;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n\t\t\ta[i] = Integer.parseInt(sc.next());\n\t\t}", "{\n\t\t\ta[i] = Integer.parseInt(sc.next());\n\t\t}", "a[i] = Integer.parseInt(sc.next())", "a[i]", "a", "i", "Integer.parseInt(sc.next())", "Integer.parseInt", "Integer", "sc.next()", "sc.next", "sc", "Long ans = 0l;", "ans", "0l", "for(int i = 1 ; i < n ; i++) {\n\t\t\t\n\t\t\tif(a[i] < a[i-1]) {\n\t\t\t\tans += a[i-1] - a[i];\n\t\t\t\ta[i] = a[i-1];\n\t\t\t}\n\t\t}", "int i = 1 ;", "int i = 1 ;", "i", "1", "i < n", "i", "n", "i++", "i++", "i", "{\n\t\t\t\n\t\t\tif(a[i] < a[i-1]) {\n\t\t\t\tans += a[i-1] - a[i];\n\t\t\t\ta[i] = a[i-1];\n\t\t\t}\n\t\t}", "{\n\t\t\t\n\t\t\tif(a[i] < a[i-1]) {\n\t\t\t\tans += a[i-1] - a[i];\n\t\t\t\ta[i] = a[i-1];\n\t\t\t}\n\t\t}", "if(a[i] < a[i-1]) {\n\t\t\t\tans += a[i-1] - a[i];\n\t\t\t\ta[i] = a[i-1];\n\t\t\t}", "a[i] < a[i-1]", "a[i]", "a", "i", "a[i-1]", "a", "i-1", "i", "1", "{\n\t\t\t\tans += a[i-1] - a[i];\n\t\t\t\ta[i] = a[i-1];\n\t\t\t}", "ans += a[i-1] - a[i]", "ans", "a[i-1] - a[i]", "a[i-1]", "a", "i-1", "i", "1", "a[i]", "a", "i", "a[i] = a[i-1]", "a[i]", "a", "i", "a[i-1]", "a", "i-1", "i", "1", "System.out.println(ans)", "System.out.println", "System.out", "System", "System.out", "ans", "String[] args", "args", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = Integer.parseInt(sc.next());\n\t\tint[] a = new int[n];\n\t\t\n\t\tfor(int i = 0 ; i < n ; i++) {\n\t\t\ta[i] = Integer.parseInt(sc.next());\n\t\t}\n\t\t\n\t\tLong ans = 0l;\n\t\tfor(int i = 1 ; i < n ; i++) {\n\t\t\t\n\t\t\tif(a[i] < a[i-1]) {\n\t\t\t\tans += a[i-1] - a[i];\n\t\t\t\ta[i] = a[i-1];\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(ans);\n\t}\n\n}", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = Integer.parseInt(sc.next());\n\t\tint[] a = new int[n];\n\t\t\n\t\tfor(int i = 0 ; i < n ; i++) {\n\t\t\ta[i] = Integer.parseInt(sc.next());\n\t\t}\n\t\t\n\t\tLong ans = 0l;\n\t\tfor(int i = 1 ; i < n ; i++) {\n\t\t\t\n\t\t\tif(a[i] < a[i-1]) {\n\t\t\t\tans += a[i-1] - a[i];\n\t\t\t\ta[i] = a[i-1];\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(ans);\n\t}\n\n}", "Main" ]
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = Integer.parseInt(sc.next()); int[] a = new int[n]; for(int i = 0 ; i < n ; i++) { a[i] = Integer.parseInt(sc.next()); } Long ans = 0l; for(int i = 1 ; i < n ; i++) { if(a[i] < a[i-1]) { ans += a[i-1] - a[i]; a[i] = a[i-1]; } } System.out.println(ans); } }
[ 7, 15, 13, 17, 6, 13, 41, 13, 17, 41, 13, 17, 41, 13, 17, 12, 13, 30, 38, 30, 41, 13, 20, 0, 13, 4, 18, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 13, 18, 13, 13, 30, 0, 13, 18, 13, 13, 30, 0, 13, 2, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 100, 5 ], [ 100, 6 ], [ 6, 7 ], [ 6, 8 ], [ 100, 9 ], [ 9, 10 ], [ 9, 11 ], [ 100, 12 ], [ 12, 13 ], [ 12, 14 ], [ 100, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 19, 20 ], [ 20, 21 ], [ 20, 22 ], [ 19, 23 ], [ 23, 24 ], [ 23, 25 ], [ 25, 26 ], [ 26, 27 ], [ 25, 28 ], [ 28, 29 ], [ 29, 30 ], [ 19, 31 ], [ 31, 32 ], [ 31, 33 ], [ 19, 35 ], [ 35, 36 ], [ 36, 37 ], [ 37, 38 ], [ 37, 39 ], [ 35, 40 ], [ 40, 41 ], [ 40, 42 ], [ 35, 43 ], [ 43, 44 ], [ 44, 45 ], [ 35, 46 ], [ 47, 47 ], [ 47, 48 ], [ 48, 49 ], [ 49, 50 ], [ 49, 51 ], [ 48, 52 ], [ 52, 53 ], [ 53, 54 ], [ 52, 55 ], [ 55, 56 ], [ 56, 57 ], [ 19, 58 ], [ 58, 59 ], [ 59, 60 ], [ 60, 61 ], [ 60, 62 ], [ 58, 63 ], [ 63, 64 ], [ 63, 65 ], [ 58, 66 ], [ 66, 67 ], [ 67, 68 ], [ 58, 69 ], [ 70, 70 ], [ 70, 71 ], [ 71, 72 ], [ 72, 73 ], [ 72, 74 ], [ 74, 75 ], [ 74, 76 ], [ 71, 77 ], [ 77, 78 ], [ 78, 79 ], [ 78, 80 ], [ 80, 81 ], [ 80, 82 ], [ 71, 83 ], [ 83, 84 ], [ 84, 85 ], [ 84, 86 ], [ 86, 87 ], [ 86, 88 ], [ 88, 89 ], [ 88, 90 ], [ 17, 91 ], [ 91, 92 ], [ 92, 93 ], [ 93, 94 ], [ 93, 95 ], [ 91, 96 ], [ 15, 97 ], [ 97, 98 ], [ 0, 99 ], [ 99, 100 ], [ 99, 101 ] ]
[ "import java.util.Scanner;\n\npublic class Main {\n\tstatic int N=0;\n\tstatic long count=0L;\n\tstatic long max=0L;\n\tpublic static void main(String args[]) {\n\t\ttry(Scanner sc = new Scanner(System.in)){\n\t\t\tN = Integer.parseInt(sc.next());\n\t\t\tLong a[] = new Long[N]; \n\t\t\tfor(int i=0;i<N;i++) {\n\t\t\t\ta[i] = Long.parseLong(sc.next());\n\t\t\t}\n\t\t\tfor(int i=0;i<N;i++) {\n\t\t\t\tif(max<a[i]) {\n\t\t\t\t\tmax = a[i];\n\t\t\t\t} else {\n\t\t\t\t\tcount += max-a[i];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(count);\n\t}\n}", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\tstatic int N=0;\n\tstatic long count=0L;\n\tstatic long max=0L;\n\tpublic static void main(String args[]) {\n\t\ttry(Scanner sc = new Scanner(System.in)){\n\t\t\tN = Integer.parseInt(sc.next());\n\t\t\tLong a[] = new Long[N]; \n\t\t\tfor(int i=0;i<N;i++) {\n\t\t\t\ta[i] = Long.parseLong(sc.next());\n\t\t\t}\n\t\t\tfor(int i=0;i<N;i++) {\n\t\t\t\tif(max<a[i]) {\n\t\t\t\t\tmax = a[i];\n\t\t\t\t} else {\n\t\t\t\t\tcount += max-a[i];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(count);\n\t}\n}", "Main", "static int N=0;", "N", "0", "static long count=0L;", "count", "0L", "static long max=0L;", "max", "0L", "public static void main(String args[]) {\n\t\ttry(Scanner sc = new Scanner(System.in)){\n\t\t\tN = Integer.parseInt(sc.next());\n\t\t\tLong a[] = new Long[N]; \n\t\t\tfor(int i=0;i<N;i++) {\n\t\t\t\ta[i] = Long.parseLong(sc.next());\n\t\t\t}\n\t\t\tfor(int i=0;i<N;i++) {\n\t\t\t\tif(max<a[i]) {\n\t\t\t\t\tmax = a[i];\n\t\t\t\t} else {\n\t\t\t\t\tcount += max-a[i];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(count);\n\t}", "main", "{\n\t\ttry(Scanner sc = new Scanner(System.in)){\n\t\t\tN = Integer.parseInt(sc.next());\n\t\t\tLong a[] = new Long[N]; \n\t\t\tfor(int i=0;i<N;i++) {\n\t\t\t\ta[i] = Long.parseLong(sc.next());\n\t\t\t}\n\t\t\tfor(int i=0;i<N;i++) {\n\t\t\t\tif(max<a[i]) {\n\t\t\t\t\tmax = a[i];\n\t\t\t\t} else {\n\t\t\t\t\tcount += max-a[i];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(count);\n\t}", "try(Scanner sc = new Scanner(System.in)){\n\t\t\tN = Integer.parseInt(sc.next());\n\t\t\tLong a[] = new Long[N]; \n\t\t\tfor(int i=0;i<N;i++) {\n\t\t\t\ta[i] = Long.parseLong(sc.next());\n\t\t\t}\n\t\t\tfor(int i=0;i<N;i++) {\n\t\t\t\tif(max<a[i]) {\n\t\t\t\t\tmax = a[i];\n\t\t\t\t} else {\n\t\t\t\t\tcount += max-a[i];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}", "{\n\t\t\tN = Integer.parseInt(sc.next());\n\t\t\tLong a[] = new Long[N]; \n\t\t\tfor(int i=0;i<N;i++) {\n\t\t\t\ta[i] = Long.parseLong(sc.next());\n\t\t\t}\n\t\t\tfor(int i=0;i<N;i++) {\n\t\t\t\tif(max<a[i]) {\n\t\t\t\t\tmax = a[i];\n\t\t\t\t} else {\n\t\t\t\t\tcount += max-a[i];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}", "Scanner sc = new Scanner(System.in)", "Scanner sc = new Scanner(System.in)", "new Scanner(System.in)", "N = Integer.parseInt(sc.next())", "N", "Integer.parseInt(sc.next())", "Integer.parseInt", "Integer", "sc.next()", "sc.next", "sc", "Long a[] = new Long[N];", "a", "new Long[N]", "N", "for(int i=0;i<N;i++) {\n\t\t\t\ta[i] = Long.parseLong(sc.next());\n\t\t\t}", "int i=0;", "int i=0;", "i", "0", "i<N", "i", "N", "i++", "i++", "i", "{\n\t\t\t\ta[i] = Long.parseLong(sc.next());\n\t\t\t}", "{\n\t\t\t\ta[i] = Long.parseLong(sc.next());\n\t\t\t}", "a[i] = Long.parseLong(sc.next())", "a[i]", "a", "i", "Long.parseLong(sc.next())", "Long.parseLong", "Long", "sc.next()", "sc.next", "sc", "for(int i=0;i<N;i++) {\n\t\t\t\tif(max<a[i]) {\n\t\t\t\t\tmax = a[i];\n\t\t\t\t} else {\n\t\t\t\t\tcount += max-a[i];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}", "int i=0;", "int i=0;", "i", "0", "i<N", "i", "N", "i++", "i++", "i", "{\n\t\t\t\tif(max<a[i]) {\n\t\t\t\t\tmax = a[i];\n\t\t\t\t} else {\n\t\t\t\t\tcount += max-a[i];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}", "{\n\t\t\t\tif(max<a[i]) {\n\t\t\t\t\tmax = a[i];\n\t\t\t\t} else {\n\t\t\t\t\tcount += max-a[i];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}", "if(max<a[i]) {\n\t\t\t\t\tmax = a[i];\n\t\t\t\t} else {\n\t\t\t\t\tcount += max-a[i];\n\t\t\t\t}", "max<a[i]", "max", "a[i]", "a", "i", "{\n\t\t\t\t\tmax = a[i];\n\t\t\t\t}", "max = a[i]", "max", "a[i]", "a", "i", "{\n\t\t\t\t\tcount += max-a[i];\n\t\t\t\t}", "count += max-a[i]", "count", "max-a[i]", "max", "a[i]", "a", "i", "System.out.println(count)", "System.out.println", "System.out", "System", "System.out", "count", "String args[]", "args", "public class Main {\n\tstatic int N=0;\n\tstatic long count=0L;\n\tstatic long max=0L;\n\tpublic static void main(String args[]) {\n\t\ttry(Scanner sc = new Scanner(System.in)){\n\t\t\tN = Integer.parseInt(sc.next());\n\t\t\tLong a[] = new Long[N]; \n\t\t\tfor(int i=0;i<N;i++) {\n\t\t\t\ta[i] = Long.parseLong(sc.next());\n\t\t\t}\n\t\t\tfor(int i=0;i<N;i++) {\n\t\t\t\tif(max<a[i]) {\n\t\t\t\t\tmax = a[i];\n\t\t\t\t} else {\n\t\t\t\t\tcount += max-a[i];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(count);\n\t}\n}", "public class Main {\n\tstatic int N=0;\n\tstatic long count=0L;\n\tstatic long max=0L;\n\tpublic static void main(String args[]) {\n\t\ttry(Scanner sc = new Scanner(System.in)){\n\t\t\tN = Integer.parseInt(sc.next());\n\t\t\tLong a[] = new Long[N]; \n\t\t\tfor(int i=0;i<N;i++) {\n\t\t\t\ta[i] = Long.parseLong(sc.next());\n\t\t\t}\n\t\t\tfor(int i=0;i<N;i++) {\n\t\t\t\tif(max<a[i]) {\n\t\t\t\t\tmax = a[i];\n\t\t\t\t} else {\n\t\t\t\t\tcount += max-a[i];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(count);\n\t}\n}", "Main" ]
import java.util.Scanner; public class Main { static int N=0; static long count=0L; static long max=0L; public static void main(String args[]) { try(Scanner sc = new Scanner(System.in)){ N = Integer.parseInt(sc.next()); Long a[] = new Long[N]; for(int i=0;i<N;i++) { a[i] = Long.parseLong(sc.next()); } for(int i=0;i<N;i++) { if(max<a[i]) { max = a[i]; } else { count += max-a[i]; } } } System.out.println(count); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 41, 13, 4, 18, 13, 14, 2, 13, 13, 0, 13, 2, 13, 13, 0, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 8, 20 ], [ 20, 21 ], [ 20, 22 ], [ 8, 23 ], [ 23, 24 ], [ 24, 25 ], [ 25, 26 ], [ 25, 27 ], [ 23, 28 ], [ 28, 29 ], [ 28, 30 ], [ 23, 31 ], [ 31, 32 ], [ 32, 33 ], [ 23, 34 ], [ 35, 35 ], [ 35, 36 ], [ 36, 37 ], [ 36, 38 ], [ 38, 39 ], [ 39, 40 ], [ 35, 41 ], [ 41, 42 ], [ 42, 43 ], [ 42, 44 ], [ 41, 45 ], [ 45, 46 ], [ 45, 47 ], [ 47, 48 ], [ 47, 49 ], [ 41, 50 ], [ 50, 51 ], [ 50, 52 ], [ 8, 53 ], [ 53, 54 ], [ 54, 55 ], [ 55, 56 ], [ 55, 57 ], [ 53, 58 ], [ 6, 59 ], [ 59, 60 ] ]
[ "import java.util.*;\n\nclass Main{\n\n public static void main(String args[]){\n\n Scanner s=new Scanner(System.in);\n int N=s.nextInt();\n long ans=0;\n long max=0;\n for(int i=0;i<N;i++){\n long height=s.nextInt();\n if(height<=max) ans+=max-height;\n else max=height;\n }\n System.out.println(ans);\n \n } \n}", "import java.util.*;", "util.*", "java", "class Main{\n\n public static void main(String args[]){\n\n Scanner s=new Scanner(System.in);\n int N=s.nextInt();\n long ans=0;\n long max=0;\n for(int i=0;i<N;i++){\n long height=s.nextInt();\n if(height<=max) ans+=max-height;\n else max=height;\n }\n System.out.println(ans);\n \n } \n}", "Main", "public static void main(String args[]){\n\n Scanner s=new Scanner(System.in);\n int N=s.nextInt();\n long ans=0;\n long max=0;\n for(int i=0;i<N;i++){\n long height=s.nextInt();\n if(height<=max) ans+=max-height;\n else max=height;\n }\n System.out.println(ans);\n \n }", "main", "{\n\n Scanner s=new Scanner(System.in);\n int N=s.nextInt();\n long ans=0;\n long max=0;\n for(int i=0;i<N;i++){\n long height=s.nextInt();\n if(height<=max) ans+=max-height;\n else max=height;\n }\n System.out.println(ans);\n \n }", "Scanner s=new Scanner(System.in);", "s", "new Scanner(System.in)", "int N=s.nextInt();", "N", "s.nextInt()", "s.nextInt", "s", "long ans=0;", "ans", "0", "long max=0;", "max", "0", "for(int i=0;i<N;i++){\n long height=s.nextInt();\n if(height<=max) ans+=max-height;\n else max=height;\n }", "int i=0;", "int i=0;", "i", "0", "i<N", "i", "N", "i++", "i++", "i", "{\n long height=s.nextInt();\n if(height<=max) ans+=max-height;\n else max=height;\n }", "{\n long height=s.nextInt();\n if(height<=max) ans+=max-height;\n else max=height;\n }", "long height=s.nextInt();", "height", "s.nextInt()", "s.nextInt", "s", "if(height<=max) ans+=max-height;\n else max=height;", "height<=max", "height", "max", "ans+=max-height", "ans", "max-height", "max", "height", "max=height", "max", "height", "System.out.println(ans)", "System.out.println", "System.out", "System", "System.out", "ans", "String args[]", "args" ]
import java.util.*; class Main{ public static void main(String args[]){ Scanner s=new Scanner(System.in); int N=s.nextInt(); long ans=0; long max=0; for(int i=0;i<N;i++){ long height=s.nextInt(); if(height<=max) ans+=max-height; else max=height; } System.out.println(ans); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 4, 18, 13, 41, 13, 18, 13, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 4, 18, 13, 0, 18, 13, 13, 18, 13, 13, 41, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 18, 13, 13, 18, 13, 13, 30, 0, 13, 2, 18, 13, 13, 18, 13, 13, 30, 0, 13, 13, 4, 18, 18, 13, 13, 17, 13, 4, 18, 18, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 106, 8 ], [ 106, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 16, 17 ], [ 11, 18 ], [ 18, 19 ], [ 18, 20 ], [ 20, 21 ], [ 20, 22 ], [ 11, 23 ], [ 23, 24 ], [ 23, 25 ], [ 11, 27 ], [ 27, 28 ], [ 28, 29 ], [ 29, 30 ], [ 29, 31 ], [ 27, 32 ], [ 32, 33 ], [ 32, 34 ], [ 27, 35 ], [ 35, 36 ], [ 36, 37 ], [ 27, 38 ], [ 39, 39 ], [ 39, 40 ], [ 40, 41 ], [ 41, 42 ], [ 39, 43 ], [ 43, 44 ], [ 44, 45 ], [ 44, 46 ], [ 43, 47 ], [ 47, 48 ], [ 47, 49 ], [ 11, 50 ], [ 50, 51 ], [ 50, 52 ], [ 11, 53 ], [ 53, 54 ], [ 53, 55 ], [ 11, 56 ], [ 56, 57 ], [ 57, 58 ], [ 58, 59 ], [ 58, 60 ], [ 56, 61 ], [ 61, 62 ], [ 61, 63 ], [ 56, 64 ], [ 64, 65 ], [ 65, 66 ], [ 56, 67 ], [ 68, 68 ], [ 68, 69 ], [ 69, 70 ], [ 70, 71 ], [ 71, 72 ], [ 71, 73 ], [ 70, 74 ], [ 74, 75 ], [ 74, 76 ], [ 69, 77 ], [ 77, 78 ], [ 78, 79 ], [ 78, 80 ], [ 80, 81 ], [ 81, 82 ], [ 81, 83 ], [ 80, 84 ], [ 84, 85 ], [ 84, 86 ], [ 69, 87 ], [ 87, 88 ], [ 88, 89 ], [ 88, 90 ], [ 11, 91 ], [ 91, 92 ], [ 92, 93 ], [ 93, 94 ], [ 93, 95 ], [ 91, 96 ], [ 91, 97 ], [ 11, 98 ], [ 98, 99 ], [ 99, 100 ], [ 100, 101 ], [ 100, 102 ], [ 9, 103 ], [ 103, 104 ], [ 0, 105 ], [ 105, 106 ], [ 105, 107 ] ]
[ "import java.util.*;\nimport java.io.*;\npublic class Main {\n public static void main(String[] args) throws Exception{\n StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));\n in.nextToken();\n int N = (int) in.nval;\n int[] a = new int[N];\n for(int i = 0; i < N; i++){\n in.nextToken();\n a[i] = (int) in.nval;\n }\n int j = 0;\n double ans = 0;\n for(int i = 1; i < N; i++){\n if(a[i] < a[j]){\n ans += (a[j] - a[i]);\n }else{\n j = i;\n }\n }\n System.out.format(\"%.0f\",ans);\n System.out.println();\n }\n}", "import java.util.*;", "util.*", "java", "import java.io.*;", "io.*", "java", "public class Main {\n public static void main(String[] args) throws Exception{\n StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));\n in.nextToken();\n int N = (int) in.nval;\n int[] a = new int[N];\n for(int i = 0; i < N; i++){\n in.nextToken();\n a[i] = (int) in.nval;\n }\n int j = 0;\n double ans = 0;\n for(int i = 1; i < N; i++){\n if(a[i] < a[j]){\n ans += (a[j] - a[i]);\n }else{\n j = i;\n }\n }\n System.out.format(\"%.0f\",ans);\n System.out.println();\n }\n}", "Main", "public static void main(String[] args) throws Exception{\n StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));\n in.nextToken();\n int N = (int) in.nval;\n int[] a = new int[N];\n for(int i = 0; i < N; i++){\n in.nextToken();\n a[i] = (int) in.nval;\n }\n int j = 0;\n double ans = 0;\n for(int i = 1; i < N; i++){\n if(a[i] < a[j]){\n ans += (a[j] - a[i]);\n }else{\n j = i;\n }\n }\n System.out.format(\"%.0f\",ans);\n System.out.println();\n }", "main", "{\n StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));\n in.nextToken();\n int N = (int) in.nval;\n int[] a = new int[N];\n for(int i = 0; i < N; i++){\n in.nextToken();\n a[i] = (int) in.nval;\n }\n int j = 0;\n double ans = 0;\n for(int i = 1; i < N; i++){\n if(a[i] < a[j]){\n ans += (a[j] - a[i]);\n }else{\n j = i;\n }\n }\n System.out.format(\"%.0f\",ans);\n System.out.println();\n }", "StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));", "in", "new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)))", "in.nextToken()", "in.nextToken", "in", "int N = (int) in.nval;", "N", "(int) in.nval", "in", "in.nval", "int[] a = new int[N];", "a", "new int[N]", "N", "for(int i = 0; i < N; i++){\n in.nextToken();\n a[i] = (int) in.nval;\n }", "int i = 0;", "int i = 0;", "i", "0", "i < N", "i", "N", "i++", "i++", "i", "{\n in.nextToken();\n a[i] = (int) in.nval;\n }", "{\n in.nextToken();\n a[i] = (int) in.nval;\n }", "in.nextToken()", "in.nextToken", "in", "a[i] = (int) in.nval", "a[i]", "a", "i", "(int) in.nval", "in", "in.nval", "int j = 0;", "j", "0", "double ans = 0;", "ans", "0", "for(int i = 1; i < N; i++){\n if(a[i] < a[j]){\n ans += (a[j] - a[i]);\n }else{\n j = i;\n }\n }", "int i = 1;", "int i = 1;", "i", "1", "i < N", "i", "N", "i++", "i++", "i", "{\n if(a[i] < a[j]){\n ans += (a[j] - a[i]);\n }else{\n j = i;\n }\n }", "{\n if(a[i] < a[j]){\n ans += (a[j] - a[i]);\n }else{\n j = i;\n }\n }", "if(a[i] < a[j]){\n ans += (a[j] - a[i]);\n }else{\n j = i;\n }", "a[i] < a[j]", "a[i]", "a", "i", "a[j]", "a", "j", "{\n ans += (a[j] - a[i]);\n }", "ans += (a[j] - a[i])", "ans", "(a[j] - a[i])", "a[j]", "a", "j", "a[i]", "a", "i", "{\n j = i;\n }", "j = i", "j", "i", "System.out.format(\"%.0f\",ans)", "System.out.format", "System.out", "System", "System.out", "\"%.0f\"", "ans", "System.out.println()", "System.out.println", "System.out", "System", "System.out", "String[] args", "args", "public class Main {\n public static void main(String[] args) throws Exception{\n StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));\n in.nextToken();\n int N = (int) in.nval;\n int[] a = new int[N];\n for(int i = 0; i < N; i++){\n in.nextToken();\n a[i] = (int) in.nval;\n }\n int j = 0;\n double ans = 0;\n for(int i = 1; i < N; i++){\n if(a[i] < a[j]){\n ans += (a[j] - a[i]);\n }else{\n j = i;\n }\n }\n System.out.format(\"%.0f\",ans);\n System.out.println();\n }\n}", "public class Main {\n public static void main(String[] args) throws Exception{\n StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));\n in.nextToken();\n int N = (int) in.nval;\n int[] a = new int[N];\n for(int i = 0; i < N; i++){\n in.nextToken();\n a[i] = (int) in.nval;\n }\n int j = 0;\n double ans = 0;\n for(int i = 1; i < N; i++){\n if(a[i] < a[j]){\n ans += (a[j] - a[i]);\n }else{\n j = i;\n }\n }\n System.out.format(\"%.0f\",ans);\n System.out.println();\n }\n}", "Main" ]
import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws Exception{ StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in))); in.nextToken(); int N = (int) in.nval; int[] a = new int[N]; for(int i = 0; i < N; i++){ in.nextToken(); a[i] = (int) in.nval; } int j = 0; double ans = 0; for(int i = 1; i < N; i++){ if(a[i] < a[j]){ ans += (a[j] - a[i]); }else{ j = i; } } System.out.format("%.0f",ans); System.out.println(); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 20, 41, 13, 4, 18, 13, 4, 18, 13, 41, 13, 4, 18, 4, 18, 13, 17, 41, 13, 17, 41, 13, 17, 41, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 2, 13, 17, 1, 40, 13, 30, 30, 0, 13, 2, 4, 18, 13, 18, 13, 13, 13, 0, 13, 4, 18, 13, 18, 13, 2, 13, 17, 14, 2, 13, 13, 30, 0, 13, 2, 13, 13, 0, 13, 13, 30, 0, 13, 17, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 113, 14 ], [ 113, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 18, 20 ], [ 17, 21 ], [ 21, 22 ], [ 21, 23 ], [ 17, 24 ], [ 24, 25 ], [ 24, 26 ], [ 26, 27 ], [ 27, 28 ], [ 26, 29 ], [ 29, 30 ], [ 30, 31 ], [ 17, 32 ], [ 32, 33 ], [ 32, 34 ], [ 34, 35 ], [ 35, 36 ], [ 36, 37 ], [ 37, 38 ], [ 34, 39 ], [ 17, 40 ], [ 40, 41 ], [ 40, 42 ], [ 17, 43 ], [ 43, 44 ], [ 43, 45 ], [ 17, 46 ], [ 46, 47 ], [ 46, 48 ], [ 17, 49 ], [ 49, 50 ], [ 49, 51 ], [ 17, 52 ], [ 52, 53 ], [ 53, 54 ], [ 54, 55 ], [ 54, 56 ], [ 52, 57 ], [ 57, 58 ], [ 57, 59 ], [ 59, 60 ], [ 59, 61 ], [ 52, 62 ], [ 62, 63 ], [ 63, 64 ], [ 52, 65 ], [ 66, 66 ], [ 66, 67 ], [ 67, 68 ], [ 67, 69 ], [ 69, 70 ], [ 70, 71 ], [ 71, 72 ], [ 70, 73 ], [ 73, 74 ], [ 73, 75 ], [ 69, 76 ], [ 66, 77 ], [ 77, 78 ], [ 77, 79 ], [ 79, 80 ], [ 80, 81 ], [ 79, 82 ], [ 82, 83 ], [ 82, 84 ], [ 84, 85 ], [ 84, 86 ], [ 66, 87 ], [ 87, 88 ], [ 88, 89 ], [ 88, 90 ], [ 87, 91 ], [ 91, 92 ], [ 92, 93 ], [ 92, 94 ], [ 94, 95 ], [ 94, 96 ], [ 91, 97 ], [ 97, 98 ], [ 97, 99 ], [ 87, 100 ], [ 100, 101 ], [ 101, 102 ], [ 101, 103 ], [ 17, 104 ], [ 104, 105 ], [ 105, 106 ], [ 106, 107 ], [ 106, 108 ], [ 104, 109 ], [ 15, 110 ], [ 110, 111 ], [ 0, 112 ], [ 112, 113 ], [ 112, 114 ] ]
[ "import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.nio.charset.StandardCharsets;\n\npublic class Main {\n public static void main(String[] args) throws IOException {\n InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);\n BufferedReader in = new BufferedReader(reader);\n long size = Long.parseLong(in.readLine());\n String[] str = in.readLine().split(\" \");\n long num1 = 0;\n long num2 = 0;\n long step = 0;\n long res = 0;\n\n for(int i=0; i < size-1; i++) {\n \tnum1 = Long.parseLong(str[i]) + step;\n \tnum2 = Long.parseLong(str[i+1]);\n\n \tif(num1 > num2) {\n \t\tstep = num1 - num2;\n \t\tres += step;\n \t}else {\n \t\tstep = 0;\n \t}\n }\n\n System.out.println(res);\n\n }\n}", "import java.io.BufferedReader;", "BufferedReader", "java.io", "import java.io.IOException;", "IOException", "java.io", "import java.io.InputStreamReader;", "InputStreamReader", "java.io", "import java.nio.charset.StandardCharsets;", "StandardCharsets", "java.nio.charset", "public class Main {\n public static void main(String[] args) throws IOException {\n InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);\n BufferedReader in = new BufferedReader(reader);\n long size = Long.parseLong(in.readLine());\n String[] str = in.readLine().split(\" \");\n long num1 = 0;\n long num2 = 0;\n long step = 0;\n long res = 0;\n\n for(int i=0; i < size-1; i++) {\n \tnum1 = Long.parseLong(str[i]) + step;\n \tnum2 = Long.parseLong(str[i+1]);\n\n \tif(num1 > num2) {\n \t\tstep = num1 - num2;\n \t\tres += step;\n \t}else {\n \t\tstep = 0;\n \t}\n }\n\n System.out.println(res);\n\n }\n}", "Main", "public static void main(String[] args) throws IOException {\n InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);\n BufferedReader in = new BufferedReader(reader);\n long size = Long.parseLong(in.readLine());\n String[] str = in.readLine().split(\" \");\n long num1 = 0;\n long num2 = 0;\n long step = 0;\n long res = 0;\n\n for(int i=0; i < size-1; i++) {\n \tnum1 = Long.parseLong(str[i]) + step;\n \tnum2 = Long.parseLong(str[i+1]);\n\n \tif(num1 > num2) {\n \t\tstep = num1 - num2;\n \t\tres += step;\n \t}else {\n \t\tstep = 0;\n \t}\n }\n\n System.out.println(res);\n\n }", "main", "{\n InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);\n BufferedReader in = new BufferedReader(reader);\n long size = Long.parseLong(in.readLine());\n String[] str = in.readLine().split(\" \");\n long num1 = 0;\n long num2 = 0;\n long step = 0;\n long res = 0;\n\n for(int i=0; i < size-1; i++) {\n \tnum1 = Long.parseLong(str[i]) + step;\n \tnum2 = Long.parseLong(str[i+1]);\n\n \tif(num1 > num2) {\n \t\tstep = num1 - num2;\n \t\tres += step;\n \t}else {\n \t\tstep = 0;\n \t}\n }\n\n System.out.println(res);\n\n }", "InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);", "reader", "new InputStreamReader(System.in, StandardCharsets.UTF_8)", "BufferedReader in = new BufferedReader(reader);", "in", "new BufferedReader(reader)", "long size = Long.parseLong(in.readLine());", "size", "Long.parseLong(in.readLine())", "Long.parseLong", "Long", "in.readLine()", "in.readLine", "in", "String[] str = in.readLine().split(\" \");", "str", "in.readLine().split(\" \")", "in.readLine().split", "in.readLine()", "in.readLine", "in", "\" \"", "long num1 = 0;", "num1", "0", "long num2 = 0;", "num2", "0", "long step = 0;", "step", "0", "long res = 0;", "res", "0", "for(int i=0; i < size-1; i++) {\n \tnum1 = Long.parseLong(str[i]) + step;\n \tnum2 = Long.parseLong(str[i+1]);\n\n \tif(num1 > num2) {\n \t\tstep = num1 - num2;\n \t\tres += step;\n \t}else {\n \t\tstep = 0;\n \t}\n }", "int i=0;", "int i=0;", "i", "0", "i < size-1", "i", "size-1", "size", "1", "i++", "i++", "i", "{\n \tnum1 = Long.parseLong(str[i]) + step;\n \tnum2 = Long.parseLong(str[i+1]);\n\n \tif(num1 > num2) {\n \t\tstep = num1 - num2;\n \t\tres += step;\n \t}else {\n \t\tstep = 0;\n \t}\n }", "{\n \tnum1 = Long.parseLong(str[i]) + step;\n \tnum2 = Long.parseLong(str[i+1]);\n\n \tif(num1 > num2) {\n \t\tstep = num1 - num2;\n \t\tres += step;\n \t}else {\n \t\tstep = 0;\n \t}\n }", "num1 = Long.parseLong(str[i]) + step", "num1", "Long.parseLong(str[i]) + step", "Long.parseLong(str[i])", "Long.parseLong", "Long", "str[i]", "str", "i", "step", "num2 = Long.parseLong(str[i+1])", "num2", "Long.parseLong(str[i+1])", "Long.parseLong", "Long", "str[i+1]", "str", "i+1", "i", "1", "if(num1 > num2) {\n \t\tstep = num1 - num2;\n \t\tres += step;\n \t}else {\n \t\tstep = 0;\n \t}", "num1 > num2", "num1", "num2", "{\n \t\tstep = num1 - num2;\n \t\tres += step;\n \t}", "step = num1 - num2", "step", "num1 - num2", "num1", "num2", "res += step", "res", "step", "{\n \t\tstep = 0;\n \t}", "step = 0", "step", "0", "System.out.println(res)", "System.out.println", "System.out", "System", "System.out", "res", "String[] args", "args", "public class Main {\n public static void main(String[] args) throws IOException {\n InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);\n BufferedReader in = new BufferedReader(reader);\n long size = Long.parseLong(in.readLine());\n String[] str = in.readLine().split(\" \");\n long num1 = 0;\n long num2 = 0;\n long step = 0;\n long res = 0;\n\n for(int i=0; i < size-1; i++) {\n \tnum1 = Long.parseLong(str[i]) + step;\n \tnum2 = Long.parseLong(str[i+1]);\n\n \tif(num1 > num2) {\n \t\tstep = num1 - num2;\n \t\tres += step;\n \t}else {\n \t\tstep = 0;\n \t}\n }\n\n System.out.println(res);\n\n }\n}", "public class Main {\n public static void main(String[] args) throws IOException {\n InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);\n BufferedReader in = new BufferedReader(reader);\n long size = Long.parseLong(in.readLine());\n String[] str = in.readLine().split(\" \");\n long num1 = 0;\n long num2 = 0;\n long step = 0;\n long res = 0;\n\n for(int i=0; i < size-1; i++) {\n \tnum1 = Long.parseLong(str[i]) + step;\n \tnum2 = Long.parseLong(str[i+1]);\n\n \tif(num1 > num2) {\n \t\tstep = num1 - num2;\n \t\tres += step;\n \t}else {\n \t\tstep = 0;\n \t}\n }\n\n System.out.println(res);\n\n }\n}", "Main" ]
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; public class Main { public static void main(String[] args) throws IOException { InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8); BufferedReader in = new BufferedReader(reader); long size = Long.parseLong(in.readLine()); String[] str = in.readLine().split(" "); long num1 = 0; long num2 = 0; long step = 0; long res = 0; for(int i=0; i < size-1; i++) { num1 = Long.parseLong(str[i]) + step; num2 = Long.parseLong(str[i+1]); if(num1 > num2) { step = num1 - num2; res += step; }else { step = 0; } } System.out.println(res); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 13, 41, 13, 20, 13, 41, 13, 4, 18, 4, 18, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 18, 13, 2, 13, 17, 18, 13, 13, 30, 41, 13, 2, 18, 13, 2, 13, 17, 18, 13, 13, 0, 13, 13, 0, 18, 13, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 15, 17 ], [ 14, 18 ], [ 18, 19 ], [ 18, 20 ], [ 20, 21 ], [ 21, 22 ], [ 14, 23 ], [ 23, 24 ], [ 23, 25 ], [ 25, 26 ], [ 26, 27 ], [ 25, 28 ], [ 14, 29 ], [ 29, 30 ], [ 29, 31 ], [ 14, 33 ], [ 33, 34 ], [ 33, 35 ], [ 35, 36 ], [ 36, 37 ], [ 37, 38 ], [ 38, 39 ], [ 35, 40 ], [ 14, 41 ], [ 41, 42 ], [ 42, 43 ], [ 43, 44 ], [ 43, 45 ], [ 41, 46 ], [ 46, 47 ], [ 46, 48 ], [ 41, 49 ], [ 49, 50 ], [ 50, 51 ], [ 41, 52 ], [ 53, 53 ], [ 53, 54 ], [ 54, 55 ], [ 55, 56 ], [ 55, 57 ], [ 54, 58 ], [ 58, 59 ], [ 59, 60 ], [ 58, 61 ], [ 61, 62 ], [ 61, 63 ], [ 14, 64 ], [ 64, 65 ], [ 64, 66 ], [ 14, 67 ], [ 67, 68 ], [ 68, 69 ], [ 69, 70 ], [ 69, 71 ], [ 67, 72 ], [ 72, 73 ], [ 72, 74 ], [ 67, 75 ], [ 75, 76 ], [ 76, 77 ], [ 67, 78 ], [ 79, 79 ], [ 79, 80 ], [ 80, 81 ], [ 81, 82 ], [ 82, 83 ], [ 82, 84 ], [ 84, 85 ], [ 84, 86 ], [ 81, 87 ], [ 87, 88 ], [ 87, 89 ], [ 80, 90 ], [ 90, 91 ], [ 91, 92 ], [ 91, 93 ], [ 93, 94 ], [ 94, 95 ], [ 94, 96 ], [ 96, 97 ], [ 96, 98 ], [ 93, 99 ], [ 99, 100 ], [ 99, 101 ], [ 90, 102 ], [ 102, 103 ], [ 102, 104 ], [ 90, 105 ], [ 105, 106 ], [ 106, 107 ], [ 106, 108 ], [ 105, 109 ], [ 14, 110 ], [ 110, 111 ], [ 111, 112 ], [ 112, 113 ], [ 112, 114 ], [ 110, 115 ], [ 12, 116 ], [ 116, 117 ] ]
[ "import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\nclass Main {\n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String n = br.readLine();\n int person = Integer.parseInt(n);\n long[] hi = new long[person];\n String[] str = br.readLine().split(\" \");\n\n for (int i = 0; i < person; i++) {\n hi[i] = Long.parseLong(str[i]);\n }\n\n long sum = 0;\n for (int i = 1; i < person; i++) {\n if (hi[i - 1] > hi[i]) {\n long diff = (hi[i - 1] - hi[i]);\n sum += diff;\n hi[i] += diff;\n }\n }\n System.out.println(sum);\n }\n}", "import java.io.BufferedReader;", "BufferedReader", "java.io", "import java.io.IOException;", "IOException", "java.io", "import java.io.InputStreamReader;", "InputStreamReader", "java.io", "class Main {\n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String n = br.readLine();\n int person = Integer.parseInt(n);\n long[] hi = new long[person];\n String[] str = br.readLine().split(\" \");\n\n for (int i = 0; i < person; i++) {\n hi[i] = Long.parseLong(str[i]);\n }\n\n long sum = 0;\n for (int i = 1; i < person; i++) {\n if (hi[i - 1] > hi[i]) {\n long diff = (hi[i - 1] - hi[i]);\n sum += diff;\n hi[i] += diff;\n }\n }\n System.out.println(sum);\n }\n}", "Main", "public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String n = br.readLine();\n int person = Integer.parseInt(n);\n long[] hi = new long[person];\n String[] str = br.readLine().split(\" \");\n\n for (int i = 0; i < person; i++) {\n hi[i] = Long.parseLong(str[i]);\n }\n\n long sum = 0;\n for (int i = 1; i < person; i++) {\n if (hi[i - 1] > hi[i]) {\n long diff = (hi[i - 1] - hi[i]);\n sum += diff;\n hi[i] += diff;\n }\n }\n System.out.println(sum);\n }", "main", "{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String n = br.readLine();\n int person = Integer.parseInt(n);\n long[] hi = new long[person];\n String[] str = br.readLine().split(\" \");\n\n for (int i = 0; i < person; i++) {\n hi[i] = Long.parseLong(str[i]);\n }\n\n long sum = 0;\n for (int i = 1; i < person; i++) {\n if (hi[i - 1] > hi[i]) {\n long diff = (hi[i - 1] - hi[i]);\n sum += diff;\n hi[i] += diff;\n }\n }\n System.out.println(sum);\n }", "BufferedReader br = new BufferedReader(new InputStreamReader(System.in));", "br", "new BufferedReader(new InputStreamReader(System.in))", "String n = br.readLine();", "n", "br.readLine()", "br.readLine", "br", "int person = Integer.parseInt(n);", "person", "Integer.parseInt(n)", "Integer.parseInt", "Integer", "n", "long[] hi = new long[person];", "hi", "new long[person]", "person", "String[] str = br.readLine().split(\" \");", "str", "br.readLine().split(\" \")", "br.readLine().split", "br.readLine()", "br.readLine", "br", "\" \"", "for (int i = 0; i < person; i++) {\n hi[i] = Long.parseLong(str[i]);\n }", "int i = 0;", "int i = 0;", "i", "0", "i < person", "i", "person", "i++", "i++", "i", "{\n hi[i] = Long.parseLong(str[i]);\n }", "{\n hi[i] = Long.parseLong(str[i]);\n }", "hi[i] = Long.parseLong(str[i])", "hi[i]", "hi", "i", "Long.parseLong(str[i])", "Long.parseLong", "Long", "str[i]", "str", "i", "long sum = 0;", "sum", "0", "for (int i = 1; i < person; i++) {\n if (hi[i - 1] > hi[i]) {\n long diff = (hi[i - 1] - hi[i]);\n sum += diff;\n hi[i] += diff;\n }\n }", "int i = 1;", "int i = 1;", "i", "1", "i < person", "i", "person", "i++", "i++", "i", "{\n if (hi[i - 1] > hi[i]) {\n long diff = (hi[i - 1] - hi[i]);\n sum += diff;\n hi[i] += diff;\n }\n }", "{\n if (hi[i - 1] > hi[i]) {\n long diff = (hi[i - 1] - hi[i]);\n sum += diff;\n hi[i] += diff;\n }\n }", "if (hi[i - 1] > hi[i]) {\n long diff = (hi[i - 1] - hi[i]);\n sum += diff;\n hi[i] += diff;\n }", "hi[i - 1] > hi[i]", "hi[i - 1]", "hi", "i - 1", "i", "1", "hi[i]", "hi", "i", "{\n long diff = (hi[i - 1] - hi[i]);\n sum += diff;\n hi[i] += diff;\n }", "long diff = (hi[i - 1] - hi[i]);", "diff", "(hi[i - 1] - hi[i])", "hi[i - 1]", "hi", "i - 1", "i", "1", "hi[i]", "hi", "i", "sum += diff", "sum", "diff", "hi[i] += diff", "hi[i]", "hi", "i", "diff", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "String[] args", "args" ]
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String n = br.readLine(); int person = Integer.parseInt(n); long[] hi = new long[person]; String[] str = br.readLine().split(" "); for (int i = 0; i < person; i++) { hi[i] = Long.parseLong(str[i]); } long sum = 0; for (int i = 1; i < person; i++) { if (hi[i - 1] > hi[i]) { long diff = (hi[i - 1] - hi[i]); sum += diff; hi[i] += diff; } } System.out.println(sum); } }
[ 7, 15, 13, 17, 6, 13, 41, 13, 20, 12, 13, 30, 41, 13, 4, 18, 13, 41, 13, 17, 41, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 4, 18, 13, 14, 2, 13, 13, 0, 13, 13, 0, 13, 2, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 64, 5 ], [ 64, 6 ], [ 6, 7 ], [ 6, 8 ], [ 64, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 11, 17 ], [ 17, 18 ], [ 17, 19 ], [ 11, 20 ], [ 20, 21 ], [ 11, 22 ], [ 22, 23 ], [ 22, 24 ], [ 11, 25 ], [ 25, 26 ], [ 26, 27 ], [ 27, 28 ], [ 27, 29 ], [ 25, 30 ], [ 30, 31 ], [ 30, 32 ], [ 25, 33 ], [ 33, 34 ], [ 34, 35 ], [ 25, 36 ], [ 37, 37 ], [ 37, 38 ], [ 38, 39 ], [ 38, 40 ], [ 40, 41 ], [ 41, 42 ], [ 37, 43 ], [ 43, 44 ], [ 44, 45 ], [ 44, 46 ], [ 43, 47 ], [ 47, 48 ], [ 47, 49 ], [ 37, 50 ], [ 50, 51 ], [ 50, 52 ], [ 52, 53 ], [ 52, 54 ], [ 11, 55 ], [ 55, 56 ], [ 56, 57 ], [ 57, 58 ], [ 57, 59 ], [ 55, 60 ], [ 9, 61 ], [ 61, 62 ], [ 0, 63 ], [ 63, 64 ], [ 63, 65 ] ]
[ "import java.util.*;\npublic class Main{\n\t\n\t\n\tprivate static Scanner sc=new Scanner(System.in);\n\t\n\tpublic static void main(String []args){\n\t\tlong n=sc.nextInt();\n\t\tlong curMax=0,temp,totalHeight=0;\n\t\tfor(int i=0;i<n;i++){\n\t\t\ttemp=sc.nextInt();\n\t\t\tif(curMax<temp)\n\t\t\t\tcurMax=temp;\n\t\t\ttotalHeight+=(curMax-temp);\n\t\t}\n\t\tSystem.out.println(totalHeight);\n\t}\n}", "import java.util.*;", "util.*", "java", "public class Main{\n\t\n\t\n\tprivate static Scanner sc=new Scanner(System.in);\n\t\n\tpublic static void main(String []args){\n\t\tlong n=sc.nextInt();\n\t\tlong curMax=0,temp,totalHeight=0;\n\t\tfor(int i=0;i<n;i++){\n\t\t\ttemp=sc.nextInt();\n\t\t\tif(curMax<temp)\n\t\t\t\tcurMax=temp;\n\t\t\ttotalHeight+=(curMax-temp);\n\t\t}\n\t\tSystem.out.println(totalHeight);\n\t}\n}", "Main", "private static Scanner sc=new Scanner(System.in);", "sc", "new Scanner(System.in)", "public static void main(String []args){\n\t\tlong n=sc.nextInt();\n\t\tlong curMax=0,temp,totalHeight=0;\n\t\tfor(int i=0;i<n;i++){\n\t\t\ttemp=sc.nextInt();\n\t\t\tif(curMax<temp)\n\t\t\t\tcurMax=temp;\n\t\t\ttotalHeight+=(curMax-temp);\n\t\t}\n\t\tSystem.out.println(totalHeight);\n\t}", "main", "{\n\t\tlong n=sc.nextInt();\n\t\tlong curMax=0,temp,totalHeight=0;\n\t\tfor(int i=0;i<n;i++){\n\t\t\ttemp=sc.nextInt();\n\t\t\tif(curMax<temp)\n\t\t\t\tcurMax=temp;\n\t\t\ttotalHeight+=(curMax-temp);\n\t\t}\n\t\tSystem.out.println(totalHeight);\n\t}", "long n=sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "long curMax=0", "curMax", "0", "temp", "temp", "totalHeight=0;", "totalHeight", "0", "for(int i=0;i<n;i++){\n\t\t\ttemp=sc.nextInt();\n\t\t\tif(curMax<temp)\n\t\t\t\tcurMax=temp;\n\t\t\ttotalHeight+=(curMax-temp);\n\t\t}", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\n\t\t\ttemp=sc.nextInt();\n\t\t\tif(curMax<temp)\n\t\t\t\tcurMax=temp;\n\t\t\ttotalHeight+=(curMax-temp);\n\t\t}", "{\n\t\t\ttemp=sc.nextInt();\n\t\t\tif(curMax<temp)\n\t\t\t\tcurMax=temp;\n\t\t\ttotalHeight+=(curMax-temp);\n\t\t}", "temp=sc.nextInt()", "temp", "sc.nextInt()", "sc.nextInt", "sc", "if(curMax<temp)\n\t\t\t\tcurMax=temp;", "curMax<temp", "curMax", "temp", "curMax=temp", "curMax", "temp", "totalHeight+=(curMax-temp)", "totalHeight", "(curMax-temp)", "curMax", "temp", "System.out.println(totalHeight)", "System.out.println", "System.out", "System", "System.out", "totalHeight", "String []args", "args", "public class Main{\n\t\n\t\n\tprivate static Scanner sc=new Scanner(System.in);\n\t\n\tpublic static void main(String []args){\n\t\tlong n=sc.nextInt();\n\t\tlong curMax=0,temp,totalHeight=0;\n\t\tfor(int i=0;i<n;i++){\n\t\t\ttemp=sc.nextInt();\n\t\t\tif(curMax<temp)\n\t\t\t\tcurMax=temp;\n\t\t\ttotalHeight+=(curMax-temp);\n\t\t}\n\t\tSystem.out.println(totalHeight);\n\t}\n}", "public class Main{\n\t\n\t\n\tprivate static Scanner sc=new Scanner(System.in);\n\t\n\tpublic static void main(String []args){\n\t\tlong n=sc.nextInt();\n\t\tlong curMax=0,temp,totalHeight=0;\n\t\tfor(int i=0;i<n;i++){\n\t\t\ttemp=sc.nextInt();\n\t\t\tif(curMax<temp)\n\t\t\t\tcurMax=temp;\n\t\t\ttotalHeight+=(curMax-temp);\n\t\t}\n\t\tSystem.out.println(totalHeight);\n\t}\n}", "Main" ]
import java.util.*; public class Main{ private static Scanner sc=new Scanner(System.in); public static void main(String []args){ long n=sc.nextInt(); long curMax=0,temp,totalHeight=0; for(int i=0;i<n;i++){ temp=sc.nextInt(); if(curMax<temp) curMax=temp; totalHeight+=(curMax-temp); } System.out.println(totalHeight); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 18, 13, 41, 13, 18, 13, 17, 41, 13, 20, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 13, 18, 13, 13, 30, 0, 13, 4, 18, 13, 4, 18, 13, 2, 13, 18, 13, 13, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 11, 24 ], [ 24, 25 ], [ 25, 26 ], [ 26, 27 ], [ 26, 28 ], [ 24, 29 ], [ 29, 30 ], [ 29, 31 ], [ 24, 32 ], [ 32, 33 ], [ 33, 34 ], [ 24, 35 ], [ 35, 36 ], [ 36, 37 ], [ 37, 38 ], [ 37, 39 ], [ 36, 40 ], [ 40, 41 ], [ 41, 42 ], [ 11, 43 ], [ 43, 44 ], [ 43, 45 ], [ 45, 46 ], [ 45, 47 ], [ 11, 48 ], [ 48, 49 ], [ 48, 50 ], [ 11, 51 ], [ 51, 52 ], [ 52, 53 ], [ 53, 54 ], [ 53, 55 ], [ 51, 56 ], [ 56, 57 ], [ 56, 58 ], [ 51, 59 ], [ 59, 60 ], [ 60, 61 ], [ 51, 62 ], [ 63, 63 ], [ 63, 64 ], [ 64, 65 ], [ 65, 66 ], [ 65, 67 ], [ 67, 68 ], [ 67, 69 ], [ 64, 70 ], [ 70, 71 ], [ 71, 72 ], [ 71, 73 ], [ 73, 74 ], [ 74, 75 ], [ 73, 76 ], [ 76, 77 ], [ 77, 78 ], [ 76, 79 ], [ 79, 80 ], [ 79, 81 ], [ 81, 82 ], [ 81, 83 ], [ 64, 84 ], [ 84, 85 ], [ 85, 86 ], [ 85, 87 ], [ 87, 88 ], [ 87, 89 ], [ 11, 90 ], [ 90, 91 ], [ 91, 92 ], [ 92, 93 ], [ 92, 94 ], [ 90, 95 ], [ 9, 96 ], [ 96, 97 ] ]
[ "import java.math.BigDecimal;\nimport java.util.Scanner;\nclass Main {\n public static void main(final String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int[] a = new int[N];\n\n for(int i=0;i<N;i++)a[i] = sc.nextInt();\n int max=a[0];\n BigDecimal ans =new BigDecimal(0);\n for(int i=1;i<N;i++){\n if(max>a[i]){\n ans = ans.add(BigDecimal.valueOf(max - a[i]));\n }else{\n max = a[i];\n }\n }\n System.out.println(ans);\n }\n}", "import java.math.BigDecimal;", "BigDecimal", "java.math", "import java.util.Scanner;", "Scanner", "java.util", "class Main {\n public static void main(final String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int[] a = new int[N];\n\n for(int i=0;i<N;i++)a[i] = sc.nextInt();\n int max=a[0];\n BigDecimal ans =new BigDecimal(0);\n for(int i=1;i<N;i++){\n if(max>a[i]){\n ans = ans.add(BigDecimal.valueOf(max - a[i]));\n }else{\n max = a[i];\n }\n }\n System.out.println(ans);\n }\n}", "Main", "public static void main(final String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int[] a = new int[N];\n\n for(int i=0;i<N;i++)a[i] = sc.nextInt();\n int max=a[0];\n BigDecimal ans =new BigDecimal(0);\n for(int i=1;i<N;i++){\n if(max>a[i]){\n ans = ans.add(BigDecimal.valueOf(max - a[i]));\n }else{\n max = a[i];\n }\n }\n System.out.println(ans);\n }", "main", "{\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int[] a = new int[N];\n\n for(int i=0;i<N;i++)a[i] = sc.nextInt();\n int max=a[0];\n BigDecimal ans =new BigDecimal(0);\n for(int i=1;i<N;i++){\n if(max>a[i]){\n ans = ans.add(BigDecimal.valueOf(max - a[i]));\n }else{\n max = a[i];\n }\n }\n System.out.println(ans);\n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int N = sc.nextInt();", "N", "sc.nextInt()", "sc.nextInt", "sc", "int[] a = new int[N];", "a", "new int[N]", "N", "for(int i=0;i<N;i++)a[i] = sc.nextInt();", "int i=0;", "int i=0;", "i", "0", "i<N", "i", "N", "i++", "i++", "i", "a[i] = sc.nextInt();", "a[i] = sc.nextInt()", "a[i]", "a", "i", "sc.nextInt()", "sc.nextInt", "sc", "int max=a[0];", "max", "a[0]", "a", "0", "BigDecimal ans =new BigDecimal(0);", "ans", "new BigDecimal(0)", "for(int i=1;i<N;i++){\n if(max>a[i]){\n ans = ans.add(BigDecimal.valueOf(max - a[i]));\n }else{\n max = a[i];\n }\n }", "int i=1;", "int i=1;", "i", "1", "i<N", "i", "N", "i++", "i++", "i", "{\n if(max>a[i]){\n ans = ans.add(BigDecimal.valueOf(max - a[i]));\n }else{\n max = a[i];\n }\n }", "{\n if(max>a[i]){\n ans = ans.add(BigDecimal.valueOf(max - a[i]));\n }else{\n max = a[i];\n }\n }", "if(max>a[i]){\n ans = ans.add(BigDecimal.valueOf(max - a[i]));\n }else{\n max = a[i];\n }", "max>a[i]", "max", "a[i]", "a", "i", "{\n ans = ans.add(BigDecimal.valueOf(max - a[i]));\n }", "ans = ans.add(BigDecimal.valueOf(max - a[i]))", "ans", "ans.add(BigDecimal.valueOf(max - a[i]))", "ans.add", "ans", "BigDecimal.valueOf(max - a[i])", "BigDecimal.valueOf", "BigDecimal", "max - a[i]", "max", "a[i]", "a", "i", "{\n max = a[i];\n }", "max = a[i]", "max", "a[i]", "a", "i", "System.out.println(ans)", "System.out.println", "System.out", "System", "System.out", "ans", "final String[] args", "args" ]
import java.math.BigDecimal; import java.util.Scanner; class Main { public static void main(final String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int[] a = new int[N]; for(int i=0;i<N;i++)a[i] = sc.nextInt(); int max=a[0]; BigDecimal ans =new BigDecimal(0); for(int i=1;i<N;i++){ if(max>a[i]){ ans = ans.add(BigDecimal.valueOf(max - a[i])); }else{ max = a[i]; } } System.out.println(ans); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 41, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 0, 13, 4, 18, 13, 13, 18, 13, 13, 14, 2, 13, 18, 13, 13, 30, 0, 13, 2, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 79, 5 ], [ 79, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 8, 21 ], [ 21, 22 ], [ 21, 23 ], [ 8, 24 ], [ 24, 25 ], [ 24, 26 ], [ 8, 27 ], [ 27, 28 ], [ 28, 29 ], [ 29, 30 ], [ 29, 31 ], [ 27, 32 ], [ 32, 33 ], [ 32, 34 ], [ 27, 35 ], [ 35, 36 ], [ 36, 37 ], [ 27, 38 ], [ 39, 39 ], [ 39, 40 ], [ 40, 41 ], [ 41, 42 ], [ 41, 43 ], [ 40, 44 ], [ 44, 45 ], [ 45, 46 ], [ 39, 47 ], [ 47, 48 ], [ 47, 49 ], [ 49, 50 ], [ 50, 51 ], [ 49, 52 ], [ 49, 53 ], [ 53, 54 ], [ 53, 55 ], [ 39, 56 ], [ 56, 57 ], [ 57, 58 ], [ 57, 59 ], [ 59, 60 ], [ 59, 61 ], [ 56, 62 ], [ 62, 63 ], [ 63, 64 ], [ 63, 65 ], [ 65, 66 ], [ 65, 67 ], [ 67, 68 ], [ 67, 69 ], [ 8, 70 ], [ 70, 71 ], [ 71, 72 ], [ 72, 73 ], [ 72, 74 ], [ 70, 75 ], [ 6, 76 ], [ 76, 77 ], [ 0, 78 ], [ 78, 79 ], [ 78, 80 ] ]
[ "import java.util.Scanner;\n\n\n\tpublic class Main {\n\t\t\n\t\t\n\n\t\tpublic static void main(String[] args) {\n\n\t\t\tScanner sc = new Scanner(System.in);\n\t\t\t\n\t\t\tint n = sc.nextInt();\n\t\t\tlong[] a = new long[n];\n\t\t\tlong max = 0;\n\t\t\tlong ret = 0;\n\t\t\t\n\t\t\tfor(int i=0;i<n;i++) {\n\t\t\t\ta[i] = sc.nextLong();\n\t\t\t\tmax = Math.max(max, a[i]);\n\t\t\t\tif(max>a[i]) {\n\t\t\t\t\tret += (max-a[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(ret);\n\t\t\t\n\t\t\t\n\t }\n\t\t\t\t\n\t}\n\t", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\t\t\n\t\t\n\n\t\tpublic static void main(String[] args) {\n\n\t\t\tScanner sc = new Scanner(System.in);\n\t\t\t\n\t\t\tint n = sc.nextInt();\n\t\t\tlong[] a = new long[n];\n\t\t\tlong max = 0;\n\t\t\tlong ret = 0;\n\t\t\t\n\t\t\tfor(int i=0;i<n;i++) {\n\t\t\t\ta[i] = sc.nextLong();\n\t\t\t\tmax = Math.max(max, a[i]);\n\t\t\t\tif(max>a[i]) {\n\t\t\t\t\tret += (max-a[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(ret);\n\t\t\t\n\t\t\t\n\t }\n\t\t\t\t\n\t}", "Main", "public static void main(String[] args) {\n\n\t\t\tScanner sc = new Scanner(System.in);\n\t\t\t\n\t\t\tint n = sc.nextInt();\n\t\t\tlong[] a = new long[n];\n\t\t\tlong max = 0;\n\t\t\tlong ret = 0;\n\t\t\t\n\t\t\tfor(int i=0;i<n;i++) {\n\t\t\t\ta[i] = sc.nextLong();\n\t\t\t\tmax = Math.max(max, a[i]);\n\t\t\t\tif(max>a[i]) {\n\t\t\t\t\tret += (max-a[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(ret);\n\t\t\t\n\t\t\t\n\t }", "main", "{\n\n\t\t\tScanner sc = new Scanner(System.in);\n\t\t\t\n\t\t\tint n = sc.nextInt();\n\t\t\tlong[] a = new long[n];\n\t\t\tlong max = 0;\n\t\t\tlong ret = 0;\n\t\t\t\n\t\t\tfor(int i=0;i<n;i++) {\n\t\t\t\ta[i] = sc.nextLong();\n\t\t\t\tmax = Math.max(max, a[i]);\n\t\t\t\tif(max>a[i]) {\n\t\t\t\t\tret += (max-a[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(ret);\n\t\t\t\n\t\t\t\n\t }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "long[] a = new long[n];", "a", "new long[n]", "n", "long max = 0;", "max", "0", "long ret = 0;", "ret", "0", "for(int i=0;i<n;i++) {\n\t\t\t\ta[i] = sc.nextLong();\n\t\t\t\tmax = Math.max(max, a[i]);\n\t\t\t\tif(max>a[i]) {\n\t\t\t\t\tret += (max-a[i]);\n\t\t\t\t}\n\t\t\t}", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\n\t\t\t\ta[i] = sc.nextLong();\n\t\t\t\tmax = Math.max(max, a[i]);\n\t\t\t\tif(max>a[i]) {\n\t\t\t\t\tret += (max-a[i]);\n\t\t\t\t}\n\t\t\t}", "{\n\t\t\t\ta[i] = sc.nextLong();\n\t\t\t\tmax = Math.max(max, a[i]);\n\t\t\t\tif(max>a[i]) {\n\t\t\t\t\tret += (max-a[i]);\n\t\t\t\t}\n\t\t\t}", "a[i] = sc.nextLong()", "a[i]", "a", "i", "sc.nextLong()", "sc.nextLong", "sc", "max = Math.max(max, a[i])", "max", "Math.max(max, a[i])", "Math.max", "Math", "max", "a[i]", "a", "i", "if(max>a[i]) {\n\t\t\t\t\tret += (max-a[i]);\n\t\t\t\t}", "max>a[i]", "max", "a[i]", "a", "i", "{\n\t\t\t\t\tret += (max-a[i]);\n\t\t\t\t}", "ret += (max-a[i])", "ret", "(max-a[i])", "max", "a[i]", "a", "i", "System.out.println(ret)", "System.out.println", "System.out", "System", "System.out", "ret", "String[] args", "args", "public class Main {\n\t\t\n\t\t\n\n\t\tpublic static void main(String[] args) {\n\n\t\t\tScanner sc = new Scanner(System.in);\n\t\t\t\n\t\t\tint n = sc.nextInt();\n\t\t\tlong[] a = new long[n];\n\t\t\tlong max = 0;\n\t\t\tlong ret = 0;\n\t\t\t\n\t\t\tfor(int i=0;i<n;i++) {\n\t\t\t\ta[i] = sc.nextLong();\n\t\t\t\tmax = Math.max(max, a[i]);\n\t\t\t\tif(max>a[i]) {\n\t\t\t\t\tret += (max-a[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(ret);\n\t\t\t\n\t\t\t\n\t }\n\t\t\t\t\n\t}", "public class Main {\n\t\t\n\t\t\n\n\t\tpublic static void main(String[] args) {\n\n\t\t\tScanner sc = new Scanner(System.in);\n\t\t\t\n\t\t\tint n = sc.nextInt();\n\t\t\tlong[] a = new long[n];\n\t\t\tlong max = 0;\n\t\t\tlong ret = 0;\n\t\t\t\n\t\t\tfor(int i=0;i<n;i++) {\n\t\t\t\ta[i] = sc.nextLong();\n\t\t\t\tmax = Math.max(max, a[i]);\n\t\t\t\tif(max>a[i]) {\n\t\t\t\t\tret += (max-a[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(ret);\n\t\t\t\n\t\t\t\n\t }\n\t\t\t\t\n\t}", "Main" ]
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long[] a = new long[n]; long max = 0; long ret = 0; for(int i=0;i<n;i++) { a[i] = sc.nextLong(); max = Math.max(max, a[i]); if(max>a[i]) { ret += (max-a[i]); } } System.out.println(ret); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 41, 13, 17, 41, 13, 17, 41, 13, 17, 42, 2, 13, 13, 30, 14, 2, 18, 13, 13, 18, 13, 13, 30, 0, 13, 2, 18, 13, 13, 18, 13, 13, 30, 0, 13, 13, 40, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 88, 5 ], [ 88, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 8, 21 ], [ 21, 22 ], [ 22, 23 ], [ 23, 24 ], [ 23, 25 ], [ 21, 26 ], [ 26, 27 ], [ 26, 28 ], [ 21, 29 ], [ 29, 30 ], [ 30, 31 ], [ 21, 32 ], [ 33, 33 ], [ 33, 34 ], [ 34, 35 ], [ 35, 36 ], [ 35, 37 ], [ 34, 38 ], [ 38, 39 ], [ 39, 40 ], [ 8, 41 ], [ 41, 42 ], [ 41, 43 ], [ 8, 44 ], [ 44, 45 ], [ 44, 46 ], [ 8, 47 ], [ 47, 48 ], [ 47, 49 ], [ 8, 50 ], [ 50, 51 ], [ 51, 52 ], [ 51, 53 ], [ 50, 54 ], [ 54, 55 ], [ 55, 56 ], [ 56, 57 ], [ 57, 58 ], [ 57, 59 ], [ 56, 60 ], [ 60, 61 ], [ 60, 62 ], [ 55, 63 ], [ 63, 64 ], [ 64, 65 ], [ 64, 66 ], [ 66, 67 ], [ 67, 68 ], [ 67, 69 ], [ 66, 70 ], [ 70, 71 ], [ 70, 72 ], [ 55, 73 ], [ 73, 74 ], [ 74, 75 ], [ 74, 76 ], [ 54, 77 ], [ 77, 78 ], [ 8, 79 ], [ 79, 80 ], [ 80, 81 ], [ 81, 82 ], [ 81, 83 ], [ 79, 84 ], [ 6, 85 ], [ 85, 86 ], [ 0, 87 ], [ 87, 88 ], [ 87, 89 ] ]
[ "import java.util.*;\npublic class Main{\n public static void main(String args[]){\n \tScanner sc=new Scanner(System.in);\n int n=sc.nextInt();\n long arr[]=new long[n];\n for(int i=0;i<n;i++){\n \tarr[i]=sc.nextLong();\n }\n int i=0,start=0;\n long count=0;\n while(i<n){\n \tif(arr[start]>=arr[i]){\n count+=arr[start]-arr[i];\n }\n else{\n \tstart=i;\n }\n i++;\n }\n System.out.println(count);\n }\n}", "import java.util.*;", "util.*", "java", "public class Main{\n public static void main(String args[]){\n \tScanner sc=new Scanner(System.in);\n int n=sc.nextInt();\n long arr[]=new long[n];\n for(int i=0;i<n;i++){\n \tarr[i]=sc.nextLong();\n }\n int i=0,start=0;\n long count=0;\n while(i<n){\n \tif(arr[start]>=arr[i]){\n count+=arr[start]-arr[i];\n }\n else{\n \tstart=i;\n }\n i++;\n }\n System.out.println(count);\n }\n}", "Main", "public static void main(String args[]){\n \tScanner sc=new Scanner(System.in);\n int n=sc.nextInt();\n long arr[]=new long[n];\n for(int i=0;i<n;i++){\n \tarr[i]=sc.nextLong();\n }\n int i=0,start=0;\n long count=0;\n while(i<n){\n \tif(arr[start]>=arr[i]){\n count+=arr[start]-arr[i];\n }\n else{\n \tstart=i;\n }\n i++;\n }\n System.out.println(count);\n }", "main", "{\n \tScanner sc=new Scanner(System.in);\n int n=sc.nextInt();\n long arr[]=new long[n];\n for(int i=0;i<n;i++){\n \tarr[i]=sc.nextLong();\n }\n int i=0,start=0;\n long count=0;\n while(i<n){\n \tif(arr[start]>=arr[i]){\n count+=arr[start]-arr[i];\n }\n else{\n \tstart=i;\n }\n i++;\n }\n System.out.println(count);\n }", "Scanner sc=new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n=sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "long arr[]=new long[n];", "arr", "new long[n]", "n", "for(int i=0;i<n;i++){\n \tarr[i]=sc.nextLong();\n }", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\n \tarr[i]=sc.nextLong();\n }", "{\n \tarr[i]=sc.nextLong();\n }", "arr[i]=sc.nextLong()", "arr[i]", "arr", "i", "sc.nextLong()", "sc.nextLong", "sc", "int i=0", "i", "0", "start=0;", "start", "0", "long count=0;", "count", "0", "while(i<n){\n \tif(arr[start]>=arr[i]){\n count+=arr[start]-arr[i];\n }\n else{\n \tstart=i;\n }\n i++;\n }", "i<n", "i", "n", "{\n \tif(arr[start]>=arr[i]){\n count+=arr[start]-arr[i];\n }\n else{\n \tstart=i;\n }\n i++;\n }", "if(arr[start]>=arr[i]){\n count+=arr[start]-arr[i];\n }\n else{\n \tstart=i;\n }", "arr[start]>=arr[i]", "arr[start]", "arr", "start", "arr[i]", "arr", "i", "{\n count+=arr[start]-arr[i];\n }", "count+=arr[start]-arr[i]", "count", "arr[start]-arr[i]", "arr[start]", "arr", "start", "arr[i]", "arr", "i", "{\n \tstart=i;\n }", "start=i", "start", "i", "i++", "i", "System.out.println(count)", "System.out.println", "System.out", "System", "System.out", "count", "String args[]", "args", "public class Main{\n public static void main(String args[]){\n \tScanner sc=new Scanner(System.in);\n int n=sc.nextInt();\n long arr[]=new long[n];\n for(int i=0;i<n;i++){\n \tarr[i]=sc.nextLong();\n }\n int i=0,start=0;\n long count=0;\n while(i<n){\n \tif(arr[start]>=arr[i]){\n count+=arr[start]-arr[i];\n }\n else{\n \tstart=i;\n }\n i++;\n }\n System.out.println(count);\n }\n}", "public class Main{\n public static void main(String args[]){\n \tScanner sc=new Scanner(System.in);\n int n=sc.nextInt();\n long arr[]=new long[n];\n for(int i=0;i<n;i++){\n \tarr[i]=sc.nextLong();\n }\n int i=0,start=0;\n long count=0;\n while(i<n){\n \tif(arr[start]>=arr[i]){\n count+=arr[start]-arr[i];\n }\n else{\n \tstart=i;\n }\n i++;\n }\n System.out.println(count);\n }\n}", "Main" ]
import java.util.*; public class Main{ public static void main(String args[]){ Scanner sc=new Scanner(System.in); int n=sc.nextInt(); long arr[]=new long[n]; for(int i=0;i<n;i++){ arr[i]=sc.nextLong(); } int i=0,start=0; long count=0; while(i<n){ if(arr[start]>=arr[i]){ count+=arr[start]-arr[i]; } else{ start=i; } i++; } System.out.println(count); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 41, 13, 4, 18, 13, 14, 2, 13, 13, 30, 0, 13, 2, 13, 2, 13, 13, 30, 0, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 66, 5 ], [ 66, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 8, 20 ], [ 20, 21 ], [ 20, 22 ], [ 8, 23 ], [ 23, 24 ], [ 24, 25 ], [ 25, 26 ], [ 25, 27 ], [ 23, 28 ], [ 28, 29 ], [ 28, 30 ], [ 23, 31 ], [ 31, 32 ], [ 32, 33 ], [ 23, 34 ], [ 35, 35 ], [ 35, 36 ], [ 36, 37 ], [ 36, 38 ], [ 38, 39 ], [ 39, 40 ], [ 35, 41 ], [ 41, 42 ], [ 42, 43 ], [ 42, 44 ], [ 41, 45 ], [ 45, 46 ], [ 46, 47 ], [ 46, 48 ], [ 48, 49 ], [ 48, 50 ], [ 50, 51 ], [ 50, 52 ], [ 41, 53 ], [ 53, 54 ], [ 54, 55 ], [ 54, 56 ], [ 8, 57 ], [ 57, 58 ], [ 58, 59 ], [ 59, 60 ], [ 59, 61 ], [ 57, 62 ], [ 6, 63 ], [ 63, 64 ], [ 0, 65 ], [ 65, 66 ], [ 65, 67 ] ]
[ "import java.util.*;\npublic class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\t// 整数の入力(スペース改行関係なし)\n\t\tint n = sc.nextInt();\n long soukei = 0;\n \tint amae = 0;\n\n \tfor(int i = 0 ; i < n ; i++){\n \tint a = sc.nextInt();\n \tif(a < amae){\n \tsoukei = soukei + (amae-a);\n }else{\n \tamae = a;\n }\n \t\n }\n\n\t\tSystem.out.println(soukei);\n\n\t\t\n\t}\n}", "import java.util.*;", "util.*", "java", "public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\t// 整数の入力(スペース改行関係なし)\n\t\tint n = sc.nextInt();\n long soukei = 0;\n \tint amae = 0;\n\n \tfor(int i = 0 ; i < n ; i++){\n \tint a = sc.nextInt();\n \tif(a < amae){\n \tsoukei = soukei + (amae-a);\n }else{\n \tamae = a;\n }\n \t\n }\n\n\t\tSystem.out.println(soukei);\n\n\t\t\n\t}\n}", "Main", "public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\t// 整数の入力(スペース改行関係なし)\n\t\tint n = sc.nextInt();\n long soukei = 0;\n \tint amae = 0;\n\n \tfor(int i = 0 ; i < n ; i++){\n \tint a = sc.nextInt();\n \tif(a < amae){\n \tsoukei = soukei + (amae-a);\n }else{\n \tamae = a;\n }\n \t\n }\n\n\t\tSystem.out.println(soukei);\n\n\t\t\n\t}", "main", "{\n\t\tScanner sc = new Scanner(System.in);\n\t\t// 整数の入力(スペース改行関係なし)\n\t\tint n = sc.nextInt();\n long soukei = 0;\n \tint amae = 0;\n\n \tfor(int i = 0 ; i < n ; i++){\n \tint a = sc.nextInt();\n \tif(a < amae){\n \tsoukei = soukei + (amae-a);\n }else{\n \tamae = a;\n }\n \t\n }\n\n\t\tSystem.out.println(soukei);\n\n\t\t\n\t}", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "long soukei = 0;", "soukei", "0", "int amae = 0;", "amae", "0", "for(int i = 0 ; i < n ; i++){\n \tint a = sc.nextInt();\n \tif(a < amae){\n \tsoukei = soukei + (amae-a);\n }else{\n \tamae = a;\n }\n \t\n }", "int i = 0 ;", "int i = 0 ;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n \tint a = sc.nextInt();\n \tif(a < amae){\n \tsoukei = soukei + (amae-a);\n }else{\n \tamae = a;\n }\n \t\n }", "{\n \tint a = sc.nextInt();\n \tif(a < amae){\n \tsoukei = soukei + (amae-a);\n }else{\n \tamae = a;\n }\n \t\n }", "int a = sc.nextInt();", "a", "sc.nextInt()", "sc.nextInt", "sc", "if(a < amae){\n \tsoukei = soukei + (amae-a);\n }else{\n \tamae = a;\n }", "a < amae", "a", "amae", "{\n \tsoukei = soukei + (amae-a);\n }", "soukei = soukei + (amae-a)", "soukei", "soukei + (amae-a)", "soukei", "(amae-a)", "amae", "a", "{\n \tamae = a;\n }", "amae = a", "amae", "a", "System.out.println(soukei)", "System.out.println", "System.out", "System", "System.out", "soukei", "String[] args", "args", "public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\t// 整数の入力(スペース改行関係なし)\n\t\tint n = sc.nextInt();\n long soukei = 0;\n \tint amae = 0;\n\n \tfor(int i = 0 ; i < n ; i++){\n \tint a = sc.nextInt();\n \tif(a < amae){\n \tsoukei = soukei + (amae-a);\n }else{\n \tamae = a;\n }\n \t\n }\n\n\t\tSystem.out.println(soukei);\n\n\t\t\n\t}\n}", "public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\t// 整数の入力(スペース改行関係なし)\n\t\tint n = sc.nextInt();\n long soukei = 0;\n \tint amae = 0;\n\n \tfor(int i = 0 ; i < n ; i++){\n \tint a = sc.nextInt();\n \tif(a < amae){\n \tsoukei = soukei + (amae-a);\n }else{\n \tamae = a;\n }\n \t\n }\n\n\t\tSystem.out.println(soukei);\n\n\t\t\n\t}\n}", "Main" ]
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); // 整数の入力(スペース改行関係なし) int n = sc.nextInt(); long soukei = 0; int amae = 0; for(int i = 0 ; i < n ; i++){ int a = sc.nextInt(); if(a < amae){ soukei = soukei + (amae-a); }else{ amae = a; } } System.out.println(soukei); } }
[ 7, 15, 13, 17, 6, 13, 41, 13, 12, 13, 30, 0, 13, 20, 41, 13, 4, 18, 13, 4, 18, 13, 41, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 41, 13, 4, 18, 13, 4, 18, 13, 14, 2, 13, 13, 30, 0, 13, 13, 30, 0, 13, 2, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 72, 5 ], [ 72, 6 ], [ 6, 7 ], [ 72, 8 ], [ 8, 9 ], [ 8, 10 ], [ 10, 11 ], [ 11, 12 ], [ 11, 13 ], [ 10, 14 ], [ 14, 15 ], [ 14, 16 ], [ 16, 17 ], [ 17, 18 ], [ 16, 19 ], [ 19, 20 ], [ 20, 21 ], [ 10, 22 ], [ 22, 23 ], [ 22, 24 ], [ 10, 25 ], [ 25, 26 ], [ 25, 27 ], [ 10, 28 ], [ 28, 29 ], [ 29, 30 ], [ 30, 31 ], [ 30, 32 ], [ 28, 33 ], [ 33, 34 ], [ 33, 35 ], [ 28, 36 ], [ 36, 37 ], [ 37, 38 ], [ 28, 39 ], [ 40, 40 ], [ 40, 41 ], [ 41, 42 ], [ 41, 43 ], [ 43, 44 ], [ 44, 45 ], [ 43, 46 ], [ 46, 47 ], [ 47, 48 ], [ 40, 49 ], [ 49, 50 ], [ 50, 51 ], [ 50, 52 ], [ 49, 53 ], [ 53, 54 ], [ 54, 55 ], [ 54, 56 ], [ 49, 57 ], [ 57, 58 ], [ 58, 59 ], [ 58, 60 ], [ 60, 61 ], [ 60, 62 ], [ 10, 63 ], [ 63, 64 ], [ 64, 65 ], [ 65, 66 ], [ 65, 67 ], [ 63, 68 ], [ 8, 69 ], [ 69, 70 ], [ 0, 71 ], [ 71, 72 ], [ 71, 73 ] ]
[ "import java.util.Scanner;\n\npublic class Main {\n\tprivate static Scanner sc;\n\n\tpublic static void main(String[] args) {\n\t\tsc = new Scanner(System.in);\n\t\tint n = Integer.parseInt(sc.next());\n\t\tlong result = 0;\n\t\tlong nowHighestLength = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tlong numberILength = Long.parseLong(sc.next());\n\t\t\tif (nowHighestLength < numberILength) {\n\t\t\t\tnowHighestLength = numberILength;\n\t\t\t} else {\n\t\t\t\tresult += nowHighestLength - numberILength;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(result);\n\t\t\n\t\t\n\t}\t\n\n}", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\tprivate static Scanner sc;\n\n\tpublic static void main(String[] args) {\n\t\tsc = new Scanner(System.in);\n\t\tint n = Integer.parseInt(sc.next());\n\t\tlong result = 0;\n\t\tlong nowHighestLength = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tlong numberILength = Long.parseLong(sc.next());\n\t\t\tif (nowHighestLength < numberILength) {\n\t\t\t\tnowHighestLength = numberILength;\n\t\t\t} else {\n\t\t\t\tresult += nowHighestLength - numberILength;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(result);\n\t\t\n\t\t\n\t}\t\n\n}", "Main", "private static Scanner sc;", "sc", "public static void main(String[] args) {\n\t\tsc = new Scanner(System.in);\n\t\tint n = Integer.parseInt(sc.next());\n\t\tlong result = 0;\n\t\tlong nowHighestLength = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tlong numberILength = Long.parseLong(sc.next());\n\t\t\tif (nowHighestLength < numberILength) {\n\t\t\t\tnowHighestLength = numberILength;\n\t\t\t} else {\n\t\t\t\tresult += nowHighestLength - numberILength;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(result);\n\t\t\n\t\t\n\t}", "main", "{\n\t\tsc = new Scanner(System.in);\n\t\tint n = Integer.parseInt(sc.next());\n\t\tlong result = 0;\n\t\tlong nowHighestLength = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tlong numberILength = Long.parseLong(sc.next());\n\t\t\tif (nowHighestLength < numberILength) {\n\t\t\t\tnowHighestLength = numberILength;\n\t\t\t} else {\n\t\t\t\tresult += nowHighestLength - numberILength;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(result);\n\t\t\n\t\t\n\t}", "sc = new Scanner(System.in)", "sc", "new Scanner(System.in)", "int n = Integer.parseInt(sc.next());", "n", "Integer.parseInt(sc.next())", "Integer.parseInt", "Integer", "sc.next()", "sc.next", "sc", "long result = 0;", "result", "0", "long nowHighestLength = 0;", "nowHighestLength", "0", "for (int i = 0; i < n; i++) {\n\t\t\tlong numberILength = Long.parseLong(sc.next());\n\t\t\tif (nowHighestLength < numberILength) {\n\t\t\t\tnowHighestLength = numberILength;\n\t\t\t} else {\n\t\t\t\tresult += nowHighestLength - numberILength;\n\t\t\t}\n\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n\t\t\tlong numberILength = Long.parseLong(sc.next());\n\t\t\tif (nowHighestLength < numberILength) {\n\t\t\t\tnowHighestLength = numberILength;\n\t\t\t} else {\n\t\t\t\tresult += nowHighestLength - numberILength;\n\t\t\t}\n\t\t}", "{\n\t\t\tlong numberILength = Long.parseLong(sc.next());\n\t\t\tif (nowHighestLength < numberILength) {\n\t\t\t\tnowHighestLength = numberILength;\n\t\t\t} else {\n\t\t\t\tresult += nowHighestLength - numberILength;\n\t\t\t}\n\t\t}", "long numberILength = Long.parseLong(sc.next());", "numberILength", "Long.parseLong(sc.next())", "Long.parseLong", "Long", "sc.next()", "sc.next", "sc", "if (nowHighestLength < numberILength) {\n\t\t\t\tnowHighestLength = numberILength;\n\t\t\t} else {\n\t\t\t\tresult += nowHighestLength - numberILength;\n\t\t\t}", "nowHighestLength < numberILength", "nowHighestLength", "numberILength", "{\n\t\t\t\tnowHighestLength = numberILength;\n\t\t\t}", "nowHighestLength = numberILength", "nowHighestLength", "numberILength", "{\n\t\t\t\tresult += nowHighestLength - numberILength;\n\t\t\t}", "result += nowHighestLength - numberILength", "result", "nowHighestLength - numberILength", "nowHighestLength", "numberILength", "System.out.println(result)", "System.out.println", "System.out", "System", "System.out", "result", "String[] args", "args", "public class Main {\n\tprivate static Scanner sc;\n\n\tpublic static void main(String[] args) {\n\t\tsc = new Scanner(System.in);\n\t\tint n = Integer.parseInt(sc.next());\n\t\tlong result = 0;\n\t\tlong nowHighestLength = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tlong numberILength = Long.parseLong(sc.next());\n\t\t\tif (nowHighestLength < numberILength) {\n\t\t\t\tnowHighestLength = numberILength;\n\t\t\t} else {\n\t\t\t\tresult += nowHighestLength - numberILength;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(result);\n\t\t\n\t\t\n\t}\t\n\n}", "public class Main {\n\tprivate static Scanner sc;\n\n\tpublic static void main(String[] args) {\n\t\tsc = new Scanner(System.in);\n\t\tint n = Integer.parseInt(sc.next());\n\t\tlong result = 0;\n\t\tlong nowHighestLength = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tlong numberILength = Long.parseLong(sc.next());\n\t\t\tif (nowHighestLength < numberILength) {\n\t\t\t\tnowHighestLength = numberILength;\n\t\t\t} else {\n\t\t\t\tresult += nowHighestLength - numberILength;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(result);\n\t\t\n\t\t\n\t}\t\n\n}", "Main" ]
import java.util.Scanner; public class Main { private static Scanner sc; public static void main(String[] args) { sc = new Scanner(System.in); int n = Integer.parseInt(sc.next()); long result = 0; long nowHighestLength = 0; for (int i = 0; i < n; i++) { long numberILength = Long.parseLong(sc.next()); if (nowHighestLength < numberILength) { nowHighestLength = numberILength; } else { result += nowHighestLength - numberILength; } } System.out.println(result); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 4, 13, 18, 13, 13, 18, 13, 13, 23, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 41, 13, 20, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 14, 2, 18, 13, 13, 13, 30, 0, 13, 18, 13, 13, 0, 18, 13, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 2, 18, 13, 13, 18, 13, 13, 4, 18, 13, 13, 23, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 13, 14 ], [ 13, 15 ], [ 0, 16 ], [ 16, 17 ], [ 16, 18 ], [ 0, 19 ], [ 19, 20 ], [ 19, 21 ], [ 0, 22 ], [ 130, 23 ], [ 130, 24 ], [ 24, 25 ], [ 24, 26 ], [ 26, 27 ], [ 27, 28 ], [ 27, 29 ], [ 29, 30 ], [ 29, 31 ], [ 27, 32 ], [ 32, 33 ], [ 32, 34 ], [ 24, 35 ], [ 35, 36 ], [ 130, 37 ], [ 37, 38 ], [ 37, 39 ], [ 39, 40 ], [ 40, 41 ], [ 40, 42 ], [ 39, 43 ], [ 43, 44 ], [ 43, 45 ], [ 45, 46 ], [ 46, 47 ], [ 39, 48 ], [ 48, 49 ], [ 48, 50 ], [ 39, 52 ], [ 52, 53 ], [ 52, 54 ], [ 39, 56 ], [ 56, 57 ], [ 56, 58 ], [ 39, 59 ], [ 59, 60 ], [ 60, 61 ], [ 61, 62 ], [ 61, 63 ], [ 59, 64 ], [ 64, 65 ], [ 64, 66 ], [ 59, 67 ], [ 67, 68 ], [ 68, 69 ], [ 59, 70 ], [ 71, 71 ], [ 71, 72 ], [ 72, 73 ], [ 73, 74 ], [ 73, 75 ], [ 72, 76 ], [ 76, 77 ], [ 77, 78 ], [ 71, 79 ], [ 79, 80 ], [ 80, 81 ], [ 81, 82 ], [ 81, 83 ], [ 80, 84 ], [ 79, 85 ], [ 85, 86 ], [ 86, 87 ], [ 86, 88 ], [ 88, 89 ], [ 88, 90 ], [ 71, 91 ], [ 91, 92 ], [ 92, 93 ], [ 92, 94 ], [ 91, 95 ], [ 39, 96 ], [ 96, 97 ], [ 96, 98 ], [ 39, 99 ], [ 99, 100 ], [ 100, 101 ], [ 101, 102 ], [ 101, 103 ], [ 99, 104 ], [ 104, 105 ], [ 104, 106 ], [ 99, 107 ], [ 107, 108 ], [ 108, 109 ], [ 99, 110 ], [ 111, 111 ], [ 111, 112 ], [ 112, 113 ], [ 112, 114 ], [ 114, 115 ], [ 115, 116 ], [ 115, 117 ], [ 114, 118 ], [ 118, 119 ], [ 118, 120 ], [ 39, 121 ], [ 121, 122 ], [ 122, 123 ], [ 121, 124 ], [ 37, 125 ], [ 125, 126 ], [ 37, 127 ], [ 127, 128 ], [ 0, 129 ], [ 129, 130 ], [ 129, 131 ] ]
[ "\nimport java.io.InputStream;\nimport java.io.PrintStream;\nimport java.math.BigDecimal;\nimport java.util.HashMap;\nimport java.util.HashSet;\nimport java.util.Scanner;\nimport java.util.Set;\n\npublic class Main {\n public static void main(String[] args) throws Exception {\n solve(System.in, System.out);\n }\n\n static void solve(InputStream is, PrintStream os) {\n // Your code here!\n Scanner scan = new Scanner(is);\n int N = scan.nextInt();\n int A[] = new int[N];\n int maxA[] = new int[N];\n\n int max = 0;\n\n for(int i = 0; i < N; i++) {\n A[i] = scan.nextInt();\n if(A[i] > max){\n max = A[i];\n }\n maxA[i] = max;\n }\n\n long ans = 0;\n\n for(int i = 0; i < N; i++) {\n ans += maxA[i] - A[i];\n }\n\n os.println(ans);\n }\n}", "import java.io.InputStream;", "InputStream", "java.io", "import java.io.PrintStream;", "PrintStream", "java.io", "import java.math.BigDecimal;", "BigDecimal", "java.math", "import java.util.HashMap;", "HashMap", "java.util", "import java.util.HashSet;", "HashSet", "java.util", "import java.util.Scanner;", "Scanner", "java.util", "import java.util.Set;", "Set", "java.util", "public class Main {\n public static void main(String[] args) throws Exception {\n solve(System.in, System.out);\n }\n\n static void solve(InputStream is, PrintStream os) {\n // Your code here!\n Scanner scan = new Scanner(is);\n int N = scan.nextInt();\n int A[] = new int[N];\n int maxA[] = new int[N];\n\n int max = 0;\n\n for(int i = 0; i < N; i++) {\n A[i] = scan.nextInt();\n if(A[i] > max){\n max = A[i];\n }\n maxA[i] = max;\n }\n\n long ans = 0;\n\n for(int i = 0; i < N; i++) {\n ans += maxA[i] - A[i];\n }\n\n os.println(ans);\n }\n}", "Main", "public static void main(String[] args) throws Exception {\n solve(System.in, System.out);\n }", "main", "{\n solve(System.in, System.out);\n }", "solve(System.in, System.out)", "solve", "System.in", "System", "System.in", "System.out", "System", "System.out", "String[] args", "args", "static void solve(InputStream is, PrintStream os) {\n // Your code here!\n Scanner scan = new Scanner(is);\n int N = scan.nextInt();\n int A[] = new int[N];\n int maxA[] = new int[N];\n\n int max = 0;\n\n for(int i = 0; i < N; i++) {\n A[i] = scan.nextInt();\n if(A[i] > max){\n max = A[i];\n }\n maxA[i] = max;\n }\n\n long ans = 0;\n\n for(int i = 0; i < N; i++) {\n ans += maxA[i] - A[i];\n }\n\n os.println(ans);\n }", "solve", "{\n // Your code here!\n Scanner scan = new Scanner(is);\n int N = scan.nextInt();\n int A[] = new int[N];\n int maxA[] = new int[N];\n\n int max = 0;\n\n for(int i = 0; i < N; i++) {\n A[i] = scan.nextInt();\n if(A[i] > max){\n max = A[i];\n }\n maxA[i] = max;\n }\n\n long ans = 0;\n\n for(int i = 0; i < N; i++) {\n ans += maxA[i] - A[i];\n }\n\n os.println(ans);\n }", "Scanner scan = new Scanner(is);", "scan", "new Scanner(is)", "int N = scan.nextInt();", "N", "scan.nextInt()", "scan.nextInt", "scan", "int A[] = new int[N];", "A", "new int[N]", "N", "int maxA[] = new int[N];", "maxA", "new int[N]", "N", "int max = 0;", "max", "0", "for(int i = 0; i < N; i++) {\n A[i] = scan.nextInt();\n if(A[i] > max){\n max = A[i];\n }\n maxA[i] = max;\n }", "int i = 0;", "int i = 0;", "i", "0", "i < N", "i", "N", "i++", "i++", "i", "{\n A[i] = scan.nextInt();\n if(A[i] > max){\n max = A[i];\n }\n maxA[i] = max;\n }", "{\n A[i] = scan.nextInt();\n if(A[i] > max){\n max = A[i];\n }\n maxA[i] = max;\n }", "A[i] = scan.nextInt()", "A[i]", "A", "i", "scan.nextInt()", "scan.nextInt", "scan", "if(A[i] > max){\n max = A[i];\n }", "A[i] > max", "A[i]", "A", "i", "max", "{\n max = A[i];\n }", "max = A[i]", "max", "A[i]", "A", "i", "maxA[i] = max", "maxA[i]", "maxA", "i", "max", "long ans = 0;", "ans", "0", "for(int i = 0; i < N; i++) {\n ans += maxA[i] - A[i];\n }", "int i = 0;", "int i = 0;", "i", "0", "i < N", "i", "N", "i++", "i++", "i", "{\n ans += maxA[i] - A[i];\n }", "{\n ans += maxA[i] - A[i];\n }", "ans += maxA[i] - A[i]", "ans", "maxA[i] - A[i]", "maxA[i]", "maxA", "i", "A[i]", "A", "i", "os.println(ans)", "os.println", "os", "ans", "InputStream is", "is", "PrintStream os", "os", "public class Main {\n public static void main(String[] args) throws Exception {\n solve(System.in, System.out);\n }\n\n static void solve(InputStream is, PrintStream os) {\n // Your code here!\n Scanner scan = new Scanner(is);\n int N = scan.nextInt();\n int A[] = new int[N];\n int maxA[] = new int[N];\n\n int max = 0;\n\n for(int i = 0; i < N; i++) {\n A[i] = scan.nextInt();\n if(A[i] > max){\n max = A[i];\n }\n maxA[i] = max;\n }\n\n long ans = 0;\n\n for(int i = 0; i < N; i++) {\n ans += maxA[i] - A[i];\n }\n\n os.println(ans);\n }\n}", "public class Main {\n public static void main(String[] args) throws Exception {\n solve(System.in, System.out);\n }\n\n static void solve(InputStream is, PrintStream os) {\n // Your code here!\n Scanner scan = new Scanner(is);\n int N = scan.nextInt();\n int A[] = new int[N];\n int maxA[] = new int[N];\n\n int max = 0;\n\n for(int i = 0; i < N; i++) {\n A[i] = scan.nextInt();\n if(A[i] > max){\n max = A[i];\n }\n maxA[i] = max;\n }\n\n long ans = 0;\n\n for(int i = 0; i < N; i++) {\n ans += maxA[i] - A[i];\n }\n\n os.println(ans);\n }\n}", "Main" ]
import java.io.InputStream; import java.io.PrintStream; import java.math.BigDecimal; import java.util.HashMap; import java.util.HashSet; import java.util.Scanner; import java.util.Set; public class Main { public static void main(String[] args) throws Exception { solve(System.in, System.out); } static void solve(InputStream is, PrintStream os) { // Your code here! Scanner scan = new Scanner(is); int N = scan.nextInt(); int A[] = new int[N]; int maxA[] = new int[N]; int max = 0; for(int i = 0; i < N; i++) { A[i] = scan.nextInt(); if(A[i] > max){ max = A[i]; } maxA[i] = max; } long ans = 0; for(int i = 0; i < N; i++) { ans += maxA[i] - A[i]; } os.println(ans); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 41, 13, 17, 41, 13, 18, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 18, 13, 13, 13, 0, 13, 2, 13, 18, 13, 13, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 91, 5 ], [ 91, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 8, 21 ], [ 21, 22 ], [ 22, 23 ], [ 23, 24 ], [ 23, 25 ], [ 21, 26 ], [ 26, 27 ], [ 26, 28 ], [ 21, 29 ], [ 29, 30 ], [ 30, 31 ], [ 21, 32 ], [ 32, 33 ], [ 33, 34 ], [ 34, 35 ], [ 34, 36 ], [ 33, 37 ], [ 37, 38 ], [ 38, 39 ], [ 8, 40 ], [ 40, 41 ], [ 41, 42 ], [ 8, 43 ], [ 43, 44 ], [ 43, 45 ], [ 8, 46 ], [ 46, 47 ], [ 46, 48 ], [ 48, 49 ], [ 48, 50 ], [ 8, 51 ], [ 51, 52 ], [ 52, 53 ], [ 53, 54 ], [ 53, 55 ], [ 51, 56 ], [ 56, 57 ], [ 56, 58 ], [ 51, 59 ], [ 59, 60 ], [ 60, 61 ], [ 51, 62 ], [ 63, 63 ], [ 63, 64 ], [ 64, 65 ], [ 65, 66 ], [ 66, 67 ], [ 66, 68 ], [ 65, 69 ], [ 64, 70 ], [ 70, 71 ], [ 70, 72 ], [ 72, 73 ], [ 72, 74 ], [ 74, 75 ], [ 74, 76 ], [ 64, 77 ], [ 77, 78 ], [ 77, 79 ], [ 79, 80 ], [ 79, 81 ], [ 8, 82 ], [ 82, 83 ], [ 83, 84 ], [ 84, 85 ], [ 84, 86 ], [ 82, 87 ], [ 6, 88 ], [ 88, 89 ], [ 0, 90 ], [ 90, 91 ], [ 90, 92 ] ]
[ "import java.util.Scanner;\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint[] a = new int[n];\n\t\tfor(int i = 0 ; i < n ; i++) a[i] = scan.nextInt();\n\t\tscan.close();\n\t\tlong sum = 0;\n\t\tint max = a[0];\n\t\tfor(int i = 1 ; i < n ; i++) {\n\t\t\tif(a[i] < max) sum+= (max - a[i]);\n\t\t\telse max = a[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n}", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint[] a = new int[n];\n\t\tfor(int i = 0 ; i < n ; i++) a[i] = scan.nextInt();\n\t\tscan.close();\n\t\tlong sum = 0;\n\t\tint max = a[0];\n\t\tfor(int i = 1 ; i < n ; i++) {\n\t\t\tif(a[i] < max) sum+= (max - a[i]);\n\t\t\telse max = a[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n}", "Main", "public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint[] a = new int[n];\n\t\tfor(int i = 0 ; i < n ; i++) a[i] = scan.nextInt();\n\t\tscan.close();\n\t\tlong sum = 0;\n\t\tint max = a[0];\n\t\tfor(int i = 1 ; i < n ; i++) {\n\t\t\tif(a[i] < max) sum+= (max - a[i]);\n\t\t\telse max = a[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\t}", "main", "{\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint[] a = new int[n];\n\t\tfor(int i = 0 ; i < n ; i++) a[i] = scan.nextInt();\n\t\tscan.close();\n\t\tlong sum = 0;\n\t\tint max = a[0];\n\t\tfor(int i = 1 ; i < n ; i++) {\n\t\t\tif(a[i] < max) sum+= (max - a[i]);\n\t\t\telse max = a[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\t}", "Scanner scan = new Scanner(System.in);", "scan", "new Scanner(System.in)", "int n = scan.nextInt();", "n", "scan.nextInt()", "scan.nextInt", "scan", "int[] a = new int[n];", "a", "new int[n]", "n", "for(int i = 0 ; i < n ; i++) a[i] = scan.nextInt();", "int i = 0 ;", "int i = 0 ;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "a[i] = scan.nextInt();", "a[i] = scan.nextInt()", "a[i]", "a", "i", "scan.nextInt()", "scan.nextInt", "scan", "scan.close()", "scan.close", "scan", "long sum = 0;", "sum", "0", "int max = a[0];", "max", "a[0]", "a", "0", "for(int i = 1 ; i < n ; i++) {\n\t\t\tif(a[i] < max) sum+= (max - a[i]);\n\t\t\telse max = a[i];\n\t\t}", "int i = 1 ;", "int i = 1 ;", "i", "1", "i < n", "i", "n", "i++", "i++", "i", "{\n\t\t\tif(a[i] < max) sum+= (max - a[i]);\n\t\t\telse max = a[i];\n\t\t}", "{\n\t\t\tif(a[i] < max) sum+= (max - a[i]);\n\t\t\telse max = a[i];\n\t\t}", "if(a[i] < max) sum+= (max - a[i]);\n\t\t\telse max = a[i];", "a[i] < max", "a[i]", "a", "i", "max", "sum+= (max - a[i])", "sum", "(max - a[i])", "max", "a[i]", "a", "i", "max = a[i]", "max", "a[i]", "a", "i", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "String[] args", "args", "public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint[] a = new int[n];\n\t\tfor(int i = 0 ; i < n ; i++) a[i] = scan.nextInt();\n\t\tscan.close();\n\t\tlong sum = 0;\n\t\tint max = a[0];\n\t\tfor(int i = 1 ; i < n ; i++) {\n\t\t\tif(a[i] < max) sum+= (max - a[i]);\n\t\t\telse max = a[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n}", "public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint[] a = new int[n];\n\t\tfor(int i = 0 ; i < n ; i++) a[i] = scan.nextInt();\n\t\tscan.close();\n\t\tlong sum = 0;\n\t\tint max = a[0];\n\t\tfor(int i = 1 ; i < n ; i++) {\n\t\t\tif(a[i] < max) sum+= (max - a[i]);\n\t\t\telse max = a[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n}", "Main" ]
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int[] a = new int[n]; for(int i = 0 ; i < n ; i++) a[i] = scan.nextInt(); scan.close(); long sum = 0; int max = a[0]; for(int i = 1 ; i < n ; i++) { if(a[i] < max) sum+= (max - a[i]); else max = a[i]; } System.out.println(sum); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 41, 13, 17, 41, 13, 17, 11, 1, 41, 13, 2, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 18, 13, 13, 18, 13, 13, 30, 0, 13, 2, 18, 13, 13, 18, 13, 13, 30, 0, 13, 13, 4, 18, 18, 13, 13, 13, 4, 18, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 96, 5 ], [ 96, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 8, 21 ], [ 21, 22 ], [ 22, 23 ], [ 23, 24 ], [ 23, 25 ], [ 21, 26 ], [ 26, 27 ], [ 26, 28 ], [ 21, 29 ], [ 29, 30 ], [ 30, 31 ], [ 21, 32 ], [ 33, 33 ], [ 33, 34 ], [ 34, 35 ], [ 35, 36 ], [ 35, 37 ], [ 34, 38 ], [ 38, 39 ], [ 39, 40 ], [ 8, 41 ], [ 41, 42 ], [ 41, 43 ], [ 8, 44 ], [ 44, 45 ], [ 44, 46 ], [ 8, 47 ], [ 47, 48 ], [ 48, 49 ], [ 49, 50 ], [ 49, 51 ], [ 51, 52 ], [ 51, 53 ], [ 47, 54 ], [ 54, 55 ], [ 54, 56 ], [ 47, 57 ], [ 57, 58 ], [ 58, 59 ], [ 47, 60 ], [ 61, 61 ], [ 61, 62 ], [ 62, 63 ], [ 63, 64 ], [ 64, 65 ], [ 64, 66 ], [ 63, 67 ], [ 67, 68 ], [ 67, 69 ], [ 62, 70 ], [ 70, 71 ], [ 71, 72 ], [ 71, 73 ], [ 73, 74 ], [ 74, 75 ], [ 74, 76 ], [ 73, 77 ], [ 77, 78 ], [ 77, 79 ], [ 62, 80 ], [ 80, 81 ], [ 81, 82 ], [ 81, 83 ], [ 8, 84 ], [ 84, 85 ], [ 85, 86 ], [ 86, 87 ], [ 86, 88 ], [ 84, 89 ], [ 8, 90 ], [ 90, 91 ], [ 91, 92 ], [ 6, 93 ], [ 93, 94 ], [ 0, 95 ], [ 95, 96 ], [ 95, 97 ] ]
[ "import java.util.Scanner;\n \npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] a = new long[n];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t}\n \n\t\tlong sum = 0;\n\t\tint i = 0;\n \n\t\tfor (int j = i + 1; j < n; j++) {\n\t\t\tif (a[i] >= a[j]) {\n\t\t\t\tsum += a[i] - a[j];\n\t\t\t} else {\n\t\t\t\ti = j;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(sum);\n\t\tsc.close();\n\t\n\t}\n}", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] a = new long[n];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t}\n \n\t\tlong sum = 0;\n\t\tint i = 0;\n \n\t\tfor (int j = i + 1; j < n; j++) {\n\t\t\tif (a[i] >= a[j]) {\n\t\t\t\tsum += a[i] - a[j];\n\t\t\t} else {\n\t\t\t\ti = j;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(sum);\n\t\tsc.close();\n\t\n\t}\n}", "Main", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] a = new long[n];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t}\n \n\t\tlong sum = 0;\n\t\tint i = 0;\n \n\t\tfor (int j = i + 1; j < n; j++) {\n\t\t\tif (a[i] >= a[j]) {\n\t\t\t\tsum += a[i] - a[j];\n\t\t\t} else {\n\t\t\t\ti = j;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(sum);\n\t\tsc.close();\n\t\n\t}", "main", "{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] a = new long[n];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t}\n \n\t\tlong sum = 0;\n\t\tint i = 0;\n \n\t\tfor (int j = i + 1; j < n; j++) {\n\t\t\tif (a[i] >= a[j]) {\n\t\t\t\tsum += a[i] - a[j];\n\t\t\t} else {\n\t\t\t\ti = j;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(sum);\n\t\tsc.close();\n\t\n\t}", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "long[] a = new long[n];", "a", "new long[n]", "n", "for (int i = 0; i < n; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n\t\t\ta[i] = sc.nextLong();\n\t\t}", "{\n\t\t\ta[i] = sc.nextLong();\n\t\t}", "a[i] = sc.nextLong()", "a[i]", "a", "i", "sc.nextLong()", "sc.nextLong", "sc", "long sum = 0;", "sum", "0", "int i = 0;", "i", "0", "for (int j = i + 1; j < n; j++) {\n\t\t\tif (a[i] >= a[j]) {\n\t\t\t\tsum += a[i] - a[j];\n\t\t\t} else {\n\t\t\t\ti = j;\n\t\t\t}\n\t\t}", "int j = i + 1;", "int j = i + 1;", "j", "i + 1", "i", "1", "j < n", "j", "n", "j++", "j++", "j", "{\n\t\t\tif (a[i] >= a[j]) {\n\t\t\t\tsum += a[i] - a[j];\n\t\t\t} else {\n\t\t\t\ti = j;\n\t\t\t}\n\t\t}", "{\n\t\t\tif (a[i] >= a[j]) {\n\t\t\t\tsum += a[i] - a[j];\n\t\t\t} else {\n\t\t\t\ti = j;\n\t\t\t}\n\t\t}", "if (a[i] >= a[j]) {\n\t\t\t\tsum += a[i] - a[j];\n\t\t\t} else {\n\t\t\t\ti = j;\n\t\t\t}", "a[i] >= a[j]", "a[i]", "a", "i", "a[j]", "a", "j", "{\n\t\t\t\tsum += a[i] - a[j];\n\t\t\t}", "sum += a[i] - a[j]", "sum", "a[i] - a[j]", "a[i]", "a", "i", "a[j]", "a", "j", "{\n\t\t\t\ti = j;\n\t\t\t}", "i = j", "i", "j", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "sc.close()", "sc.close", "sc", "String[] args", "args", "public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] a = new long[n];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t}\n \n\t\tlong sum = 0;\n\t\tint i = 0;\n \n\t\tfor (int j = i + 1; j < n; j++) {\n\t\t\tif (a[i] >= a[j]) {\n\t\t\t\tsum += a[i] - a[j];\n\t\t\t} else {\n\t\t\t\ti = j;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(sum);\n\t\tsc.close();\n\t\n\t}\n}", "public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] a = new long[n];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\ta[i] = sc.nextLong();\n\t\t}\n \n\t\tlong sum = 0;\n\t\tint i = 0;\n \n\t\tfor (int j = i + 1; j < n; j++) {\n\t\t\tif (a[i] >= a[j]) {\n\t\t\t\tsum += a[i] - a[j];\n\t\t\t} else {\n\t\t\t\ti = j;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(sum);\n\t\tsc.close();\n\t\n\t}\n}", "Main" ]
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long[] a = new long[n]; for (int i = 0; i < n; i++) { a[i] = sc.nextLong(); } long sum = 0; int i = 0; for (int j = i + 1; j < n; j++) { if (a[i] >= a[j]) { sum += a[i] - a[j]; } else { i = j; } } System.out.println(sum); sc.close(); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 41, 13, 17, 41, 13, 18, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 13, 18, 13, 13, 30, 0, 13, 2, 2, 13, 13, 18, 13, 13, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 93, 5 ], [ 93, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 8, 21 ], [ 21, 22 ], [ 22, 23 ], [ 23, 24 ], [ 23, 25 ], [ 21, 26 ], [ 26, 27 ], [ 26, 28 ], [ 21, 29 ], [ 29, 30 ], [ 30, 31 ], [ 21, 32 ], [ 33, 33 ], [ 33, 34 ], [ 34, 35 ], [ 35, 36 ], [ 35, 37 ], [ 34, 38 ], [ 38, 39 ], [ 39, 40 ], [ 8, 41 ], [ 41, 42 ], [ 41, 43 ], [ 8, 44 ], [ 44, 45 ], [ 44, 46 ], [ 46, 47 ], [ 46, 48 ], [ 8, 49 ], [ 49, 50 ], [ 50, 51 ], [ 51, 52 ], [ 51, 53 ], [ 49, 54 ], [ 54, 55 ], [ 54, 56 ], [ 49, 57 ], [ 57, 58 ], [ 58, 59 ], [ 49, 60 ], [ 61, 61 ], [ 61, 62 ], [ 62, 63 ], [ 63, 64 ], [ 63, 65 ], [ 65, 66 ], [ 65, 67 ], [ 62, 68 ], [ 68, 69 ], [ 69, 70 ], [ 69, 71 ], [ 71, 72 ], [ 72, 73 ], [ 72, 74 ], [ 71, 75 ], [ 75, 76 ], [ 75, 77 ], [ 62, 78 ], [ 78, 79 ], [ 79, 80 ], [ 79, 81 ], [ 81, 82 ], [ 81, 83 ], [ 8, 84 ], [ 84, 85 ], [ 85, 86 ], [ 86, 87 ], [ 86, 88 ], [ 84, 89 ], [ 6, 90 ], [ 90, 91 ], [ 0, 92 ], [ 92, 93 ], [ 92, 94 ] ]
[ "import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String [] args) {\n \tScanner sn = new Scanner(System.in);\n \tint n = sn.nextInt();\n \tint x[] = new int[n];\n \tfor(int i = 0; i < n; i++) {\n \tx[i] = sn.nextInt();\n }\n \tLong res = 0L;\n \tint max = x[0];\n \tfor(int i = 1; i < n; i++) {\n \tif( max > x[i]) {\n \tres = res + max - x[i]; \n } else {\n \tmax = x[i];\n }\n }\n \tSystem.out.println(res);\n }\n}", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\tpublic static void main(String [] args) {\n \tScanner sn = new Scanner(System.in);\n \tint n = sn.nextInt();\n \tint x[] = new int[n];\n \tfor(int i = 0; i < n; i++) {\n \tx[i] = sn.nextInt();\n }\n \tLong res = 0L;\n \tint max = x[0];\n \tfor(int i = 1; i < n; i++) {\n \tif( max > x[i]) {\n \tres = res + max - x[i]; \n } else {\n \tmax = x[i];\n }\n }\n \tSystem.out.println(res);\n }\n}", "Main", "public static void main(String [] args) {\n \tScanner sn = new Scanner(System.in);\n \tint n = sn.nextInt();\n \tint x[] = new int[n];\n \tfor(int i = 0; i < n; i++) {\n \tx[i] = sn.nextInt();\n }\n \tLong res = 0L;\n \tint max = x[0];\n \tfor(int i = 1; i < n; i++) {\n \tif( max > x[i]) {\n \tres = res + max - x[i]; \n } else {\n \tmax = x[i];\n }\n }\n \tSystem.out.println(res);\n }", "main", "{\n \tScanner sn = new Scanner(System.in);\n \tint n = sn.nextInt();\n \tint x[] = new int[n];\n \tfor(int i = 0; i < n; i++) {\n \tx[i] = sn.nextInt();\n }\n \tLong res = 0L;\n \tint max = x[0];\n \tfor(int i = 1; i < n; i++) {\n \tif( max > x[i]) {\n \tres = res + max - x[i]; \n } else {\n \tmax = x[i];\n }\n }\n \tSystem.out.println(res);\n }", "Scanner sn = new Scanner(System.in);", "sn", "new Scanner(System.in)", "int n = sn.nextInt();", "n", "sn.nextInt()", "sn.nextInt", "sn", "int x[] = new int[n];", "x", "new int[n]", "n", "for(int i = 0; i < n; i++) {\n \tx[i] = sn.nextInt();\n }", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n \tx[i] = sn.nextInt();\n }", "{\n \tx[i] = sn.nextInt();\n }", "x[i] = sn.nextInt()", "x[i]", "x", "i", "sn.nextInt()", "sn.nextInt", "sn", "Long res = 0L;", "res", "0L", "int max = x[0];", "max", "x[0]", "x", "0", "for(int i = 1; i < n; i++) {\n \tif( max > x[i]) {\n \tres = res + max - x[i]; \n } else {\n \tmax = x[i];\n }\n }", "int i = 1;", "int i = 1;", "i", "1", "i < n", "i", "n", "i++", "i++", "i", "{\n \tif( max > x[i]) {\n \tres = res + max - x[i]; \n } else {\n \tmax = x[i];\n }\n }", "{\n \tif( max > x[i]) {\n \tres = res + max - x[i]; \n } else {\n \tmax = x[i];\n }\n }", "if( max > x[i]) {\n \tres = res + max - x[i]; \n } else {\n \tmax = x[i];\n }", "max > x[i]", "max", "x[i]", "x", "i", "{\n \tres = res + max - x[i]; \n }", "res = res + max - x[i]", "res", "res + max - x[i]", "res + max", "res", "max", "x[i]", "x", "i", "{\n \tmax = x[i];\n }", "max = x[i]", "max", "x[i]", "x", "i", "System.out.println(res)", "System.out.println", "System.out", "System", "System.out", "res", "String [] args", "args", "public class Main {\n\tpublic static void main(String [] args) {\n \tScanner sn = new Scanner(System.in);\n \tint n = sn.nextInt();\n \tint x[] = new int[n];\n \tfor(int i = 0; i < n; i++) {\n \tx[i] = sn.nextInt();\n }\n \tLong res = 0L;\n \tint max = x[0];\n \tfor(int i = 1; i < n; i++) {\n \tif( max > x[i]) {\n \tres = res + max - x[i]; \n } else {\n \tmax = x[i];\n }\n }\n \tSystem.out.println(res);\n }\n}", "public class Main {\n\tpublic static void main(String [] args) {\n \tScanner sn = new Scanner(System.in);\n \tint n = sn.nextInt();\n \tint x[] = new int[n];\n \tfor(int i = 0; i < n; i++) {\n \tx[i] = sn.nextInt();\n }\n \tLong res = 0L;\n \tint max = x[0];\n \tfor(int i = 1; i < n; i++) {\n \tif( max > x[i]) {\n \tres = res + max - x[i]; \n } else {\n \tmax = x[i];\n }\n }\n \tSystem.out.println(res);\n }\n}", "Main" ]
import java.util.Scanner; public class Main { public static void main(String [] args) { Scanner sn = new Scanner(System.in); int n = sn.nextInt(); int x[] = new int[n]; for(int i = 0; i < n; i++) { x[i] = sn.nextInt(); } Long res = 0L; int max = x[0]; for(int i = 1; i < n; i++) { if( max > x[i]) { res = res + max - x[i]; } else { max = x[i]; } } System.out.println(res); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 20, 41, 13, 20, 41, 13, 4, 18, 13, 4, 18, 13, 41, 13, 4, 18, 4, 18, 13, 17, 41, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 41, 13, 4, 18, 13, 18, 13, 13, 14, 2, 13, 13, 30, 0, 13, 2, 13, 13, 30, 0, 13, 13, 4, 18, 13, 13, 4, 18, 13, 4, 18, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 97, 14 ], [ 97, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 18, 20 ], [ 17, 21 ], [ 21, 22 ], [ 21, 23 ], [ 17, 24 ], [ 24, 25 ], [ 24, 26 ], [ 17, 27 ], [ 27, 28 ], [ 27, 29 ], [ 29, 30 ], [ 30, 31 ], [ 29, 32 ], [ 32, 33 ], [ 33, 34 ], [ 17, 35 ], [ 35, 36 ], [ 35, 37 ], [ 37, 38 ], [ 38, 39 ], [ 39, 40 ], [ 40, 41 ], [ 37, 42 ], [ 17, 43 ], [ 43, 44 ], [ 43, 45 ], [ 17, 46 ], [ 46, 47 ], [ 46, 48 ], [ 17, 49 ], [ 49, 50 ], [ 50, 51 ], [ 51, 52 ], [ 51, 53 ], [ 49, 54 ], [ 54, 55 ], [ 54, 56 ], [ 49, 57 ], [ 57, 58 ], [ 58, 59 ], [ 49, 60 ], [ 61, 61 ], [ 61, 62 ], [ 62, 63 ], [ 62, 64 ], [ 64, 65 ], [ 65, 66 ], [ 64, 67 ], [ 67, 68 ], [ 67, 69 ], [ 61, 70 ], [ 70, 71 ], [ 71, 72 ], [ 71, 73 ], [ 70, 74 ], [ 74, 75 ], [ 75, 76 ], [ 75, 77 ], [ 77, 78 ], [ 77, 79 ], [ 70, 80 ], [ 80, 81 ], [ 81, 82 ], [ 81, 83 ], [ 17, 84 ], [ 84, 85 ], [ 85, 86 ], [ 84, 87 ], [ 17, 88 ], [ 88, 89 ], [ 89, 90 ], [ 17, 91 ], [ 91, 92 ], [ 92, 93 ], [ 15, 94 ], [ 94, 95 ], [ 0, 96 ], [ 96, 97 ], [ 96, 98 ] ]
[ "import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.PrintWriter;\nimport java.util.StringTokenizer;\n\npublic class Main {\n \n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in));\n PrintWriter pw = new PrintWriter(System.out);\n StringTokenizer st = new StringTokenizer(br.readLine());\n\n int N = Integer.parseInt(st.nextToken());\n String[] tall_array = br.readLine().split(\" \");\n int tmp = 0;\n long result = 0;\n\n for(int i = 0; i < N; i++) {\n\n int target = Integer.parseInt(tall_array[i]);\n\n if(target < tmp) {\n result += tmp - target;\n } else {\n tmp = target;\n }\n }\n\n pw.println(result);\n br.close();\n pw.close();\n }\n}", "import java.io.BufferedReader;", "BufferedReader", "java.io", "import java.io.IOException;", "IOException", "java.io", "import java.io.PrintWriter;", "PrintWriter", "java.io", "import java.util.StringTokenizer;", "StringTokenizer", "java.util", "public class Main {\n \n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in));\n PrintWriter pw = new PrintWriter(System.out);\n StringTokenizer st = new StringTokenizer(br.readLine());\n\n int N = Integer.parseInt(st.nextToken());\n String[] tall_array = br.readLine().split(\" \");\n int tmp = 0;\n long result = 0;\n\n for(int i = 0; i < N; i++) {\n\n int target = Integer.parseInt(tall_array[i]);\n\n if(target < tmp) {\n result += tmp - target;\n } else {\n tmp = target;\n }\n }\n\n pw.println(result);\n br.close();\n pw.close();\n }\n}", "Main", "public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in));\n PrintWriter pw = new PrintWriter(System.out);\n StringTokenizer st = new StringTokenizer(br.readLine());\n\n int N = Integer.parseInt(st.nextToken());\n String[] tall_array = br.readLine().split(\" \");\n int tmp = 0;\n long result = 0;\n\n for(int i = 0; i < N; i++) {\n\n int target = Integer.parseInt(tall_array[i]);\n\n if(target < tmp) {\n result += tmp - target;\n } else {\n tmp = target;\n }\n }\n\n pw.println(result);\n br.close();\n pw.close();\n }", "main", "{\n BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in));\n PrintWriter pw = new PrintWriter(System.out);\n StringTokenizer st = new StringTokenizer(br.readLine());\n\n int N = Integer.parseInt(st.nextToken());\n String[] tall_array = br.readLine().split(\" \");\n int tmp = 0;\n long result = 0;\n\n for(int i = 0; i < N; i++) {\n\n int target = Integer.parseInt(tall_array[i]);\n\n if(target < tmp) {\n result += tmp - target;\n } else {\n tmp = target;\n }\n }\n\n pw.println(result);\n br.close();\n pw.close();\n }", "BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in));", "br", "new BufferedReader(new java.io.InputStreamReader(System.in))", "PrintWriter pw = new PrintWriter(System.out);", "pw", "new PrintWriter(System.out)", "StringTokenizer st = new StringTokenizer(br.readLine());", "st", "new StringTokenizer(br.readLine())", "int N = Integer.parseInt(st.nextToken());", "N", "Integer.parseInt(st.nextToken())", "Integer.parseInt", "Integer", "st.nextToken()", "st.nextToken", "st", "String[] tall_array = br.readLine().split(\" \");", "tall_array", "br.readLine().split(\" \")", "br.readLine().split", "br.readLine()", "br.readLine", "br", "\" \"", "int tmp = 0;", "tmp", "0", "long result = 0;", "result", "0", "for(int i = 0; i < N; i++) {\n\n int target = Integer.parseInt(tall_array[i]);\n\n if(target < tmp) {\n result += tmp - target;\n } else {\n tmp = target;\n }\n }", "int i = 0;", "int i = 0;", "i", "0", "i < N", "i", "N", "i++", "i++", "i", "{\n\n int target = Integer.parseInt(tall_array[i]);\n\n if(target < tmp) {\n result += tmp - target;\n } else {\n tmp = target;\n }\n }", "{\n\n int target = Integer.parseInt(tall_array[i]);\n\n if(target < tmp) {\n result += tmp - target;\n } else {\n tmp = target;\n }\n }", "int target = Integer.parseInt(tall_array[i]);", "target", "Integer.parseInt(tall_array[i])", "Integer.parseInt", "Integer", "tall_array[i]", "tall_array", "i", "if(target < tmp) {\n result += tmp - target;\n } else {\n tmp = target;\n }", "target < tmp", "target", "tmp", "{\n result += tmp - target;\n }", "result += tmp - target", "result", "tmp - target", "tmp", "target", "{\n tmp = target;\n }", "tmp = target", "tmp", "target", "pw.println(result)", "pw.println", "pw", "result", "br.close()", "br.close", "br", "pw.close()", "pw.close", "pw", "String[] args", "args", "public class Main {\n \n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in));\n PrintWriter pw = new PrintWriter(System.out);\n StringTokenizer st = new StringTokenizer(br.readLine());\n\n int N = Integer.parseInt(st.nextToken());\n String[] tall_array = br.readLine().split(\" \");\n int tmp = 0;\n long result = 0;\n\n for(int i = 0; i < N; i++) {\n\n int target = Integer.parseInt(tall_array[i]);\n\n if(target < tmp) {\n result += tmp - target;\n } else {\n tmp = target;\n }\n }\n\n pw.println(result);\n br.close();\n pw.close();\n }\n}", "public class Main {\n \n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in));\n PrintWriter pw = new PrintWriter(System.out);\n StringTokenizer st = new StringTokenizer(br.readLine());\n\n int N = Integer.parseInt(st.nextToken());\n String[] tall_array = br.readLine().split(\" \");\n int tmp = 0;\n long result = 0;\n\n for(int i = 0; i < N; i++) {\n\n int target = Integer.parseInt(tall_array[i]);\n\n if(target < tmp) {\n result += tmp - target;\n } else {\n tmp = target;\n }\n }\n\n pw.println(result);\n br.close();\n pw.close();\n }\n}", "Main" ]
import java.io.BufferedReader; import java.io.IOException; import java.io.PrintWriter; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in)); PrintWriter pw = new PrintWriter(System.out); StringTokenizer st = new StringTokenizer(br.readLine()); int N = Integer.parseInt(st.nextToken()); String[] tall_array = br.readLine().split(" "); int tmp = 0; long result = 0; for(int i = 0; i < N; i++) { int target = Integer.parseInt(tall_array[i]); if(target < tmp) { result += tmp - target; } else { tmp = target; } } pw.println(result); br.close(); pw.close(); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 11, 1, 41, 13, 17, 2, 13, 2, 13, 17, 1, 40, 13, 30, 30, 41, 13, 18, 13, 13, 41, 13, 18, 13, 2, 13, 17, 14, 2, 13, 13, 30, 0, 13, 2, 13, 13, 0, 18, 13, 2, 13, 17, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 97, 5 ], [ 97, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 8, 21 ], [ 21, 22 ], [ 21, 23 ], [ 8, 24 ], [ 24, 25 ], [ 25, 26 ], [ 26, 27 ], [ 26, 28 ], [ 24, 29 ], [ 29, 30 ], [ 29, 31 ], [ 24, 32 ], [ 32, 33 ], [ 33, 34 ], [ 24, 35 ], [ 36, 36 ], [ 36, 37 ], [ 37, 38 ], [ 38, 39 ], [ 38, 40 ], [ 37, 41 ], [ 41, 42 ], [ 42, 43 ], [ 8, 44 ], [ 44, 45 ], [ 45, 46 ], [ 46, 47 ], [ 46, 48 ], [ 44, 49 ], [ 49, 50 ], [ 49, 51 ], [ 51, 52 ], [ 51, 53 ], [ 44, 54 ], [ 54, 55 ], [ 55, 56 ], [ 44, 57 ], [ 58, 58 ], [ 58, 59 ], [ 59, 60 ], [ 59, 61 ], [ 61, 62 ], [ 61, 63 ], [ 58, 64 ], [ 64, 65 ], [ 64, 66 ], [ 66, 67 ], [ 66, 68 ], [ 68, 69 ], [ 68, 70 ], [ 58, 71 ], [ 71, 72 ], [ 72, 73 ], [ 72, 74 ], [ 71, 75 ], [ 75, 76 ], [ 76, 77 ], [ 76, 78 ], [ 78, 79 ], [ 78, 80 ], [ 75, 81 ], [ 81, 82 ], [ 82, 83 ], [ 82, 84 ], [ 84, 85 ], [ 84, 86 ], [ 81, 87 ], [ 8, 88 ], [ 88, 89 ], [ 89, 90 ], [ 90, 91 ], [ 90, 92 ], [ 88, 93 ], [ 6, 94 ], [ 94, 95 ], [ 0, 96 ], [ 96, 97 ], [ 96, 98 ] ]
[ "import java.util.*;\n\npublic class Main{\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int loop = sc.nextInt();\n int[] array = new int[loop];\n long count = 0;\n for(int i = 0; i < loop; i++) {\n array[i] = sc.nextInt();\n }\n for(int i = 0; i < (loop - 1); i++) {\n int temp = array[i];\n int next = array[i+1];\n if(next < temp){\n count += (temp - next);\n array[i+1] = temp;\n }\n }\n System.out.println(count);\n\n }\n}", "import java.util.*;", "util.*", "java", "public class Main{\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int loop = sc.nextInt();\n int[] array = new int[loop];\n long count = 0;\n for(int i = 0; i < loop; i++) {\n array[i] = sc.nextInt();\n }\n for(int i = 0; i < (loop - 1); i++) {\n int temp = array[i];\n int next = array[i+1];\n if(next < temp){\n count += (temp - next);\n array[i+1] = temp;\n }\n }\n System.out.println(count);\n\n }\n}", "Main", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int loop = sc.nextInt();\n int[] array = new int[loop];\n long count = 0;\n for(int i = 0; i < loop; i++) {\n array[i] = sc.nextInt();\n }\n for(int i = 0; i < (loop - 1); i++) {\n int temp = array[i];\n int next = array[i+1];\n if(next < temp){\n count += (temp - next);\n array[i+1] = temp;\n }\n }\n System.out.println(count);\n\n }", "main", "{\n Scanner sc = new Scanner(System.in);\n int loop = sc.nextInt();\n int[] array = new int[loop];\n long count = 0;\n for(int i = 0; i < loop; i++) {\n array[i] = sc.nextInt();\n }\n for(int i = 0; i < (loop - 1); i++) {\n int temp = array[i];\n int next = array[i+1];\n if(next < temp){\n count += (temp - next);\n array[i+1] = temp;\n }\n }\n System.out.println(count);\n\n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int loop = sc.nextInt();", "loop", "sc.nextInt()", "sc.nextInt", "sc", "int[] array = new int[loop];", "array", "new int[loop]", "loop", "long count = 0;", "count", "0", "for(int i = 0; i < loop; i++) {\n array[i] = sc.nextInt();\n }", "int i = 0;", "int i = 0;", "i", "0", "i < loop", "i", "loop", "i++", "i++", "i", "{\n array[i] = sc.nextInt();\n }", "{\n array[i] = sc.nextInt();\n }", "array[i] = sc.nextInt()", "array[i]", "array", "i", "sc.nextInt()", "sc.nextInt", "sc", "for(int i = 0; i < (loop - 1); i++) {\n int temp = array[i];\n int next = array[i+1];\n if(next < temp){\n count += (temp - next);\n array[i+1] = temp;\n }\n }", "int i = 0;", "int i = 0;", "i", "0", "i < (loop - 1)", "i", "(loop - 1)", "loop", "1", "i++", "i++", "i", "{\n int temp = array[i];\n int next = array[i+1];\n if(next < temp){\n count += (temp - next);\n array[i+1] = temp;\n }\n }", "{\n int temp = array[i];\n int next = array[i+1];\n if(next < temp){\n count += (temp - next);\n array[i+1] = temp;\n }\n }", "int temp = array[i];", "temp", "array[i]", "array", "i", "int next = array[i+1];", "next", "array[i+1]", "array", "i+1", "i", "1", "if(next < temp){\n count += (temp - next);\n array[i+1] = temp;\n }", "next < temp", "next", "temp", "{\n count += (temp - next);\n array[i+1] = temp;\n }", "count += (temp - next)", "count", "(temp - next)", "temp", "next", "array[i+1] = temp", "array[i+1]", "array", "i+1", "i", "1", "temp", "System.out.println(count)", "System.out.println", "System.out", "System", "System.out", "count", "String[] args", "args", "public class Main{\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int loop = sc.nextInt();\n int[] array = new int[loop];\n long count = 0;\n for(int i = 0; i < loop; i++) {\n array[i] = sc.nextInt();\n }\n for(int i = 0; i < (loop - 1); i++) {\n int temp = array[i];\n int next = array[i+1];\n if(next < temp){\n count += (temp - next);\n array[i+1] = temp;\n }\n }\n System.out.println(count);\n\n }\n}", "public class Main{\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int loop = sc.nextInt();\n int[] array = new int[loop];\n long count = 0;\n for(int i = 0; i < loop; i++) {\n array[i] = sc.nextInt();\n }\n for(int i = 0; i < (loop - 1); i++) {\n int temp = array[i];\n int next = array[i+1];\n if(next < temp){\n count += (temp - next);\n array[i+1] = temp;\n }\n }\n System.out.println(count);\n\n }\n}", "Main" ]
import java.util.*; public class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int loop = sc.nextInt(); int[] array = new int[loop]; long count = 0; for(int i = 0; i < loop; i++) { array[i] = sc.nextInt(); } for(int i = 0; i < (loop - 1); i++) { int temp = array[i]; int next = array[i+1]; if(next < temp){ count += (temp - next); array[i+1] = temp; } } System.out.println(count); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 41, 13, 41, 13, 17, 41, 13, 17, 41, 13, 17, 41, 13, 41, 13, 17, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 0, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 0, 13, 17, 42, 2, 13, 2, 13, 17, 30, 14, 2, 18, 13, 13, 18, 13, 2, 13, 17, 30, 0, 13, 2, 18, 13, 13, 18, 13, 2, 13, 17, 0, 18, 13, 2, 13, 17, 18, 13, 13, 40, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 117, 11 ], [ 117, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 15, 17 ], [ 14, 18 ], [ 18, 19 ], [ 14, 20 ], [ 20, 21 ], [ 14, 22 ], [ 22, 23 ], [ 22, 24 ], [ 14, 25 ], [ 25, 26 ], [ 25, 27 ], [ 14, 28 ], [ 28, 29 ], [ 28, 30 ], [ 14, 31 ], [ 31, 32 ], [ 14, 33 ], [ 33, 34 ], [ 33, 35 ], [ 14, 36 ], [ 36, 37 ], [ 36, 38 ], [ 38, 39 ], [ 39, 40 ], [ 14, 41 ], [ 41, 42 ], [ 41, 43 ], [ 14, 45 ], [ 45, 46 ], [ 46, 47 ], [ 47, 48 ], [ 47, 49 ], [ 45, 50 ], [ 50, 51 ], [ 50, 52 ], [ 45, 53 ], [ 53, 54 ], [ 54, 55 ], [ 45, 56 ], [ 57, 57 ], [ 57, 58 ], [ 58, 59 ], [ 59, 60 ], [ 59, 61 ], [ 58, 62 ], [ 62, 63 ], [ 63, 64 ], [ 14, 65 ], [ 65, 66 ], [ 65, 67 ], [ 14, 68 ], [ 68, 69 ], [ 69, 70 ], [ 69, 71 ], [ 71, 72 ], [ 71, 73 ], [ 68, 74 ], [ 74, 75 ], [ 75, 76 ], [ 76, 77 ], [ 77, 78 ], [ 77, 79 ], [ 76, 80 ], [ 80, 81 ], [ 80, 82 ], [ 82, 83 ], [ 82, 84 ], [ 75, 85 ], [ 85, 86 ], [ 86, 87 ], [ 86, 88 ], [ 88, 89 ], [ 89, 90 ], [ 89, 91 ], [ 88, 92 ], [ 92, 93 ], [ 92, 94 ], [ 94, 95 ], [ 94, 96 ], [ 85, 97 ], [ 97, 98 ], [ 98, 99 ], [ 98, 100 ], [ 100, 101 ], [ 100, 102 ], [ 97, 103 ], [ 103, 104 ], [ 103, 105 ], [ 74, 106 ], [ 106, 107 ], [ 14, 108 ], [ 108, 109 ], [ 109, 110 ], [ 110, 111 ], [ 110, 112 ], [ 108, 113 ], [ 12, 114 ], [ 114, 115 ], [ 0, 116 ], [ 116, 117 ], [ 116, 118 ] ]
[ "import java.util.*;\nimport java.lang.*;\nimport java.io.*;\n\npublic class Main {\n\tpublic static void main (String[] args) {\n\t\t//code\n\tScanner in=new Scanner(System.in);\n int t,k,i=0,j=0,sum=0;\n double m;\n long l=0;\n int n=in.nextInt();\n int a[]=new int[n];\n for(i=0;i<n;i++)\n {\n a[i]=in.nextInt();\n \n }\n i=0;\n while(i<n-1)\n {\n if(a[i]>a[i+1])\n {\n l+=a[i]-a[i+1];\n // System.out.println(\"l=\"+l);\n a[i+1]=a[i];\n // System.out.println(\"a[i+1]=\"+a[i+1]);\n }i++;\n }\n System.out.println(l);\n\n \n\t}\n}", "import java.util.*;", "util.*", "java", "import java.lang.*;", "lang.*", "java", "import java.io.*;", "io.*", "java", "public class Main {\n\tpublic static void main (String[] args) {\n\t\t//code\n\tScanner in=new Scanner(System.in);\n int t,k,i=0,j=0,sum=0;\n double m;\n long l=0;\n int n=in.nextInt();\n int a[]=new int[n];\n for(i=0;i<n;i++)\n {\n a[i]=in.nextInt();\n \n }\n i=0;\n while(i<n-1)\n {\n if(a[i]>a[i+1])\n {\n l+=a[i]-a[i+1];\n // System.out.println(\"l=\"+l);\n a[i+1]=a[i];\n // System.out.println(\"a[i+1]=\"+a[i+1]);\n }i++;\n }\n System.out.println(l);\n\n \n\t}\n}", "Main", "public static void main (String[] args) {\n\t\t//code\n\tScanner in=new Scanner(System.in);\n int t,k,i=0,j=0,sum=0;\n double m;\n long l=0;\n int n=in.nextInt();\n int a[]=new int[n];\n for(i=0;i<n;i++)\n {\n a[i]=in.nextInt();\n \n }\n i=0;\n while(i<n-1)\n {\n if(a[i]>a[i+1])\n {\n l+=a[i]-a[i+1];\n // System.out.println(\"l=\"+l);\n a[i+1]=a[i];\n // System.out.println(\"a[i+1]=\"+a[i+1]);\n }i++;\n }\n System.out.println(l);\n\n \n\t}", "main", "{\n\t\t//code\n\tScanner in=new Scanner(System.in);\n int t,k,i=0,j=0,sum=0;\n double m;\n long l=0;\n int n=in.nextInt();\n int a[]=new int[n];\n for(i=0;i<n;i++)\n {\n a[i]=in.nextInt();\n \n }\n i=0;\n while(i<n-1)\n {\n if(a[i]>a[i+1])\n {\n l+=a[i]-a[i+1];\n // System.out.println(\"l=\"+l);\n a[i+1]=a[i];\n // System.out.println(\"a[i+1]=\"+a[i+1]);\n }i++;\n }\n System.out.println(l);\n\n \n\t}", "Scanner in=new Scanner(System.in);", "in", "new Scanner(System.in)", "int t", "t", "k", "k", "i=0", "i", "0", "j=0", "j", "0", "sum=0;", "sum", "0", "double m;", "m", "long l=0;", "l", "0", "int n=in.nextInt();", "n", "in.nextInt()", "in.nextInt", "in", "int a[]=new int[n];", "a", "new int[n]", "n", "for(i=0;i<n;i++)\n {\n a[i]=in.nextInt();\n \n }", "i=0;", "i=0", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\n a[i]=in.nextInt();\n \n }", "{\n a[i]=in.nextInt();\n \n }", "a[i]=in.nextInt()", "a[i]", "a", "i", "in.nextInt()", "in.nextInt", "in", "i=0", "i", "0", "while(i<n-1)\n {\n if(a[i]>a[i+1])\n {\n l+=a[i]-a[i+1];\n // System.out.println(\"l=\"+l);\n a[i+1]=a[i];\n // System.out.println(\"a[i+1]=\"+a[i+1]);\n }i++;\n }", "i<n-1", "i", "n-1", "n", "1", "{\n if(a[i]>a[i+1])\n {\n l+=a[i]-a[i+1];\n // System.out.println(\"l=\"+l);\n a[i+1]=a[i];\n // System.out.println(\"a[i+1]=\"+a[i+1]);\n }i++;\n }", "if(a[i]>a[i+1])\n {\n l+=a[i]-a[i+1];\n // System.out.println(\"l=\"+l);\n a[i+1]=a[i];\n // System.out.println(\"a[i+1]=\"+a[i+1]);\n }", "a[i]>a[i+1]", "a[i]", "a", "i", "a[i+1]", "a", "i+1", "i", "1", "{\n l+=a[i]-a[i+1];\n // System.out.println(\"l=\"+l);\n a[i+1]=a[i];\n // System.out.println(\"a[i+1]=\"+a[i+1]);\n }", "l+=a[i]-a[i+1]", "l", "a[i]-a[i+1]", "a[i]", "a", "i", "a[i+1]", "a", "i+1", "i", "1", "a[i+1]=a[i]", "a[i+1]", "a", "i+1", "i", "1", "a[i]", "a", "i", "i++", "i", "System.out.println(l)", "System.out.println", "System.out", "System", "System.out", "l", "String[] args", "args", "public class Main {\n\tpublic static void main (String[] args) {\n\t\t//code\n\tScanner in=new Scanner(System.in);\n int t,k,i=0,j=0,sum=0;\n double m;\n long l=0;\n int n=in.nextInt();\n int a[]=new int[n];\n for(i=0;i<n;i++)\n {\n a[i]=in.nextInt();\n \n }\n i=0;\n while(i<n-1)\n {\n if(a[i]>a[i+1])\n {\n l+=a[i]-a[i+1];\n // System.out.println(\"l=\"+l);\n a[i+1]=a[i];\n // System.out.println(\"a[i+1]=\"+a[i+1]);\n }i++;\n }\n System.out.println(l);\n\n \n\t}\n}", "public class Main {\n\tpublic static void main (String[] args) {\n\t\t//code\n\tScanner in=new Scanner(System.in);\n int t,k,i=0,j=0,sum=0;\n double m;\n long l=0;\n int n=in.nextInt();\n int a[]=new int[n];\n for(i=0;i<n;i++)\n {\n a[i]=in.nextInt();\n \n }\n i=0;\n while(i<n-1)\n {\n if(a[i]>a[i+1])\n {\n l+=a[i]-a[i+1];\n // System.out.println(\"l=\"+l);\n a[i+1]=a[i];\n // System.out.println(\"a[i+1]=\"+a[i+1]);\n }i++;\n }\n System.out.println(l);\n\n \n\t}\n}", "Main" ]
import java.util.*; import java.lang.*; import java.io.*; public class Main { public static void main (String[] args) { //code Scanner in=new Scanner(System.in); int t,k,i=0,j=0,sum=0; double m; long l=0; int n=in.nextInt(); int a[]=new int[n]; for(i=0;i<n;i++) { a[i]=in.nextInt(); } i=0; while(i<n-1) { if(a[i]>a[i+1]) { l+=a[i]-a[i+1]; // System.out.println("l="+l); a[i+1]=a[i]; // System.out.println("a[i+1]="+a[i+1]); }i++; } System.out.println(l); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 41, 13, 2, 17, 17, 12, 13, 30, 4, 18, 13, 18, 13, 13, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 41, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 41, 13, 4, 18, 13, 14, 2, 13, 13, 30, 0, 13, 2, 13, 13, 0, 13, 4, 18, 13, 13, 13, 4, 18, 13, 13, 4, 18, 13, 23, 13, 6, 13, 41, 13, 41, 13, 12, 13, 30, 0, 13, 20, 0, 13, 20, 12, 13, 30, 0, 13, 20, 0, 13, 20, 23, 13, 12, 13, 30, 29, 4, 18, 13, 12, 13, 30, 42, 40, 4, 18, 13, 30, 0, 13, 20, 29, 4, 18, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 162, 8 ], [ 162, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 11, 13 ], [ 162, 14 ], [ 14, 15 ], [ 14, 16 ], [ 16, 17 ], [ 17, 18 ], [ 18, 19 ], [ 17, 20 ], [ 20, 21 ], [ 20, 22 ], [ 16, 23 ], [ 23, 24 ], [ 23, 25 ], [ 16, 26 ], [ 26, 27 ], [ 26, 28 ], [ 28, 29 ], [ 29, 30 ], [ 16, 31 ], [ 31, 32 ], [ 31, 33 ], [ 16, 35 ], [ 35, 36 ], [ 35, 37 ], [ 16, 38 ], [ 38, 39 ], [ 38, 40 ], [ 16, 41 ], [ 41, 42 ], [ 42, 43 ], [ 43, 44 ], [ 43, 45 ], [ 41, 46 ], [ 46, 47 ], [ 46, 48 ], [ 41, 49 ], [ 49, 50 ], [ 50, 51 ], [ 41, 52 ], [ 53, 53 ], [ 53, 54 ], [ 54, 55 ], [ 54, 56 ], [ 56, 57 ], [ 57, 58 ], [ 53, 59 ], [ 59, 60 ], [ 60, 61 ], [ 60, 62 ], [ 59, 63 ], [ 63, 64 ], [ 64, 65 ], [ 64, 66 ], [ 66, 67 ], [ 66, 68 ], [ 53, 69 ], [ 69, 70 ], [ 69, 71 ], [ 71, 72 ], [ 72, 73 ], [ 71, 74 ], [ 71, 75 ], [ 16, 76 ], [ 76, 77 ], [ 77, 78 ], [ 76, 79 ], [ 16, 80 ], [ 80, 81 ], [ 81, 82 ], [ 14, 83 ], [ 83, 84 ], [ 0, 85 ], [ 85, 86 ], [ 85, 87 ], [ 87, 88 ], [ 85, 89 ], [ 89, 90 ], [ 85, 91 ], [ 91, 92 ], [ 91, 93 ], [ 93, 94 ], [ 94, 95 ], [ 94, 96 ], [ 93, 97 ], [ 97, 98 ], [ 97, 99 ], [ 85, 100 ], [ 100, 101 ], [ 100, 102 ], [ 102, 103 ], [ 103, 104 ], [ 103, 105 ], [ 102, 106 ], [ 106, 107 ], [ 106, 108 ], [ 100, 109 ], [ 109, 110 ], [ 85, 111 ], [ 111, 112 ], [ 111, 113 ], [ 113, 114 ], [ 114, 115 ], [ 115, 116 ], [ 116, 117 ], [ 85, 118 ], [ 118, 119 ], [ 118, 120 ], [ 120, 121 ], [ 121, 122 ], [ 122, 123 ], [ 123, 124 ], [ 124, 125 ], [ 121, 126 ], [ 126, 127 ], [ 127, 128 ], [ 127, 129 ], [ 120, 130 ], [ 130, 131 ], [ 131, 132 ], [ 132, 133 ], [ 85, 134 ], [ 134, 135 ], [ 134, 136 ], [ 136, 137 ], [ 137, 138 ], [ 138, 139 ], [ 139, 140 ], [ 138, 141 ], [ 141, 142 ], [ 85, 143 ], [ 143, 144 ], [ 143, 145 ], [ 145, 146 ], [ 146, 147 ], [ 147, 148 ], [ 148, 149 ], [ 147, 150 ], [ 150, 151 ], [ 85, 152 ], [ 152, 153 ], [ 152, 154 ], [ 154, 155 ], [ 155, 156 ], [ 156, 157 ], [ 157, 158 ], [ 156, 159 ], [ 159, 160 ], [ 0, 161 ], [ 161, 162 ], [ 161, 163 ] ]
[ "import java.io.*;\nimport java.util.*;\n\npublic class Main {\n\t\n\tstatic long mod= (long) 1e9+7;\n\t\n\t\t\n\tpublic static void main(String[] args) throws IOException {\n\t\t// TODO Auto-generated method stub\n\t\tReader.init(System.in);\n\t\tPrintWriter out=new PrintWriter(System.out);\n\t\tint n=Reader.nextInt();\n\t\tint[] arr=new int[n];\n\t\tlong ans=0;\n\t\tint max=0;\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tint a=Reader.nextInt();\n\t\t\tif(max>a) {\n\t\t\t\tans+=(max-a);\n\t\t\t}\n\t\t\tmax=Math.max(a,max);\n\t\t}\n\t\tout.println(ans);\n\t\t\n\t\tout.flush();\n\t\t\n\t}\n\n}\n\n\nclass Reader {\n static BufferedReader reader;\n static StringTokenizer tokenizer;\n /** call this method to initialize reader for InputStream */\n static void init() throws IOException {\n reader = new BufferedReader(\n new FileReader(\"C:\\\\Users\\\\samee\\\\Desktop\\\\GRE prep\\\\confusion.txt\"));\n tokenizer = new StringTokenizer(\"\");\n }\n static void init(InputStream input) {\n reader = new BufferedReader(\n new InputStreamReader(input) );\n tokenizer = new StringTokenizer(\"\");\n }\n /** get next word */\n static String nextLine() throws IOException{\n return reader.readLine();\n }\n static String next() throws IOException {\n while ( ! tokenizer.hasMoreTokens() ) {\n //TODO add check for eof if necessary\n tokenizer = new StringTokenizer(\n reader.readLine() );\n }\n return tokenizer.nextToken();\n }\n static int nextInt() throws IOException {\n return Integer.parseInt( next() );\n }\n static long nextLong() throws IOException {\n return Long.parseLong( next() );\n }\n static double nextDouble() throws IOException {\n return Double.parseDouble( next() );\n }\n}", "import java.io.*;", "io.*", "java", "import java.util.*;", "util.*", "java", "public class Main {\n\t\n\tstatic long mod= (long) 1e9+7;\n\t\n\t\t\n\tpublic static void main(String[] args) throws IOException {\n\t\t// TODO Auto-generated method stub\n\t\tReader.init(System.in);\n\t\tPrintWriter out=new PrintWriter(System.out);\n\t\tint n=Reader.nextInt();\n\t\tint[] arr=new int[n];\n\t\tlong ans=0;\n\t\tint max=0;\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tint a=Reader.nextInt();\n\t\t\tif(max>a) {\n\t\t\t\tans+=(max-a);\n\t\t\t}\n\t\t\tmax=Math.max(a,max);\n\t\t}\n\t\tout.println(ans);\n\t\t\n\t\tout.flush();\n\t\t\n\t}\n\n}", "Main", "static long mod= (long) 1e9+7;", "mod", "(long) 1e9+7", "(long) 1e9", "7", "public static void main(String[] args) throws IOException {\n\t\t// TODO Auto-generated method stub\n\t\tReader.init(System.in);\n\t\tPrintWriter out=new PrintWriter(System.out);\n\t\tint n=Reader.nextInt();\n\t\tint[] arr=new int[n];\n\t\tlong ans=0;\n\t\tint max=0;\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tint a=Reader.nextInt();\n\t\t\tif(max>a) {\n\t\t\t\tans+=(max-a);\n\t\t\t}\n\t\t\tmax=Math.max(a,max);\n\t\t}\n\t\tout.println(ans);\n\t\t\n\t\tout.flush();\n\t\t\n\t}", "main", "{\n\t\t// TODO Auto-generated method stub\n\t\tReader.init(System.in);\n\t\tPrintWriter out=new PrintWriter(System.out);\n\t\tint n=Reader.nextInt();\n\t\tint[] arr=new int[n];\n\t\tlong ans=0;\n\t\tint max=0;\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tint a=Reader.nextInt();\n\t\t\tif(max>a) {\n\t\t\t\tans+=(max-a);\n\t\t\t}\n\t\t\tmax=Math.max(a,max);\n\t\t}\n\t\tout.println(ans);\n\t\t\n\t\tout.flush();\n\t\t\n\t}", "Reader.init(System.in)", "Reader.init", "Reader", "System.in", "System", "System.in", "PrintWriter out=new PrintWriter(System.out);", "out", "new PrintWriter(System.out)", "int n=Reader.nextInt();", "n", "Reader.nextInt()", "Reader.nextInt", "Reader", "int[] arr=new int[n];", "arr", "new int[n]", "n", "long ans=0;", "ans", "0", "int max=0;", "max", "0", "for(int i=0;i<n;i++) {\n\t\t\tint a=Reader.nextInt();\n\t\t\tif(max>a) {\n\t\t\t\tans+=(max-a);\n\t\t\t}\n\t\t\tmax=Math.max(a,max);\n\t\t}", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\n\t\t\tint a=Reader.nextInt();\n\t\t\tif(max>a) {\n\t\t\t\tans+=(max-a);\n\t\t\t}\n\t\t\tmax=Math.max(a,max);\n\t\t}", "{\n\t\t\tint a=Reader.nextInt();\n\t\t\tif(max>a) {\n\t\t\t\tans+=(max-a);\n\t\t\t}\n\t\t\tmax=Math.max(a,max);\n\t\t}", "int a=Reader.nextInt();", "a", "Reader.nextInt()", "Reader.nextInt", "Reader", "if(max>a) {\n\t\t\t\tans+=(max-a);\n\t\t\t}", "max>a", "max", "a", "{\n\t\t\t\tans+=(max-a);\n\t\t\t}", "ans+=(max-a)", "ans", "(max-a)", "max", "a", "max=Math.max(a,max)", "max", "Math.max(a,max)", "Math.max", "Math", "a", "max", "out.println(ans)", "out.println", "out", "ans", "out.flush()", "out.flush", "out", "String[] args", "args", "class Reader {\n static BufferedReader reader;\n static StringTokenizer tokenizer;\n /** call this method to initialize reader for InputStream */\n static void init() throws IOException {\n reader = new BufferedReader(\n new FileReader(\"C:\\\\Users\\\\samee\\\\Desktop\\\\GRE prep\\\\confusion.txt\"));\n tokenizer = new StringTokenizer(\"\");\n }\n static void init(InputStream input) {\n reader = new BufferedReader(\n new InputStreamReader(input) );\n tokenizer = new StringTokenizer(\"\");\n }\n /** get next word */\n static String nextLine() throws IOException{\n return reader.readLine();\n }\n static String next() throws IOException {\n while ( ! tokenizer.hasMoreTokens() ) {\n //TODO add check for eof if necessary\n tokenizer = new StringTokenizer(\n reader.readLine() );\n }\n return tokenizer.nextToken();\n }\n static int nextInt() throws IOException {\n return Integer.parseInt( next() );\n }\n static long nextLong() throws IOException {\n return Long.parseLong( next() );\n }\n static double nextDouble() throws IOException {\n return Double.parseDouble( next() );\n }\n}", "Reader", "static BufferedReader reader;", "reader", "static StringTokenizer tokenizer;", "tokenizer", "/** call this method to initialize reader for InputStream */\n static void init() throws IOException {\n reader = new BufferedReader(\n new FileReader(\"C:\\\\Users\\\\samee\\\\Desktop\\\\GRE prep\\\\confusion.txt\"));\n tokenizer = new StringTokenizer(\"\");\n }", "init", "{\n reader = new BufferedReader(\n new FileReader(\"C:\\\\Users\\\\samee\\\\Desktop\\\\GRE prep\\\\confusion.txt\"));\n tokenizer = new StringTokenizer(\"\");\n }", "reader = new BufferedReader(\n new FileReader(\"C:\\\\Users\\\\samee\\\\Desktop\\\\GRE prep\\\\confusion.txt\"))", "reader", "new BufferedReader(\n new FileReader(\"C:\\\\Users\\\\samee\\\\Desktop\\\\GRE prep\\\\confusion.txt\"))", "tokenizer = new StringTokenizer(\"\")", "tokenizer", "new StringTokenizer(\"\")", "static void init(InputStream input) {\n reader = new BufferedReader(\n new InputStreamReader(input) );\n tokenizer = new StringTokenizer(\"\");\n }", "init", "{\n reader = new BufferedReader(\n new InputStreamReader(input) );\n tokenizer = new StringTokenizer(\"\");\n }", "reader = new BufferedReader(\n new InputStreamReader(input) )", "reader", "new BufferedReader(\n new InputStreamReader(input) )", "tokenizer = new StringTokenizer(\"\")", "tokenizer", "new StringTokenizer(\"\")", "InputStream input", "input", "/** get next word */\n static String nextLine() throws IOException{\n return reader.readLine();\n }", "nextLine", "{\n return reader.readLine();\n }", "return reader.readLine();", "reader.readLine()", "reader.readLine", "reader", "static String next() throws IOException {\n while ( ! tokenizer.hasMoreTokens() ) {\n //TODO add check for eof if necessary\n tokenizer = new StringTokenizer(\n reader.readLine() );\n }\n return tokenizer.nextToken();\n }", "next", "{\n while ( ! tokenizer.hasMoreTokens() ) {\n //TODO add check for eof if necessary\n tokenizer = new StringTokenizer(\n reader.readLine() );\n }\n return tokenizer.nextToken();\n }", "while ( ! tokenizer.hasMoreTokens() ) {\n //TODO add check for eof if necessary\n tokenizer = new StringTokenizer(\n reader.readLine() );\n }", "! tokenizer.hasMoreTokens()", "tokenizer.hasMoreTokens()", "tokenizer.hasMoreTokens", "tokenizer", "{\n //TODO add check for eof if necessary\n tokenizer = new StringTokenizer(\n reader.readLine() );\n }", "tokenizer = new StringTokenizer(\n reader.readLine() )", "tokenizer", "new StringTokenizer(\n reader.readLine() )", "return tokenizer.nextToken();", "tokenizer.nextToken()", "tokenizer.nextToken", "tokenizer", "static int nextInt() throws IOException {\n return Integer.parseInt( next() );\n }", "nextInt", "{\n return Integer.parseInt( next() );\n }", "return Integer.parseInt( next() );", "Integer.parseInt( next() )", "Integer.parseInt", "Integer", "next()", "next", "static long nextLong() throws IOException {\n return Long.parseLong( next() );\n }", "nextLong", "{\n return Long.parseLong( next() );\n }", "return Long.parseLong( next() );", "Long.parseLong( next() )", "Long.parseLong", "Long", "next()", "next", "static double nextDouble() throws IOException {\n return Double.parseDouble( next() );\n }", "nextDouble", "{\n return Double.parseDouble( next() );\n }", "return Double.parseDouble( next() );", "Double.parseDouble( next() )", "Double.parseDouble", "Double", "next()", "next", "public class Main {\n\t\n\tstatic long mod= (long) 1e9+7;\n\t\n\t\t\n\tpublic static void main(String[] args) throws IOException {\n\t\t// TODO Auto-generated method stub\n\t\tReader.init(System.in);\n\t\tPrintWriter out=new PrintWriter(System.out);\n\t\tint n=Reader.nextInt();\n\t\tint[] arr=new int[n];\n\t\tlong ans=0;\n\t\tint max=0;\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tint a=Reader.nextInt();\n\t\t\tif(max>a) {\n\t\t\t\tans+=(max-a);\n\t\t\t}\n\t\t\tmax=Math.max(a,max);\n\t\t}\n\t\tout.println(ans);\n\t\t\n\t\tout.flush();\n\t\t\n\t}\n\n}", "public class Main {\n\t\n\tstatic long mod= (long) 1e9+7;\n\t\n\t\t\n\tpublic static void main(String[] args) throws IOException {\n\t\t// TODO Auto-generated method stub\n\t\tReader.init(System.in);\n\t\tPrintWriter out=new PrintWriter(System.out);\n\t\tint n=Reader.nextInt();\n\t\tint[] arr=new int[n];\n\t\tlong ans=0;\n\t\tint max=0;\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tint a=Reader.nextInt();\n\t\t\tif(max>a) {\n\t\t\t\tans+=(max-a);\n\t\t\t}\n\t\t\tmax=Math.max(a,max);\n\t\t}\n\t\tout.println(ans);\n\t\t\n\t\tout.flush();\n\t\t\n\t}\n\n}", "Main" ]
import java.io.*; import java.util.*; public class Main { static long mod= (long) 1e9+7; public static void main(String[] args) throws IOException { // TODO Auto-generated method stub Reader.init(System.in); PrintWriter out=new PrintWriter(System.out); int n=Reader.nextInt(); int[] arr=new int[n]; long ans=0; int max=0; for(int i=0;i<n;i++) { int a=Reader.nextInt(); if(max>a) { ans+=(max-a); } max=Math.max(a,max); } out.println(ans); out.flush(); } } class Reader { static BufferedReader reader; static StringTokenizer tokenizer; /** call this method to initialize reader for InputStream */ static void init() throws IOException { reader = new BufferedReader( new FileReader("C:\\Users\\samee\\Desktop\\GRE prep\\confusion.txt")); tokenizer = new StringTokenizer(""); } static void init(InputStream input) { reader = new BufferedReader( new InputStreamReader(input) ); tokenizer = new StringTokenizer(""); } /** get next word */ static String nextLine() throws IOException{ return reader.readLine(); } static String next() throws IOException { while ( ! tokenizer.hasMoreTokens() ) { //TODO add check for eof if necessary tokenizer = new StringTokenizer( reader.readLine() ); } return tokenizer.nextToken(); } static int nextInt() throws IOException { return Integer.parseInt( next() ); } static long nextLong() throws IOException { return Long.parseLong( next() ); } static double nextDouble() throws IOException { return Double.parseDouble( next() ); } }