답안 #810265

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
810265 2023-08-06T07:46:49 Z tlnk07 Sifra (COCI21_sifra) C++17
50 / 50
1 ms 212 KB
#include<bits/stdc++.h>
using namespace std;

long long cnt = 0;
string s, s1 = "";
map<string, bool> mp;

int main()
{
	cin >> s;
	for(int i = 0; i < s.size(); ++i)
	{
		if(s[i] < '0' || s[i] > '9')	continue;
		while(s[i] >= '0' && s[i] <= '9')
		{
			s1 += s[i];
			++i;
		}
		if(!mp[s1])	++cnt;
		mp[s1] = true;
		s1 = "";
	}
	cout << cnt;
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:11:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |  for(int i = 0; i < s.size(); ++i)
      |                 ~~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct