📍 謎紛芥索紀 (Small)

https://www.acmicpc.net/problem/14730

 

 

 

 

 

 

항의 계수와 차수를 곱한 값을 더해주면 된다.

 

 

 

✨ 전체코드 ✨

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader sc = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st;

        int N = Integer.parseInt(sc.readLine());
        int sum = 0;

        for(int i=0; i<N; i++){
            st = new StringTokenizer(sc.readLine());

            int C = Integer.parseInt(st.nextToken());
            int K = Integer.parseInt(st.nextToken());

            sum += C*K;
        } System.out.println(sum);
    }
}

 

 

 

🌀 성능

  • 메모리 : 14,116 KB
  • 시간 : 120 ms

 

 

 


실버5가 아니라 브론즈5 해도 될 듯

Large 버전도 있던데 바로 풀어봐야겠다.