Submission #334881

# Submission time Handle Problem Language Result Execution time Memory
334881 2020-12-10T06:58:50 Z beksultan04 Nice sequence (IZhO18_sequence) C++14
0 / 100
1 ms 364 KB
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pii pair<int,int>
#define OK puts("OK");
#define fr first
#define sc second
#define ret return
#define scan1(a) scanf("%lld",&a);
#define scan2(a,b) scanf("%lld %lld",&a, &b);
#define scan3(a,b,c) scanf("%lld %lld %lld",&a,&b,&c);
#define all(s) s.begin(),s.end()
#define pb push_back
#define endi puts("");
const int N = 1e6+12,INF=1e9+7;

main(){
    int t;
    scan1(t)
    while (t--){
        int n,m,i,mx,mn;
        scan2(n,m)
        mx = max(m,n);
        mn = min(m,n);
        if (mx%mn==0){
            if (n > m){
                for (i=1;i<n;++i)cout <<"-1 ";
                endi;
            }
            else {
                for (i=1;i<n;++i)cout <<"1 ";
                endi;
            }
        }
    }
}




Compilation message

sequence.cpp:17:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   17 | main(){
      |      ^
sequence.cpp: In function 'int main()':
sequence.cpp:9:23: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    9 | #define scan1(a) scanf("%lld",&a);
      |                  ~~~~~^~~~~~~~~~~
sequence.cpp:19:5: note: in expansion of macro 'scan1'
   19 |     scan1(t)
      |     ^~~~~
sequence.cpp:10:25: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   10 | #define scan2(a,b) scanf("%lld %lld",&a, &b);
      |                    ~~~~~^~~~~~~~~~~~~~~~~~~~
sequence.cpp:22:9: note: in expansion of macro 'scan2'
   22 |         scan2(n,m)
      |         ^~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Jury has the better answer : jans = 0, pans = -1
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 = -1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Jury has the better answer : jans = 2, pans = -1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 364 KB Jury has the better answer : jans = 3, pans = 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Jury has the better answer : jans = 0, pans = -1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Jury has the better answer : jans = 0, pans = -1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Jury has the better answer : jans = 0, pans = -1
2 Halted 0 ms 0 KB -