F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_18073020_6874.cpp: In function 'int main()':
0_0_18073020_6874.cpp:2:214: error: 'MOD' was not declared in this scope
 long long c[110][110];int s[110];long long dp[110][110];int main(){ int n; int l; for (int i = 1; i < 110; i++) {  c[i][0] = c[i][i] = 1;  for (int j = 1; j < i; j++)   c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % MOD; } while (cin >> n) {  memset(dp, 0, sizeof(dp));  memset(s, -1, sizeof(s));  for (int i = 1; i <= n; i++)  {   scanf("%d", &s[i]);   dp[i][i] = 1;  }  for (int i = 1; i + 1 <= n; i++)   dp[i][i + 1] = 2;  for (int len = 2; len < n;len++)  for (int i = 1; i + len <= n; i++)  {      int j = i + len;   dp[i][j] = dp[i][j] + dp[i + 1][j];   dp[i][j] = dp[i][j] + dp[i][j - 1];   dp[i][j] %= MOD;   for (int k = i+1; k <j;k++)   if (s[k - 1] == s[k + 1])    dp[i][j] = (dp[i][j] + (dp[i][k - 1] * dp[k + 1][j] % MOD*c[j - i][k - i]) % MOD) % MOD;  }  cout << dp[1][n] << endl; }}
                                                                                                                                                                                                                      ^
0_0_18073020_6874.cpp:2:228: error: 'cin' was not declared in this scope
 long long c[110][110];int s[110];long long dp[110][110];int main(){ int n; int l; for (int i = 1; i < 110; i++) {  c[i][0] = c[i][i] = 1;  for (int j = 1; j < i; j++)   c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % MOD; } while (cin >> n) {  memset(dp, 0, sizeof(dp));  memset(s, -1, sizeof(s));  for (int i = 1; i <= n; i++)  {   scanf("%d", &s[i]);   dp[i][i] = 1;  }  for (int i = 1; i + 1 <= n; i++)   dp[i][i + 1] = 2;  for (int len = 2; len < n;len++)  for (int i = 1; i + len <= n; i++)  {      int j = i + len;   dp[i][j] = dp[i][j] + dp[i + 1][j];   dp[i][j] = dp[i][j] + dp[i][j - 1];   dp[i][j] %= MOD;   for (int k = i+1; k <j;k++)   if (s[k - 1] == s[k + 1])    dp[i][j] = (dp[i][j] + (dp[i][k - 1] * dp[k + 1][j] % MOD*c[j - i][k - i]) % MOD) % MOD;  }  cout << dp[1][n] << endl; }}
                                                                                                                                                                                                                                    ^
0_0_18073020_6874.cpp:2:228: note: suggested alternative:
In file included from 0_0_18073020_6874.cpp:1:0:
GCC4.9.2/x86_64-w64-mingw32/include/c++/iostream:60:18: note:   'std::cin'
   extern istream cin;  /// Linked to standard input
                  ^
0_0_18073020_6874.cpp:2:265: error: 'memset' was not declared in this scope
 long long c[110][110];int s[110];long long dp[110][110];int main(){ int n; int l; for (int i = 1; i < 110; i++) {  c[i][0] = c[i][i] = 1;  for (int j = 1; j < i; j++)   c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % MOD; } while (cin >> n) {  memset(dp, 0, sizeof(dp));  memset(s, -1, sizeof(s));  for (int i = 1; i <= n; i++)  {   scanf("%d", &s[i]);   dp[i][i] = 1;  }  for (int i = 1; i + 1 <= n; i++)   dp[i][i + 1] = 2;  for (int len = 2; len < n;len++)  for (int i = 1; i + len <= n; i++)  {      int j = i + len;   dp[i][j] = dp[i][j] + dp[i + 1][j];   dp[i][j] = dp[i][j] + dp[i][j - 1];   dp[i][j] %= MOD;   for (int k = i+1; k <j;k++)   if (s[k - 1] == s[k + 1])    dp[i][j] = (dp[i][j] + (dp[i][k - 1] * dp[k + 1][j] % MOD*c[j - i][k - i]) % MOD) % MOD;  }  cout << dp[1][n] << endl; }}
                                                                                                                                                                                                                                                                         ^
