2015ACM浙江省省赛部分题解

2024-08-28 07:32

本文主要是介绍2015ACM浙江省省赛部分题解,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

The 12th Zhejiang Provincial Collegiate Programming Contest
总体感觉题目有大概7道不涉及算法的题目。听群里讨论,现场赛有队伍一小时ac了7道题目。不过对于本弱,还是挺艰难的。
A     http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3869
Ace of Aces

Time Limit: 2 Seconds       Memory Limit: 65536 KB

There is a mysterious organization called Time-Space Administrative Bureau (TSAB) in the deep universe that we humans have not discovered yet. This year, the TSAB decided to elect an outstanding member from its elite troops. The elected guy will be honored with the title of "Ace of Aces".

After voting, the TSAB received N valid tickets. On each ticket, there is a number Ai denoting the ID of a candidate. The candidate with the most tickets nominated will be elected as the "Ace of Aces". If there are two or more candidates have the same number of nominations, no one will win.

Please write program to help TSAB determine who will be the "Ace of Aces".

Input

There are multiple test cases. The first line of input contains an integer T indicating the number of test cases. For each test case:

The first line contains an integer N (1 <= N <= 1000). The next line contains N integers Ai (1 <= Ai <= 1000).

Output

For each test case, output the ID of the candidate who will be honored with "Ace of Aces". If no one win the election, output "Nobody" (without quotes) instead.

Sample Input
3
5
2 2 2 1 1
5
1 1 2 2 3
1
998
Sample Output
2
Nobody
998
题目大意就是输出数量最多的那个数的值,如果有两个或两个以上数量相等的,就输出Nobody

#include<iostream>
#include<cstring>
#include<algorithm>
#include<cstdlib>
#include<vector>
#include<cmath>
#include<stdlib.h>
#include<iomanip>
#include<list>
#include<deque>
#include<map>
#include <stdio.h>
#include <queue>
#include <stack>
#define maxn 10000+5
#define ull unsigned long long
#define ll long long
#define reP(i,n) for(i=1;i<=n;i++)
#define rep(i,n) for(i=0;i<n;i++)
#define cle(a) memset(a,0,sizeof(a))
#define mod 90001
#define PI 3.141592657
#define INF 1<<30
const ull inf = 1LL << 61;
const double eps=1e-5;

using namespace std;
struct node{
int id;
int cnt;
}a[1010];
bool cmp(node a,node b)
{
return a.cnt>b.cnt;
}
int main()
{
#ifndef ONLINE_JUDGE
freopen("in.txt","r",stdin);
#endif
//freopen("out.txt","w",stdout);
int t,n,b;
cin>>t;
while(t--){
cin>>n;
cle(a);
for(int i=0;i<n;i++){
cin>>b;
a[b].id=b;
a[b].cnt++;
}
sort(a,a+1001,cmp);
if(a[0].cnt==a[1].cnt)
cout<<"Nobody"<<endl;
else cout<<a[0].id<<endl;
}
return 0;
}


B  http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3870
Team Formation

Time Limit: 3 Seconds       Memory Limit: 131072 KB

For an upcoming programming contest, Edward, the headmaster of Marjar University, is forming a two-man team from N students of his university.

Edward knows the skill level of each student. He has found that if two students with skill level A and B form a team, the skill level of the team will be A ? B, where ? means bitwise exclusive or. A team will play well if and only if the skill level of the team is greater than the skill level of each team member (i.e. A ? B > max{AB}).

Edward wants to form a team that will play well in the contest. Please tell him the possible number of such teams. Two teams are considered different if there is at least one different team member.

Input

There are multiple test cases. The first line of input contains an integer T indicating the number of test cases. For each test case:

The first line contains an integer N (2 <= N <= 100000), which indicates the number of student. The next line contains N positive integers separated by spaces. The ithinteger denotes the skill level of ith student. Every integer will not exceed 109.

Output

For each case, print the answer in one line.

Sample Input
2
3
1 2 3
5
1 2 3 4 5
Sample Output
1
6
题目大意:给定n个数,求这n个数中满足 A  ?  B  > max{ A B } 的个数,就是A^B>max(A,B)的AB组合的个数。
思路:对于一个数A如果他的最高位在位置i,我们假设设i+n位为从i向右数的第一个0,B的最高位在位置j ,如果j=i+n+x  (1<x<31-i-n)那么A^B就大于max(A,B)。 
例如A:1010(十进制为10)  B:110 (十进制为6)  A^B=1100  (十进制为12) 满足条件。

