Submission #344982

# Submission time Handle Problem Language Result Execution time Memory
344982 2021-01-06T20:39:35 Z kkk Nice sequence (IZhO18_sequence) C++14
6 / 100
1 ms 384 KB
#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

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 time Memory Grader output
1 Correct 1 ms 364 KB Ok
2 Correct 1 ms 364 KB Ok
3 Correct 1 ms 364 KB Ok
4 Correct 1 ms 364 KB Ok
5 Correct 1 ms 364 KB Ok
6 Correct 1 ms 364 KB Ok
7 Correct 1 ms 364 KB Ok
8 Correct 1 ms 364 KB Ok
9 Correct 1 ms 364 KB Ok
10 Correct 1 ms 364 KB Ok
11 Correct 1 ms 384 KB Ok
12 Correct 1 ms 364 KB Ok
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Jury has the better answer : jans = 3, pans = 2
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Jury has the better answer : jans = 3, pans = 2
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Jury has the better answer : jans = 3, pans = 2
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Ok
2 Correct 1 ms 364 KB Ok
3 Correct 1 ms 364 KB Ok
4 Correct 1 ms 364 KB Ok
5 Correct 1 ms 364 KB Ok
6 Correct 1 ms 364 KB Ok
7 Correct 1 ms 364 KB Ok
8 Correct 1 ms 364 KB Ok
9 Correct 1 ms 364 KB Ok
10 Correct 1 ms 364 KB Ok
11 Correct 1 ms 384 KB Ok
12 Correct 1 ms 364 KB Ok
13 Incorrect 1 ms 364 KB Jury has the better answer : jans = 3, pans = 2
14 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Ok
2 Correct 1 ms 364 KB Ok
3 Correct 1 ms 364 KB Ok
4 Correct 1 ms 364 KB Ok
5 Correct 1 ms 364 KB Ok
6 Correct 1 ms 364 KB Ok
7 Correct 1 ms 364 KB Ok
8 Correct 1 ms 364 KB Ok
9 Correct 1 ms 364 KB Ok
10 Correct 1 ms 364 KB Ok
11 Correct 1 ms 384 KB Ok
12 Correct 1 ms 364 KB Ok
13 Incorrect 1 ms 364 KB Jury has the better answer : jans = 3, pans = 2
14 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Ok
2 Correct 1 ms 364 KB Ok
3 Correct 1 ms 364 KB Ok
4 Correct 1 ms 364 KB Ok
5 Correct 1 ms 364 KB Ok
6 Correct 1 ms 364 KB Ok
7 Correct 1 ms 364 KB Ok
8 Correct 1 ms 364 KB Ok
9 Correct 1 ms 364 KB Ok
10 Correct 1 ms 364 KB Ok
11 Correct 1 ms 384 KB Ok
12 Correct 1 ms 364 KB Ok
13 Incorrect 1 ms 364 KB Jury has the better answer : jans = 3, pans = 2
14 Halted 0 ms 0 KB -