This link is really helpful for beginners to learn various algorithm implementation in different available languages. Here it is...
# | User | Rating |
---|---|---|
1 | ecnerwala | 3649 |
2 | Benq | 3581 |
3 | orzdevinwang | 3570 |
4 | Geothermal | 3569 |
4 | cnnfls_csy | 3569 |
6 | tourist | 3565 |
7 | maroonrk | 3531 |
8 | Radewoosh | 3521 |
9 | Um_nik | 3482 |
10 | jiangly | 3468 |
# | User | Contrib. |
---|---|---|
1 | maomao90 | 174 |
2 | awoo | 164 |
3 | adamant | 161 |
4 | TheScrasse | 159 |
5 | nor | 158 |
6 | maroonrk | 156 |
7 | -is-this-fft- | 152 |
8 | SecondThread | 147 |
9 | orz | 146 |
10 | pajenegod | 145 |
This link is really helpful for beginners to learn various algorithm implementation in different available languages. Here it is...
How to solve problem 158B? I cannot understand greedy algorithm . What is it actually? Someone experienced help me to learn it.
I cannot fix the problem with my code. It runs well on codeblocks and satisfies the given test cases but when I submit it , it does not produce the desired output, in fact no output is produced. Please help, here's my code.
int main() { int n,m,i; scanf("%d%d",&n,&m); for(i=1;i<=(n+m);i++) { if(n>=m) { if(i%2==0 && i<=2*m) printf("G"); else printf("B"); } else { if(i%2==0 && i<=2*n) printf("B"); else printf("G"); } } return(0); }
Name |
---|