結果

問題 No.100 直列あみだくじ
ユーザー koba-e964
提出日時 2015-06-18 13:56:29
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 350 bytes
コンパイル時間 411 ms
コンパイル使用メモリ 55,224 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-07 03:37:52
合計ジャッジ時間 1,680 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 41 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)

using namespace std;
typedef long long int ll;


int a[51];
int main(void){
  int n;
  cin >> n;
  int c = 0;
  REP(i, 0, n) {
    cin >> a[i];
  }
  REP(i, 0, n) {
    REP(j, i + 1, n) {
      c += a[i] > a[j] ? 1 : 0;
    }
  }
  cout << (c % 2 ? "No" : "Yes") << endl;
}
0