- 博客(10)
- 收藏
- 关注
原创 “山大地纬杯”第十二届山东省ICPC大学生程序设计竞赛(正式赛)赛后总结
“山大地纬杯”第十二届山东省ICPC大学生程序设计竞赛(正式赛)赛后总结
2022-05-23 16:37:19
1217
2
原创 “浪潮杯”第九届山东省ACM大学生程序设计竞赛重现赛(重现赛)赛后总结
只过了C题,赛后发现其实A题也能做出来。比赛链接A-AnagramC-CitiesC题代码:#include<bits/stdc++.h>using namespace std;const int N=1e5+10;int main(){ int t,a[N],n; long long ans; cin>>t; while(t--) { ans=0; cin>>n; for(int i=0;i<n;i++) cin
2022-04-26 10:22:43
355
原创 C-连锁商店
DP只存在一个或零个景点的公司可以不需要考虑,只需要考虑有多个景点的公司就可以了,也只需要存储这类公司的状态。#include<iostream>#include<vector>#include<string.h>using namespace std;long long n;vector<long long> g[8000];long long c[8000],w[8000],t[8000],cn[8000],ss[8000],i.
2021-11-04 22:20:06
658
原创 E. Rock, Paper, Scissors
CodeForces - 1426E Rock, Paper, Scissors莽就完事了#include<bits/stdc++.h>using namespace std;typedef long long LL;LL max3(LL x,LL y,LL z,LL h) { x= x>y ? x:y; x= x>z ? x:z; x= x>h ? x:h; return x;}int main() { LL n, a, b, c, x, .
2021-11-02 21:16:01
139
原创 Powerful Discount Tickets
每次让最高价格的物品除以2就行了#include<bits/stdc++.h>using namespace std;priority_queue<int>q;int main(){ long long t,n,m,a,sum = 0; cin>>n>>m; for(int i = 0;i < n;i ++) { cin >> a; q.push(a); } for(int i = 0;i < m;i.
2021-10-26 22:37:07
166
原创 D - Different Rules
CodeForces - 1313B最差名次:尽量让别人和他总分一样,即是min(n,x+y-1)min(x+y-1,n)最好情况分两种那么所有人的成绩都是最差的情况,他就可以排得更前面。min(n,max(1LL,x+y-n+1))整合一下就成了#include<bits/stdc++.h>using namespace std;typedef long long LL;int main(){ LL n,x,y; i...
2021-10-15 16:28:09
144
原创 A - Gregor and the Pawn Game
//类似贪心,能直走就直走,不能直走优先左上斜吃#include <bits/stdc++.h>using namespace std;int main(){ int s,n,ans; string a,b; cin>>s; while(s--) { ans=0; cin>>n>>a>>b; for(int i=0;i<n;i++) { if(b[i]=='1')//找己方棋子 {...
2021-10-12 22:00:07
254
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