zoukankan      html  css  js  c++  java
  • PE的一些水 3-50

    T3:

      分解质因数.

      lalala

    T4:

      暴模.

      然而数学方法怎么搞?---->也就是怎么手算?...

      于是看了一下讨论区...发现原来我的数学已经低于小学生水平了...

      我们把答案abccba拆成100001a+10010b+1100c,然后它是11的倍数. 我们先撂在这

      然后考虑我们的乘数,因为答案最大显然9开头,那么两个乘数末尾组合只能是(1,9),(3,3),(7,7)

      我们可以枚举出900-1000中11的倍数,发现末尾是1,3,7,9 的只有913,957,979

      然后后面就懒得写了...贴大神的过程...

      So now the presumed answer is either:

      (900 + 10 + 3)(900 + 10x + 3)

      (900 + 50 + 7)(900 + 10x + 7)

      (900 + 70 + 9)(900 + 10x + 1)

      Factoring all those out, you get: 810000 + 9000x + 2700 + 9000 + 100x + 30 + 2700 + 30x + 9 824439 + 9130x Now, for the first digit 824439 + 9130x to be 9, x must be 9 (if x were 8, then 824439 + 9130x = 897479, and the first digit is 8)

       And so you have 913 * 993, which is the answer. You can factor the others out to see if they produce a bigger answer, which they don't.

    PE-5

      题意:

        求能被1~20的每个数都整除的最小值。

      SOL:

        拓展到任意n的情况,就把他以内质数都筛出来,然后找到小于n的最大的幂,累乘即可.

    PE-6

      题意:

        求“100的和的平方”与“100的平方和”的差。

      SOL:

        暴模...

        或者手算,复习一下平方和的公式(还不会用latex...) balabala=n * (n+1) * (2n+1) * 1/6

       [ sum_{i=1}^n i^2 = frac{n imes(n+1) imes(2n+1)}{6} ]

    PE-7

      求第10001个素数

      第一道线筛...我真是弱...

      

    /*=================================================================
    # Created time: 2016-03-24 18:29
    # Filename: 7.cpp
    # Description: 
    =================================================================*/
    #define me AcrossTheSky 
    #include <cstdio> 
    #include <cmath> 
    #include <ctime> 
    #include <string> 
    #include <cstring> 
    #include <cstdlib> 
    #include <iostream> 
    #include <algorithm> 
      
    #include <set> 
    #include <map> 
    #include <stack> 
    #include <queue> 
    #include <vector> 
     
    #define lowbit(x) (x)&(-x) 
    #define FOR(i,a,b) for((i)=(a);(i)<=(b);(i)++) 
    #define FORP(i,a,b) for(int i=(a);i<=(b);i++) 
    #define FORM(i,a,b) for(int i=(a);i>=(b);i--) 
    #define ls(a,b) (((a)+(b)) << 1) 
    #define rs(a,b) (((a)+(b)) >> 1) 
    #define getlc(a) ch[(a)][0] 
    #define getrc(a) ch[(a)][1] 
     
    #define maxn 100000 
    #define maxm 100000 
    #define pi 3.1415926535898 
    #define _e 2.718281828459 
    #define INF 1070000000 
    using namespace std; 
    typedef long long ll; 
    typedef unsigned long long ull; 
     
    template<class T> inline 
    void read(T& num) { 
        bool start=false,neg=false; 
        char c; 
        num=0; 
        while((c=getchar())!=EOF) { 
            if(c=='-') start=neg=true; 
            else if(c>='0' && c<='9') { 
                start=true; 
                num=num*10+c-'0'; 
            } else if(start) break; 
        } 
        if(neg) num=-num; 
    } 
    /*==================split line==================*/ 
    int prime[maxn];
    bool a[100000000];
    int main(){
    	ll i=2,sum=0;
    	for(;;i++){
    		if (!a[i]) prime[++sum]=i;
    		if (sum==10001) break;
    		for (ll j=1;j<=sum && i*prime[j]<100000000;j++){
    			a[i*prime[j]]=true;
    			if (i%prime[j]==0) break;
    		}
    	}
    	printf("%d
    ",prime[10001]);
    }
    

     PE-8

      不知道什么乱七八糟的...过过过...

    PE-9

      题意:

        找到满足a+b+c=1000的毕达哥拉斯三元组,并求三元组的乘积。

      SOL:

        暴模...

        可以动用一切关系来减少运行时间...

    PE-10

      改一改线筛...

    PE-11

      暴模不写了,腊鸡

    PE-12

      题意:

        求使n*(n+1)/2 有500个因数的最小n.

      SOL:

        可以暴模...唯一分解定理什么的...有没有更快做法呢...

    PE-13

      奇奇怪怪的题

    PE-14 

      记忆化?或者叫DP什么的...出这种题我也是十分惊讶...

    PE-15

      丝帛组合题.

    PE-16

      求2^1000各个位上数字之和.

      除了高精度真的没别的了吗?...

    PE-17

      乱搞题...直接抄答案...

      分段打表真是兹瓷.

    PE-18

      DP...

    PE-19

      我怎么有点坚持不下去了...各种乱搞题...梦回初中启蒙时...

    PE-20

      真的只是高精度吗....

    PE-21

      继续乱搞...

    PE-22

      暴模

      复习一下约数个数和的公式

      f(n)=(p1^0+p1^1+p1^2+…p1^a1)(p2^0+p2^1+p2^2+…p2^a2)…(pk^0+pk^1+pk^2+…pk^ak)

    PE-23

      暴模

    PE-24

      暴模  

    PE-25

      题意:

        求第一个有1000位的fibonacci数.

        复习一下通项公式

     
     

    PE-26

      暴模.

    PE-27

      暴枚.

    PE-28  

      有点像noip普及那年的T3...

      右上的对角线的值是能确定的,然后相同行相同列也能确定了.

    PE-29

      题意:

        2-100的数的1-100次方一共有多少个不同的数

      暴模套个set...

      感觉可以找个幂,只有幂会重复,然后容斥减一减...就是有点麻烦...

    PE-30

      暴枚...

    PE-31

      丝帛DP

    PE-32

      枚举乘数判断一下

    PE-33

      乱搞,暴模

    PE-34

      可以搞个组合,然后暴模

    PE-35

      预处理一下暴枚

    PE-36  

      暴枚

    PE-37

      暴枚

    PE-38

      暴模

    PE-39

      暴枚

    PE-40

      暴模

    PE-41

      暴枚

    PE-42

      暴枚

    PE-43

      全排列

    PE-44

      暴模真的好吗...感觉数学方法完全没有前途...难道式子列错了?...

    PE-45

      暴模..吐血

    PE-46

      暴模,吐血

    PE-47

      暴模

    PE-48

      快速幂

    PE-49 & 50

      模模模模到吐血

  • 相关阅读:
    用struct定义函数
    三、OCTAVE画图
    二、OCTAVE 移动数据
    SQL复习
    Flink处理迟到的数据
    LeetCode题目学习
    CentOS7安装pycharm
    IntelliJ IDEA 刷题利器 LeetCode 插件
    Redis命令学习
    项目杂记
  • 原文地址:https://www.cnblogs.com/YCuangWhen/p/5318228.html
Copyright © 2011-2022 走看看