Submission #622421


Source Code Expand

import java.io.*;
import java.util.*;
 
public class Main{

	public void solve(){
		String str = "DiscoPresentsDiscoveryChannelProgrammingContest2016";
		int W = nextInt();
		int idx = 0;
		while(idx < str.length()){
			out.println(str.substring(idx, Math.min(idx + W, str.length())));
			idx += W;
		}
		
	}
	
	
	private static PrintWriter out;
	
	public static void main(String[] args){
		out = new PrintWriter(System.out);
		new Main().solve();
		out.flush();
	}
	
	
	
	public static int nextInt(){
		int num = 0;
		String str = next();
		boolean minus = false;
		int i = 0;
		if(str.charAt(0) == '-'){
			minus = true;
			i++;
		}
		int len = str.length();
		for(;i < len; i++){
			char c = str.charAt(i);
			if(!('0' <= c && c <= '9')) throw new RuntimeException();
			num = num * 10 + (c - '0');
		}
		return minus ? -num : num;
	}
	
	public static long nextLong(){
		long num = 0;
		String str = next();
		boolean minus = false;
		int i = 0;
		if(str.charAt(0) == '-'){
			minus = true;
			i++;
		}
		int len = str.length();
		for(;i < len; i++){
			char c = str.charAt(i);
			if(!('0' <= c && c <= '9')) throw new RuntimeException();
			num = num * 10l + (c - '0');
		}
		return minus ? -num : num;
	}
	public static String next(){
		int c;
		while(!isAlNum(c = read())){}
		StringBuilder build = new StringBuilder();
		build.append((char)c);
		while(isAlNum(c = read())){
			build.append((char)c);
		}
		return build.toString();
	}
	
	
	private static byte[] inputBuffer = new byte[1024];
	private static int bufferLength = 0;
	private static int bufferIndex = 0;
	private static int read(){
		if(bufferLength < 0) throw new RuntimeException();
		if(bufferIndex >= bufferLength){
			try{
				bufferLength = System.in.read(inputBuffer);
				bufferIndex = 0;
			}catch(IOException e){
				throw new RuntimeException(e);
			}
			if(bufferLength <= 0) return (bufferLength = -1);
		}
		return inputBuffer[bufferIndex++];
	}
	
	private static boolean isAlNum(int c){
		return '!' <= c && c <= '~';
	}
}

Submission Info

Submission Time
Task A - DISCO presents ディスカバリーチャンネルプログラミングコンテスト 2016
User a3636tako
Language Java (OpenJDK 1.7.0)
Score 100
Code Size 2100 Byte
Status AC
Exec Time 617 ms
Memory 22500 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 51
Set Name Test Cases
Sample example_01.txt, example_02.txt, example_03.txt
All example_01.txt, example_02.txt, example_03.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt, test_14.txt, test_15.txt, test_16.txt, test_18.txt, test_19.txt, test_20.txt, test_21.txt, test_22.txt, test_23.txt, test_24.txt, test_25.txt, test_26.txt, test_27.txt, test_28.txt, test_29.txt, test_30.txt, test_31.txt, test_32.txt, test_33.txt, test_34.txt, test_35.txt, test_36.txt, test_37.txt, test_38.txt, test_39.txt, test_41.txt, test_42.txt, test_43.txt, test_44.txt, test_45.txt, test_46.txt, test_47.txt, test_48.txt, test_49.txt, test_50.txt
Case Name Status Exec Time Memory
example_01.txt AC 492 ms 22452 KB
example_02.txt AC 334 ms 22412 KB
example_03.txt AC 333 ms 22376 KB
test_01.txt AC 344 ms 22408 KB
test_02.txt AC 337 ms 22388 KB
test_03.txt AC 336 ms 22412 KB
test_04.txt AC 339 ms 22408 KB
test_05.txt AC 347 ms 22404 KB
test_06.txt AC 432 ms 22440 KB
test_07.txt AC 346 ms 22328 KB
test_08.txt AC 336 ms 22448 KB
test_09.txt AC 357 ms 22356 KB
test_10.txt AC 348 ms 22420 KB
test_11.txt AC 337 ms 22388 KB
test_12.txt AC 333 ms 22500 KB
test_13.txt AC 334 ms 22408 KB
test_14.txt AC 334 ms 22412 KB
test_15.txt AC 337 ms 22352 KB
test_16.txt AC 334 ms 22432 KB
test_18.txt AC 340 ms 22324 KB
test_19.txt AC 333 ms 22408 KB
test_20.txt AC 336 ms 22488 KB
test_21.txt AC 343 ms 22460 KB
test_22.txt AC 336 ms 22392 KB
test_23.txt AC 341 ms 22372 KB
test_24.txt AC 333 ms 22428 KB
test_25.txt AC 337 ms 22412 KB
test_26.txt AC 334 ms 22420 KB
test_27.txt AC 332 ms 22404 KB
test_28.txt AC 341 ms 22404 KB
test_29.txt AC 337 ms 22408 KB
test_30.txt AC 337 ms 22396 KB
test_31.txt AC 360 ms 22416 KB
test_32.txt AC 358 ms 22384 KB
test_33.txt AC 346 ms 22416 KB
test_34.txt AC 346 ms 22408 KB
test_35.txt AC 356 ms 22320 KB
test_36.txt AC 344 ms 22404 KB
test_37.txt AC 345 ms 22428 KB
test_38.txt AC 336 ms 22328 KB
test_39.txt AC 365 ms 22396 KB
test_41.txt AC 349 ms 22340 KB
test_42.txt AC 334 ms 22376 KB
test_43.txt AC 617 ms 22368 KB
test_44.txt AC 335 ms 22408 KB
test_45.txt AC 343 ms 22424 KB
test_46.txt AC 333 ms 22348 KB
test_47.txt AC 323 ms 22336 KB
test_48.txt AC 326 ms 22404 KB
test_49.txt AC 352 ms 22404 KB
test_50.txt AC 342 ms 22396 KB