제출 #223192

#제출 시각아이디문제언어결과실행 시간메모리
223192jamielimTrener (COCI20_trener)C++14
22 / 110
19 ms768 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(){ int n,k; scanf("%d%d",&n,&k); char str[n][k][55]; for(int i=0;i<n;i++){ for(int j=0;j<k;j++){ scanf("%s",str[i][j]); } } ll dp[n][k]; memset(dp,0,sizeof(dp)); for(int i=0;i<k;i++)dp[n-1][i]=1; for(int i=n-2;i>=0;i--){ for(int j=0;j<k;j++){ for(int m=0;m<k;m++){ bool f=1,s=1; for(int l=0;l<=i;l++){ if(str[i][j][l]!=str[i+1][m][l])f=0; if(str[i][j][l]!=str[i+1][m][l+1])s=0; } if(f||s)dp[i][j]+=dp[i+1][m]; } } } ll ans=0; for(int i=0;i<k;i++)ans+=dp[0][i]; printf("%lld",ans); }

컴파일 시 표준 에러 (stderr) 메시지

trener.cpp: In function 'int main()':
trener.cpp:8:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d",&n,&k);
  ~~~~~^~~~~~~~~~~~~~
trener.cpp:12:9: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    scanf("%s",str[i][j]);
    ~~~~~^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...