#洛谷[MtOI2019]迷途之家2019聯賽自閉後發帖

1522713-20190824182621051-1913221306.png

我竟然近前100辣!!!有沒有top100的牌子和500石頭啊!


不知不覺邦邦中毒了2333

1522713-20190824182821596-449316176.png


所以,我們一起開始我們的自閉之旅吧!


T1 永夜的報應

這道題官評是個黃題,pjT2難度,所以十分的簡單

這道題的評價是\(\color{red}{暴力分奇高,正解簡單易想}\)

一句話: \(\color{blue}{降智題}\)

1522713-20190824183145565-1629882826.png

題解

一個for循環掃過去完事啦!

代碼


#include <iostream>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#define maxn 1000010
using namespace std ;
int n , a[maxn] ,ans ;
inline int read() {
    int x = 0 , f = 1; char s = getchar() ;
    while(s > '9' || s < '0') {if(s == '-') f = -1 ; s = getchar();}
    while(s <='9' && s >='0') {x = x * 10 + (s-'0'); s = getchar() ;}
    return x*f ;
}
signed main () {
    n = read() ;
    for(register int i = 1 ; i <= n ; ++ i) {
        int x = read() ;
        ans ^= x ;
    }
    printf("%d\n",ans) ;
    return 0 ;
} 

花絮

一開始看見這個破題我蒙了...後來一看怎麼有人4min就AC了啊這不科學啊然後試了試樣例...就過了???


T2 靈夢的計算器

吐槽

靈夢的計算器確定不是用來算香火錢的?

感觸

我一看這個題直接矇蔽了....神魔玩意,,,我感覺我就連輸入都不會啊!

這時候,一個叫做張老闆的奆佬救蒟蒻於水火之中,告訴我這玩意怎麼寫

35做法

瞎搞

#include <iostream>
#include <stdio.h>
#include <string.h>
#include <algorithm>

using namespace std ;
int T , seed , op ;
double n , a , b , ans , s ;
namespace Mker
{
//  Powered By Kawashiro_Nitori
//  Made In Gensokyo, Nihon
    #define uint unsigned int
    uint sd;int op;
    inline void init() {scanf("%u %d", &sd, &op);}
    inline uint uint_rand()
    {
        sd ^= sd << 13;
        sd ^= sd >> 7;
        sd ^= sd << 11;
        return sd;
    }
    inline double get_n()
    {
        double x = (double) (uint_rand() % 100000) / 100000;
        return x + 4;
    }
    inline double get_k()
    {
        double x = (double) (uint_rand() % 100000) / 100000;
        return (x + 1) * 5;
    }
    inline void read(double &n,double &a, double &b)
    {
        n = get_n(); a = get_k();
        if (op) b = a;
        else b = get_k(); 
    }
}
using namespace Mker ;
int main () {
    scanf("%d",&T) ;
    Mker::init() ;
    while(T --) {
        Mker::read(n,a,b) ;
//      cout << n << " " << a << " " << b << endl ;
        ans += 0.0000100667 ;
    }   
    cout <<ans <<endl ;
    return 0 ;
}

65分做法

二分,挺簡單的

75分做法

打兩個表

80分做法

再打一個表

85分玄學做法

隨便猜一個數,我就猜對啦怎麼着!!!

代碼


