QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#229849 | #7636. Fair Elections | ucup-team918# | WA | 0ms | 3564kb | C++14 | 2.6kb | 2023-10-28 17:02:44 | 2023-10-28 17:02:50 |
Judging History
answer
/* Code by pp_orange */
#include<bits/stdc++.h>
#define m_p(a,b) make_pair(a,b)
#define pb push_back
#define ll long long
#define ull unsigned long long
#define lld long double
#define inf 0x7FFFFFFF
#define inff 9223372036854775807
#define rep(i,l,r) for(int i=l;i<r;++i)
#define repp(i,l,r) for(int i=l;i<=r;++i)
#define per(i,r,l) for(int i=r-1;i>=l;--i)
#define pper(i,r,l) for(int i=r;i>=l;--i)
#define pii pair<int,int>
#define fi first
#define se second
#define p_q priority_queue
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define ls(x) ((x)<<1)
#define rs(x) ((x)<<1|1)
#define lb(x) ((x)&-(x))
const int mod = 998244353;
//#define int ll
using namespace std;
inline int rd(){
int x(0),f(1);char ch=getchar();
while(!isdigit(ch)){if(ch=='-')f=-f;ch=getchar();}
while (isdigit(ch)){x=(x<<3)+(x<<1)+(ch^48);ch=getchar();}
return x*f;
}
inline void out(int X){
if(X<0) {X=~(X-1); putchar('-');}
if(X>9) out(X/10);
putchar(X%10+'0');
}
ll pw(ll x,int d){
ll t = 1;
for(;d;d>>=1,x=x*x%mod)if(d&1)t = t*x%mod;
return t;
}
#define MAX 200005
signed main(){
//freopen("in.in","r",stdin);
//freopen("out.out","w",stdout);
int p = rd();
int q = rd();
if(5*p>4*q){
cout<<-1<<' '<<-1<<endl;
return 0;
}
if(p==0){
cout<<"1 1\n.\n";
return 0;
}
if(p<=2){
if(p==1)p*=2,q*=2;
cout<<1<<' '<<q<<endl;
rep(i,0,p)cout<<"#";
rep(i,0,q-p)cout<<".";
cout<<endl;
return 0;
}
if(p==3&&q==4){
cout<<"4 4\n#.##\n#.##\n###.\n###.\n";
return 0;
}
if(p==3){
bool ans[100];
memset(ans,0,sizeof(ans));
ans[1] = ans[2] = ans[4] = ans[5] = ans[7] = ans[8] = 1;
q *= 2;
cout<<1<<' '<<q<<endl;
rep(i,0,q){
if(ans[i])cout<<"#";
else cout<<".";
}cout<<endl;
return 0;
}
if(p==4&&q==5){
cout<<"5\n5\n.####\n##.##\n####.\n#.###\n###.#\n";
return 0;
}
if(p==4){
bool ans[100];
memset(ans,0,sizeof(ans));
ans[1] = ans[2] = ans[4] = ans[5] = 1;
cout<<1<<' '<<q<<endl;
rep(i,0,q){
if(ans[i])cout<<"#";
else cout<<".";
}cout<<endl;
return 0;
}
if(p==5&&q==7){
cout<<-1<<endl;
// assert(false);
return 0;
}
if(p==5){
bool ans[100];
memset(ans,0,sizeof(ans));
ans[1] = ans[2] = ans[4] = ans[5] = ans[7] = ans[8] = ans[10] = ans[11] = ans[13] = ans[14] = 1;
q *= 2;
cout<<1<<' '<<q<<endl;
rep(i,0,q){
if(ans[i])cout<<"#";
else cout<<".";
}cout<<endl;
return 0;
}
if(p==7&&q==9){
assert(false);
return 0;
}
if(p==7&&q==10){
cout<<"4 5\n##.##\n##.##\n.###.\n.###.\n";
return 0;
}
while(1);
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3564kb
input:
3 3 2 1 1 2 3 2 1 3
output:
-1 -1
result:
wrong answer 1st numbers differ - expected: '2', found: '-1'