結果
| 問題 |
No.2089 置換の符号
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-09-30 21:31:10 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 8 ms / 2,000 ms |
| コード長 | 510 bytes |
| コンパイル時間 | 9,147 ms |
| コンパイル使用メモリ | 399,080 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-22 22:28:33 |
| 合計ジャッジ時間 | 10,227 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 33 |
ソースコード
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<bits/extc++.h>
using namespace std;
typedef long long ll;
typedef long long ull;
constexpr int dx[]={1,0,0,-1},dy[]={0,1,-1,0};
constexpr int mod=998244353,Mod=1e9+7;
//*
#include<atcoder/all>
using namespace atcoder;
//*/
int main(){
int n,s[10000];
cin>>n;
for(int i=0;i<n;i++)
cin>>s[i];
int ans=0;
for(int i=0;i<n;i++)
for(int j=i+1;j<n;j++)
if(s[i]>s[j])
ans++;
cout<<(1-ans%2*2)<<endl;
}