Submission #2554495
Source Code Expand
#include <bits/stdc++.h> using namespace std; #define ll long long #define pub push_back #define pob pop_back #define all(a) a.begin(),a.end() #define rall(a) a.rbegin(),a.rend() #define repp(i,a,b) for(int i=a;i<b;i++) #define repm(i,a,b) for(int i=a;i>b;i--) #define debug_interval endl #define dump_interval ' ' #define debug_toggle 0 inline int toInt(string s){int v;istringstream sin(s);sin>>v;return v;} template<class T> inline string toString(T x){ostringstream sout;sout<<x;return sout.str();} inline int gcd(int a,int b){return a?gcd(b%a,a):b;} //Don't use C++17 template<class...A> inline void dump(){cout<<endl;} template<class...A> inline void dump_rest() {cout<<endl;} template<class T, class...A> inline void dump_rest(const T& first, const A&... rest){cout<<dump_interval<<first;dump_rest(rest...);} template<class T,class...A> inline void dump(const T&first,const A&...rest){cout<<first;dump_rest(rest...);} template<class...A> inline void debug(){cout<<endl;} template<class...A> inline void debug_rest() {cout<<endl;} template<class T, class...A> inline void debug_rest(const T& first, const A&... rest){cout<<debug_interval<<first;debug_rest(rest...);} template<class T,class...A> inline void debug(const T&first,const A&...rest){if(debug_toggle)cout<<first,debug_rest(rest...);} string s; char m; main(){ ios::sync_with_stdio(false); cin>>s; sort(all(s)); m=s.front(); for(int i=1;i<n;i++){ if(m==s[i])dump("no"),return 0; } dump("Yes"); }
Submission Info
Submission Time | |
---|---|
Task | B - Varied |
User | masu1208 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1542 Byte |
Status | CE |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:36:19: error: ‘n’ was not declared in this scope for(int i=1;i<n;i++){ ^ ./Main.cpp:37:31: error: expected primary-expression before ‘return’ if(m==s[i])dump("no"),return 0; ^