| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 81617 | 杨竣周 | class | C++ | Accepted | 100 | 1 MS | 252 KB | 299 | 2023-08-09 17:09:38 |
#include<bits/stdc++.h> using namespace std; int k,x,y,p,q,ans; bool a,b; int main(){ cin>>k>>x>>y>>p>>q; for(int i=1;i<=k;i++){ if(i%(x+y)==(x+1)%(x+y)) a=1; if(i%(x+y)==1) a=0; if(i%(p+q)==(p+1)%(p+q)) b=1; if(i%(p+q)==1) b=0; if(a&&b) ans++; } cout<<ans; return 0; }