#include<iostream>
#include<cstring>
#include<algorithm>
#include<cstdlib>
#include<vector>
#include<cmath>
#include<stdlib.h>
#include<iomanip>
#include<list>
#include<deque>
#include<map>
#include <stdio.h>
#include <queue>
#include <stack>
#define maxn 100000+5
#define ull unsigned long long
#define ll long long
#define reP(i,n) for(i=1;i<=n;i++)
#define rep(i,n) for(i=0;i<n;i++)
#define cle(a) memset(a,0,sizeof(a))
#define mod 90001
#define PI 3.141592657
#define INF 1<<30
const ull inf = 1LL << 61;
const double eps=1e-5;

using namespace std;

bool cmp(int a,int b)
{
return a>b;
}
int t,n;
int ans;
int a[maxn],b[33];//b数组存放第i位为最高位且为1数 的个数
void hibit(int x){
int l=31;
while(l>=0){
if(x&(1<<l)){
b[l]++;
return ;
}
l--;
}
return ;
}
int main()
{
#ifndef ONLINE_JUDGE
freopen("in.txt","r",stdin);
#endif
//freopen("out.txt","w",stdout);
cin>>t;
while(t--){
cin>>n;
cle(b);
for(int i=0;i<n;i++)
{
cin>>a[i];
hibit(a[i]);
}
ans=0;
for(int i=0;i<n;i++){
int l=31;
while(l>=0){
if(a[i]&(1<<l))break;//去掉a[i]的最高位
l--;
}
while(l>=0){
if(!(a[i]&(1<<l)))ans+=b[l];
l--;
}
}
printf("%d\n",ans);
}
return 0;
}


D  http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3872
Beauty of Array

Time Limit: 2 Seconds       Memory Limit: 65536 KB

Edward has an array A with N integers. He defines the beauty of an array as the summation of all distinct integers in the array. Now Edward wants to know the summation of the beauty of all contiguous subarray of the array A.

Input

There are multiple test cases. The first line of input contains an integer T indicating the number of test cases. For each test case:

The first line contains an integer N (1 <= N <= 100000), which indicates the size of the array. The next line contains N positive integers separated by spaces. Every integer is no larger than 1000000.

Output

For each case, print the answer in one line.

Sample Input
3
5
1 2 3 4 5
3
2 3 3
4
2 3 3 2
Sample Output
105
21
38
题目大意:给一个长度为n的一个序列,算连续集合里不同数的和,然后求所有集合的总和。如 1 2 3 连续的集合为 {1},{2},{3},{1,2} ,{2,3}, {1,2,3}   总和 1+2+3+3+5+6=20
解题思路:设dp[i]为i个元素组成的集合的总和。
我们假设序列是一个一个 
则    if(当前的数a没有出现过)dp[i]=dp[i-1]+i*a;
else (当前的数a在前面出现过)dp[i]=dp[i-1]+i*a-(b[a])*a;   b[a]为前面的a出现的位置。

#include<iostream>
#include<cstring>
#include<algorithm>
#include<cstdlib>
#include<vector>
#include<cmath>
#include<stdlib.h>
#include<iomanip>
#include<list>
#include<deque>
#include<map>
#include <stdio.h>
#include <queue>
#include <stack>
#define maxn 100000+5
#define ull unsigned long long
#define ll long long
#define reP(i,n) for(i=1;i<=n;i++)
#define rep(i,n) for(i=0;i<n;i++)
#define cle(a) memset(a,0,sizeof(a))
#define mod 90001
#define PI 3.141592657
#define INF 1<<30
const ull inf = 1LL << 61;
const double eps=1e-5;

using namespace std;

bool cmp(int a,int b)
{
return a>b;
}
int t;

ll dp[maxn];
int vis[maxn*10];
ll sum;
int n,a;
int main()
{
#ifndef ONLINE_JUDGE
freopen("in.txt","r",stdin);
#endif
//freopen("out.txt","w",stdout);
cin>>t;
while(t--){
cin>>n;
cle(vis);
cle(dp);
sum=0;
for(int i=1;i<=n;i++){
cin>>a;
if(!vis[a]){
dp[i]=dp[i-1]+a*i;
}
else{
//cout<<dp[i-1]<<endl;
dp[i]=dp[i-1]+a*i-a*vis[a];
}
vis[a]=i;
sum+=dp[i];
}
printf("%lld\n",sum);
}
return 0;
}


