제출 #91980

#제출 시각아이디문제언어결과실행 시간메모리
91980emil_physmathNice sequence (IZhO18_sequence)C++17
15 / 100
9 ms760 KiB
#include <iostream> #include <stdio.h> using namespace std; void SubTaskOne(int n, int m); void SubTaskTwo(int n, int m); void SubTaskThree(int n, int m); void SubTaskFour(int n, int m); int main() { int T, n, m; cin>>T; while (T--) { cin>>n>>m; if (max(n, m)%min(n, m)==0) SubTaskOne(n, m); else if (max(n, m)<=10000 && min(n, m)==2) SubTaskTwo(n, m); else if (max(n, m)<=10) SubTaskThree(n, m); else if (max(n, m)-min(n, m)<=2) SubTaskFour(n, m); else return 0; } char I; cin >> I; return 0; } void SubTaskOne(int n, int m) { int fillNum=(n%m==0)?1:-1; cout<<max(n, m)-1<<'\n'; for (int i=1; i<max(n, m); i++) printf("%d ", fillNum); cout<<'\n'; } void SubTaskTwo(int n, int m) { if (n==2) { cout<<m<<'\n'; for (int i=0; i<m; i++) if (i%2) printf("%d ", -m); else printf("%d ", m-1); } else { cout<<n<<'\n'; for (int i=0; i<n; i++) if (i%2) printf("%d ", n); else printf("%d ", -n+1); } cout<<'\n'; } void SubTaskThree(int n, int m) { } void SubTaskFour(int n, int 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...