Search found 2 matches

by Omar_
Sat Dec 27, 2014 12:47 am
Forum: Volume 123 (12300-12399)
Topic: 12356 - Army Buddies
Replies: 21
Views: 4871

Re: 12356 - Army Buddies

please help, i don't know why it gets TL ; bool arr[100010]; int main() { int s, b, l, r; bool flag; scanf("%d %d",&s,&b); while(s!=0 && b!=0){ fill(arr,arr+s+1,1); for(int i=1;i<=b;i++){ scanf("%d %d",&l,&r); flag=1; if(l==1) printf("* "); else{ for(int c=l-1;c>=1;c--) if(arr[c]&1){ printf("%d ",c)...
by Omar_
Sat Dec 27, 2014 12:44 am
Forum: Volume 123 (12300-12399)
Topic: 12356 - Army Buddies
Replies: 21
Views: 4871

Re: 12356 - Army Buddies

i don't know why it gets TL !! anybody please help bool arr[100010]; int main() { freopen("in.txt","r",stdin); int s, b, l, r; bool flag; scanf("%d %d",&s,&b); while(s!=0 && b!=0){ fill(arr,arr+s+1,1); for(int i=1;i<=b;i++){ scanf("%d %d",&l,&r); flag=1; if(l==1) printf("* "); else{ for(int c=l-1;c>...

Go to advanced search