Mrli

Contacts:
QQ博客园

# 第二十八届“和巨耀通杯”南京邮电大学在线测评系统程序设计邀请赛--

2019/11/17
Word count: 1,109 | Reading time: 7min

# 第二十八届“和巨耀通杯”NOJ邀请赛

## 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:

Sample Output:

## 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:

Sample Output:

## 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:

Sample Output:

AC

Author: Mrli