CF 2020.10.04比赛在线讨论

RT

9 条评论

  • @ 2020-10-11 18:13:34

    @IcproX: 快来!

  • @ 2020-10-05 20:48:36

    @Dry_ice 在吗?

  • @ 2020-10-05 01:43:24
    #include<stdio.h>
    #include<string.h>
    #include<iostream>
    #define LL long long
    const int N = 1e5;
    using namespace std;
    LL mod = 1e9 + 7;
    
    
    char a[N + 5];
    LL ans = 0, p[N + 5], s[N + 5];
    
    
    int main() {
        scanf("%s", a + 1);
        int l = strlen(a + 1);
        p[1] = 1;
        for(int i = 2; i <= l; ++i)
            p[i] = (p[i - 1] * 10) % mod;
        for(int i = 1; i <= l; ++i)
            s[i] = (s[i - 1] + i * p[i] % mod) % mod;    
        ans = (l - 1) * l / 2 % mod * (a[l] - '0') % mod;
        // cout << ans << endl;/
        for(int i = l - 1; i >= 1; --i) {
            int t = a[i] - '0';
            ans = (ans + (i - 1) * i / 2 * t * p[l - i + 1] % mod) % mod;
            ans = (ans + s[l - i] * t % mod) % mod;
            // cout << ans << endl;
        }
        cout << ans << endl;
        return 0;
    }
    
  • @ 2020-10-05 01:43:07

    怎么也没过, WA on#6

  • @ 2020-10-05 01:42:52

    终于C

  • @ 2020-10-05 00:24:25

    再见,一题没过

  • @ 2020-10-04 23:53:50

    有人么?

  • @ 2020-10-04 23:50:06

    不应该是10.5比赛吗?0:05开始/xyx

  • @ 2020-10-04 23:49:35

    我来了

  • 1