这题太水了

P1001 A+B Problem

203孙召轩B4 @ 2020-11-13 21:18:09

不知怎么的感觉非常非常非常非常非常水


by hensier @ 2020-11-13 21:18:39

orz+sqlm


by 一只书虫仔 @ 2020-11-13 21:18:50

你家试机题不水?sqlm


by AffineRing @ 2020-11-13 21:19:45

\begin{gathered}\boxed{\begin{matrix}\color{white}\tfrac{}{\tfrac{}{\tfrac{}{\color{black}\begin{gathered}\colorbox{black}{\color{white}\Huge\textbf{R.I.P}}\cr\text{\tiny 永远的时间}\cr \footnotesize\texttt{\red{机惨者} 葬身此地}\cr\cr\cr\cr \large\texttt{\qquad我诅咒机惨者\qquad} \cr \cr \cr\scriptsize\text{sb jcer qs} \end{gathered}}}}\end{matrix}} \cr[-5pt]\fcolorbox{black}{grey}{\raisebox{12pt}{\kern{180pt}}} \cr[-5pt]\fcolorbox{black}{grey}{\raisebox{12pt}{\kern{230pt}}}\end{gathered}

by VioletIsMyLove @ 2020-11-13 21:22:30

orz


by CGDGAD @ 2020-11-13 21:22:40

sqlm


by Uniseca @ 2020-11-13 21:30:25

orz,这题我做了70 pts/min^{-1001}


by donghanwen1225 @ 2020-11-13 21:30:41

sqlm


by AMIRIOX無暝 @ 2020-11-13 21:31:33

这题还水?

线段树是提高组的, code来自题解, 侵删

#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<iostream>
using namespace std;
struct node{
    int val,l,r;
};
node t[5];
int a[5],f[5];
int n,m;
void init(){
    for(int i=1;i<=2;i++){
        scanf("%d",&a[i]);
    }
}
void build(int l,int r,int node){//这是棵树
    t[node].l=l;t[node].r=r;t[node].val=0;
    if(l==r){
        f[l]=node;
        t[node].val=a[l];
        return;
    }
    int mid=(l+r)>>1;
    build(l,mid,node*2);
    build(mid+1,r,node*2+1);
    t[node].val=t[node*2].val+t[node*2+1].val;
}
void update(int node){
    if(node==1)return;
    int fa=node>>1;
    t[fa].val=t[fa*2].val+t[fa*2+1].val;
    update(fa);
}
int find(int l,int r,int node){
    if(t[node].l==l&&t[node].r==r){
        return t[node].val;
    }
    int sum=0;
    int lc=node*2;int rc=lc+1;
    if(t[lc].r>=l){
        if(t[lc].r>=r){
            sum+=find(l,r,lc);
        }
        else{
            sum+=find(l,t[lc].r,lc);
        }
    }
    if(t[rc].l<=r){
        if(t[rc].l<=l){
            sum+=find(l,r,rc);
        }
        else{
            sum+=find(t[rc].l,r,rc);
        }
    }
    return sum;
}
int main(){
    init();
    build(1,2,1);
    printf("%d",find(1,2,1));
}

by 囧仙 @ 2020-11-13 22:50:30

@AMIRIOX無暝 然而线段树实际上是普及组的(


by AMIRIOX無暝 @ 2020-11-14 00:13:57

@囧仙

万物皆可普及组 ( ( (

验证码T8 RE什么鬼


| 下一页