답안 #447782

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
447782 2021-07-27T14:05:52 Z Jasiekstrz Sifra (COCI21_sifra) C++17
50 / 50
1 ms 204 KB
#include<bits/stdc++.h>
#define fi first
#define se second
using namespace std;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	string s;
	cin>>s;
	int curr=0;
	bool xd=false;
	set<int> st;
	for(auto v:s)
	{
		if('0'<=v && v<='9')
		{
			curr=10*curr+v-'0';
			xd=true;
		}
		else if(xd)
		{
			st.insert(curr);
			xd=false;
			curr=0;
		}
	}
	if(xd)
		st.insert(curr);
	cout<<st.size()<<"\n";
	return 0;
}

# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 0 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct