結果
問題 | No.793 うし数列 2 |
ユーザー |
![]() |
提出日時 | 2019-02-22 22:34:55 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 945 bytes |
コンパイル時間 | 692 ms |
コンパイル使用メモリ | 98,996 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-25 09:52:55 |
合計ジャッジ時間 | 1,383 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 5 WA * 16 |
コンパイルメッセージ
main.cpp: In function 'int main()': main.cpp:56:29: warning: 'tmp' may be used uninitialized [-Wmaybe-uninitialized] 56 | cout << (ans + (tmp + z)*2)%MOD << endl; | ~~~~~~~~~^~ main.cpp:50:8: note: 'tmp' was declared here 50 | ll tmp; | ^~~
ソースコード
#include<iostream> #include<vector> #include<algorithm> #include<functional> #include<queue> #include<stack> #include<set> #include<map> #include<unordered_map> #include<climits> #include<cstdlib> #include<cmath> #include<string> #include<iomanip> #include<bitset> using namespace std; #define ll long long int ll const MOD = 1000000007; ll const INF = (long long int)1 << 61; int main(){ cin.tie(0); ios::sync_with_stdio(false); ll n; cin >> n; ll x = n%(MOD-1); ll y = (((MOD)*(MOD-1))/2)%MOD; ll z = ((((n/(MOD-1))%MOD)*y)%MOD); ll base = 1; for(int i = 1; i < 100000; i++){ base = (base*10 + 1)%MOD; } ll ans = 1; while(x > 100000){ x -= 100000; ans = (ans * 100000 + base)%MOD; } ll tmp; for(int i = 0; i < x; i++){ tmp = ans; ans = (ans*10 + 1)%MOD; } cout << (ans + (tmp + z)*2)%MOD << endl; return 0; }