UESTC 2016 Summer Training #1 Div.2

时间:2021-12-04 04:26:36

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

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

 

水题都不会做..

LCS (A)

 

LCS (B)

没有看题

 

Gym 100989C

 

1D Cafeteria (B)

不会捉

 

Gym 100989E

 

Gym 100989F

 

Mission in Amman (B)

没看题

 

Queue (A)

感觉题意理解得有问题啊

UESTC 2016 Summer Training #1 Div.2UESTC 2016 Summer Training #1 Div.2
 1 #include <iostream>
 2 #include <cstdio>
 3 #include <cstring>
 4 #include <algorithm>
 5 using namespace std;
 6 int n,f[6],c[6],b[6],cnt[100];
 7 
 8 int check(int x){
 9     for(int i = 5;i >= 1;i--){
10         int cc = x/b[i];
11         if(cc > cnt[b[i]]) return 0;
12         cnt[b[i]] -= cc;
13         x -= b[i]*cc;
14     }
15     return 1;
16 }
17 
18 void solve(){
19     int tot;
20     b[1]=1;b[2]=5;b[3]=10;b[4]=20;b[5]=50;
21     memset(c,0,sizeof(c));
22     memset(cnt,0,sizeof(cnt));
23     int ok = 0;
24     for(int i = 1;i <= n;i++){
25         scanf("%d",&tot);
26         int tmp = 0,yu = 0;
27         for(int j = 1;j <= 5;j++){
28             scanf("%d",&c[j]);
29             tmp += c[j]*b[j];
30             cnt[b[j]] += c[j];
31         } 
32         yu = tmp-tot;
33         if(!check(yu)) ok = 1;
34     }
35 
36     if(ok == 1) puts("no");
37     else puts("yes");
38 }
39 
40 int main(){
41     while(scanf("%d",&n) != EOF){
42         solve();
43     }
44     return 0;
45 }
View Code

 

Queue (B)

没读题

 

Objects Panel (A)

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

没有看出来是个dfs...

UESTC 2016 Summer Training #1 Div.2UESTC 2016 Summer Training #1 Div.2
 1 #include <iostream>
 2 #include <cstdio>
 3 #include <cstring>
 4 #include <vector>
 5 #include <algorithm>
 6 using namespace std;
 7 int n,m,a[105];
 8 vector<int> g[105];
 9 
10 void dfs(int u,int cnt){
11     for(int i = 0;i < cnt-2;i++) printf(" ");
12         if(g[u].size()){
13             if(a[u]) printf("- ");
14             else printf("+ ");
15         }
16         else printf("  ");
17         if(u == 0) printf("project\n");
18         else printf("object%d\n",u);
19         if(a[u]){
20             for(int i = 0;i < g[u].size();i++){
21                 int v = g[u][i];
22                 dfs(v,cnt+2);
23             }
24         }
25 }
26 
27 int main(){
28         scanf("%d",&n);
29         memset(a,0,sizeof(a));
30         for(int i = 0;i <= n;i++) g[i].clear();
31         char s[5];
32         for(int i = 0;i <= n;i++){
33             scanf("%s %d",s,&m);
34             int x;
35             for(int j = 0;j < m;j++){
36                 scanf("%d",&x);
37                 g[i].push_back(x);
38             }
39             if(s[0] == '-') a[i] = 1;
40         }
41         dfs(0,2);
42     return 0;
43 }
View Code

 

 

Objects Panel (B)

没看题

 

Plus or Minus (A)

 

Plus or Minus (B)

没看题

 

Mixed Dimensions

没看题

 

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