Skip to content

Commit

Permalink
Add 14579.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiyabye committed Mar 12, 2024
1 parent eee512a commit c60e59b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions 14xxx/14579.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include <iostream>
#define MOD 14579
using namespace std;

void solve(void) {
int a, b; cin >> a >> b;

int ans = 1;
for (int i=a; i<=b; i++) {
ans = ans * (i*(i+1)/2 % MOD) % MOD;
}
cout << ans;
}

int main(void) {
ios::sync_with_stdio(false);
cin.tie(nullptr);

solve();
return 0;
}

0 comments on commit c60e59b

Please sign in to comment.