結果
| 問題 |
No.1620 Substring Sum
|
| コンテスト | |
| ユーザー |
Nachia
|
| 提出日時 | 2021-07-22 21:26:57 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 7 ms / 2,000 ms |
| コード長 | 362 bytes |
| コンパイル時間 | 666 ms |
| コンパイル使用メモリ | 70,256 KB |
| 最終ジャッジ日時 | 2025-01-23 06:05:50 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 20 |
ソースコード
#include <iostream>
#include <vector>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define rep(i,n) for(int i=0; i<(n); i++)
int main(){
string S; cin >> S;
ull ans = 0;
ull x = 1;
for(auto c : S){
ans = ans * 11 + x * (c-'0');
ans %= 998244353;
x = x * 2 % 998244353;
}
cout << ans << endl;
return 0;
}
Nachia