結果

問題 No.175 simpleDNA
ユーザー fkwnw3_1243fkwnw3_1243
提出日時 2017-04-30 10:11:04
言語 Java21
(openjdk 21)
結果
AC  
実行時間 45 ms / 1,000 ms
コード長 714 bytes
コンパイル時間 1,937 ms
コンパイル使用メモリ 71,728 KB
実行使用メモリ 49,444 KB
最終ジャッジ日時 2023-10-11 23:31:31
合計ジャッジ時間 3,072 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
49,108 KB
testcase_01 AC 44 ms
49,116 KB
testcase_02 AC 44 ms
49,308 KB
testcase_03 AC 44 ms
49,248 KB
testcase_04 AC 45 ms
49,444 KB
testcase_05 AC 45 ms
49,300 KB
testcase_06 AC 44 ms
49,260 KB
testcase_07 AC 44 ms
49,236 KB
testcase_08 AC 44 ms
49,212 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

import static java.lang.System.in;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        int L = Integer.parseInt(reader.readLine());
        int N = Integer.parseInt(reader.readLine());
        String[] inputs = reader.readLine().split(" ");
        int sum = 0;
        for (int i = 0; i < N; i++) {
            String pattern = inputs[i];
             int diff = L-pattern.length();
             int m =(int) Math.pow(2,diff);
             sum+=m;
        }
        System.out.println(sum);
    }

}
0