結果

問題 No.1943 消えたAGCT(1)
ユーザー マサマサ
提出日時 2022-09-30 22:55:58
言語 Java21
(openjdk 21)
結果
AC  
実行時間 543 ms / 2,000 ms
コード長 489 bytes
コンパイル時間 2,122 ms
コンパイル使用メモリ 71,796 KB
実行使用メモリ 95,272 KB
最終ジャッジ日時 2023-08-24 16:30:31
合計ジャッジ時間 13,011 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
53,744 KB
testcase_01 AC 119 ms
55,824 KB
testcase_02 AC 120 ms
56,172 KB
testcase_03 AC 121 ms
55,852 KB
testcase_04 AC 120 ms
55,952 KB
testcase_05 AC 123 ms
55,856 KB
testcase_06 AC 123 ms
56,168 KB
testcase_07 AC 122 ms
56,068 KB
testcase_08 AC 121 ms
55,760 KB
testcase_09 AC 543 ms
94,952 KB
testcase_10 AC 523 ms
95,080 KB
testcase_11 AC 523 ms
92,632 KB
testcase_12 AC 498 ms
94,624 KB
testcase_13 AC 433 ms
77,780 KB
testcase_14 AC 182 ms
58,492 KB
testcase_15 AC 501 ms
94,424 KB
testcase_16 AC 446 ms
86,160 KB
testcase_17 AC 444 ms
86,780 KB
testcase_18 AC 493 ms
94,616 KB
testcase_19 AC 542 ms
94,660 KB
testcase_20 AC 506 ms
95,152 KB
testcase_21 AC 497 ms
94,876 KB
testcase_22 AC 492 ms
94,536 KB
testcase_23 AC 495 ms
95,272 KB
testcase_24 AC 517 ms
94,456 KB
testcase_25 AC 523 ms
94,796 KB
testcase_26 AC 529 ms
94,672 KB
権限があれば一括ダウンロードができます

ソースコード

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;
		int i = strAry.length - 1;
		for ( ; -1 < i ; i--) {
			switch(strAry[i]) {
				case "A":
				case "G":
				case "C":
				case "T":
					flag = true;
					break;
			}
			
			if (flag) {
				break;
			}
		}
		
		System.out.println(i + 1);
		
		sc.close();
		
	}
}
0