| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 81513 | 曹张煜 | class | C++ | Accepted | 100 | 2 MS | 1016 KB | 407 | 2023-08-09 14:30:26 |
#include<bits/stdc++.h> using namespace std; int a[100010]={0},b[100010]={0},ans=0; int main(){ int k,x,y,p,q; cin>>k>>x>>y>>p>>q; for(int i=1;i<=k;i++){ if(i%(x+y)<=x&&i%(x+y)!=0) continue; else a[i]=1; } for(int i=1;i<=k;i++){ if(i%(p+q)<=p&&i%(p+q)!=0) continue; else b[i]=1; } for(int i=1;i<=k;i++){ if(a[i]==b[i]&&a[i]==1&&b[i]==1) ans++; } cout<<ans; return 0; }