답안 #1010578

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1010578 2024-06-29T08:19:06 Z tarpent 원형 문자열 (IZhO13_rowords) C++14
0 / 100
2000 ms 348 KB
#include<bits/stdc++.h>
using namespace std;


string a,b;
int m,pr,od;
int main(){
	cin>>a>>b;
	m=-1;
	for(int i = 0; i<a.size(); i++){
		int j = pr;
		while(true){
			if(a[i]==b[j]){
				od++;
				pr=j;
				if(m==-1) m=j;
			}
			if(j==b.size()-1){
				j=0;
			}
			else j++;
			if(j==m-1){
				break;
			}
			
			
			
		}
	}
	cout<<od;
	
	
	
}

Compilation message

rowords.cpp: In function 'int main()':
rowords.cpp:10:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |  for(int i = 0; i<a.size(); i++){
      |                 ~^~~~~~~~~
rowords.cpp:18:8: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   18 |    if(j==b.size()-1){
      |       ~^~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Execution timed out 2097 ms 348 KB Time limit exceeded
5 Incorrect 1 ms 348 KB Output isn't correct
6 Incorrect 0 ms 348 KB Output isn't correct
7 Execution timed out 2051 ms 348 KB Time limit exceeded
8 Execution timed out 2057 ms 348 KB Time limit exceeded
9 Incorrect 0 ms 344 KB Output isn't correct
10 Incorrect 0 ms 344 KB Output isn't correct
11 Incorrect 0 ms 348 KB Output isn't correct
12 Execution timed out 2097 ms 348 KB Time limit exceeded
13 Execution timed out 2027 ms 348 KB Time limit exceeded
14 Incorrect 0 ms 348 KB Output isn't correct
15 Incorrect 0 ms 348 KB Output isn't correct
16 Incorrect 0 ms 348 KB Output isn't correct
17 Incorrect 0 ms 348 KB Output isn't correct
18 Execution timed out 2095 ms 348 KB Time limit exceeded
19 Incorrect 1 ms 344 KB Output isn't correct
20 Execution timed out 2050 ms 348 KB Time limit exceeded
21 Incorrect 0 ms 348 KB Output isn't correct
22 Incorrect 0 ms 348 KB Output isn't correct
23 Incorrect 0 ms 348 KB Output isn't correct
24 Incorrect 0 ms 348 KB Output isn't correct
25 Incorrect 0 ms 344 KB Output isn't correct