反思8.23

再次吃了语文的亏,读了$40$分钟题干,愣是没懂他要求的是什么

完了总是吃语文不好的亏

还得知我$set$这么写会爆炸

            ll pre=*--upper_bound(st.begin(),st.end(),a[i]),
            nxt=*lower_bound(st.begin(),st.end(),a[i]);

            ll pre=*--st.upper_bound(a[i]),
            nxt=*st.lower_bound(a[i]);
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define A 1010101
ll a[A],b[A],yuan[A];
ll n,que,cnt=0,mx=-10000000000ll,mn=10000000000ll;
set<ll> st;
set<ll> ::iterator it;
int main(){
    while(cin>>n){
        cnt++;
        ll ans=0,bj=1;
        mx=-10000000000ll,mn=10000000000ll;
        st.clear();
        st.insert(-10000000000ll);
        st.insert(10000000000ll);
        for(ll i=1;i<=n;i++){
            scanf("%lld",&a[i]);
            st.insert(a[i]);
            mx=max(mx,a[i]);
            mn=min(mn,a[i]);
        }
        if(mx==mn){
            printf("Case #%lld: -1\n",cnt);
            continue ;
        }
        for(ll i=1;i<=n;i++){
            ll sd=a[i];
            if((it=st.find(a[i]))!=st.end()) st.erase(it);
            ll pre=*--upper_bound(st.begin(),st.end(),a[i]),
            nxt=*lower_bound(st.begin(),st.end(),a[i]);
            st.insert(sd);
            if(pre==-10000000000ll)
                pre=mx;
            if(nxt==10000000000ll)
                nxt=mn;
            if(pre!=nxt) bj=0;
//            printf("pre=%lld nxt=%lld\n",pre,nxt);
            if((a[i]+pre)%2147483647==nxt) ans++;
        }
        printf("Case #%lld: %lld\n",cnt,ans);
    }
}
View Code

 算是,,收获颇丰?

然而$t2$没打出线性推约瑟夫问题我真是没有动脑思考

$t3$看出$crt$然而指数上的欧拉函数我不会求???

$phi(54184622)=?$

多了一个任务:复习数学

猜你喜欢

转载自www.cnblogs.com/znsbc-13/p/11400500.html