結果
問題 | No.559 swapAB列 |
ユーザー |
![]() |
提出日時 | 2019-03-04 00:40:55 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 274 bytes |
コンパイル時間 | 499 ms |
コンパイル使用メモリ | 61,480 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-23 13:20:25 |
合計ジャッジ時間 | 975 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 6 WA * 1 |
ソースコード
#include <iostream>#include <vector>#include <algorithm>using namespace std;int main(void){string s;cin >> s;int c = 0;int ans = 0;for(int i = 0; i < s.length(); i++){if(s[i] == s[0]) c++;else ans += c;}cout << ans << endl;return 0;}