2018 BACS Regional Programming Contest C. BACS, Scoundrel Shopkeeper and Contiguous Sequence (模擬)
Description
Solution
模擬
Code
const int maxn = 1e2 + 7;
int a[maxn];
int main() {
int T;scanf("%d",&T);
for(int cas = 1;cas <= T;++cas) {
int n,m;scanf("%d %d",&m,&n);
ll sum = 0;
for(int i = 1;i <= n;++i) {
scanf("%d",&a[i]); sum += a[i];
}
bool flag1 = false, flag2 = false;
if(sum == m) flag1 = true;
for(int i = 1;i < n;++i) {
if(a[i+1] - a[i] == 1) {flag2 = true; break;}
}
printf("Case %d: Thank You BACS!!!", cas);
if(flag1) printf(" Thik ache."); else printf(" Bojjat dokandar!!");
if(flag2) printf(" Yes\n"); else printf(" No\n");
}
}
相關文章
- The 2022 ICPC Asia Hangzhou Regional Programming Contest
- North American Invitational Programming Contest 2018
- 2019-2020 ICPC Southeastern European Regional Programming Contest (SEERC 2019) 補題記錄AST
- 2018 China Collegiate Programming Contest Final (CCPC-Final 2018)
- 2018-2019 ACM-ICPC, Asia Seoul Regional Contest——A - CircuitsACMUI
- The 2024 ICPC Asia Nanjing Regional ContestNaN
- The 2021 ICPC Asia Shenyang Regional Contest
- The 2023 ICPC Asia Macau Regional ContestMac
- The 2022 ICPC Asia Nanjing Regional ContestNaN
- The 2022 ICPC Asia Xian Regional Contest
- AISing Programming Contest 2021(AtCoder Beginner Contest 202)AI
- Mynavi Programming Contest 2021(AtCoder Beginner Contest 201)
- 2024 BUPT Programming Contest F
- 2024 Jiangsu Collegiate Programming Contest
- The 2024 CCPC Shandong Invitational Contest and Provincial Collegiate Programming Contest
- 2018-2019 ACM-ICPC, China Multi-Provincial Collegiate Programming ContestACM
- The 2022 ICPC Asia Xian Regional Contest 前六題
- Toyota Programming Contest 2024#11(AtCoder Beginner Contest 379)
- KEYENCE Programming Contest 2024(AtCoder Beginner Contest 374)題解
- Toyota Programming Contest 2024#7(AtCoder Beginner Contest 362)
- Toyota Programming Contest 2024#3(AtCoder Beginner Contest 344)
- UNIQUE VISION Programming Contest 2024 Spring(AtCoder Beginner Contest 346)Spring
- 聯賽模擬測試20 C. Weed
- CF1455 D. Sequence and Swaps(模擬)
- 2022 International Collegiate Programming Contest, Jinan SiteNaN
- 2020 China Collegiate Programming Contest Qinhuangdao Site
- Toyota Programming Contest 2024#11(AtCoder Beginner Contest 379)題解
- Hitachi Vantara Programming Contest 2024(AtCoder Beginner Contest 368)題解A~D
- Hitachi Vantara Programming Contest 2024(AtCoder Beginner Contest 368)F - Dividing GameGAM
- The 2022 ICPC Polish Collegiate Programming Contest (AMPPZ 2022)
- 2022 China Collegiate Programming Contest (CCPC) Guilin SiteGUI
- The 11th Zhejiang Provincial Collegiate Programming Contest
- 2020-2021 “Orz Panda” Cup Programming Contest
- The 2022 ICPC Asia Nanjing Regional Contest IGDA,和令人疑惑的MNaN
- Chayas - 2023-2024 ICPC, Asia Yokohama Regional Contest 2023, Problem E
- Toyota Programming Contest 2024#11(AtCoder Beginner Contest 379)題解總結
- 2024.10.3 2022-2023 ICPC Brazil Subregional Programming Contest
- PAT甲級-1140. Look-and-say Sequence (20)(模擬)