183368493 please see my solution and tell me why i get run time error please dont ignore i am dugging this more than hours PLEASE!!!

# | User | Rating |
---|---|---|

1 | Benq | 3783 |

2 | jiangly | 3772 |

3 | tourist | 3706 |

4 | maroonrk | 3609 |

5 | Um_nik | 3591 |

6 | fantasy | 3526 |

7 | ko_osaga | 3500 |

8 | inaFSTream | 3477 |

9 | cnnfls_csy | 3427 |

10 | zh0ukangyang | 3423 |

# | User | Contrib. |
---|---|---|

1 | Um_nik | 185 |

2 | awoo | 182 |

3 | nor | 172 |

4 | -is-this-fft- | 170 |

5 | adamant | 169 |

6 | maroonrk | 165 |

7 | antontrygubO_o | 160 |

8 | SecondThread | 159 |

9 | dario2994 | 152 |

9 | kostka | 152 |

https://codeforces.com/contest/1225/my 182321559 any body tell me why there is overflow

https://codeforces.com/contest/1539/problem/A i am not able to solve the problem because of constraints the first solution is this

using namespace std; void solve(){ ll n,x,t; cin>>n>>x>>t; int v[n]={0}; for(int i=1;i<n;i++) v[i]=v[i-1]+x; // for(auto i:v) cout<<i<<" "; // cout<<endl; int vv[n]={0}; for(int i=0;i<n;i++) vv[i]=v[i]+t; // for(auto i: vv ) cout<<i<<" "; // cout<<endl; ll sum=0; for(int i=0;i<n-1;i++){ ll upper1 = upper_bound(v, v+n, vv[i]) — v; sum+=upper1-i-1; } cout<<sum<<endl;

} int main() { int tc; cin>>tc; while(tc--){ solve(); } } 2.nd solution is this

using namespace std; void solve(){ ll n,x,t; ll ans=(max(0ll,(n-t)/x)*(t/x))+min((n-1),t/(x-1))*(min(n,(t/x)))/2; cout<<ans<<endl;

} int main() { int tc; cin>>tc; while(tc--){ solve(); } } IN FIRST ONE IT SHOWS RUN TIME ERROR BECOZ OF CONSTRAINT AND IN 2ND IT SHOWS RANDOM NUMBER MAY BE BECAUSE OF 0LL HELP ME PLEASE!!!!1:(

What i do my codeforces telegram link is not working

Codeforces (c) Copyright 2010-2023 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Mar/27/2023 17:24:03 (h1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|