第二十八届“和巨耀通杯”NOJ邀请赛
三人团队赛， 正好最近在刷PTA， 于是一个人报名尝试了一下。
一共AC了三题， Rank28
C. Battle game
签到题
Description:
You are playing a game which you will battle with an enemy. As you don’t want to lose, your total power can’t be lower than your enemy’s. Your power is simply added by the power of your soldiers, and all of your soldiers’ power is exactly aa. Now you have known that your enemy’s total power is bb. You want to know how many soldiers you need in order not to lose the battle.
Input:
A line with two integers a,ba,b, (1≤a,b≤109)(1≤a,b≤109).
Output:
A line with one integer, denotes the minimum number of soldiers you need.
Sample Input:
1  123 456 
Sample Output:
1  4 
AC代码
1 

D. Gomoku
Description:
Alice and Bob are playing a game called Gomoku (a.k.a. Five in a Row). Alice is sente(black, moves first) and Bob is gote(white, moves second). Alice wants to know whether she can win(have five or more consecutive stones of the same color in a diagonal, vertical, or horizontal row) in one step, and now is Alice’s turn. It is guranteed that neither Alice or Bob wins currently. Prohibitions are not considered in this problem.
Input:
The first line contains one integer nn, which denotes the size of the board is n×nn×n.
Next nn lines each has a string of length nn, use @
to represent black, O
to represent white, +
to represent there’s no stone at that position.
Output:
If Alice can win in one step, output YES
, otherwise output NO
.
Sample Input:
1  7 
Sample Output:
1  YES 
AC代码
1 

G. Number
规律题
Description:
0xfaner just learned the factorial today, and the factorial is defined as follows:$x!=1×2×⋯×xx!=1×2×⋯×x$
He found that $10!=362880010!=3628800 $， $20!=2432902008176640000$ , the number of trailing zeros is increasing.
Now 0xfaner wants to know the the number of trailing zeros of n!n!to each given nn .
Input:
The only line contains one integer nn ( 1≤n≤1091≤n≤109 ).
Output:
Print the number of trailing zeros of n!n! .
Sample Input:
1  25 
Sample Output:
1  6 
AC
规律题
1  import java.math.BigInteger; 
执行后一直TLE，于是猜测是否有规律
AC代码
1 

Author: Mrli
Link: https://nymrli.top/2019/11/17/第二十八届“和巨耀通杯”NOJ邀请赛/
Copyright: All articles in this blog are licensed under CC BYNCSA 3.0 unless stating additionally.