diff --git a/1016A.cpp b/1016A.cpp new file mode 100644 index 0000000..28f34cd --- /dev/null +++ b/1016A.cpp @@ -0,0 +1,20 @@ +//The_Shellkore_Awakens +#include +using namespace std; +#define fast() ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL) +typedef long long ll; +int main() +{ +ll n,m,val; +cin>>n>>m; +ll sum=0; +for(int i=0;i>val; +sum+=val; +cout< +using namespace std; +#define fast() ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL) +typedef long long ll; +int main() +{ +int n,m,q; +cin>>n>>m>>q; +string s,t; +cin>>s>>t; +int h[n]={0}; +for(int i=0;i<=n-m;i++) +{int c=0; +for(int j=0;j>l>>r; + for(int i=l-1;i +using namespace std; +#define fast() ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL) +typedef long long ll; +int main() +{ +int n; +cin>>n; +int a[n]; +for(int i=0;i>w>>x>>y>>z; +a[i]=w+x+y+z; +} +int thomas=a[0]; +sort(a,a+n,greater()); +for(int i=0;i +//The_Shellkore_Awakens +#include using namespace std; +#define fast() ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL) typedef long long ll; -const int N = 1<<20; -vectorv; -ll cnt,a[N],b[N],has[N],n,m,sum; -bool flag,f; int main() { - ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL); - cin>>n>>m; - string s,t; - cin>>s>>t; - if(n>m+1) - cout<<"NO"; - else{ - for(int i=0;i0;i--) - { if(s[i]=='*') - {f=1;break;} - if(s[i]!=t[i+(m-n)]) - {flag=1; - break;} - } - if(m>n&&f==0)cout<<"NO"; - else - {if(flag==0) - cout<<"YES"; - else cout<<"NO"; - } - } - return 0; +int i=0; +int n,m; +cin>>n>>m; + +string s,t; +cin>>s>>t; +if(m