AIM Tech Round 3 (Div. 2) D. Recover the String (构造)
来源:互联网 发布:衣服除皱喷雾 知乎 编辑:程序博客网 时间:2024/06/06 03:27
题目点我点我点我
/* ***********************************************┆ ┏┓ ┏┓ ┆┆┏┛┻━━━┛┻┓ ┆┆┃ ┃ ┆┆┃ ━ ┃ ┆┆┃ ┳┛ ┗┳ ┃ ┆┆┃ ┃ ┆┆┃ ┻ ┃ ┆┆┗━┓ 马 ┏━┛ ┆┆ ┃ 勒 ┃ ┆ ┆ ┃ 戈 ┗━━━┓ ┆┆ ┃ 壁 ┣┓┆┆ ┃ 的草泥马 ┏┛┆┆ ┗┓┓┏━┳┓┏┛ ┆┆ ┃┫┫ ┃┫┫ ┆┆ ┗┻┛ ┗┻┛ ┆************************************************ */#include <stdio.h>#include <string.h>#include <iostream>#include <algorithm>#include <vector>#include <queue>#include <stack>#include <set>#include <map>#include <string>#include <math.h>#include <stdlib.h>#include <bitset>using namespace std;#define rep(i,a,b) for (int i=(a),_ed=(b);i<=_ed;i++)#define per(i,a,b) for (int i=(b),_ed=(a);i>=_ed;i--)#define pb push_back#define mp make_pairconst int inf_int = 2e9;const long long inf_ll = 2e18;#define inf_add 0x3f3f3f3f#define mod 1000000007#define LL long long#define ULL unsigned long long#define MS0(X) memset((X), 0, sizeof((X)))#define SelfType intSelfType Gcd(SelfType p,SelfType q){return q==0?p:Gcd(q,p%q);}SelfType Pow(SelfType p,SelfType q){SelfType ans=1;while(q){if(q&1)ans=ans*p;p=p*p;q>>=1;}return ans;}#define Sd(X) int (X); scanf("%d", &X)#define Sdd(X, Y) int X, Y; scanf("%d%d", &X, &Y)#define Sddd(X, Y, Z) int X, Y, Z; scanf("%d%d%d", &X, &Y, &Z)#define reunique(v) v.resize(std::unique(v.begin(), v.end()) - v.begin())#define all(a) a.begin(), a.end()typedef pair<int, int> pii;typedef pair<long long, long long> pll;typedef vector<int> vi;typedef vector<long long> vll;inline int read(){int ra,fh;char rx;rx=getchar(),ra=0,fh=1;while((rx<'0'||rx>'9')&&rx!='-')rx=getchar();if(rx=='-')fh=-1,rx=getchar();while(rx>='0'&&rx<='9')ra*=10,ra+=rx-48,rx=getchar();return ra*fh;}//#pragma comment(linker, "/STACK:102400000,102400000")int f(int x){ if(x&1)return (x-1)/2*x; else return x/2*(x-1);}int main(){//freopen("in.txt","r",stdin);//freopen("out.txt","w",stdout);ios::sync_with_stdio(0);cin.tie(0);int a,b,c,d;scanf("%d%d%d%d",&a,&b,&c,&d);int flag = 0;int A=0,B=0;for(int i=0;f(i)<=a;i++) { if(f(i)==a) { for(int j=0;f(j)<=d;j++) { if(f(j)==d) { if(i*j==b+c) { A = i; B = j; flag = 1; } } } } } if(!flag) { printf("Impossible\n"); } else { int sum = A + B; for(int i=1;i<=sum;i++) { if(c>=A) { c -= A; B--; printf("1"); } else { A--; printf("0"); } } printf("\n"); }return 0;}
0 0
- AIM Tech Round 3 (Div. 2) -- D. Recover the String (思路题目--构造字符串)
- AIM Tech Round 3 (Div. 2) -- D. Recover the String (构造字符串)
- AIM Tech Round 3 (Div. 2) D. Recover the String (构造)
- AIM Tech Round 3 (Div. 2) D. Recover the String 构造、贪心、多坑、WA162
- codeforces AIM Tech Round 3 (Div. 2)D. Recover the String
- CF AIM Tech Round 3 (Div. 2) D - Recover the String
- AIM Tech Round 3 (Div. 1)-B. Recover the String
- AIM Tech Round 3 (Div. 1) B. Recover the String(构造)
- AIM Tech Round 3 (Div. 1) B. Recover the String 构造
- codeforces AIM Tech Round 3 (Div. 2) (A~D)
- 【DP】AIM Tech Round (Div. 2) D
- AIM Tech Round 3 (Div. 2) E. Connecting Universities 【构造】
- CodeForces AIM Tech Round 3 (Div. 2) D
- Codeforces AIM Tech Round 3 (Div. 2)(A-D 未完)
- AIM Tech Round (Div. 2) D. Array GCD(dp)
- AIM Tech Round 3 (Div. 2)
- AIM Tech Round 3 (Div. 2)
- AIM Tech Round 3 (Div. 2)
- 二叉树相关面试题
- 汇编预备知识(一)
- Atitit.你这些项目不都是模板吗?不是原创 集成和整合的方式大总结
- Oracle Linux 对服务器和存储的硬件认证列表
- M路平衡B树
- AIM Tech Round 3 (Div. 2) D. Recover the String (构造)
- QT 结构体转XML XML转结构体
- The entitlements specified in your application’s Code Signing Entitlements file do not match those .
- SQL 中如何去掉decimal字段後面的0
- NS_ENUM & NS_OPTIONS(百度没有,谷歌上的)
- Android开发人员不得不收集的代码
- 8080端口
- Atitit.安全性方案规划设计4gm v1 q928
- 支持向量机(SVM)方法的一些扩充