HDU1517 A Multiplication Game

解题连接:http://blog.csdn.net/qinmusiyan/article/details/8016033

/* ***********************************************
Author        :devil
Created Time  :2016/03/08 11:41:53
************************************************ */

#include <bits/stdc++.h>
using namespace std;
int main()
{
    //freopen("in.txt","r",stdin);
    long long n;
    while(~scanf("%lld",&n))
    {
        while(n>18) n=ceil(n*1.0/18);
        if(n>9) printf("Ollie wins.\n");
        else printf("Stan wins.\n");
    }
    return 0;
}
时间: 2024-10-25 21:12:30

HDU1517 A Multiplication Game的相关文章

HDU 1517 A Multiplication Game 博弈

A Multiplication Game Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6202    Accepted Submission(s): 3532 Problem Description Stan and Ollie play the game of multiplication by multiplying an in

ACDream 1213 Matrix Multiplication (01矩阵处理)

Matrix Multiplication Time Limit: 2000/1000MS (Java/Others) Memory Limit: 128000/64000KB (Java/Others) Submit Statistic Next Problem Problem Description Let us consider undirected graph G = {V; E} which has N vertices and M edges. Incidence matrix of

POJ1651——Multiplication Puzzle

Multiplication Puzzle Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 6511   Accepted: 3964 Description The multiplication puzzle is played with a row of cards, each containing a single positive integer. During the move player takes one

A Multiplication Game

A Multiplication Game http://acm.hdu.edu.cn/showproblem.php?pid=1517 Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3761    Accepted Submission(s): 2136 Problem Description Stan and Ollie play

UVAoj 348 - Optimal Array Multiplication Sequence

1 /* 2 题意:矩阵相乘的最少的步数 3 dp[i][j]=min(dp[i][j], dp[i][k]+dp[k+1][j]+num[i-1]*num[k]*num[j]); 4 表示的是第i个矩阵到第j个矩阵相乘的最少步数 5 sign[i][j]表示的是第i个矩阵到第j个矩阵相乘的最少步数是由第i个矩阵到第sign[i][j]个矩阵相乘最少步数 6 和第sign[i][j]+1个矩阵到第j个矩阵相乘最少步数的得到的最小值! 7 */ 8 #include<iostream> 9 #i

Matrix multiplication

题目链接 题意: 给两个n*n的矩阵,求乘积后对3取摸的结果(1≤n≤800) 分析: 考虑一下为什么给3呢,对3取摸只可能得到0.1.2,都可以看作两位的,那么在乘法的时候我们可以用分配率将原来的矩阵乘法分成四个矩阵乘法,每个矩阵都只包括0和1.对于0/1矩阵的乘法,可以使用bitset来快速运算 const int MAXN = 801; bitset<MAXN> r1[MAXN], r2[MAXN], c1[MAXN], c2[MAXN]; int a[MAXN][MAXN]; int

HDU 4902 Matrix multiplication

点击打开链接 Matrix multiplication Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 2113    Accepted Submission(s): 956 Problem Description Given two matrices A and B of size n×n, find the product o

POJ 3318 Matrix Multiplication(随机化算法)

给你三个矩阵A,B,C.让你判断A*B是否等于C. 随机一组数据,然后判断乘以A,B之后是否与乘C之后相等. 很扯淡的啊,感觉这种算法不严谨啊... Matrix Multiplication Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 16255   Accepted: 3515 Description You are given three n × n matrices A, B and C. Does the e

uva442-Matrix Chain Multiplication

 Matrix Chain Multiplication  Suppose you have to evaluate an expression like A*B*C*D*E where A,B,C,D and E are matrices. Since matrix multiplication is associative, the order in which multiplications are performed is arbitrary. However, the number o