結果

問題 No.500 階乗電卓
ユーザー GJTD74aGJTD74a
提出日時 2017-04-20 00:56:34
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 432 bytes
コンパイル時間 313 ms
コンパイル使用メモリ 25,852 KB
実行使用メモリ 8,760 KB
最終ジャッジ日時 2023-09-26 15:25:30
合計ジャッジ時間 4,765 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 TLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
int main(void){
    long long int N,K,i,count;
    scanf("%lld",&N);
    scanf("%lld",&K);
    long long int hairetu[N];
    for(i=1;i<=N;i++)
    {
        scanf("%lld",&hairetu[i]);
    }
    count=0;
    while(i!=hairetu[i])
    {
        hairetu[hairetu[i]]=hairetu[i];
        count++;
    }
    if((K-count)%2==0 && K-count>=0)
    {
        printf("YES");
    }
    else
    {
        printf("NO");
    }
}
0