結果
問題 | No.559 swapAB列 |
ユーザー |
|
提出日時 | 2017-08-25 22:21:50 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 9 ms / 2,000 ms |
コード長 | 290 bytes |
コンパイル時間 | 915 ms |
コンパイル使用メモリ | 73,348 KB |
最終ジャッジ日時 | 2025-01-05 02:27:58 |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 |
ソースコード
#include <iostream>#include <algorithm>#include <vector>#include <string>using namespace std;int main() {string s;cin >> s;int ans = 0;for (int i = 0; i < s.size(); i++) {for (int j = 0; j < i; j++) {if (s[j] > s[i]) ans++;}}cout << ans << endl;}