日本搞逼视频_黄色一级片免费在线观看_色99久久_性明星video另类hd_欧美77_综合在线视频

國內最全IT社區平臺 聯系我們 | 收藏本站
阿里云優惠2
您當前位置:首頁 > php開源 > 綜合技術 > URAL 1295. Crazy Notions(數學啊 & 找規律)

URAL 1295. Crazy Notions(數學啊 & 找規律)

來源:程序員人生   發布時間:2015-04-08 08:35:27 閱讀次數:3511次

題目鏈接:http://acm.timus.ru/problem.aspx?space=1&num=1295



1295. Crazy Notions

Time limit: 0.5 second
Memory limit: 64 MB
For five days robot-loader JK546L54p has been buried under the thick layer of the Sibelian plutonium slag. The terrible strike of the atmospheric electricity has led to the depressurization of the robot’s fuel elements. Who will examine this heap of fused, broken metal here, where there is no any robot technician even at distance of a hundred parsecs? Robot-commissar even did not try to investigate what happened with JK546L54p. He ordered to throw him out into dumps and that is all. Nobody noticed that positron brains of JK546L54p were still working. If only the robopsychologist was here with JK546L54p! Of course, he would be killed with the hard gamma radiation in a moment, but… If he attached the visualizer of thoughts to the fused connectors of JK546L54p! He would see the strange performance. Robot was creating! No, I am not joking. He was investigating. Semi casual objects arose in his mind, and he examined them. Crazy properties, crazy theorems.
Besides, here is an example. Let’s take an expression 1n+2n+3n+4n. How much zeros does its decimal notation end with? JK546L54p solved this problem, and you, student, could you?

Input

The only line contains an integer n (1 ≤ n ≤ 300000).

Output

Output the number of zeroes the decimal notation of 1n+2n+3n+4n ends with.

Samples

input output
1
1
3
2



代碼以下(找規律):

#include <cstdio> #define LL __int64 //int main() //{ // int n; // for(int i = 1; i <= 32; i++) // { // LL ans1 = 1; // LL ans2 = 1; // LL ans3 = 1; // LL ans4 = 1; // for(int j = 1; j <= i; j++) // { // ans2*=2; // ans3*=3; // ans4*=4; // } // int cnt = 0; // LL ans = ans1+ans2+ans3+ans4; // while(ans) // { // if(ans%10 == 0) // { // cnt++; // ans/=10; // } // else // { // break; // } // } // printf("%d:: ans:%d ",i,cnt); // } // return 0; //} int main() { int n; int a[30]= {1,1,2,0,2,1,2,0,1,1,2,0,1,1,2,0,1,1,2,0}; while(~scanf("%d",&n)) { printf("%d ",a[(n⑴)%20]); } return 0; // while(~scanf("%d",&n)) // { // if(n%4 == 0) // { // printf("0 "); // } // else if((n%4==1 &&n%5==0) || n%4==3) // { // printf("2 "); // } // else // { // printf("1 "); // } // } return 0; }

貼1發他人的:

#include <stdio.h> #include <iostream> #include <algorithm> using namespace std; long long mod=100000; long long quickmulti(long long m,long long n)//2分快速冪 { long long ans=1; long long i; while(n) { if(n&1) ans=(m*ans)%mod; m=(m*m)%mod; n>>=1; } return ans; } int main() { long long n; while(scanf("%lld",&n)!=EOF) { long long ans=1; ans+=quickmulti(2,n); ans%=mod; ans+=quickmulti(3,n); ans%=mod; ans+=quickmulti(4,n); ans%=mod; long long tem=ans; long long tt=0; while(tem%10==0) { tem/=10; tt++; } printf("%lld ",tt); } return 0; }


生活不易,碼農辛苦
如果您覺得本網站對您的學習有所幫助,可以手機掃描二維碼進行捐贈
程序員人生
------分隔線----------------------------
分享到:
------分隔線----------------------------
關閉
程序員人生
主站蜘蛛池模板: 免费精品视频一区二区三区 | 日韩精品免费一区二区三区 | 玖玖成人| 看毛片的网址 | 在线中文字幕第一页 | 日韩精品在线一区 | 欧美日本精品 | 91免费国产在线 | 韩日av在线 | 精品毛片| 亚洲欧美中文日韩在线v日本 | 日韩在线视频观看 | 亚洲一区二区三区四区五区中文 | 99久久一区二区三区 | 亚洲一区二区三区四区五区午夜 | 亚洲一区二区精品 | 亚洲精品久久久蜜桃 | 美日韩一区 | 国产一区导航 | 麻豆精品国产传媒mv男同 | 色片网址 | 毛片黄片| 日韩欧美一区二区三区免费观看 | 日韩视频在线免费 | 国内精自视频品线六区免费 | av网站免费播放 | 成人一区二区三区 | 亚洲第一成人久久网站 | 毛片久久| 99免费视频 | 亚洲福利视频导航 | 99国产精品视频免费观看一公开 | 午夜亚洲一区 | 99精品欧美一区二区三区综合在线 | 久久电影国产免费久久电影 | 国内精品国产成人国产三级粉色 | 日皮视频在线观看 | 亚洲超碰在线 | 成人免费视频网 | 国产一区二 | 午夜精品久久久久久久久 |