답안 #845765

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
845765 2023-09-06T15:19:46 Z vjudge1 Trener (COCI20_trener) C++
컴파일 오류
0 ms 0 KB
#include<bits/stdc++.h>
using namespace std;
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	long long a,b,c,d;
	string kel;
	vector < vector <string> > strarr;
	long long arr[55][1505];
	long long mod=1000000007;
	memset(arr,0,sizeof(arr));
	vector <string> den;
	cin>>a>>b;
	for(long long i=0;a>=i;i++){
		strarr.push_back(den);
		}
	}
	for(long long i=0;a>i;i++){
		for(long long j=0;b>j;j++){
			cin>>kel;
			strarr[i].push_back(kel);
		}
	}
	for(long long j=0;b>j;j++){
		arr[a-1][j]=1;
	}
	for(long long i=1;a>=i;i++){
		for(long long j=0;b>j;j++){
			for(long long k=0;b>k;k++){
				long long h=0;
				for(long long ponk = 0;(a-i)>ponk; ponk++){
					if(strarr[a-(i+1)][j][ponk] != strarr[a-(i)][k][ponk]){
						h=1;
						break;
					}
				}
				if(h == 1){
					h=0;
					for(long long ponk = 0;(a-i)>ponk; ponk++){
					if(strarr[a-(i+1)][j][ponk] != strarr[a-(i)][k][ponk+1]){
						h=1;
						break;
					}
					}
					if(h == 0){
						arr[(a-(i+1))][j]=((arr[(a-(i))][k] % mod) + (arr[(a-(i+1))][j] % mod)% mod);
					}

				}
				else{
					arr[(a-(i+1))][j]=((arr[(a-(i))][k] % mod) + (arr[(a-(i+1))][j] % mod)% mod);
				}
			}
		}
	}
	d=0;
	for(long long j=0;b>j;j++){
		d+=arr[0][j];
		d%=mod;
	}
	cout<<d%mod;


	
}

Compilation message

trener.cpp: In function 'int main()':
trener.cpp:6:16: warning: unused variable 'c' [-Wunused-variable]
    6 |  long long a,b,c,d;
      |                ^
trener.cpp:6:18: warning: unused variable 'd' [-Wunused-variable]
    6 |  long long a,b,c,d;
      |                  ^
trener.cpp:10:12: warning: unused variable 'mod' [-Wunused-variable]
   10 |  long long mod=1000000007;
      |            ^~~
trener.cpp: At global scope:
trener.cpp:18:2: error: expected unqualified-id before 'for'
   18 |  for(long long i=0;a>i;i++){
      |  ^~~
trener.cpp:18:20: error: 'a' does not name a type
   18 |  for(long long i=0;a>i;i++){
      |                    ^
trener.cpp:18:24: error: 'i' does not name a type
   18 |  for(long long i=0;a>i;i++){
      |                        ^
trener.cpp:24:2: error: expected unqualified-id before 'for'
   24 |  for(long long j=0;b>j;j++){
      |  ^~~
trener.cpp:24:20: error: 'b' does not name a type
   24 |  for(long long j=0;b>j;j++){
      |                    ^
trener.cpp:24:24: error: 'j' does not name a type; did you mean 'jn'?
   24 |  for(long long j=0;b>j;j++){
      |                        ^
      |                        jn
trener.cpp:27:2: error: expected unqualified-id before 'for'
   27 |  for(long long i=1;a>=i;i++){
      |  ^~~
trener.cpp:27:20: error: 'a' does not name a type
   27 |  for(long long i=1;a>=i;i++){
      |                    ^
trener.cpp:27:25: error: 'i' does not name a type
   27 |  for(long long i=1;a>=i;i++){
      |                         ^
trener.cpp:56:2: error: 'd' does not name a type
   56 |  d=0;
      |  ^
trener.cpp:57:2: error: expected unqualified-id before 'for'
   57 |  for(long long j=0;b>j;j++){
      |  ^~~
trener.cpp:57:20: error: 'b' does not name a type
   57 |  for(long long j=0;b>j;j++){
      |                    ^
trener.cpp:57:24: error: 'j' does not name a type; did you mean 'jn'?
   57 |  for(long long j=0;b>j;j++){
      |                        ^
      |                        jn
trener.cpp:61:2: error: 'cout' does not name a type
   61 |  cout<<d%mod;
      |  ^~~~
trener.cpp:65:1: error: expected declaration before '}' token
   65 | }
      | ^