結果

問題 No.175 simpleDNA
コンテスト
ユーザー fkwnw3_1243
提出日時 2017-04-30 10:11:04
言語 Java
(openjdk 26.0.2.1)
コンパイル:
javac -encoding UTF8 _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true _class_
結果
AC  
実行時間 30 ms / 1,000 ms
+ 71µs
コード長 714 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,354 ms
コンパイル使用メモリ 83,048 KB
実行使用メモリ 40,320 KB
最終ジャッジ日時 2026-08-26 15:32:53
合計ジャッジ時間 3,134 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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