結果
| 問題 | 
                            No.1629 Sorting Integers (SUM of M)
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2021-07-31 02:42:21 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 489 bytes | 
| コンパイル時間 | 1,643 ms | 
| コンパイル使用メモリ | 165,720 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-09-16 05:38:41 | 
| 合計ジャッジ時間 | 2,177 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge6 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 WA * 2 | 
| other | WA * 14 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main () {
    int N;
    cin >> N;
    ll m = 1e9 + 7;
    ll kj = 1;
    ll ans = 0;
    for (int i = 0; i < N; i ++) {
        ans += kj;
        if (ans >= m) {
            ans -= m;
        }
        kj *= 10;
        kj %= m;
    }
    kj = 0;
    for (int i = 1; i < 10; i ++) {
        ll x;
        cin >> x;
        kj += (x * i) % m;
        if (kj >= m) kj -= m;
    }
    cout << (ans * kj) % m << endl;
}