日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

ZOJ18th省赛 Lucky 7

發(fā)布時間:2025/4/14 编程问答 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ZOJ18th省赛 Lucky 7 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

[線上網(wǎng)址](http://acm.zju.edu.cn/onlinejudge/showContestProblems.do?contestId=378)

BaoBao has just found a positive integer sequence \(a_1, a_2, \dots, a_n\) of length \(n\) from his left pocket and another positive integer \(b\) from his right pocket. As number 7 is BaoBao's favorite number, he considers a positive integer \(x\) lucky if \(x\) is divisible by 7. He now wants to select an integer \(a_k\) from the sequence such that \((a_k+b)\) is lucky. Please tell him if it is possible.

Input
There are multiple test cases. The first line of the input is an integer \(T\) (about 100), indicating the number of test cases. For each test case:

The first line contains two integers \(n\) and \(b\) (\(1 \le n, b \le 100\)), indicating the length of the sequence and the positive integer in BaoBao's right pocket.

The second line contains \(n\) positive integers \(a_1, a_2, \dots, a_n\) (\(1 \le a_i \le 100\)), indicating the sequence.

Output
For each test case output one line. If there exists an integer \(a_k\) such that \(a_k \in \{a_1, a_2, \dots, a_n\}\) and \((a_k + b)\) is lucky, output "Yes" (without quotes), otherwise output "No" (without quotes).

Sample Input
4
3 7
4 5 6
3 7
4 7 6
5 2
2 5 2 5 2
4 26
100 1 2 4
Sample Output
No
Yes
Yes
Yes
Hint
For the first sample test case, as 4 + 7 = 11, 5 + 7 = 12 and 6 + 7 = 13 are all not divisible by 7, the answer is "No".

For the second sample test case, BaoBao can select a 7 from the sequence to get 7 + 7 = 14. As 14 is divisible by 7, the answer is "Yes".

For the third sample test case, BaoBao can select a 5 from the sequence to get 5 + 2 = 7. As 7 is divisible by 7, the answer is "Yes".

For the fourth sample test case, BaoBao can select a 100 from the sequence to get 100 + 26 = 126. As 126 is divisible by 7, the answer is "Yes".

#include<bits/stdc++.h>using namespace std; int a[1005]; int main() {int t;;cin>>t;while(t--){int f=0;int n,k;cin>>n>>k;for(int i=0;i<n;i++){cin>>a[i];if((a[i]+k)%7==0) f=1;}f?puts("Yes"):puts("No");} }

轉(zhuǎn)載于:https://www.cnblogs.com/Roni-i/p/8970899.html

總結(jié)

以上是生活随笔為你收集整理的ZOJ18th省赛 Lucky 7的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 亚洲午夜片 | 高潮av| 亚洲成人日韩在线 | 中国xxxx性xxxx产国 | 日韩精品2 | jizz黄色片 | 色狠狠干| 91黄色影视| 波多野结衣一区二区三区四区 | 亚洲国产综合网 | 爱豆国产剧免费观看大全剧集 | 久久久久久综合网 | 成人天堂 | 黄色小视频网 | 国产免费成人av | 欧美在线视频观看 | 操大爷影院 | 美女光屁屁露胸胸 | 女儿的朋友在线播放 | 少妇av一区| 天天躁日日躁狠狠躁 | 香蕉在线视频播放 | 美女屁股网站 | 亚洲国产视频在线 | 最新理伦片eeuss影院 | 最近更新中文字幕 | 日韩第1页| 成人免费看片网站 | 亚洲一区在线免费 | 日韩美女黄色片 | 久久这里只有精品国产 | 国内露脸中年夫妇交换 | 日韩黄色一级 | 蜜桃成熟时李丽珍国语 | 中国黄色在线视频 | 我要看免费黄色片 | 好吊色视频在线观看 | a久久久久久 | 国产色视频一区二区三区qq号 | 高中男男gay互囗交观看 | 69福利网 | 69精品在线 | 精品一二三区久久aaa片 | 三级黄色av | 国产区av | 中文字幕免费一区二区 | 中文字幕日韩亚洲 | 欧美特级黄色大片 | 就要操就要日 | 亚洲欧美黄色片 | 精品九九 | julia在线播放88mav | 少妇人妻无码专区视频 | 九一在线观看免费高清视频 | 久久精精品久久久久噜噜 | 欧美天天性 | 国产真人无码作爱视频免费 | 欧美老女人xx| 成人在线免费网站 | 成人18视频免费69 | 亚洲麻豆一区二区三区 | 99精品欧美一区二区蜜桃免费 | 国产剧情久久久 | 韩国女主播一区二区 | 亚洲精品美女视频 | 精品久久国产字幕高潮 | 亚洲精品麻豆 | 日日爱网站 | 中文字幕日本人妻久久久免费 | 一级特黄特色的免费大片视频 | 4444亚洲人成无码网在线观看 | 亚洲午夜久久久久久久久久久 | 欧美国产中文字幕 | 丰满肉肉bbwwbbww| 欧美色999| 大香蕉视频一区二区 | 欧美aaa视频| 中文字幕99页| 久久久久久国产精品视频 | 在线播放成人av | mm视频在线观看 | eeuss国产一区二区三区黑人 | 粉嫩av网 | 久久精品成人一区二区三区蜜臀 | 制服丝袜av在线 | 涩涩网站在线 | 精品人妻无码一区二区色欲产成人 | 国产黄a三级三级三级看三级男男 | 欧美交换国产一区内射 | 99热这里 | 日韩免费视频网站 | 91超级碰 | 欧美激情另类 | 色鬼久久 | 波多野结衣在线一区二区 | 九色porny自拍视频在线播放 | 丝袜美腿av | 日韩欧美视频一区二区三区 | 欧美性色19p|