結果
問題 |
No.695 square1001 and Permutation 4
|
ユーザー |
|
提出日時 | 2018-06-08 23:18:14 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
MLE
|
実行時間 | - |
コード長 | 461 bytes |
コンパイル時間 | 1,772 ms |
コンパイル使用メモリ | 167,060 KB |
実行使用メモリ | 159,360 KB |
最終ジャッジ日時 | 2024-07-22 19:16:14 |
合計ジャッジ時間 | 10,591 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 5 RE * 1 MLE * 6 |
ソースコード
#include <bits/stdc++.h> using namespace std; long long P[ 20000000 ]; const long long iMod = 100000000000000007; int main() { int i; int j; int n; int m; int x[ 10 ]; ios::sync_with_stdio( false ); cin.tie( 0 ); cin >> n; cin >> m; for( i = 0; i < m; i++ ) cin >> x[ i ]; P[ 1 ] = 1; for( i = 1; i < n; i++ ) { for( j = 0; j < m; j++ ) { P[ i + x[ j ] ] += P[ i ]; P[ i + x[ j ] ] %= iMod; } } cout << P[ i ] << endl; return 0; }