题目链接:http://acm.tju.edu.cn/toj/showp3471.html

3471.   Happy XiaoXiao Guo


Time Limit: 1.0 Seconds   Memory Limit: 65536K
Total Runs: 271   Accepted Runs: 189


Xiao guo's brother have a son, his name is Xiaoxiao guo. In the morning, Xiao guo's brother and his wife went out. So Xiao guo must stay with her nephew. She decide to play a game with him. First, there is an empty hole, they take turns to put some stones in the hole. Every time, 1, 2, 4 or 5 stones were placed in the hole. Two players play in turn, until one player makes a number of stones to be N in the hole and wins the game. Xiaoxiao guo always dose first. Suppose that both Xiao guo and Xiaoxiao guo do their best in the game. Give you a number N, you are to write a program to determine Xiaoxiao guo will happy or not.

Input

The input contains several test cases. The first line of each test case contains an integer number N, denoting the number of stones in the hole finally. You may assume the number of stones in the hole will not exceed 10000. The last test case is followed by one zero.

Output

For each test case, if Xiaoxiao guo win the game,output "Happy", otherwise output "Unhappy".

Sample Input

3
4
7
120
0

Sample Output

Unhappy
Happy
Happy
Unhappy

水题,找规律就行,Unhappy都是3的倍数。

#include <stdio.h>
int main(){int n;while(~scanf("%d",&n) && n)(n % 3) ? printf("Happy\n") : printf("Unhappy\n");return 0;
}

TOJ 3471.Happy XiaoXiao Guo相关推荐

  1. 清华 NLP 团队推荐:必读的77篇机器阅读理解论文

    https://mp.weixin.qq.com/s/2VhgEieBwXymAv2qxO3MPw [导读]机器阅读理解(Machine Reading Comprehension)是指让机器阅读文本 ...

  2. KBQA相关论文分类整理:简单KBQA和复杂KBQA

    ©作者 | 蒋锦昊 学校 | 中国人民大学博士生 研究方向 | 知识推理和问答系统 引言 基于知识图谱的问答系统(Knowledge Based Question Answering, KBQA)目标 ...

  3. 复杂知识库问答最新综述:方法、挑战与解决方案

    ©PaperWeekly 原创 · 作者 | 刘兴贤 学校 | 北京邮电大学硕士生 研究方向 | 自然语言处理 本文是一篇有关复杂知识库问答(Complex KBQA)的综述,主要围绕 Complex ...

  4. “知识图谱+”系列:知识图谱+图神经网络

    最近有很多朋友联系泽宇说想了解一些知识图谱和图神经网络(GNN)结合的研究.那泽宇当然要满足朋友们的要求啊,本期泽宇从知识图谱的几个不同研究方向总结了结合GNN的经典研究,也和大家一起分享.所有内容是 ...

  5. 【AI 顶会】NIPS2019接收论文完整列表

    NeurIPS2019 NeurIPS 2019的论文结果已经出炉, 包括了36篇oral和164篇spotlights共1428篇论文.可以看到论文的主题还是以深度学习.神经网络.图.优化.通用性. ...

  6. 【AI视野·今日CV 计算机视觉论文速览 第152期】Fri, 9 Aug 2019

    AI视野·今日CS.CV 计算机视觉论文速览 Fri, 9 Aug 2019 Totally 31 papers ?上期速览✈更多精彩请移步主页 Interesting: ?***VOMonodept ...

  7. KBQA相关论文分类整理

    © 作者|蒋锦昊 机构|中国人民大学高瓴人工智能学院直博生 导师|赵鑫教授 研究方向 | 知识推理和问答系统 1.引言 基于知识图谱的问答系统(Knowledge Based Question Ans ...

  8. 【今日CV 计算机视觉论文速览 第122期】Fri, 31 May 2019

    今日CS.CV 计算机视觉论文速览 Fri, 31 May 2019 Totally 50 papers ?上期速览✈更多精彩请移步主页 Interesting: ?基于条件GANs的图像去水印方法, ...

  9. GitHub 3.6k Satr自监督学习(Self-Supervised Learning)资源你值得拥有!

    自我监督学习已成为AI社区中令人兴奋的方向. Jitendra Malik: "Supervision is the opium of the AI researcher" Aly ...

最新文章

  1. IE 8 中自定义自己的 Search Provider (搜索提供程序)
  2. 查看linux安装redis的位置,linux查看是否安装redis
  3. python在mac上运行不用装模块_MAC OSX使用Python安装mysql模块问题
  4. QT + OpenCV + MinGW 在windows下配置开发环境
  5. javascript下的数值型比较真的没有那么简单
  6. 线性回归的梯度下降和正规方程组求解
  7. 淘宝爬取某人的所有购物订单
  8. 从0到100亿互联网金融架构发展史
  9. 关于readonly修饰符
  10. DEDE友情链接修改
  11. 实验:Mysql实现企业级数据库主从复制架构实战
  12. 剑指 Offer 24. 反转链表java
  13. 毕业实习大作业(Android-Spring Boot-MySQL 前后端分离项目 快速上手实例)
  14. C和C++中的register变量和volatile变量理解
  15. Memcached replace 命令
  16. 面经|缺失值填补的7种方法(使用场景+Python代码)
  17. GNSS系列(2)------OneMO模组LBS定位使用方法全攻略
  18. 编译x86 release版本libcurl,支持https
  19. yapi中mock jsonp接口响应的方法
  20. 企业应如何制定多云世界的反脆弱身份?

热门文章

  1. 宋晓丽20190919-2 功能测试
  2. 李开复自传里的一些话
  3. 一份数据科学“必备”的数学基础清单
  4. 手游爆发“平台战”启幕
  5. three.js 模型详解和外部模型详解
  6. 韩信点兵问题的简单算法(downmoon)
  7. TC358743XBG/TC358749XBG(\w Scaler):HDMI转MIPI CSI东芝转换芯片
  8. 毕业设计-基于 MATLAB 的工业机器人运动学分析与实现
  9. 肖特基二极管型号大全之ASEMI肖特基常见型号
  10. android+360+手表,360智能手表