結果

問題 No.1943 消えたAGCT(1)
ユーザー マサマサ
提出日時 2022-09-30 22:49:44
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 486 bytes
コンパイル時間 2,153 ms
コンパイル使用メモリ 72,056 KB
実行使用メモリ 95,352 KB
最終ジャッジ日時 2023-08-24 16:24:21
合計ジャッジ時間 14,841 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,756 KB
testcase_01 AC 119 ms
56,044 KB
testcase_02 AC 119 ms
55,576 KB
testcase_03 WA -
testcase_04 AC 120 ms
55,476 KB
testcase_05 WA -
testcase_06 AC 119 ms
55,768 KB
testcase_07 AC 120 ms
55,788 KB
testcase_08 AC 120 ms
55,788 KB
testcase_09 AC 495 ms
94,348 KB
testcase_10 WA -
testcase_11 AC 521 ms
94,592 KB
testcase_12 AC 499 ms
95,204 KB
testcase_13 AC 428 ms
77,332 KB
testcase_14 AC 182 ms
58,480 KB
testcase_15 AC 542 ms
94,804 KB
testcase_16 AC 439 ms
86,036 KB
testcase_17 AC 439 ms
87,064 KB
testcase_18 AC 497 ms
94,416 KB
testcase_19 AC 495 ms
94,464 KB
testcase_20 AC 517 ms
94,924 KB
testcase_21 AC 496 ms
94,720 KB
testcase_22 AC 497 ms
93,644 KB
testcase_23 AC 497 ms
94,436 KB
testcase_24 AC 522 ms
94,916 KB
testcase_25 AC 521 ms
94,168 KB
testcase_26 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		String[] strAry = (sc.next()).split("");
		
		boolean flag = false;
		for (int i = strAry.length - 1; -1 < i ; i--) {
			switch(strAry[i]) {
				case "A":
				case "G":
				case "C":
				case "T":
					flag = true;
					break;
			}
			
			if (flag) {
				System.out.println(i + 1);
				break;
			}
		}
		
		
		sc.close();
		
	}
}
0