제출 #493497

#제출 시각아이디문제언어결과실행 시간메모리
493497Homichki아름다운 순열 (IZhO12_beauty)C++14
0 / 100
1738 ms324 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll st3(ll x) { ll kol=0; while(x>0) { if(x%3==1) { kol++; } x/=3; } return kol; } int main() { ios::sync_with_stdio(false); cin.tie(0); //ifstream cin("input.txt"); //ofstream cout("output.txt"); ll k,m,x1,y1,p,qqq,i,j,z,x,y,l,r,kry,w,sum,t,n,h,mew,ma,kol; vector<ll> a,b; string s; char s1; cin>>n; if(n>10) { return 0; } for(i=0;i<n;i++) { cin>>x; a.push_back(x); b.push_back(i); } sort(b.begin(),b.end()); kol=0; do { kry=0; for(i=1;i<n;i++) { y=__builtin_popcount(a[b[i-1]]); x=__builtin_popcount(a[b[i]]); l=st3(a[b[i-1]]); r=st3(a[b[i]]); if((y!=x) && (l!=r)) { kry++; break; } } if(kry==0) { kol++; } }while(next_permutation(b.begin(),b.end())); cout<<kol; return 0; }

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

beauty.cpp: In function 'int main()':
beauty.cpp:24:8: warning: unused variable 'k' [-Wunused-variable]
   24 |     ll k,m,x1,y1,p,qqq,i,j,z,x,y,l,r,kry,w,sum,t,n,h,mew,ma,kol;
      |        ^
beauty.cpp:24:10: warning: unused variable 'm' [-Wunused-variable]
   24 |     ll k,m,x1,y1,p,qqq,i,j,z,x,y,l,r,kry,w,sum,t,n,h,mew,ma,kol;
      |          ^
beauty.cpp:24:12: warning: unused variable 'x1' [-Wunused-variable]
   24 |     ll k,m,x1,y1,p,qqq,i,j,z,x,y,l,r,kry,w,sum,t,n,h,mew,ma,kol;
      |            ^~
beauty.cpp:24:15: warning: unused variable 'y1' [-Wunused-variable]
   24 |     ll k,m,x1,y1,p,qqq,i,j,z,x,y,l,r,kry,w,sum,t,n,h,mew,ma,kol;
      |               ^~
beauty.cpp:24:18: warning: unused variable 'p' [-Wunused-variable]
   24 |     ll k,m,x1,y1,p,qqq,i,j,z,x,y,l,r,kry,w,sum,t,n,h,mew,ma,kol;
      |                  ^
beauty.cpp:24:20: warning: unused variable 'qqq' [-Wunused-variable]
   24 |     ll k,m,x1,y1,p,qqq,i,j,z,x,y,l,r,kry,w,sum,t,n,h,mew,ma,kol;
      |                    ^~~
beauty.cpp:24:26: warning: unused variable 'j' [-Wunused-variable]
   24 |     ll k,m,x1,y1,p,qqq,i,j,z,x,y,l,r,kry,w,sum,t,n,h,mew,ma,kol;
      |                          ^
beauty.cpp:24:28: warning: unused variable 'z' [-Wunused-variable]
   24 |     ll k,m,x1,y1,p,qqq,i,j,z,x,y,l,r,kry,w,sum,t,n,h,mew,ma,kol;
      |                            ^
beauty.cpp:24:42: warning: unused variable 'w' [-Wunused-variable]
   24 |     ll k,m,x1,y1,p,qqq,i,j,z,x,y,l,r,kry,w,sum,t,n,h,mew,ma,kol;
      |                                          ^
beauty.cpp:24:44: warning: unused variable 'sum' [-Wunused-variable]
   24 |     ll k,m,x1,y1,p,qqq,i,j,z,x,y,l,r,kry,w,sum,t,n,h,mew,ma,kol;
      |                                            ^~~
beauty.cpp:24:48: warning: unused variable 't' [-Wunused-variable]
   24 |     ll k,m,x1,y1,p,qqq,i,j,z,x,y,l,r,kry,w,sum,t,n,h,mew,ma,kol;
      |                                                ^
beauty.cpp:24:52: warning: unused variable 'h' [-Wunused-variable]
   24 |     ll k,m,x1,y1,p,qqq,i,j,z,x,y,l,r,kry,w,sum,t,n,h,mew,ma,kol;
      |                                                    ^
beauty.cpp:24:54: warning: unused variable 'mew' [-Wunused-variable]
   24 |     ll k,m,x1,y1,p,qqq,i,j,z,x,y,l,r,kry,w,sum,t,n,h,mew,ma,kol;
      |                                                      ^~~
beauty.cpp:24:58: warning: unused variable 'ma' [-Wunused-variable]
   24 |     ll k,m,x1,y1,p,qqq,i,j,z,x,y,l,r,kry,w,sum,t,n,h,mew,ma,kol;
      |                                                          ^~
beauty.cpp:27:10: warning: unused variable 's1' [-Wunused-variable]
   27 |     char s1;
      |          ^~
#Verdict Execution timeMemoryGrader output
Fetching results...