제출 #103515

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
1035152019-03-30 20:58:39pedro_sponchiado세 명의 친구들 (BOI14_friends)C++17
0 / 100
22 ms7196 KiB
#include<bits/stdc++.h>
using namespace std;
const int maxn=2000010;
int n_, n;
char str[maxn], s1[maxn], s2[maxn], s3[maxn], s4[maxn];
int mini;
int verif(char str1[maxn], char str2[maxn]){
for(int i=0; i<=n; i++){
if(str1[i]!=str2[i]){
mini=i;
break;
}
}
// printf("mini=%d\n", mini);
int cont=0, da=1;
for(int i=0; i<n; i++){
if(cont==mini) cont++;
// printf("%c %c\n", str1[i], str2[cont]);
if(str1[i]!=str2[cont]) da=0;
cont++;
}
// printf("%d\n", da);
if(da==0) return 0;
if( (str2[mini]==str2[mini-1] && mini>=1) || (str2[mini]==str2[mini+1] && mini<=n-1) ) return 2;
return 1;
}
int main(){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

friends.cpp: In function 'int main()':
friends.cpp:31:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &n_);
  ~~~~~^~~~~~~~~~~
friends.cpp:32:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf(" %s ", str);
  ~~~~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...