fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int t;
  6. cin>>t;
  7. while(t--){
  8. cin>>w;
  9. if(!w%2){
  10. cout<<"no\n";
  11. continue
  12. }
  13. int i = 1
  14. int c = w;
  15. while(c--){
  16. int h;
  17. cin>>h;
  18. if(c*2>w)
  19. if(h!=i++) cout<<"no\n";
  20. else
  21. if(h!=i--) cout<<"no\n";
  22. }
  23. if(w<0) cout<<"yes\n";
  24. }
  25. return 0;
  26. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:8:8: error: ‘w’ was not declared in this scope
   cin>>w;
        ^
prog.cpp:12:3: error: expected ‘;’ before ‘}’ token
   }
   ^
prog.cpp:14:3: error: expected ‘,’ or ‘;’ before ‘int’
   int c = w;
   ^~~
prog.cpp:15:9: error: ‘c’ was not declared in this scope
   while(c--){
         ^
stdout
Standard output is empty