답안 #782675

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
782675 2023-07-14T07:24:33 Z 1075508020060209tc Sifra (COCI21_sifra) C++14
50 / 50
1 ms 212 KB
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define X first
#define Y second
int s;

signed main(){
string s;
cin>>s;
set<int>st;
for(int i=0;i<s.size();i++){
    int v=0;
    int t=i;
    while(i<s.size()&&isdigit(s[i])){
        v=v*10+s[i]-'0';i++;
    }
    if(v){
    i--;
    st.insert(v);}
}
cout<<st.size();

}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:12:14: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 | for(int i=0;i<s.size();i++){
      |             ~^~~~~~~~~
Main.cpp:15:12: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |     while(i<s.size()&&isdigit(s[i])){
      |           ~^~~~~~~~~
Main.cpp:14:9: warning: unused variable 't' [-Wunused-variable]
   14 |     int t=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 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 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