Submission #1085479

# Submission time Handle Problem Language Result Execution time Memory
1085479 2024-09-08T10:16:33 Z 8pete8 Nice sequence (IZhO18_sequence) C++17
9 / 100
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

sequence.cpp:32:40: warning: bad option '-funroll-lopps' to pragma 'optimize' [-Wpragmas]
   32 | #pragma GCC optimize ("03,unroll-lopps")
      |                                        ^
sequence.cpp:38:23: warning: bad option '-funroll-lopps' to attribute 'optimize' [-Wattributes]
   38 | void setIO(string name){
      |                       ^
sequence.cpp:43:12: warning: bad option '-funroll-lopps' to attribute 'optimize' [-Wattributes]
   43 | void solve(){
      |            ^
sequence.cpp:57:14: warning: bad option '-funroll-lopps' to attribute 'optimize' [-Wattributes]
   57 | int32_t main(){
      |              ^
sequence.cpp: In function 'void setIO(std::string)':
sequence.cpp:40:9: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   40 |  freopen((name+".in").c_str(),"r",stdin);
      |  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sequence.cpp:41:9: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   41 |  freopen((name+".out").c_str(),"w",stdout);
      |  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 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 -