0_0_18073020_6874.cpp:2:608: error: 'MOD' was not declared in this scope
 long long c[110][110];int s[110];long long dp[110][110];int main(){ int n; int l; for (int i = 1; i < 110; i++) {  c[i][0] = c[i][i] = 1;  for (int j = 1; j < i; j++)   c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % MOD; } while (cin >> n) {  memset(dp, 0, sizeof(dp));  memset(s, -1, sizeof(s));  for (int i = 1; i <= n; i++)  {   scanf("%d", &s[i]);   dp[i][i] = 1;  }  for (int i = 1; i + 1 <= n; i++)   dp[i][i + 1] = 2;  for (int len = 2; len < n;len++)  for (int i = 1; i + len <= n; i++)  {      int j = i + len;   dp[i][j] = dp[i][j] + dp[i + 1][j];   dp[i][j] = dp[i][j] + dp[i][j - 1];   dp[i][j] %= MOD;   for (int k = i+1; k <j;k++)   if (s[k - 1] == s[k + 1])    dp[i][j] = (dp[i][j] + (dp[i][k - 1] * dp[k + 1][j] % MOD*c[j - i][k - i]) % MOD) % MOD;  }  cout << dp[1][n] << endl; }}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ^
0_0_18073020_6874.cpp:2:767: error: 'cout' was not declared in this scope
 long long c[110][110];int s[110];long long dp[110][110];int main(){ int n; int l; for (int i = 1; i < 110; i++) {  c[i][0] = c[i][i] = 1;  for (int j = 1; j < i; j++)   c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % MOD; } while (cin >> n) {  memset(dp, 0, sizeof(dp));  memset(s, -1, sizeof(s));  for (int i = 1; i <= n; i++)  {   scanf("%d", &s[i]);   dp[i][i] = 1;  }  for (int i = 1; i + 1 <= n; i++)   dp[i][i + 1] = 2;  for (int len = 2; len < n;len++)  for (int i = 1; i + len <= n; i++)  {      int j = i + len;   dp[i][j] = dp[i][j] + dp[i + 1][j];   dp[i][j] = dp[i][j] + dp[i][j - 1];   dp[i][j] %= MOD;   for (int k = i+1; k <j;k++)   if (s[k - 1] == s[k + 1])    dp[i][j] = (dp[i][j] + (dp[i][k - 1] * dp[k + 1][j] % MOD*c[j - i][k - i]) % MOD) % MOD;  }  cout << dp[1][n] << endl; }}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               ^
0_0_18073020_6874.cpp:2:767: note: suggested alternative:
In file included from 0_0_18073020_6874.cpp:1:0:
GCC4.9.2/x86_64-w64-mingw32/include/c++/iostream:61:18: note:   'std::cout'
   extern ostream cout;  /// Linked to standard output
                  ^
0_0_18073020_6874.cpp:2:787: error: 'endl' was not declared in this scope
 long long c[110][110];int s[110];long long dp[110][110];int main(){ int n; int l; for (int i = 1; i < 110; i++) {  c[i][0] = c[i][i] = 1;  for (int j = 1; j < i; j++)   c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % MOD; } while (cin >> n) {  memset(dp, 0, sizeof(dp));  memset(s, -1, sizeof(s));  for (int i = 1; i <= n; i++)  {   scanf("%d", &s[i]);   dp[i][i] = 1;  }  for (int i = 1; i + 1 <= n; i++)   dp[i][i + 1] = 2;  for (int len = 2; len < n;len++)  for (int i = 1; i + len <= n; i++)  {      int j = i + len;   dp[i][j] = dp[i][j] + dp[i + 1][j];   dp[i][j] = dp[i][j] + dp[i][j - 1];   dp[i][j] %= MOD;   for (int k = i+1; k <j;k++)   if (s[k - 1] == s[k + 1])    dp[i][j] = (dp[i][j] + (dp[i][k - 1] * dp[k + 1][j] % MOD*c[j - i][k - i]) % MOD) % MOD;  }  cout << dp[1][n] << endl; }}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ^
0_0_18073020_6874.cpp:2:787: note: suggested alternative:
In file included from GCC4.9.2/x86_64-w64-mingw32/include/c++/iostream:39:0,
                 from 0_0_18073020_6874.cpp:1:
GCC4.9.2/x86_64-w64-mingw32/include/c++/ostream:564:5: note:   'std::endl'
     endl(basic_ostream<_CharT, _Traits>& __os)
     ^


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-23 03:39:41, Gzip enabled