【HDU5391】Zball in Tina Town】的更多相关文章

[题目大意] 一个球初始体积为1,一天天变大,第一天变大1倍,第二天变大2倍,第n天变大n倍.问当第 n-1天的时候,体积变为多少.注意答案对n取模. [题解] 根据威尔逊定理:(n-1)! mod n =-1 所以当n为质数时,答案就是n-1 否则答案显然是0 注意4要特判一下,ans[4]=2 这里有一种很魔性的判素数的方法,详见代码 /************* HDU 5391 by chty 2016.11.4 *************/ #include<iostream> #i…
<题目链接> Zball in Tina Town Problem Description Tina Town is a friendly place. People there care about each other.Tina has a ball called zball. Zball is magic. It grows larger every day. On the first day, it becomes 1 time as large as its original siz…
转载请注明出处: http://www.cnblogs.com/fraud/          ——by fraud Zball in Tina Town Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 219    Accepted Submission(s): 144 Problem Description Tina Town i…
(n-1)!/n 就是如果n为素数,就等于n-1else为0. 求素数表: Zball in Tina Town Time Limit: 3000/1500 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 833 Accepted Submission(s): 477 Problem Description Tina Town is a friendly place. People…
版权声明: 本文为博主Bravo Yeung(知乎UserName同名)的原创文章,欲转载请先私信获博主允许,转载时请附上网址 http://blog.csdn.net/lzuacm. HDUoj 5391 - Zball in Tina Town 在线提交: http://acm.hdu.edu.cn/showproblem.php?pid=5391 Time Limit: 3000/1500 MS (Java/Others) Memory Limit: 262144/262144 K (Ja…
Zball in Tina Town Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others) Problem Description Tina Town is a friendly place. People there care about each other. Tina has a ball called zball. Zball is magic. It grows lar…
题目传送门 /* 题意: 求(n-1)! mod n 数论:没啥意思,打个表能发现规律,但坑点是4时要特判! */ /************************************************ * Author :Running_Time * Created Time :2015-8-15 19:06:12 * File Name :A.cpp ************************************************/ #include <cstdi…
Zball in Tina Town  Accepts: 541  Submissions: 2463  Time Limit: 3000/1500 MS (Java/Others)  Memory Limit: 262144/262144 K (Java/Others) 问题描写叙述 Tina Town 是一个善良友好的地方,这里的每个人都互相关心. Tina有一个球,它的名字叫zball.zball非常奇妙,它会每天变大.在第一天的时候,它会变大11倍. 在第二天的时候,它会变大22倍.在第…
Zball in Tina Town  Accepts: 356  Submissions: 2463  Time Limit: 3000/1500 MS (Java/Others)  Memory Limit: 262144/262144 K (Java/Others) Problem Description Tina Town is a friendly place. People there care about each other. Tina has a ball called zba…
Problem Description Tina Town is a friendly place. People there care about each other. Tina has a ball called zball. Zball is magic. It grows larger every day. On the first day, it becomes 1 time as large as its original size. On the second day,it wi…