Submission #172719

# Submission time Handle Problem Language Result Execution time Memory
172719 2020-01-02T12:56:32 Z mosiashvililuka Nice sequence (IZhO18_sequence) C++14
15 / 100
10 ms 888 KB
#include<bits/stdc++.h>
using namespace std;
int a,b,c,d,e,tes,t,n,m,zx;
int main(){
    ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
    cin>>tes;
    for(t=1; t<=tes; t++){
        cin>>n>>m;
        if(n<m){
            swap(n,m);
            zx=-1;
        }else{
            zx=1;
        }
        if(n%m==0){
        cout<<n-1<<endl;
        if(n!=1){
            for(b=1; b<n; b++){
                cout<<zx<<" ";
            }
            cout<<endl;
        }
        }else{
            cout<<n<<endl;
            for(b=1; b<=n; b++){
                if(b%2==0) cout<<zx*1000000<<" "; else cout<<-zx*999999<<" ";
            }
            cout<<endl;
        }
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 380 KB Ok
2 Correct 2 ms 376 KB Ok
3 Correct 2 ms 376 KB Ok
4 Correct 2 ms 376 KB Ok
5 Correct 2 ms 376 KB Ok
6 Correct 2 ms 376 KB Ok
7 Correct 1 ms 376 KB Ok
8 Correct 2 ms 376 KB Ok
9 Correct 2 ms 376 KB Ok
10 Correct 2 ms 376 KB Ok
11 Correct 2 ms 376 KB Ok
12 Correct 2 ms 376 KB Ok
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Ok
2 Correct 2 ms 376 KB Ok
3 Correct 2 ms 376 KB Ok
4 Correct 2 ms 376 KB Ok
5 Correct 2 ms 292 KB Ok
6 Correct 4 ms 456 KB Ok
7 Correct 10 ms 756 KB Ok
8 Correct 5 ms 604 KB Ok
9 Correct 10 ms 888 KB Ok
10 Correct 7 ms 632 KB Ok
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Ok
2 Correct 2 ms 376 KB Ok
3 Correct 2 ms 376 KB Ok
4 Incorrect 2 ms 376 KB Jury has the better answer : jans = 9, pans = 8
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Jury has the better answer : jans = 5, pans = 4
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 380 KB Ok
2 Correct 2 ms 376 KB Ok
3 Correct 2 ms 376 KB Ok
4 Correct 2 ms 376 KB Ok
5 Correct 2 ms 376 KB Ok
6 Correct 2 ms 376 KB Ok
7 Correct 1 ms 376 KB Ok
8 Correct 2 ms 376 KB Ok
9 Correct 2 ms 376 KB Ok
10 Correct 2 ms 376 KB Ok
11 Correct 2 ms 376 KB Ok
12 Correct 2 ms 376 KB Ok
13 Correct 2 ms 376 KB Ok
14 Correct 2 ms 376 KB Ok
15 Correct 2 ms 376 KB Ok
16 Incorrect 2 ms 376 KB Jury has the better answer : jans = 9, pans = 8
17 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 380 KB Ok
2 Correct 2 ms 376 KB Ok
3 Correct 2 ms 376 KB Ok
4 Correct 2 ms 376 KB Ok
5 Correct 2 ms 376 KB Ok
6 Correct 2 ms 376 KB Ok
7 Correct 1 ms 376 KB Ok
8 Correct 2 ms 376 KB Ok
9 Correct 2 ms 376 KB Ok
10 Correct 2 ms 376 KB Ok
11 Correct 2 ms 376 KB Ok
12 Correct 2 ms 376 KB Ok
13 Correct 2 ms 376 KB Ok
14 Correct 2 ms 376 KB Ok
15 Correct 2 ms 376 KB Ok
16 Correct 2 ms 376 KB Ok
17 Correct 2 ms 292 KB Ok
18 Correct 4 ms 456 KB Ok
19 Correct 10 ms 756 KB Ok
20 Correct 5 ms 604 KB Ok
21 Correct 10 ms 888 KB Ok
22 Correct 7 ms 632 KB Ok
23 Correct 2 ms 376 KB Ok
24 Correct 2 ms 376 KB Ok
25 Correct 2 ms 376 KB Ok
26 Incorrect 2 ms 376 KB Jury has the better answer : jans = 9, pans = 8
27 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 380 KB Ok
2 Correct 2 ms 376 KB Ok
3 Correct 2 ms 376 KB Ok
4 Correct 2 ms 376 KB Ok
5 Correct 2 ms 376 KB Ok
6 Correct 2 ms 376 KB Ok
7 Correct 1 ms 376 KB Ok
8 Correct 2 ms 376 KB Ok
9 Correct 2 ms 376 KB Ok
10 Correct 2 ms 376 KB Ok
11 Correct 2 ms 376 KB Ok
12 Correct 2 ms 376 KB Ok
13 Correct 2 ms 376 KB Ok
14 Correct 2 ms 376 KB Ok
15 Correct 2 ms 376 KB Ok
16 Correct 2 ms 376 KB Ok
17 Correct 2 ms 292 KB Ok
18 Correct 4 ms 456 KB Ok
19 Correct 10 ms 756 KB Ok
20 Correct 5 ms 604 KB Ok
21 Correct 10 ms 888 KB Ok
22 Correct 7 ms 632 KB Ok
23 Correct 2 ms 376 KB Ok
24 Correct 2 ms 376 KB Ok
25 Correct 2 ms 376 KB Ok
26 Incorrect 2 ms 376 KB Jury has the better answer : jans = 9, pans = 8
27 Halted 0 ms 0 KB -