SWEA [D1] 더블더블 - 2019 JAVA

YB·2026년 5월 17일
post-thumbnail

링크텍스트

설명

풀이 흐름 설명

시간복잡도: O(N), 공간복잡도: O(N)

회독

  • [ x ] 1회
  • 2회
  • 3회

코드

import java.util.Scanner;
import java.io.FileInputStream;

class Solution
{
    static StringBuilder sb = new StringBuilder();
	public static void main(String args[]) throws Exception
	{

		Scanner sc = new Scanner(System.in);
		int T;
		T=sc.nextInt();
		
        sb.append(1).append(" ");
		for(int test_case = 0; test_case <T; test_case++)
		{
			sb.append(2<<test_case).append(" ");
		}
        
        System.out.print(sb);
	}
}

profile
안녕하세요

0개의 댓글