Submission #132045


Source Code Expand

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

import java.util.*;
import java.util.Map.Entry;

public class Main {
	
	
	public static void main(String[] args) throws IOException{
		Scanner sc = new Scanner(System.in);
		
		final int n = sc.nextInt();
		
		final int left_in = (n / 5) % 6;
		final int mod = n % 5;
		
		int[] array = new int[6];
		for(int i = 0; i < 6; i++){
			array[i] = (i + left_in) % 6 + 1;
		}
		
		for(int i = 0; i < mod; i++){
			int tmp = array[i];
			array[i] = array[i+1];
			array[i+1] = tmp;
		}
		
		for(int i = 0; i < 6; i++){
			System.out.print(array[i]);
		}
		System.out.println();
		
	}
	
	public static class Scanner {
		
		private BufferedReader br;
		private StringTokenizer tok;
		
		public Scanner(InputStream is) throws IOException{
			br = new BufferedReader(new InputStreamReader(is));
			getLine();
		}
		
		private void getLine() throws IOException{
			while(tok == null || !tok.hasMoreTokens()){
				tok = new StringTokenizer(br.readLine());
			}
		}
		
		private boolean hasNext(){
			return tok.hasMoreTokens();
		}
		
		public String next() throws IOException{
			if(hasNext()){
				return tok.nextToken();
			}else{
				getLine();
				return tok.nextToken();
			}
		}
		
		public int nextInt() throws IOException{
			if(hasNext()){
				return Integer.parseInt(tok.nextToken());
			}else{
				getLine();
				return Integer.parseInt(tok.nextToken());
			}
		}
		
		public long nextLong() throws IOException{
			if(hasNext()){
				return Long.parseLong(tok.nextToken());
			}else{
				getLine();
				return Long.parseLong(tok.nextToken());
			}
		}
		
		public double nextDouble() throws IOException{
			if(hasNext()){
				return Double.parseDouble(tok.nextToken());
			}else{
				getLine();
				return Double.parseDouble(tok.nextToken());
			}
		}
	}
}

Submission Info

Submission Time
Task C - 入れ替え
User mondatto
Language Java (OpenJDK 1.7.0)
Score 100
Code Size 1970 Byte
Status AC
Exec Time 464 ms
Memory 20652 KB

Judge Result

Set Name Subtask1 Subtask2
Score / Max Score 30 / 30 70 / 70
Status
AC × 13
AC × 27
Set Name Test Cases
Subtask1 SubTask1/00_sample_00.txt, SubTask1/00_sample_01.txt, SubTask1/00_sample_02.txt, SubTask1/rand_19.txt, SubTask1/rand_2.txt, SubTask1/rand_25.txt, SubTask1/rand_27.txt, SubTask1/rand_33.txt, SubTask1/rand_35.txt, SubTask1/rand_4.txt, SubTask1/rand_44.txt, SubTask1/rand_48.txt, SubTask1/rand_8.txt
Subtask2 SubTask2/00_sample_03.txt, SubTask2/max_case.txt, SubTask2/rand_120009641.txt, SubTask2/rand_134230520.txt, SubTask2/rand_136939465.txt, SubTask2/rand_200732473.txt, SubTask2/rand_211796835.txt, SubTask2/rand_312330341.txt, SubTask2/rand_377341731.txt, SubTask2/rand_384611280.txt, SubTask2/rand_386098102.txt, SubTask2/rand_399010727.txt, SubTask2/rand_409627453.txt, SubTask2/rand_416537730.txt, SubTask2/rand_425486442.txt, SubTask2/rand_493135174.txt, SubTask2/rand_573105326.txt, SubTask2/rand_62794810.txt, SubTask2/rand_649471654.txt, SubTask2/rand_693017484.txt, SubTask2/rand_729197057.txt, SubTask2/rand_759630883.txt, SubTask2/rand_823752210.txt, SubTask2/rand_830399384.txt, SubTask2/rand_893242387.txt, SubTask2/rand_935005824.txt, SubTask2/rand_989703310.txt
Case Name Status Exec Time Memory
SubTask1/00_sample_00.txt AC 424 ms 20548 KB
SubTask1/00_sample_01.txt AC 382 ms 20572 KB
SubTask1/00_sample_02.txt AC 394 ms 20576 KB
SubTask1/rand_19.txt AC 381 ms 20564 KB
SubTask1/rand_2.txt AC 392 ms 20568 KB
SubTask1/rand_25.txt AC 384 ms 20572 KB
SubTask1/rand_27.txt AC 382 ms 20572 KB
SubTask1/rand_33.txt AC 391 ms 20572 KB
SubTask1/rand_35.txt AC 381 ms 20576 KB
SubTask1/rand_4.txt AC 385 ms 20580 KB
SubTask1/rand_44.txt AC 387 ms 20568 KB
SubTask1/rand_48.txt AC 389 ms 20580 KB
SubTask1/rand_8.txt AC 389 ms 20564 KB
SubTask2/00_sample_03.txt AC 385 ms 20572 KB
SubTask2/max_case.txt AC 388 ms 20572 KB
SubTask2/rand_120009641.txt AC 389 ms 20572 KB
SubTask2/rand_134230520.txt AC 387 ms 20564 KB
SubTask2/rand_136939465.txt AC 383 ms 20564 KB
SubTask2/rand_200732473.txt AC 385 ms 20572 KB
SubTask2/rand_211796835.txt AC 392 ms 20564 KB
SubTask2/rand_312330341.txt AC 419 ms 20440 KB
SubTask2/rand_377341731.txt AC 401 ms 20564 KB
SubTask2/rand_384611280.txt AC 398 ms 20576 KB
SubTask2/rand_386098102.txt AC 402 ms 20572 KB
SubTask2/rand_399010727.txt AC 389 ms 20652 KB
SubTask2/rand_409627453.txt AC 386 ms 20560 KB
SubTask2/rand_416537730.txt AC 393 ms 20568 KB
SubTask2/rand_425486442.txt AC 392 ms 20616 KB
SubTask2/rand_493135174.txt AC 391 ms 20576 KB
SubTask2/rand_573105326.txt AC 397 ms 20572 KB
SubTask2/rand_62794810.txt AC 414 ms 20568 KB
SubTask2/rand_649471654.txt AC 397 ms 20572 KB
SubTask2/rand_693017484.txt AC 402 ms 20580 KB
SubTask2/rand_729197057.txt AC 391 ms 20568 KB
SubTask2/rand_759630883.txt AC 407 ms 20568 KB
SubTask2/rand_823752210.txt AC 398 ms 20576 KB
SubTask2/rand_830399384.txt AC 416 ms 20576 KB
SubTask2/rand_893242387.txt AC 404 ms 20568 KB
SubTask2/rand_935005824.txt AC 404 ms 20584 KB
SubTask2/rand_989703310.txt AC 464 ms 20564 KB