제출 #1117796

#제출 시각아이디문제언어결과실행 시간메모리
1117796vjudge1캥거루 (CEOI16_kangaroo)C++17
0 / 100
2054 ms33360 KiB
#pragma GCC optimize("O3") #include<bits/stdc++.h> #define ll long long #define endl "\n" #define AI ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); using namespace std; vector<ll>val; vector<vector<ll>>edge; vector<ll>check; ll k,c=0; int main() { AI freopen("kangaroo.in", "r", stdin); freopen("kangaroo.out", "w", stdout); ll n,a,b,i,j; cin>>n>>a>>b; vector<vector<ll>>per; vector<ll>v(n); for(i=1;i<=n;i++) v[i-1]=i; do { if(v[0]!=a or v[n-1]!=b) continue; bool bo=true; for(i=1;i<n;i++) { if(i>2 and ((v[i-2]<v[i-1] and v[i-1]<v[i]) or (v[i-2]>v[i-1] and v[i-1]>v[i]))) { bo=false; break; } } if(bo) per.push_back(v); }while(next_permutation(v.begin(),v.end())); cout<<per.size(); }

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

kangaroo.cpp: In function 'int main()':
kangaroo.cpp:16:16: warning: unused variable 'j' [-Wunused-variable]
   16 |     ll n,a,b,i,j;
      |                ^
kangaroo.cpp:14:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |     freopen("kangaroo.in", "r", stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
kangaroo.cpp:15:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |     freopen("kangaroo.out", "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...