UVa 10050 - Hartals
来源:互联网 发布:医疗与大数据 编辑:程序博客网 时间:2024/05/29 09:12
题意给出了一共的天数。和party。用数组模拟就可以。记录days[i]的倍数。最后做mod 排除 周五 周六
// File Name: UVa10050.cpp// Author: Toy// Created Time: 2013年03月26日 星期二 20时52分02秒#include <iostream>#include <cstdio>#include <cstring>#include <vector>#include <cctype>#include <cmath>#include <string>#include <algorithm>#include <cstdlib>#include <iomanip>#include <list>#include <map>#include <set>#include <deque>#include <stack>#include <bitset>#define L(x) x << 1#define R(x) x << 1 | 1using namespace std;int days[3700], Case, day, party, tmp, x, cmp;int main ( ) { scanf ( "%d", &Case ); while ( Case-- ) {memset ( days, 0, sizeof ( days ) );scanf ( "%d%d", &day, &party );for ( int i = 0; i < party; ++i ) { tmp = 1; scanf ( "%d", &x ); cmp = x; while ( cmp <= day ) {days[cmp]++;tmp++;cmp = x * tmp; }}int ans = 0;for ( int i = 0; i <= day; ++i ) if ( days[i] && ( i - 1 ) % 7 != 5 && ( i - 1 ) % 7 != 6 ) ans++; printf ( "%d\n", ans ); } return 0;}
- uva 10050 - Hartals
- UVa 10050 - Hartals
- uva 10050 - Hartals//水题
- UVa 10050 - Hartals
- UVA 10050 - Hartals
- uva 10050Hartals
- uva-10050 Hartals
- UVa 10050 - Hartals
- UVA 10050 Hartals
- uva 10050 - Hartals
- uva 10050 Hartals
- uva 10050Hartals
- UVa 10050 Hartals
- UVa 10050 - Hartals
- UVA - 10050 - Hartals
- UVA - 10050 Hartals
- UVa-10050-Hartals
- UVA - 10050 Hartals
- C#中ListView(CheckBox)滚动的技巧
- Android错误:Failed to install *.apk on device *: timeout
- Oracle 10g Shrink Table 详解[表空间收缩]
- USACO Section 1.2 Milking Cows
- 让程序可以脱离opencv,vs等开发环境运
- UVa 10050 - Hartals
- 描述符表
- 如何在Quartus II 11.0中调用ModelSim-Altera 6.6
- java价格处理的一个问题
- 3维动态规划 hdu 4501 小明系列故事——买年货
- 描述符
- GetClipBox()和SeletClipRgn()问题
- 北大poj Q3 P,MTHBGWB
- Session.load()和get()方法区别