結果
| 問題 |
No.500 階乗電卓
|
| コンテスト | |
| ユーザー |
GJTD74a
|
| 提出日時 | 2017-04-20 00:54:46 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 484 bytes |
| コンパイル時間 | 355 ms |
| コンパイル使用メモリ | 23,168 KB |
| 実行使用メモリ | 812,928 KB |
| 最終ジャッジ日時 | 2024-07-19 09:32:15 |
| 合計ジャッジ時間 | 3,711 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | MLE * 1 -- * 19 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:4:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
4 | scanf("%lld",&N);
| ~~~~~^~~~~~~~~~~
main.cpp:5:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
5 | scanf("%lld",&K);
| ~~~~~^~~~~~~~~~~
main.cpp:9:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | scanf("%lld",&hairetu[i]);
| ~~~~~^~~~~~~~~~~~~~~~~~~~
ソースコード
#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;
for(i=1;i<=N;i++)
{
if(i!=hairetu[i])
{
hairetu[hairetu[i]]=hairetu[i];
count++;
}
}
if((K-count)%2==0 && K-count>=0)
{
printf("YES");
}
else
{
printf("NO");
}
}
GJTD74a