# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
375116 | Nordway | Sifra (COCI21_sifra) | C++17 | 1 ms | 512 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define x first
#define y second
#define pb push_back
#define mp make_pair
#define all(v) v.begin(),v.end()
#define sz(v) (int)v.size()
#define up_b upper_bound
#define low_b lower_bound
#define nl '\n'
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
const int N=1e5+11;
const int M=1e6+1;
const ll inf=1e9+11;
const ld EPS=1e-6;
const ll INF=1e18;
const ll mod=/*999999001*/1e9+7;
const int dx[4]={1,2,2,-1};
const int dy[4]={2,1,-1,2};
map<string,int>used;
void solve(){
string s;
cin>>s;
int n=sz(s);
int cnt=0;
for(int i=0;i<n;i++){
if(isalpha(s[i]))continue;
int j=i;
while(j<n-1&&!isalpha(s[j+1]))j++;
string t=s.substr(i,j-i+1);
if(!used[t])cnt++;
used[t]=1;
i=j;
}
cout<<cnt;
}
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0),cout.tie(0);
int T=1;
//cin>>T;
for(int i=1;i<=T;i++){
solve();
cout<<nl;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |