Submission #141654

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1416542019-08-08 16:25:22mariusnicoliMate (COCI18_mate)C++14
0 / 100
2064 ms49028 KiB
/**
banana
1
2 na
**/
#include <iostream>
#include <cstring>
#include <vector>
#define MOD 1000000007
using namespace std;
char p, u, s[2002];
long long R[2002][26];
long long D[2002][26][26], sol[2002][26][26];
long long C[2002][2002];
vector<long long> poz[26];
long long n, i, j, k, t, L;
int main () {
cin>>s+1;
n = strlen(s+1);
C[0][0] = 1;
for (i=1;i<=n;i++) {
C[i][0] = 1;
for (j=1;j<=i;j++)
C[i][j] = (C[i-1][j-1] + C[i-1][j]) % MOD;
}
for (i=1;i<=n;i++)
poz[s[i]-'a'].push_back(i);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

mate.cpp: In function 'int main()':
mate.cpp:18:11: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
     cin>>s+1;
          ~^~
mate.cpp:56:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for (t=0;t<poz[j].size();t++) {
                      ~^~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...