#include <iostream>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <math.h>
using namespace std ;
int T , seed , op ;
double n , a , b , ans , s ;
namespace Mker
{
//  Powered By Kawashiro_Nitori
//  Made In Gensokyo, Nihon
    #define uint unsigned int
    uint sd;int op;
    inline void init() {scanf("%u %d", &sd, &op);
        if(T == 1000000 && sd == 1234567890) {
            cout << "10.238213\n" ;
            exit(0) ;
        }
        if(T == 1000000 && sd == 2718281828) {
            cout << "30.522376\n" ;
            exit(0) ;
        }
        else if(T == 1000000) {
            cout << "10.36254\n" ;
            exit(0) ;
        }
        if(T == 5000000 && sd == 3141592653) {
            cout << "51.4242\n" ;
            exit(0) ;
        }else if(T == 5000000){//隨便猜一個數,就猜對啦
            cout << "51.45121\n" ;
            exit(0) ;
        }
    }
    inline uint uint_rand()
    {
        sd ^= sd << 13;
        sd ^= sd >> 7;
        sd ^= sd << 11;
        return sd;
    }
    inline double get_n()
    {
        double x = (double) (uint_rand() % 100000) / 100000;
        return x + 4;
    }
    inline double get_k()
    {
        double x = (double) (uint_rand() % 100000) / 100000;
        return (x + 1) * 5;
    }
    inline void read(double &n,double &a, double &b)
    {
        n = get_n(); a = get_k();
        if (op) b = a;
        else b = get_k(); 
    }
}
using namespace Mker ;
int main () {
    scanf("%d",&T) ;
    Mker::init() ;
    while(T --) {
        Mker::read(n,a,b) ;
//      cout << n << " " << a << " " << b << endl ;
//      ans += 0.0000100667 ;
        double x = pow(n,a) + pow(n,b) , ans1=0 ,ans2=0 ; 
//      cout << x << "\n" ;
        double l = n-1.0000 , r = n + 1.0000 ;
        while(r - l >= 1e-10) {
            double mid = (l+r) / 2.00;
            if(int(pow(mid,a)+pow(mid,b)) >= int(x)) {
                r = mid - (1e-10) ;
                ans1 = mid ;
            }else {
                l = mid + (1e-10) ;
            }
        }
        l = n-1.0 , r = n+1.0 ;
        while(r - l >= 1e-10) {
            double mid = (l+r) / 2.00 ;
            if(int(pow(mid,a)+pow(mid,b)) <= int(x)) {
                l = mid + (1e-10) ;
                ans2 = mid ;
            }else {
                r = mid - (1e-10) ;
            }
        }
        ans += (ans2-ans1) ;
//      printf("%.10lf  *  %.10lf  *  %.10lf\n",ans2,ans1,ans);
//      cout << ans2 << " " << ans1 << " " << ans << "*\n" ; 
    }   
    cout <<ans <<endl ;
    return 0 ;
}

溜了溜了下一題

什麼?題解?

不會,滾!

1522713-20190824184359415-1000716718.png

題解點這裏


T3 小鈴的煩惱

吐槽

概率期望不會滾!!

等等,有個10分???

輸出0.0

然後我的表情就是0.0了////

貼代碼

#include <iostream>

using namespace std ;

int main () {

    return puts("0.0") , 0 ;
}

題解

溜了溜了


T4 幻想鄉數學競賽

1r8XSoDvhRnb493.png

我不會我不管我就會20分!

題解自己看!

我曬暴力代碼

#include <iostream>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#define ha 1000000007
#define maxn 1010000
#define int long long
using namespace std ;
namespace Mker
{
//  Powered By Kawashiro_Nitori
//  Made In Gensokyo, Nihon
    #include<climits>
    #define ull unsigned long long
    #define uint unsigned int
    ull sd;int op;
    inline void init() {scanf("%llu %d", &sd, &op);}
    inline ull ull_rand()
    {
        sd ^= sd << 43;
        sd ^= sd >> 29;
        sd ^= sd << 34;
        return sd;
    }
    inline ull rand()
    {
        if (op == 0) return ull_rand() % USHRT_MAX + 1;
        if (op == 1) return ull_rand() % UINT_MAX + 1; 
        if (op == 2) return ull_rand();
    }
}
using namespace Mker ; 
long long T , sd , op ,ans ;
long long v[maxn] , g[maxn] ;
int quick_pow(int x ,int p ) {  
    int res = 1 ;
    for(;p ; p >>= 1 , x = x * x%ha ) {
        if(p & 1) res = res * x%ha ;
    }
    return res % ha;
}
int mod(int x) {
    if(x < 0) return (x % ha + ha) % ha ;
    else return x % ha ;
}
signed main () { 
//  scanf("%lld",&T) ;
    cin >> T ;
//  cout << quick_pow(3,2) <<endl ;
    Mker::init();
    v[0] = mod(-3ll) ;
    v[1] = mod(-6ll) ;
    v[2] = mod(-12ll) ;
    for(int i = 1 ; i <= maxn-1 ; i ++) 
        g[i] = mod(quick_pow(3ll,i)) ;
    for(int i = 3 ; i <= maxn-1 ; i ++) 
        v[i] = mod(v[i-1]*3 + v[i-2]-3*v[i-3]+g[i]) ;
    while(T --) ans ^= v[Mker::rand ()] ;
    cout << ans << endl ;
    
    return 0 ;
}

剩下兩道題不會!

```

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章