G  http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3875
Lunch Time

Time Limit: 2 Seconds       Memory Limit: 65536 KB

The 999th Zhejiang Provincial Collegiate Programming Contest will be held in Marjar University. The canteen of Marjar University is making preparations for this grand competition. The canteen provides a lunch set of three types: appetizer, main course and dessert. Each type has several dishes with different prices for choosing.

Edward is the headmaster of Marjar University. One day, to inspect the quality of dishes, he go to the canteen and decides to choose a median set for his lunch. That means he must choose one dish from each of appetizers, main courses and desserts. Each chosen dish should at the median price among all dishes of the same type.

For example, if there are five dessert dishes selling at the price of 2, 3, 5, 10, 30, Edward should choose the dish with price 5 as his dessert since its price is located at the median place of the dessert type. If the number of dishes of a type is even, Edward will choose the dish which is more expensive among the two medians.

You are given the list of all dishes, please write a program to help Edward decide which dishes he should choose.

Input

There are multiple test cases. The first line of input contains an integer T indicating the number of test cases. For each test case:

The first line contains three integers SM and D (1 <= SMD <= 100), which means that there are S dishes of appetizer, M dishes of main course and D dishes of dessert.

Then followed by three parts. The first part contains S lines, the second and the last part contains M and D lines respectively. In each line of the three parts, there is a string and an integer indicating the name and the price of a dish. The name of dishes will only consist of non-whitespace characters with no more than 50 characters. The price of dishes are non-negative integers less than or equal to 1000. All dish names will be distinct.

Output

For each test case, output the total price of the median set, together with the names of appetizer, main course and dessert, separated by a single space.

Sample Input
2
1 3 2
Fresh_Cucumber 4
Chow_Mein 5
Rice_Served_with_Duck_Leg 12
Fried_Vermicelli 7
Steamed_Dumpling 3
Steamed_Stuffed_Bun 4
2 3 1
Stir-fried_Loofah_with_Dried_Bamboo_Shoot 33
West_Lake_Water_Shield_Soup 36
DongPo's_Braised_Pork 54
West_Lake_Fish_in_Vinegar 48
Longjing_Shrimp 188
DongPo's_Crisp 18
Sample Output
15 Fresh_Cucumber Fried_Vermicelli Steamed_Stuffed_Bun
108 West_Lake_Water_Shield_Soup DongPo's_Braised_Pork DongPo's_Crisp
模拟一下就好了

#include<iostream>
#include<cstring>
#include<algorithm>
#include<cstdlib>
#include<vector>
#include<cmath>
#include<stdlib.h>
#include<iomanip>
#include<list>
#include<deque>
#include<map>
#include <stdio.h>
#include <queue>
#include <stack>
#define maxn 10000+5
#define ull unsigned long long
#define ll long long
#define reP(i,n) for(i=1;i<=n;i++)
#define rep(i,n) for(i=0;i<n;i++)
#define cle(a) memset(a,0,sizeof(a))
#define mod 90001
#define PI 3.141592657
#define INF 1<<30
const ull inf = 1LL << 61;
const double eps=1e-5;

using namespace std;
struct node{
int num;
char s[110];
}n1[110],n2[110],n3[110];
bool cmp(node a,node b)
{
return a.num<b.num;
}
int a,b,c;
int main()
{
#ifndef ONLINE_JUDGE
freopen("in.txt","r",stdin);
#endif
//freopen("out.txt","w",stdout);
int t;
cin>>t;
while(t--){
cin>>a>>b>>c;
for(int i=0;i<a;i++)
cin>>n1[i].s>>n1[i].num;
for(int i=0;i<b;i++)
cin>>n2[i].s>>n2[i].num;
for(int i=0;i<c;i++)
cin>>n3[i].s>>n3[i].num;
sort(n1,n1+a,cmp);
sort(n2,n2+b,cmp);
sort(n3,n3+c,cmp);
int sum=0;
sum=n1[a/2].num+n2[b/2].num+n3[c/2].num;
printf("%d %s %s %s\n",sum,n1[a/2].s,n2[b/2].s,n3[c/2].s);
}
return 0;
}


H  http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3876
May Day Holiday

Time Limit: 2 Seconds       Memory Limit: 65536 KB

As a university advocating self-learning and work-rest balance, Marjar University has so many days of rest, including holidays and weekends. Each weekend, which consists of Saturday and Sunday, is a rest time in the Marjar University.

