結果
| 問題 |
No.559 swapAB列
|
| コンテスト | |
| ユーザー |
kimny
|
| 提出日時 | 2017-12-08 16:54:04 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 25 ms / 2,000 ms |
| コード長 | 573 bytes |
| コンパイル時間 | 805 ms |
| コンパイル使用メモリ | 111,572 KB |
| 実行使用メモリ | 25,684 KB |
| 最終ジャッジ日時 | 2024-11-29 19:36:13 |
| 合計ジャッジ時間 | 1,640 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace yukicoder_559 {
class Program {
static void Main(string[] args) {
//A:65,B:66
char[] a = Console.ReadLine().ToCharArray();
int countB = 0;
int answer = 0;
for(int i = 0; i < a.Length; i++) {
if (a[i] == 66) countB++;
else answer += countB;
}
Console.WriteLine(answer);
Console.ReadLine();
}
}
}
kimny