Submission #344982

#TimeUsernameProblemLanguageResultExecution timeMemory
344982kkkNice sequence (IZhO18_sequence)C++14
6 / 100
1 ms384 KiB
#include<iostream> #include<cstring> #define endl '\n' using namespace std; long long a[100003],d[100003],used[5002]; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); long long n,l,r,i,j,t,m; cin>>t; for(i=0;i<t;i++) { cin>>n>>m; if(n>m) { cout<<n-1<<endl; if(n-1!=0){ for(j=1;j<n-1;j++)cout<<j<<" ";cout<<n-1<<endl;} } else { cout<<m-1<<endl; if(m-1!=0){ for(j=1;j<m-1;j++)cout<<-j<<" ";cout<<-m+1<<endl;} } } }

Compilation message (stderr)

sequence.cpp: In function 'int main()':
sequence.cpp:21:12: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   21 |            for(j=1;j<n-1;j++)cout<<j<<" ";cout<<n-1<<endl;}
      |            ^~~
sequence.cpp:21:43: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   21 |            for(j=1;j<n-1;j++)cout<<j<<" ";cout<<n-1<<endl;}
      |                                           ^~~~
sequence.cpp:26:14: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   26 |              for(j=1;j<m-1;j++)cout<<-j<<" ";cout<<-m+1<<endl;}
      |              ^~~
sequence.cpp:26:46: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   26 |              for(j=1;j<m-1;j++)cout<<-j<<" ";cout<<-m+1<<endl;}
      |                                              ^~~~
sequence.cpp:12:17: warning: unused variable 'l' [-Wunused-variable]
   12 |     long long n,l,r,i,j,t,m;
      |                 ^
sequence.cpp:12:19: warning: unused variable 'r' [-Wunused-variable]
   12 |     long long n,l,r,i,j,t,m;
      |                   ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...