# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1085479 | 2024-09-08T10:16:33 Z | 8pete8 | Nice sequence (IZhO18_sequence) | C++17 | 6 ms | 1628 KB |
#include<iostream> #include<stack> #include<map> #include<vector> #include<string> #include<cassert> #include<unordered_map> #include <queue> #include <cstdint> #include<cstring> #include<limits.h> #include<cmath> #include<set> #include<algorithm> #include <iomanip> #include<numeric> #include<bitset> using namespace std; #define ll long long #define f first #define s second #define pii pair<int,int> #define ppii pair<int,pii> #define vi vector<int> #define pb push_back #define all(x) x.begin(),x.end() #define rall(x) x.rbegin(),x.rend() #define F(n) for(int i=0;i<n;i++) #define lb lower_bound #define ub upper_bound #define fastio ios::sync_with_stdio(false);cin.tie(NULL); #pragma GCC optimize ("03,unroll-lopps") #define int long long using namespace std; const int mod=1e9+7,mxn=2e5+5,inf=1e9,minf=-1e18,lg=30; //#undef int int n,k,m; void setIO(string name){ ios_base::sync_with_stdio(0); cin.tie(0); freopen((name+".in").c_str(),"r",stdin); freopen((name+".out").c_str(),"w",stdout); } void solve(){ int n,m,mul=1;cin>>n>>m; if(n>m)swap(n,m),mul=-1; int k=m+(m%n)-1; vector<int>ans(k); int val=(inf-1)/(n-1); cout<<k<<'\n'; for(int i=0;i<k;i++){ if(i%n==n-1)ans[i]=-inf; else ans[i]=val; } for(auto i:ans)cout<<mul*i<<" "; cout<<'\n'; } int32_t main(){ fastio int t;cin>>t; while(t--)solve(); } /* */
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 344 KB | Execution killed with signal 8 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Ok |
2 | Correct | 0 ms | 348 KB | Ok |
3 | Correct | 1 ms | 604 KB | Ok |
4 | Correct | 0 ms | 348 KB | Ok |
5 | Correct | 0 ms | 348 KB | Ok |
6 | Correct | 2 ms | 604 KB | Ok |
7 | Correct | 5 ms | 1372 KB | Ok |
8 | Correct | 3 ms | 856 KB | Ok |
9 | Correct | 6 ms | 1628 KB | Ok |
10 | Correct | 3 ms | 1116 KB | Ok |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 348 KB | Execution killed with signal 8 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Jury has the better answer : jans = 5, pans = 4 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 344 KB | Execution killed with signal 8 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 344 KB | Execution killed with signal 8 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 344 KB | Execution killed with signal 8 |
2 | Halted | 0 ms | 0 KB | - |