日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Common Knowledge_快速幂

發布時間:2023/12/1 编程问答 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Common Knowledge_快速幂 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

問題 I: Common Knowledge

時間限制:?1 Sec??內存限制:?64 MB
提交:?9??解決:?8
[提交][狀態][討論版]

題目描述

Alice and Bob play some game in which they score points. Each of the two has an n-digit?scoreboard which depicts numbers in base 10 (with leading zeroes). The digits 0 to 9 are?displayed on a seven-segment display in the following fashion:

For some odd reason, the two players cannot see the scoreboards entirely. Alice can only see the?lower half of her own scoreboard and the upper half of Bob’s scoreboard. Bob can only see the?upper half of his scoreboard and the upper half of Alice’s scoreboard. Here, ‘half’ is meant to
include the horizontal segments in the digits’ centers: they can be seen by both players at all?times. For example, if one sees the upper half of an eight, one can conclude that the digit is not?a zero.

A pair of n-digit scores is called fully known if both players know both scores (i.e. all 2n digits)?by looking at the displays with their restricted vision. The players cannot communicate.

輸入

The input consists of:
? one line with an integer n (1 ≤ n ≤ 20), where n is the number of digits.

輸出

Output the number of score pairs that can be displayed on two n-digit scoreboards and are fully?known by both players.

樣例輸入

10

樣例輸出

1073741824 #include <iostream> #include <cstdio> #include <algorithm>using namespace std;int main() {int x=8;long long int mi;int n;while(scanf("%d",&n)!=EOF){mi=x;if(n==0){printf("1\n");continue;}for(int i=1;i<n;){if(i<n/2){mi*=mi;i*=2;}else{mi*=x;i+=1;}}printf("%lld\n",mi);mi=0;}return 0; }

?

轉載于:https://www.cnblogs.com/TWS-YIFEI/p/5940256.html

總結

以上是生活随笔為你收集整理的Common Knowledge_快速幂的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。