제출 #604754

#제출 시각아이디문제언어결과실행 시간메모리
604754HazemKangaroo (CEOI16_kangaroo)C++14
6 / 100
2085 ms212 KiB
#include <bits/stdc++.h>
#define LL long long 

using namespace std;

const int N = 2e5+10;
int a[N];

int main()
{

    int n,s,f;
    scanf("%d%d%d",&n,&s,&f);

    for(int i=1;i<=n;i++)
        a[i] = i;

    int ans = 0;
    do{
        bool q = 1;
        q &= a[1]==s;
        q &= a[n]==f;

        for(int i=3;i<=n;i++)
            q &= (a[i]>a[i-1])^(a[i-1]>a[i-2]);

        ans += q;

    }while(next_permutation(a+1,a+n+1));

    printf("%d\n",ans);
}

컴파일 시 표준 에러 (stderr) 메시지

kangaroo.cpp: In function 'int main()':
kangaroo.cpp:13:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |     scanf("%d%d%d",&n,&s,&f);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...