結果
問題 | No.1177 余りは? |
ユーザー |
|
提出日時 | 2020-08-21 23:08:01 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 294 bytes |
コンパイル時間 | 656 ms |
コンパイル使用メモリ | 71,936 KB |
実行使用メモリ | 50,304 KB |
最終ジャッジ日時 | 2024-10-15 06:33:24 |
合計ジャッジ時間 | 14,969 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 31 TLE * 1 |
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 6 | main() | ^~~~
ソースコード
#include<iostream> #include<set> using namespace std; long P,K; const long mod=1e9+7; main() { cin>>P>>K; long ans=0; long now=1; set<long>S; while(S.find(now)==S.end()) { S.insert(now); now=now*10; ans=(ans*10+now/P)%mod; now%=P; } if(K==0)ans=(ans+1)%mod; cout<<ans<<endl; }