12345679*81=?

本文揭秘了一种巧妙的数学计算方法,通过将12345679乘以81的过程进行拆解,展示了数学运算中的规律和美感。通过一系列等式的转换,最终得出结果为999999999,过程既有趣又富有教育意义。

12345679*81

=(11111111+1111111+111111+11111+1111+111+11+2)*9*9

=(99999999+9999999+999999+99999+9999+999+99+9+9)*9

=(100000000+10000000+1000000+100000+10000+1000+100+10+10-9)*9

=111111111*9

=999999999

Done.

转载于:https://www.cnblogs.com/tupx/archive/2012/04/22/2464906.html

#include <iostream> #include <iomanip> #include <fstream> #include <cmath> #include <numeric> #include <algorithm> #include <queue> #include <deque> #include <stack> #include <vector> #include <map> #include <set> #include <unordered_map> #include <unordered_set> #include <string> #include <cstring> #include <utility> #include <bitset> #include <climits> #include <cstdlib> #include <chrono> #include <functional> using namespace std; #define endl '\n' #define ll long long #define IOS ios::sync_with_stdio(false);cin.tie(nullptr); typedef pair<int, int> PII; typedef pair<int, PII> PIII; typedef unsigned long long ull; const int N = 2e5 + 10; const int MOD = 1e9 + 7; const int INF = INT_MAX; const ll LNF = LLONG_MAX; const double PI = acos(-1); const int dx4[] = {-1, 0, 1, 0}; const int dy4[] = {0, 1, 0, -1}; const int dx8[] = {-1, -1, -1, 0, 0, 1, 1, 1}; const int dy8[] = {-1, 0, 1, -1, 1, -1, 0, 1}; void solve() { int n, m; cin >> n >> m; } int main() { IOS; int a, b, c; vector<int> orz; cin >> a >> b >> c; int n = a + 2; if(a < b + c) { cout << -1 << endl; return 0; } orz.push_back(1); orz.push_back(2); orz.push_back(3); int rc = a - 1 - c; for(int i = 0; i < c; i ++ ) orz.push_back(3); for(int i = 0; i < rc; i ++ ) orz.push_back(1); if(orz.size() != n) { cout << -1 << endl; return 0; } cout << n << endl; for(int i : orz) cout << i << " "; return 0; } 题目意思可转化为: 小红喜爱数字1,小紫喜爱数字2,小彩喜爱数字3。她们定义了“好数”的规则:一个数是好数,当且仅当它的所有数位**同时包含且仅包含1、2、3这三个数字**,并且**任意两个相邻的数位数字都不相同**。 现在需要你构造两个n位的正整数a和b,使得a与b的乘积(a×b)是一个好数。 **输入**:一个正整数n(满足1 ≤ n ≤ 2×10⁵)。 **输出**:如果不存在这样的两个n位正整数a和b,输出-1;如果存在,输出任意一组符合要求的n位正整数a和b即可(若有多个解,输出任意一个都可)。
10-20
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值