最近意志力好飘摇..不知道坚不坚持得下去..

这么弱还瞎纠结...可以滚了..

水题都不会做..

LCS (A)

LCS (B)

没有看题

Gym 100989C

1D Cafeteria (B)

不会捉

Gym 100989E

Gym 100989F

Mission in Amman (B)

没看题

Queue (A)

感觉题意理解得有问题啊

 #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int n,f[],c[],b[],cnt[]; int check(int x){
for(int i = ;i >= ;i--){
int cc = x/b[i];
if(cc > cnt[b[i]]) return ;
cnt[b[i]] -= cc;
x -= b[i]*cc;
}
return ;
} void solve(){
int tot;
b[]=;b[]=;b[]=;b[]=;b[]=;
memset(c,,sizeof(c));
memset(cnt,,sizeof(cnt));
int ok = ;
for(int i = ;i <= n;i++){
scanf("%d",&tot);
int tmp = ,yu = ;
for(int j = ;j <= ;j++){
scanf("%d",&c[j]);
tmp += c[j]*b[j];
cnt[b[j]] += c[j];
}
yu = tmp-tot;
if(!check(yu)) ok = ;
} if(ok == ) puts("no");
else puts("yes");
} int main(){
while(scanf("%d",&n) != EOF){
solve();
}
return ;
}

Queue (B)

没读题

Objects Panel (A)

觉得很难写,,而且不会写...可是过的人很多啊

没有看出来是个dfs...

 #include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
using namespace std;
int n,m,a[];
vector<int> g[]; void dfs(int u,int cnt){
for(int i = ;i < cnt-;i++) printf(" ");
if(g[u].size()){
if(a[u]) printf("- ");
else printf("+ ");
}
else printf(" ");
if(u == ) printf("project\n");
else printf("object%d\n",u);
if(a[u]){
for(int i = ;i < g[u].size();i++){
int v = g[u][i];
dfs(v,cnt+);
}
}
} int main(){
scanf("%d",&n);
memset(a,,sizeof(a));
for(int i = ;i <= n;i++) g[i].clear();
char s[];
for(int i = ;i <= n;i++){
scanf("%s %d",s,&m);
int x;
for(int j = ;j < m;j++){
scanf("%d",&x);
g[i].push_back(x);
}
if(s[] == '-') a[i] = ;
}
dfs(,);
return ;
}

Objects Panel (B)

没看题

Plus or Minus (A)

Plus or Minus (B)

没看题

Mixed Dimensions

没看题

我好菜啊...............................................

05-07 15:50