QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#110967 | #3132. The League of Sequence Designers | owkyehfsmkbrgumpne | Compile Error | / | / | C++14 | 2.2kb | 2023-06-05 02:55:19 | 2023-06-05 02:55:21 |
Judging History
你现在查看的是最新测评结果
- [2023-08-10 23:21:45]
- System Update: QOJ starts to keep a history of the judgings of all the submissions.
- [2023-06-05 02:55:21]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2023-06-05 02:55:19]
- 提交
answer
#include <bits/stdc++.h>
using namespace std;
/* TYPES */
#define ll long long
#define ld long double
#define pii pair<int, int>
#define pll pair<long long, long long>
#define vi vector<int>
#define vll vector<long long>
#define mii map<int, int>
#define si set<int>
#define sc set<char>
/* FUNCTIONS */
#define f(i,s,e) for(long long int i=s;i<e;i++)
#define trav(a, x) for (auto &a : x)
#define cf(i,s,e) for(long long int i=s;i<=e;i++)
#define rf(i,e,s) for(long long int i=e-1;i>=s;i--)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define lb lower_bound
#define ub upper_bound
#define rall(x) x.rbegin(), x.rend()
/* TESTING */
#define dbg(x) cout << #x << " = " << x << endl;
#define fastio ios::sync_with_stdio(false); cin.tie(NULL); // cout.tie(NULL);
#define cinx(array) for(auto& x : array) cin >> x;
/* CONSTANTS */
#define MOD 1000000007
#define INF 1e18
// Vector, set, string, const char
template <class Ch, class Tr, class Container>
basic_ostream <Ch, Tr> & operator << (basic_ostream <Ch, Tr> & os, Container const& x) {
os << "{ ";
for(auto& y : x) os << y << " ";
return os << "}";
}
// map
template <class X, class Y>
ostream & operator << (ostream & os, pair <X, Y> const& p) {
return os << "[ " << p.first << ", " << p.second << "]" ;
}
void solve(){
int ans,x,n;
scanf("%d%d",&k,&l);
if(l>2000){
printf("-1\n");
return ;
}
bool flag=false;
for(int i=2;i<=2000;i++){
int mo=k%(i-1);
x=i-1-mo;
ans=x+(x+k)/(i-1);
// if(i==2) printf("%d\n",ans);
if(ans<=1000000){
n=i;
flag=true;
break;
}
}
if(!flag) printf("-1\n");
else {
printf("1999\n");
for(int i=1;i<=1999-n;i++)
printf("-1000000 ");
for(int i=1999-n+1;i<=1997;i++)
printf("0 ");
printf("%d ",-x);
printf("%d\n",ans);
}
}
int main(){
fastio;
int t;
cin >> t;
while(t--){
solve();
}
return 0;
}
詳細信息
answer.code: In function ‘void solve()’: answer.code:57:19: error: ‘k’ was not declared in this scope 57 | scanf("%d%d",&k,&l); | ^ answer.code:57:22: error: ‘l’ was not declared in this scope 57 | scanf("%d%d",&k,&l); | ^