The May Day, also known as International Workers' Day or International Labour Day, falls on May 1st. In Marjar University, the May Day holiday is a five-day vacation from May 1st to May 5th. Due to Saturday or Sunday may be adjacent to the May Day holiday, the continuous vacation may be as long as nine days in reality. For example, the May Day in 2015 is Friday so the continuous vacation is only 5 days (May 1st to May 5th). And the May Day in 2016 is Sunday so the continuous vacation is 6 days (April 30th to May 5th). In 2017, the May Day is Monday so the vacation is 9 days (April 29th to May 7th). How excited!

Edward, the headmaster of Marjar University, is very curious how long is the continuous vacation containing May Day in different years. Can you help him?

Input

There are multiple test cases. The first line of input contains an integer T indicating the number of test cases. For each test case, there is an integer y (1928 <= y <= 9999) in one line, indicating the year of Edward's query.

Output

For each case, print the number of days of the continuous vacation in that year.

Sample Input
3
2015
2016
2017
Output
5
6
9
注意闰年。我看有的人的题解写的很简单  1928  5.1是星期2。。。。然后直接判断闰年去做的。。可是现场赛的时候谁知道1928 5.1是星期2 啊  除非你AC了。
我的做法是 以2015年往前往后 模拟。。

#include<iostream>
#include<cstring>
#include<algorithm>
#include<cstdlib>
#include<vector>
#include<cmath>
#include<stdlib.h>
#include<iomanip>
#include<list>
#include<deque>
#include<map>
#include <stdio.h>
#include <queue>
#include <stack>
#define maxn 10000+5
#define ull unsigned long long
#define ll long long
#define reP(i,n) for(i=1;i<=n;i++)
#define rep(i,n) for(i=0;i<n;i++)
#define cle(a) memset(a,0,sizeof(a))
#define mod 90001
#define PI 3.141592657
#define INF 1<<30
const ull inf = 1LL << 61;
const double eps=1e-5;

using namespace std;

bool cmp(int a,int b)
{
return a>b;
}
int n,a;
int mp[10]={6,9,6,5,5,5,5};
bool leap(int x){
if(x%4==0&&x%100!=0)
return true;
if(x%400==0)
return true;
return false;
}
int solve(int x){
int cnt=0;
if(x>2015){
for(int i=2016;i<=x;i++)
if(leap(i))cnt++;
int d=(x-2015+cnt)%7;
int t=(5+d)%7;
return mp[t];
}
else if(x<2015){
for(int i=x;i<2015;i++)
if(leap(i))cnt++;
if(leap(x))cnt--;
int d=(2015-x+cnt)%7;
int t=(abs(5-d))%7;
//cout<<t<<endl;
return mp[t];
}
else if(x==2015)return 5;
}
int main()
{
#ifndef ONLINE_JUDGE
freopen("in.txt","r",stdin);
#endif
//freopen("out.txt","w",stdout);
while(cin>>n){
for(int i=1;i<=n;i++){
cin>>a;
printf("%d\n",solve(a));
}
}
return 0;
}
/*
//以下是网上的题解。。
#include<stdio.h>
int a[7]= {6,9,6,5,5,5,5};
int main()
{
int year,T;
scanf("%d",&T);
while(T--)
{
scanf("%d",&year);
int k=year-1928;
int cnt=0;
for(int i=1929; i<=year; i++)
{
if(i%400==0||(i%4==0&&i%100!=0)) cnt++;
}
printf("%d\n",a[(2+k+cnt)%7]);
}
return 0;
}
*/


J  http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3878
Convert QWERTY to Dvorak

Time Limit: 2 Seconds       Memory Limit: 65536 KB

Edward, a poor copy typist, is a user of the Dvorak Layout. But now he has only a QWERTY Keyboard with a broken Caps Lock key, so Edward never presses the broken Caps Lock key. Luckily, all the other keys on the QWERTY keyboard work well. Every day, he has a lot of documents to type. Thus he needs a converter to translate QWERTY into Dvorak. Can you help him?

The QWERTY Layout and the Dvorak Layout are in the following:

Qwerty Layout
The QWERTY Layout

Dvorak Layout
The Dvorak Layout

Input

A QWERTY document Edward typed. The document has no more than 100 kibibytes. And there are no invalid characters in the document.

Output

The Dvorak document.

