Viewing a response to: @justyy/re-kenchung-question-mathematics-programming-competition-8-20171020t174626994z
用一行python语句把这道题解了,我是不是疯了? https://steemit.com/cn/@speeding/one-line-python-math-programming print(int(sum(map(lambda d: 0.5 if d != ''.join(map(lambda i:'012xx59x86'[int(i)], d[::-1])) and ''.join(map(lambda i:'012xx59x86'[int(i)], d[::-1])) in ['%04d' % x for x in range(0, 10000)] else 1 , ['%04d' % x for x in range(0, 10000)]))))
author | speeding |
---|---|
permlink | re-justyy-re-kenchung-question-mathematics-programming-competition-8-20171022t092830260z |
category | contest |
json_metadata | {"tags":["contest"],"app":"steemit/0.1","links":["https://steemit.com/cn/@speeding/one-line-python-math-programming"]} |
created | 2017-10-22 09:28:30 |
last_update | 2017-10-22 09:30:30 |
depth | 2 |
children | 2 |
last_payout | 2017-10-29 09:28:30 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 335 |
author_reputation | 1,172,222,545,920 |
root_title | "[Question] Mathematics × Programming Competition #8 [問題] 數學 × 程式編寫比賽 (第八回)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 18,284,113 |
net_rshares | 0 |
这个可以有,PYTHON一向以一行代码解题著称,不过写出来的代码没有维护性,很难改,用于快速刷题可以的。
author | justyy |
---|---|
permlink | re-speeding-re-justyy-re-kenchung-question-mathematics-programming-competition-8-20171022t095518265z |
category | contest |
json_metadata | {"tags":["contest"],"app":"steemit/0.1"} |
created | 2017-10-22 09:55:21 |
last_update | 2017-10-22 09:55:21 |
depth | 3 |
children | 1 |
last_payout | 2017-10-29 09:55:21 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 52 |
author_reputation | 280,616,224,641,976 |
root_title | "[Question] Mathematics × Programming Competition #8 [問題] 數學 × 程式編寫比賽 (第八回)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 18,285,763 |
net_rshares | 0 |
只是好玩
author | speeding |
---|---|
permlink | re-justyy-re-speeding-re-justyy-re-kenchung-question-mathematics-programming-competition-8-20171022t142011483z |
category | contest |
json_metadata | {"tags":["contest"],"app":"steemit/0.1"} |
created | 2017-10-22 14:20:15 |
last_update | 2017-10-22 14:20:15 |
depth | 4 |
children | 0 |
last_payout | 2017-10-29 14:20:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 4 |
author_reputation | 1,172,222,545,920 |
root_title | "[Question] Mathematics × Programming Competition #8 [問題] 數學 × 程式編寫比賽 (第八回)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 18,303,180 |
net_rshares | 0 |