結果
| 問題 |
No.559 swapAB列
|
| コンテスト | |
| ユーザー |
uafr_cs
|
| 提出日時 | 2017-10-28 17:28:06 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 121 ms / 2,000 ms |
| コード長 | 556 bytes |
| コンパイル時間 | 1,991 ms |
| コンパイル使用メモリ | 74,988 KB |
| 実行使用メモリ | 41,616 KB |
| 最終ジャッジ日時 | 2024-11-22 03:40:40 |
| 合計ジャッジ時間 | 3,793 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 |
ソースコード
import java.util.Arrays;
import java.util.LinkedList;
import java.util.Scanner;
public class Main {
public static long MOD = 1000000007;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// めんどうなので A だけ寄せる
final char[] ins = sc.next().toCharArray();
int answer =0 ;
int curr_A_index = 0;
for(int index = 0; index < ins.length; index++){
if(ins[index] != 'A'){ continue; }
answer += (index - curr_A_index);
curr_A_index++;
}
System.out.println(answer);
}
}
uafr_cs