Sample Input
Jgw Gqm Andpw a H.soav Patsfk f;doe
Nfk Gq.d slpt a X,dokt vdtnsaohe
Kjd yspps,glu pgld; aod yso kd;kgluZ
1234567890
`~!@#$%^&*()}"']_+-=ZQqWEwe{[\|
ANIHDYf.,bt/
ABCDEFuvwxyz
Sample Output
Hi, I'm Abel, a Dvorak Layout user.
But I've only a Qwerty keyboard.
The following lines are for testing:
1234567890
`~!@#$%^&*()+_-={}[]:"'<>,.?/\|
ABCDEFuvwxyz
AXJE>Ugk,qf;
在CF上做过类似的题目。哈哈
就是打两个表,,不过要细心啊

#include<iostream>
#include<cstring>
#include<algorithm>
#include<cstdlib>
#include<vector>
#include<cmath>
#include<stdlib.h>
#include<iomanip>
#include<list>
#include<deque>
#include<map>
#include <stdio.h>
#include <queue>
#include <stack>
#define maxn 10000+5
#define ull unsigned long long
#define ll long long
#define reP(i,n) for(i=1;i<=n;i++)
#define rep(i,n) for(i=0;i<n;i++)
#define cle(a) memset(a,0,sizeof(a))
#define mod 90001
#define PI 3.141592657
#define INF 1<<30
const ull inf = 1LL << 61;
const double eps=1e-5;

using namespace std;

bool cmp(int a,int b)
{
return a>b;
}
char *s={"_-+=QWERTYUIOP{}[]qweASDFGHJKL:\";'ZzXCVBNM<>?,./rtyuiopasdfghjklxcvbnm"};
char *t={"{[}]\"<>PYFGCRL?+/=',.AOEUIDHTNS_s-:;QJKXBMWVZwvzpyfgcrlaoeuidhtnqjkxbm"};
char p;
int main()
{
#ifndef ONLINE_JUDGE
freopen("in.txt","r",stdin);
#endif
//freopen("out.txt","w",stdout);
//cout<<strlen(s1)<<" "<<strlen(t)<<endl;
map<char,char>mp;
for(int i=0;i<strlen(s);i++)
mp[s[i]]=t[i];
while(~scanf("%c",&p)){//不知道为什么用gets()会re..
if(!mp[p]){
putchar(p);
}
else putchar(mp[p]);
}
return 0;
}


L http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3880
   
Demacia of the Ancients

Time Limit: 2 Seconds       Memory Limit: 65536 KB

There is a popular multiplayer online battle arena game called Demacia of the Ancients. There are lots of professional teams playing this game. A team will be approved as Level K if there are exact K team members whose match making ranking (MMR) is strictly greater than 6000.

You are given a list of teams. Please calculate the level of each team.

Input

There are multiple test cases. The first line of input contains an integer T indicating the number of test cases. For each test case:

The first line contains an integer N (1 <= N <= 10) indicating the number of team members.

The second line contains N integers representing the MMR of each team member. All MMRs are non-negative integers less than or equal to 9999.

Output

For each test case, output the level of the given team.

Sample Input
3
5
7986 6984 6645 6200 6150
5
7401 7377 6900 6000 4300
3
800 600 200
Sample Output
5
3
0
这道题目好水啊。求大于6000的数的个数

#include<iostream>
#include<cstring>
#include<algorithm>
#include<cstdlib>
#include<vector>
#include<cmath>
#include<stdlib.h>
#include<iomanip>
#include<list>
#include<deque>
#include<map>
#include <stdio.h>
#include <queue>
#include <stack>
#define maxn 10000+5
#define ull unsigned long long
#define ll long long
#define reP(i,n) for(i=1;i<=n;i++)
#define rep(i,n) for(i=0;i<n;i++)
#define cle(a) memset(a,0,sizeof(a))
#define mod 90001
#define PI 3.141592657
#define INF 1<<30
const ull inf = 1LL << 61;
const double eps=1e-5;

using namespace std;

bool cmp(int a,int b)
{
return a>b;
}
int t,n;
int main()
{
#ifndef ONLINE_JUDGE
freopen("in.txt","r",stdin);
#endif
//freopen("out.txt","w",stdout);
cin>>t;
while(t--){
cin>>n;
int ans=0,a;
for(int i=1;i<=n;i++)
{
cin>>a;
if(a>6000)ans++;
}
cout<<ans<<endl;
}
return 0;
}


这篇关于2015ACM浙江省省赛部分题解的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1114125

相关文章

