#include <stdio.h>
int parties[101];
int main() {
int I, J, T, N, P, COUNT;
scanf("%d",&T);
while (T--) {
scanf("%d",&N);
scanf("%d",&P);
for (I=0 ; I<P ; I++) {
scanf("%d",&parties[I]);
}
for (I=1, COUNT=0 ; I<=N ; I++) {
if ((I%7)!=6 && (I%7)!=0) {
for (J=0 ; J<P ; J++) {
if (!(I%parties[J])) {
COUNT++;
break;
}
}
}
}
printf("%d\n",COUNT);
}
return 0;
}
Wednesday, September 08, 2010
[UVa] 10050 - Hartals
It's just a simulation. Mods and Mods that's all.
Subscribe to:
Post Comments (Atom)
Connect Rapoo MT750S with Linux (Tested on Manjaro)
I bought this obvious copy of MX Master 2S in hopes of having the device switching functionality along with a lightweight body because I ha...
-
I like coding a lot, keeps me glued to the PC for hours. For that reason it's a need to edit the Syntax Highlighter to suit my eyes for...
-
I bought this obvious copy of MX Master 2S in hopes of having the device switching functionality along with a lightweight body because I ha...
-
Install MinGW GCC Port on Windows. 1. Just go to this address [ http://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/ ]...
this give wrong answer. why?
ReplyDeleteWhich one? My code? I tested it again. It got Accepted. If you're getting Wrong Answer with your code, please kindly pass it to me so that I can debug it. You can use ideone or codepad.org to paste the codes.
ReplyDeletehttp://ideone.com/0hAOjU
ReplyDeletecheck this one please.
why do u use T-- on the while and not scanf("%d",&T) and a T--; down?
ReplyDelete