UESTC 2016 Summer Training #1 Div.2

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

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

水题都不会做..

LCS (A)

LCS (B)

没有看题

Gym 100989C

1D Cafeteria (B)

不会捉

Gym 100989E

Gym 100989F

Mission in Amman (B)

没看题

Queue (A)

感觉题意理解得有问题啊

 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 }

Queue (B)

没读题

Objects Panel (A)

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

Objects Panel (B)

没看题

Plus or Minus (A)

Plus or Minus (B)

没看题

Mixed Dimensions

没看题

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

时间: 2024-10-10 08:54:04

UESTC 2016 Summer Training #1 Div.2的相关文章

UESTC 2016 Summer Training #5 Div.2(未完待续)

A #include <cstdio> #include <cstring> #include <vector> #define MAXN 100005 #define mem(a) memset(a, 0, sizeof(a)) using namespace std; int TreeArray[MAXN], Left[MAXN], Right[MAXN], Fork[MAXN]; typedef vector<int> Ve; vector<Ve

UESTC 2016 Summer Training #2 Div.2 A dp、递推、多阶段问题

A - A Time Limit:336MS     Memory Limit:1572864KB     64bit IO Format:%lld & %llu Submit Status Practice SPOJ AMR11A Description Thanks a lot for helping Harry Potter in finding the Sorcerer's Stone of Immortality in October. Did we not tell you that

UESTC 2016 Summer Training #1 Div.2 E - Accepted Passwords 讨论

E - Accepted Passwords Time Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Practice Gym 100989E Description standard input/output Islam is usually in a hurry. He often types his passwords incorrectly. He hates

UESTC 2016 Summer Training #1 Div.2 F - Mission in Amman (A) 动态维护(刷新:--、++)

F - Mission in Amman (A) Time Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Practice Gym 100989F Description standard input/output You must have heard about Agent Mahone! Dr. Ibrahim hired him to catch the che

UESTC 2016 Summer Training #1 Div.2 L - Plus or Minus (A) dfs

L - Plus or Minus (A) Time Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Practice Gym 100989L Description standard input/output AbdelKader enjoys math. He feels very frustrated whenever he sees an incorrect eq

UESTC 2016 Summer Training #1 Div.2 H - Queue (A) 贪心

H - Queue (A) Time Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Practice Gym 100989H Description standard input/output After the data structures exam, students lined up in the cafeteria to have a drink and ch

UESTC 2016 Summer Training #2 Div.2 E 分解质因素(除了以后剩下的可能也是个素数)

E - E Time Limit:3000MS     Memory Limit:1572864KB     64bit IO Format:%lld & %llu Submit Status Practice SPOJ AMR11E Description Arithmancy is Draco Malfoy's favorite subject, but what spoils it for him is that Hermione Granger is in his class, and

UESTC 2014 Summer Training #18 Div.2

A.UVALive 6661 题意从1~N中选k个数,和为s的方案数 第一眼搜索,估计错状态量,又去yydp...浪费大量时间 数据很小的,状态数都不会超过2^N...直接dfs就过了 //state二进制表示选取的数 #include <iostream> #include <cstdio> #include <cstdlib> #include <cstring> using namespace std; const int maxn = 200; in

UESTC 2014 Summer Training #3 Div.2

(更新中) A:ZOJ 3611 BFS+状态压缩 [题意]:给定一张n*m的图,图上每个点有如下情况:L,R,D,U:代表在该点上只能往它已经给定的方向前进.#,W:不能走到该点.$:走到该点,可以花两分钟得到一分值,然后可以从该点向任意方向走.0:走到该点后可以向任意方向走.然后给你起点和终点坐标,问是否能从起点走到终点,如果能,求出可获得的最大分值以及与之对应达到该最大分值所需的的最小时间花 费.(其中起点和终点坐标可以相同)[知识点]:BFS+状态压缩[题解]:我觉得超级棒的题!真心感觉