Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- typedef long long LL;
- const int maxn = 100 + 100;
- LL sum(LL x) {
- return (1 + x) * x / 2 % 100;
- }
- LL mult(LL x) {
- LL ret = 1;
- for (LL i = 1; i <= x; ++i) {
- ret = ret * i % 100;
- }
- return ret;
- }
- int main() {
- #ifdef ExRoc
- freopen("test.txt", "r", stdin);
- #endif // ExRoc
- ios::sync_with_stdio(false);
- int cnt = 0;
- for (int i = 1; i <= 2000; ++i) {
- if ((sum(i) - mult(i)) % 100 == 0) {
- ++cnt;
- cout << i << ": " << cnt << endl;
- }
- }
- cout << "2024041331404202" << endl;
- cout << "202404133140400" << endl;
- cout << "40480826628086" << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement