제출 #1225397

#제출 시각아이디문제언어결과실행 시간메모리
1225397MarwenElarbiKangaroo (CEOI16_kangaroo)C++17
0 / 100
1 ms320 KiB
#include <bits/stdc++.h> using namespace std; const int nax=2e3+5; const int MOD=1e9+7; long long dp[nax][nax]; int main() { #ifndef ONLINE_JUDGE freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); #endif int n,l,r; cin>>n>>l>>r; if(l>r) swap(l,r); dp[0][0]=1; long long ans=0; vector<int> arr; for (int i = 0; i < n; ++i) { arr.push_back(i+1); } do{ if(arr[0]!=l) continue; if(arr.back()!=r) continue; bool test=true; for (int i = 1; i < n-1; ++i) { if(arr[i-1]<arr[i]&&arr[i]<arr[i+1]) test=false; if(arr[i-1]>arr[i]&&arr[i]>arr[i+1]) test=false; } /*if(test) for(auto u:arr) cout << u<<" "; cout <<endl;*/ ans+=test; }while(next_permutation(arr.begin(),arr.end())); cout <<ans<<endl; }

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

kangaroo.cpp: In function 'int main()':
kangaroo.cpp:8:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
    8 |         freopen("input.txt","r",stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
kangaroo.cpp:9:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |         freopen("output.txt","w",stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...