結果

問題 No.742 にゃんにゃんにゃん 猫の挨拶
ユーザー HaarHaar
提出日時 2018-10-06 07:27:57
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 307 bytes
コンパイル時間 1,670 ms
コンパイル使用メモリ 166,416 KB
実行使用メモリ 11,424 KB
最終ジャッジ日時 2024-04-20 18:03:08
合計ジャッジ時間 5,813 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
10,624 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 9 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 1 ms
5,376 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