题意:给定 n 个数,问是不是全是3的倍数。

析:略。

代码如下:

#pragma comment(linker, "/STACK:1024000000,1024000000")
#include <cstdio>
#include <string>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <cstring>
#include <set>
#include <queue>
#include <algorithm>
#include <vector>
#include <map>
#include <cctype>
#include <cmath>
#include <stack>
//#include <unordered_map>
//#include <tr1/unordered_map>
#define freopenr freopen("in.txt", "r", stdin)
#define freopenw freopen("out.txt", "w", stdout)
using namespace std;
//using namespace std :: tr1; typedef long long LL;
typedef pair<int, int> P;
const int INF = 0x3f3f3f3f;
const double inf = 0x3f3f3f3f3f3f;
const LL LNF = 0x3f3f3f3f3f3f;
const double PI = acos(-1.0);
const double eps = 1e-8;
const int maxn = 10005;
const LL mod = 10000000000007;
const int N = 1e6 + 5;
const int dr[] = {-1, 0, 1, 0, 1, 1, -1, -1};
const int dc[] = {0, 1, 0, -1, 1, -1, 1, -1};
const char *Hex[] = {"0000", "0001", "0010", "0011", "0100", "0101", "0110", "0111", "1000", "1001", "1010", "1011", "1100", "1101", "1110", "1111"};
inline LL gcd(LL a, LL b){ return b == 0 ? a : gcd(b, a%b); }
int n, m;
const int mon[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const int monn[] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
inline int Min(int a, int b){ return a < b ? a : b; }
inline int Max(int a, int b){ return a > b ? a : b; }
inline LL Min(LL a, LL b){ return a < b ? a : b; }
inline LL Max(LL a, LL b){ return a > b ? a : b; }
inline bool is_in(int r, int c){
return r >= 0 && r < n && c >= 0 && c < m;
}
int main(){
int T; cin >> T;
for(int kase = 1; kase <= T; ++kase){
scanf("%d", &n);
bool ok = true;
for(int i = 0; i < n; ++i){
scanf("%d", &m);
if(m % 3 != 0) ok = false;
}
printf("Case #%d: %s\n", kase, ok ? "Yes" : "No");
}
return 0;
}

Gym 100548A Built with Qinghuai and Ari Factor (水题)的更多相关文章

  1. Codeforces Gym 100531G Grave 水题

    Problem G. Grave 题目连接: http://codeforces.com/gym/100531/attachments Description Gerard develops a Ha ...

  2. codeforces Gym 100187L L. Ministry of Truth 水题

    L. Ministry of Truth Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100187/p ...

  3. Codeforces Gym 100286G Giant Screen 水题

    Problem G.Giant ScreenTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/con ...

  4. (寒假开黑gym)2018 ACM-ICPC, Syrian Collegiate Programming Contest(爽题)

    layout: post title: (寒假开黑gym)2018 ACM-ICPC, Syrian Collegiate Programming Contest(爽题) author: " ...

  5. 水题 Gym 100553K Knockout Racing

    题目传送门 /* 题意:有若干个点在一个区间内来回移动,1m/s. 水题:n^2的复杂度能解决,注意时间可能大于一个周期,要取模 */ #include <cstdio> #include ...

  6. ACM: Gym 101047B Renzo and the palindromic decoration - 手速题

     Gym 101047B  Renzo and the palindromic decoration Time Limit:2000MS     Memory Limit:65536KB     64 ...

  7. BC水题--The Factor(质因分解)

    网址:http://acm.hdu.edu.cn/showproblem.php?pid=5428 roblem Description There is a sequence of n positi ...

  8. codeforces Gym 100187H H. Mysterious Photos 水题

    H. Mysterious Photos Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100187/p ...

  9. Codeforces gym 100685 C. Cinderella 水题

    C. CinderellaTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100685/problem/C ...

随机推荐

  1. P1093||T1142 奖学金 洛谷||codevs

    http://codevs.cn/problem/1142/ || https://www.luogu.org/problem/show?pid=1093 题目描述 某小学最近得到了一笔赞助,打算拿出 ...

  2. Distinct Subsequences (dp)

    Given a string S and a string T, count the number of distinct subsequences of T in S. A subsequence ...

  3. [Bzoj1034][ZJOJ2008]泡泡堂BNB(贪心)

    1034: [ZJOI2008]泡泡堂BNB Time Limit: 10 Sec  Memory Limit: 162 MBSubmit: 3482  Solved: 1776[Submit][St ...

  4. Java实现简单的图片浏览器

    第一次写博客,不喜勿喷. 最近一个小师弟问我怎么用Java做图片浏览器,感觉好久没玩Java了,就自己动手做了一下. 学校的教程是用Swing来做界面的,所以这里也用这个来讲. 首先要做个大概的界面出 ...

  5. 使用Spring Data Redis操作Redis(单机版)

    说明:请注意Spring Data Redis的版本以及Spring的版本!最新版本的Spring Data Redis已经去除Jedis的依赖包,需要自行引入,这个是个坑点.并且会与一些低版本的Sp ...

  6. CSS3 水波纹

    css3 动画设置水波纹,效果如下图: 源码: <!DOCTYPE html> <html lang="en"> <head> <meta ...

  7. struts2 input file多文件同时通过ajax提交

    <input type="file" name="files" multiple="multiple">必须是multiple才 ...

  8. JVM监控工具:jps、jstat、jinfo、jmap、jhat、jstack使用介绍

    转载:http://outofmemory.cn/java/jvm/jvm-tools-jps-jstat-jinfo-jmap-jhat-jstack 一.jps(JVM Process Statu ...

  9. 安装软件:/lib/ld-linux.so.2: bad ELF interpreter解决

    http://linux.chinaitlab.com/set/928509.html 我们在CentOS系统中安装软件:/lib/ld-linux.so.2: bad ELF interpreter ...

  10. Java知识图谱

    1.Java学习路径1 我想很多人看到这个路径可能会问我在哪里可以学习,所以就先附上这条路径的学习地址吧,这也是这张图片的来源,愿意学习的可以去看看:Java研发工程师学习路径 2.Java学习路径2 ...