結果
| 問題 |
No.2089 置換の符号
|
| コンテスト | |
| ユーザー |
chro_96
|
| 提出日時 | 2022-09-30 21:46:08 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 45 ms / 2,000 ms |
| コード長 | 365 bytes |
| コンパイル時間 | 527 ms |
| コンパイル使用メモリ | 29,568 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-22 23:13:40 |
| 合計ジャッジ時間 | 1,478 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 33 |
ソースコード
#include <stdio.h>
int main () {
int n = 0;
int s[10000] = {};
int res = 0;
int cnt = 0;
res = scanf("%d", &n);
for (int i = 0; i < n; i++) {
res = scanf("%d", s+i);
for (int j = 0; j < i; j++) {
if (s[j] > s[i]) {
cnt++;
}
}
}
if (cnt%2 == 1) {
printf("-");
}
printf("1\n");
return 0;
}
chro_96