結果
| 問題 |
No.493 とても長い数列と文字列(Long Long Sequence and a String)
|
| コンテスト | |
| ユーザー |
e869120
|
| 提出日時 | 2017-03-08 20:37:17 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 365 bytes |
| コンパイル時間 | 718 ms |
| コンパイル使用メモリ | 67,756 KB |
| 実行使用メモリ | 813,604 KB |
| 最終ジャッジ日時 | 2024-06-23 19:32:36 |
| 合計ジャッジ時間 | 4,330 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 55 MLE * 1 -- * 59 |
ソースコード
#include<iostream>
#include<string>
using namespace std;
int main(){
long long K,L,R;cin>>K>>L>>R;
string S="";
for(int i=1;i<=K;i++){S=S+to_string(i*i)+S;}
if(S.size()<R){cout<<"-1"<<endl;}
else{
long long r1=0,r2=1;
for(int i=L-1;i<=R-1;i++){
int G=(S[i]-'0');if(G==0)G=10;
r1+=G;r2*=G;r2%=1000000007;
}
cout<<r1<<' '<<r2<<endl;
}
return 0;
}
e869120