제출 #129241

#제출 시각아이디문제언어결과실행 시간메모리
12924144442Elder (COCI19_elder)C++11
50 / 50
2 ms504 KiB
#include <bits/stdc++.h>
using namespace std;
char a[101],b[101],j;
bool v[204];
short n,d,e,ok=1,k;
int main (){
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
   cin>>j>>n;
   for(int i=0;i<n;i++){
   	    cin>>a[i]>>b[i]; 
   }
    for(d;d<n;d++){
	    if(b[d]==j){
          v[j]=1;
          j=a[d]; 
          ok=ok+!v[j]; 
     }
    }
    cout<<j<<endl<<ok;
return 0;
}

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

elder.cpp: In function 'int main()':
elder.cpp:13:10: warning: statement has no effect [-Wunused-value]
     for(d;d<n;d++){
          ^
elder.cpp:15:14: warning: array subscript has type 'char' [-Wchar-subscripts]
           v[j]=1;
              ^
elder.cpp:17:21: warning: array subscript has type 'char' [-Wchar-subscripts]
           ok=ok+!v[j]; 
                     ^
#Verdict Execution timeMemoryGrader output
Fetching results...