結果

問題 No.742 にゃんにゃんにゃん 猫の挨拶
ユーザー HaarHaar
提出日時 2018-10-06 07:27:57
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 307 bytes
コンパイル時間 1,405 ms
コンパイル使用メモリ 150,316 KB
実行使用メモリ 8,976 KB
最終ジャッジ日時 2023-08-02 17:54:25
合計ジャッジ時間 5,663 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,384 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 10 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,384 KB
testcase_11 TLE -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
  int n;
  cin >> n;
  vector<int> ms(n,0);
  for(int i=0; i<n; ++i) cin >> ms[i];

  int count = 0;
  set<int> s;
  for(auto m : ms){
    count += distance(s.lower_bound(m), s.end());
    s.insert(m);
  }

  cout << count << endl;  
  return 0;
}
0