diff --git a/1066E.cpp b/1066E.cpp new file mode 100644 index 0000000..bd0e727 --- /dev/null +++ b/1066E.cpp @@ -0,0 +1,17 @@ +#include +using namespace std; +const int mod=998244353; +int main(){ + int n,m,ans=0,sum=0,p=1; + cin>> n >>m; + string s,t; + cin>>s>>t; + for(int i=0;i +using namespace std; +typedef long long ll; +typedef pair PLL; +map > mp; +ll dis(PLL a,PLL b){ + return abs(a.first-b.first)+abs(a.second-b.second); +} +int main(){ + ll n; + scanf("%lld",&n); + for(ll i=0;i +using namespace std; +int main(){ + long long n,T; + long long a[200010],dc=0,ans=0; + cin>>n>>T; + for(int i=0; i<(int)n; i++) cin>>a[i]; + while(T>0){ + long long Tp=T,cn=0; + for(int i=0; i=a[i]){ + Tp-=a[i]; + cn++; + } + } + if(cn==0) break; + Tp=T-Tp; + long long mv=T/Tp; + ans+=mv*cn; + T-=mv*Tp; + } + cout<