poj 2976 分数规划二分贪心(部分对总体的贡献度) poj 3111

poj 2976: 题意: 在n场考试中,每场考试共有b题,答对的题目有a题。 允许去掉k场考试,求能达到的最高正确率是多少。 解析: 假设已知准确率为x,则每场考试对于准确率的贡献值为: a - b * x,将贡献值大的排序排在前面舍弃掉后k个。 然后二分x就行了。 代码: #include <iostream>#include <cstdio>#incl

C++ | Leetcode C++题解之第393题UTF-8编码验证

题目: 题解: class Solution {public:static const int MASK1 = 1 << 7;static const int MASK2 = (1 << 7) + (1 << 6);bool isValid(int num) {return (num & MASK2) == MASK1;}int getBytes(int num) {if ((num &

C语言 | Leetcode C语言题解之第393题UTF-8编码验证

题目: 题解: static const int MASK1 = 1 << 7;static const int MASK2 = (1 << 7) + (1 << 6);bool isValid(int num) {return (num & MASK2) == MASK1;}int getBytes(int num) {if ((num & MASK1) == 0) {return

C - Word Ladder题解

C - Word Ladder 题解 解题思路: 先输入两个字符串S 和t 然后在S和T中寻找有多少个字符不同的个数(也就是需要变换多少次) 开始替换时: tips: 字符串下标以0开始 我们定义两个变量a和b,用于记录当前遍历到的字符 首先是判断:如果这时a已经==b了,那么就跳过,不用管; 如果a大于b的话:那么我们就让s中的第i项替换成b,接着就直接输出S就行了。 这样

笔记整理—内核!启动!—kernel部分(2)从汇编阶段到start_kernel

kernel起始与ENTRY(stext),和uboot一样,都是从汇编阶段开始的,因为对于kernel而言,还没进行栈的维护,所以无法使用c语言。_HEAD定义了后面代码属于段名为.head .text的段。         内核起始部分代码被解压代码调用,前面关于uboot的文章中有提到过(eg:zImage)。uboot启动是无条件的,只要代码的位置对,上电就工作,kern

【秋招笔试】9.07米哈游秋招改编题-三语言题解

🍭 大家好这里是 春秋招笔试突围,一起备战大厂笔试 💻 ACM金牌团队🏅️ | 多次AK大厂笔试 | 大厂实习经历 ✨ 本系列打算持续跟新 春秋招笔试题 👏 感谢大家的订阅➕ 和 喜欢💗 和 手里的小花花🌸 ✨ 笔试合集传送们 -> 🧷春秋招笔试合集 🍒 本专栏已收集 100+ 套笔试题,笔试真题 会在第一时间跟新 🍄 题面描述等均已改编,如果和你笔试题看到的题面描述

LeetCode 第414场周赛个人题解

目录 Q1. 将日期转换为二进制表示 原题链接 思路分析 AC代码 Q2. 范围内整数的最大得分 原题链接 思路分析 AC代码 Q3. 到达数组末尾的最大得分 原题链接 思路分析 AC代码 Q4. 吃掉所有兵需要的最多移动次数 原题链接 思路分析 AC代码 Q1. 将日期转换为二进制表示 原题链接 Q1. 将日期转换为二进制表示 思路分析

项目实战系列三: 家居购项目 第四部分

购物车 🌳购物车🍆显示购物车🍆更改商品数量🍆清空购物车&&删除商品 🌳生成订单 🌳购物车 需求分析 1.会员登陆后, 可以添加家居到购物车 2.完成购物车的设计和实现 3.每添加一个家居,购物车的数量+1, 并显示 程序框架图 1.新建src/com/zzw/furns/entity/CartItem.java, CartItem-家居项模型 /***

码蹄集部分题目(2024OJ赛9.4-9.8;线段树+树状数组)

1🐋🐋配对最小值(王者;树状数组) 时间限制:1秒 占用内存:64M 🐟题目思路 MT3065 配对最小值_哔哩哔哩_bilibili 🐟代码 #include<bits/stdc++.h> using namespace std;const int N=1e5+7;int a[N],b[N],c[N],n,q;struct QUERY{int l,r,id;}que

关于断言的部分用法

1、带变量的断言  systemVerilog assertion 中variable delay的使用,##[variable],带变量的延时(可变延时)_assertion中的延时-CSDN博客 2、until 的使用 systemVerilog assertion 中until的使用_verilog until-CSDN博客 3、throughout的使用   常用于断言和假设中的