记录编号 |
597013 |
评测结果 |
AAWWWWWT |
题目名称 |
儿童节快乐 |
最终得分 |
25 |
用户昵称 |
zz |
是否通过 |
未通过 |
代码语言 |
C++ |
运行时间 |
2.560 s |
提交时间 |
2024-11-16 18:12:14 |
内存使用 |
3.72 MiB |
显示代码纯文本
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- freopen("happya.in","r",stdin);
- freopen("happya.out","w",stdout);
- int n,m,x[100001]={0},a,b,c,max[2]={0};
- char y[100001];
- cin>>n>>m;
- for(int i=0;i<m;i++)
- {
- cin>>y[i];
- if(y[i]=='I')
- {
- cin>>a>>b>>c;
- for(int j=a;j<=b;j++)
- x[j]+=c;
- }
- else
- {
- cin>>a>>b;
- for(int j=a;j<=b;j++)
- if(max[0]<x[j])
- {
- max[0]=x[j];
- max[1]=j;
- }
- cout<<max[0]<<endl;
- x[max[1]]=0;max[0]=0;max[1]=0;
- }
- }
- }