codeforces 903A.Hungry Student Problem
来源:互联网 发布:外星人源码论坛eenot 编辑:程序博客网 时间:2024/06/05 20:32
题意:T次询问,每次问有没有两个非负整数x,y使得3*x + 7*y = n。
思路:因为数据范围很小直接暴力就可以。
#include<bits/stdc++.h>using namespace std;int main(){int T,n; scanf("%d",&T);while(T--) { scanf("%d",&n);bool flag = false; for (int i = 0; i <= 100; i++) { for (int j = 0; j <= 100; j++) { if (i * 3 + j * 7 == n) flag = true;}} if (flag) puts("YES"); else puts("NO"); } return 0;}/*265*/
阅读全文
0 0
- codeforces 903A.Hungry Student Problem
- A. Hungry Student Problem
- Educational Codeforces Round 34 div2 Hungry Student Problem 简单dfs
- Hungry Student Problem_Codeforces
- 903AHungry Student Problem
- Problem - 152A - Codeforces
- codeforces problem/244/A
- codeforces problem/415/A
- codeforces. problem/408/A
- Codeforces Problem 333A
- Codeforces Problem 332A
- Problem A: Person类与Student类的关系
- Problem A: Person类与Student类的关系
- codeforces problem/416/A 二分
- codeforces 17A Noldbach problem
- 【codeforces 29A】Spit Problem
- CodeForces - 29A - Spit Problem
- CodeForces-17A-Noldbach problem
- 语音增强原理之噪声估计
- 阿里云Ubuntu16.04搭建LAMP+私有云nextcloud
- 请求重定向和请求转发的区别
- Spring学习笔记-MVC文件上传与下载
- Dubbo 结合 Spring Boot 的探索(注册发现,管理监控,全链路日志跟踪)
- codeforces 903A.Hungry Student Problem
- BZOJ3724: PA2014Final Krolestwo
- Shoppings
- HDU P2196 Computer
- BZOJ2815: [ZJOI2012]灾难(支配树)
- java通过克隆的方式创建对象
- 复数类
- 修改DLL文件内容
- 布局和简单的适配器