# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
530953 | Tenis0206 | Trener (COCI20_trener) | C++11 | 2079 ms | 10712 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int Mod = 1e9 + 7;
int n,k;
int dp[1505];
string s[1505];
map<string,int> dps,fc;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cin>>n>>k;
for(int j=1; j<=k; j++)
{
cin>>s[j];
++dps[s[j]];
}
for(int i=2; i<=n; i++)
{
for(int j=1; j<=k; j++)
{
dp[j] = 0;
}
for(int j=1; j<=k; j++)
{
cin>>s[j];
fc.clear();
for(int st=0; st<s[j].size(); st++)
{
string aux;
for(int dr=st; dr<s[j].size(); dr++)
{
aux.push_back(s[j][dr]);
if(!fc[aux])
{
dp[j] += dps[aux];
dp[j] %= Mod;
}
++fc[aux];
}
}
}
dps.clear();
for(int j=1; j<=k; j++)
{
dps[s[j]] += dp[j];
dps[s[j]] %= Mod;
}
}
int rez = 0;
for(int j=1; j<=k; j++)
{
rez += dp[j];
rez %= Mod;
}
cout<<rez<<'\n';
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |