小蒟蒻的刷题成长之路
蓝桥杯的比赛流程和必考点_蓝桥杯省赛考点_时雨h的博客-CSDN博客
大一学生一周十万字爆肝版C语言总结笔记_大一c语言笔记_时雨h的博客-CSDN博客
程序设计与 C 语言期末复习_时雨h的博客-CSDN博客
P8597 [蓝桥杯 2013 省 B] 翻硬币个人思考总结+第五届传智杯ABC 初赛题解_时雨h的博客-CSDN博客
C++刷题20230106_时雨h的博客-CSDN博客
【LGR-(-17)】洛谷入门赛 #8个人思考_时雨h的博客-CSDN博客
2023牛客寒假算法基础集训营1 思考+题解_时雨h的博客-CSDN博客
CSDN 算法技能树 蓝桥杯-基础 刷题+思考总结_时雨h的博客-CSDN博客
关于C语言中最大公因数的思考_时雨h的博客-CSDN博客
蓝桥杯日常训练2023年3月2日_时雨h的博客-CSDN博客
2023年中国高校计算机大赛-团队程序设计天梯赛(GPLT)上海理工大学校内选拔赛(同步赛)_ACM/NOI/CSP/CCPC/ICPC算法编程高难度练习赛_牛客竞赛OJ (nowcoder.com)
#include
using namespace std;
typedef long long ll;
ll a[200005];
int main()
{ll n,ans=0;ll maxx=0;cin>>n;memset(a,0,sizeof(a));while(n--){ll k;cin>>k;a[k]++;if(maxx
#include
#include
#include
#include
using namespace std;
int n,k,sum=0;
struct arr
{int rq,a,b,c;
} arr1[100100];
bool cmp(arr x,arr y)
{
return x.c > y.c;
}
int main()
{scanf("%d %d",&n,&k);for(int i=1;i<=n;i++){arr1[i].rq=i;scanf("%d %d",&arr1[i].a,&arr1[i].b);arr1[i].c=arr1[i].b-arr1[i].a;}sort(arr1+1,arr1+n+1,cmp);for(int i=1;i<=k;i++){sum+=arr1[i].b;}for(int i=k+1;i<=n;i++){sum+=arr1[i].a;}cout<
#includeusing namespace std;
using ll=long long;
using ld=long double;
using pii=pair;
const int inf=0x3f3f3f3f;
const int mod=1e9+7;
const int N=2e6+10;map mp3;
int mp1[N],mp2[N],mp4[N];int main() {ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);int n,t;cin>>n>>t;while(t--) {int x,y;cin>>x>>y;if(mp1[x]==0&&mp2[y]==0&&mp3[x-y]==0&&mp4[x+y]==0) {cout<<"Yes"<<"\n";mp1[x]++;mp2[y]++;mp3[x-y]++;mp4[x+y]++;}elsecout<<"No"<<"\n";}return 0;
}