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 cal(LL x) {
- int ret = 0;
- while (x != 0) {
- ret = x % 10;
- x /= 10;
- }
- return ret;
- }
- int main() {
- #ifdef ExRoc
- freopen("test.txt", "r", stdin);
- #endif // ExRoc
- ios::sync_with_stdio(false);
- set<LL> st;
- LL tmp2 = 1;
- LL tmp5 = 1;
- for (int i = 0; i < 25; ++i) {
- tmp2 *= 2;
- tmp5 *= 5;
- cout << "i = " << i << ": " << cal(tmp2) * cal(tmp5) << endl;
- st.insert(cal(tmp2) * cal(tmp5));
- }
- int ans = 0;
- for (int x : st) {
- ans += x;
- }
- cout << ans << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement