Shayan's blog

By Shayan, 2 months ago, In English

Note: The text editorials will be provided by the authors of the round. This video tutorial acts as an additional resource for those who prefer video over text, not as a substitute for the text editorial.

2009A — Minimize!

Video

2009B — osu!mania

Video

2009C — The Legend of Freya the Frog

Video

2009D — Satyam and Counting

Video

2009E — Klee's SUPER DUPER LARGE Array!!!

Video

2009F — Firefly's Queries

Video

2009G — Yunli's Subarray Queries

Video
  • Vote: I like it
  • +2
  • Vote: I do not like it

»
2 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

2009C — The Legend of Freya the Frog Why its not working with if else. ~~~~~ // this is code - int main(){ - int t; - cin >> t; - while(t--){ - int x, y, k; - cin >> x >> y >> k; - if (x > y){ - int a = (x + k — 1) / k; - cout << 2 * a — 1 << "\n"; - } - else{ - int b = (y + k — 1) / k; - cout << 2 * b << "\n"; - } - } - } - ~~~~~

  • »
    »
    2 months ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    test case: 4 3 7 answer is : 2

    But your solution will give answer as 1.