Problem ID
string
Problem
string
in
string
Solution
string
cpp
string
out
string
Images
sequence
B
*Nim Sum Dim Sum*, a bustling local dumpling restaurant, has two game theory-loving servers named, you guessed it, Alice and Bob. Its dining area can be represented as a two-dimensional grid of \(R\) rows (numbered \(1..R\) from top to bottom) by \(C\) columns (numbered \(1..C\) from left to right\). Currently, both of them are standing at coordinates \((1, 1)\) where there is a big cart of dim sum. Their job is to work together to push the cart to a customer at coordinates \((R, C)\). To make the job more interesting, they've turned it into a game. Alice and Bob will take turns pushing the cart. On Alice's turn, the cart must be moved between \(1\) and \(A\) units down. On Bob's turn, the cart must be moved between \(1\) and \(B\) units to the right. The cart may not be moved out of the grid. If the cart is already at row \(R\) on Alice's turn or column \(C\) on Bob's turn, then that person loses their turn. The "winner" is the person to ultimately move the cart to \((R, C)\) and thus get all the recognition from the customer. Alice pushes first. Does she have a guaranteed winning strategy? # Constraints \(1 \leq T \leq 500\) \(2 \leq R, C \leq 10^9\) \(1 \leq A < R\) \(1 \leq B < C\) # Input Format Input begins with an integer \(T\), the number of test cases. Each case will contain one line with four space-separated integers, \(R\), \(C\), \(A\), and \(B\). # Output Format For the \(i\)th test case, print `"Case #i: "` followed by `"YES"` if Alice has a guaranteed winning strategy, or `"NO"` otherwise. # Sample Explanation The first case is depicted below, with Alice's moves in red and Bob's in blue. Alice moves down, and Bob moves right to win immediately. There is no other valid sequence of moves, so Alice has no guaranteed winning strategy. {{PHOTO_ID:842253013944047|WIDTH:500}} The second case is depicted below. One possible guaranteed winning strategy is if Alice moves \(3\) units down, then Bob can only move \(1\) unit, and finally Alice can win with \(1\) unit. {{PHOTO_ID:852013469652032|WIDTH:500}}
600 2 2 1 1 2 3 1 1 2 3 1 2 2 4 1 1 2 4 1 2 2 4 1 3 2 100 1 1 2 100 1 2 2 100 1 3 2 100 1 99 2 999999999 1 1 2 999999999 1 2 2 999999999 1 3 2 999999999 1 999999998 2 1000000000 1 1 2 1000000000 1 2 2 1000000000 1 3 2 1000000000 1 999999999 3 2 1 1 3 2 2 1 3 3 1 1 3 3 1 2 3 3 2 1 3 3 2 2 3 4 1 1 3 4 1 2 3 4 1 3 3 4 2 1 3 4 2 2 3 4 2 3 3 100 1 1 3 100 1 2 3 100 1 3 3 100 1 99 3 100 2 1 3 100 2 2 3 100 2 3 3 100 2 99 3 999999999 1 1 3 999999999 1 2 3 999999999 1 3 3 999999999 1 999999998 3 999999999 2 1 3 999999999 2 2 3 999999999 2 3 3 999999999 2 999999998 3 1000000000 1 1 3 1000000000 1 2 3 1000000000 1 3 3 1000000000 1 999999999 3 1000000000 2 1 3 1000000000 2 2 3 1000000000 2 3 3 1000000000 2 999999999 4 2 1 1 4 2 2 1 4 2 3 1 4 3 1 1 4 3 1 2 4 3 2 1 4 3 2 2 4 3 3 1 4 3 3 2 4 4 1 1 4 4 1 2 4 4 1 3 4 4 2 1 4 4 2 2 4 4 2 3 4 4 3 1 4 4 3 2 4 4 3 3 4 100 1 1 4 100 1 2 4 100 1 3 4 100 1 99 4 100 2 1 4 100 2 2 4 100 2 3 4 100 2 99 4 100 3 1 4 100 3 2 4 100 3 3 4 100 3 99 4 999999999 1 1 4 999999999 1 2 4 999999999 1 3 4 999999999 1 999999998 4 999999999 2 1 4 999999999 2 2 4 999999999 2 3 4 999999999 2 999999998 4 999999999 3 1 4 999999999 3 2 4 999999999 3 3 4 999999999 3 999999998 4 1000000000 1 1 4 1000000000 1 2 4 1000000000 1 3 4 1000000000 1 999999999 4 1000000000 2 1 4 1000000000 2 2 4 1000000000 2 3 4 1000000000 2 999999999 4 1000000000 3 1 4 1000000000 3 2 4 1000000000 3 3 4 1000000000 3 999999999 100 2 1 1 100 2 2 1 100 2 3 1 100 2 99 1 100 3 1 1 100 3 1 2 100 3 2 1 100 3 2 2 100 3 3 1 100 3 3 2 100 3 99 1 100 3 99 2 100 4 1 1 100 4 1 2 100 4 1 3 100 4 2 1 100 4 2 2 100 4 2 3 100 4 3 1 100 4 3 2 100 4 3 3 100 4 99 1 100 4 99 2 100 4 99 3 100 100 1 1 100 100 1 2 100 100 1 3 100 100 1 99 100 100 2 1 100 100 2 2 100 100 2 3 100 100 2 99 100 100 3 1 100 100 3 2 100 100 3 3 100 100 3 99 100 100 99 1 100 100 99 2 100 100 99 3 100 100 99 99 100 999999999 1 1 100 999999999 1 2 100 999999999 1 3 100 999999999 1 999999998 100 999999999 2 1 100 999999999 2 2 100 999999999 2 3 100 999999999 2 999999998 100 999999999 3 1 100 999999999 3 2 100 999999999 3 3 100 999999999 3 999999998 100 999999999 99 1 100 999999999 99 2 100 999999999 99 3 100 999999999 99 999999998 100 1000000000 1 1 100 1000000000 1 2 100 1000000000 1 3 100 1000000000 1 999999999 100 1000000000 2 1 100 1000000000 2 2 100 1000000000 2 3 100 1000000000 2 999999999 100 1000000000 3 1 100 1000000000 3 2 100 1000000000 3 3 100 1000000000 3 999999999 100 1000000000 99 1 100 1000000000 99 2 100 1000000000 99 3 100 1000000000 99 999999999 999999999 2 1 1 999999999 2 2 1 999999999 2 3 1 999999999 2 999999998 1 999999999 3 1 1 999999999 3 1 2 999999999 3 2 1 999999999 3 2 2 999999999 3 3 1 999999999 3 3 2 999999999 3 999999998 1 999999999 3 999999998 2 999999999 4 1 1 999999999 4 1 2 999999999 4 1 3 999999999 4 2 1 999999999 4 2 2 999999999 4 2 3 999999999 4 3 1 999999999 4 3 2 999999999 4 3 3 999999999 4 999999998 1 999999999 4 999999998 2 999999999 4 999999998 3 999999999 100 1 1 999999999 100 1 2 999999999 100 1 3 999999999 100 1 99 999999999 100 2 1 999999999 100 2 2 999999999 100 2 3 999999999 100 2 99 999999999 100 3 1 999999999 100 3 2 999999999 100 3 3 999999999 100 3 99 999999999 100 999999998 1 999999999 100 999999998 2 999999999 100 999999998 3 999999999 100 999999998 99 999999999 999999999 1 1 999999999 999999999 1 2 999999999 999999999 1 3 999999999 999999999 1 999999998 999999999 999999999 2 1 999999999 999999999 2 2 999999999 999999999 2 3 999999999 999999999 2 999999998 999999999 999999999 3 1 999999999 999999999 3 2 999999999 999999999 3 3 999999999 999999999 3 999999998 999999999 999999999 999999998 1 999999999 999999999 999999998 2 999999999 999999999 999999998 3 999999999 999999999 999999998 999999998 999999999 1000000000 1 1 999999999 1000000000 1 2 999999999 1000000000 1 3 999999999 1000000000 1 999999999 999999999 1000000000 2 1 999999999 1000000000 2 2 999999999 1000000000 2 3 999999999 1000000000 2 999999999 999999999 1000000000 3 1 999999999 1000000000 3 2 999999999 1000000000 3 3 999999999 1000000000 3 999999999 999999999 1000000000 999999998 1 999999999 1000000000 999999998 2 999999999 1000000000 999999998 3 999999999 1000000000 999999998 999999999 1000000000 2 1 1 1000000000 2 2 1 1000000000 2 3 1 1000000000 2 999999999 1 1000000000 3 1 1 1000000000 3 1 2 1000000000 3 2 1 1000000000 3 2 2 1000000000 3 3 1 1000000000 3 3 2 1000000000 3 999999999 1 1000000000 3 999999999 2 1000000000 4 1 1 1000000000 4 1 2 1000000000 4 1 3 1000000000 4 2 1 1000000000 4 2 2 1000000000 4 2 3 1000000000 4 3 1 1000000000 4 3 2 1000000000 4 3 3 1000000000 4 999999999 1 1000000000 4 999999999 2 1000000000 4 999999999 3 1000000000 100 1 1 1000000000 100 1 2 1000000000 100 1 3 1000000000 100 1 99 1000000000 100 2 1 1000000000 100 2 2 1000000000 100 2 3 1000000000 100 2 99 1000000000 100 3 1 1000000000 100 3 2 1000000000 100 3 3 1000000000 100 3 99 1000000000 100 999999999 1 1000000000 100 999999999 2 1000000000 100 999999999 3 1000000000 100 999999999 99 1000000000 999999999 1 1 1000000000 999999999 1 2 1000000000 999999999 1 3 1000000000 999999999 1 999999998 1000000000 999999999 2 1 1000000000 999999999 2 2 1000000000 999999999 2 3 1000000000 999999999 2 999999998 1000000000 999999999 3 1 1000000000 999999999 3 2 1000000000 999999999 3 3 1000000000 999999999 3 999999998 1000000000 999999999 999999999 1 1000000000 999999999 999999999 2 1000000000 999999999 999999999 3 1000000000 999999999 999999999 999999998 1000000000 1000000000 1 1 1000000000 1000000000 1 2 1000000000 1000000000 1 3 1000000000 1000000000 1 999999999 1000000000 1000000000 2 1 1000000000 1000000000 2 2 1000000000 1000000000 2 3 1000000000 1000000000 2 999999999 1000000000 1000000000 3 1 1000000000 1000000000 3 2 1000000000 1000000000 3 3 1000000000 1000000000 3 999999999 1000000000 1000000000 999999999 1 1000000000 1000000000 999999999 2 1000000000 1000000000 999999999 3 1000000000 1000000000 999999999 999999999 704993648 595827515 1 3 2 590064564 1 410727603 992439437 2 2 1 4 1000000000 1 809590669 569981406 4 2 2 1000000000 748176992 2 3 474573491 100 2 2 351511977 1000000000 3 1 1000000000 2 592728920 1 1000000000 889034323 2 585497466 100 999999999 5 3 377173489 999999999 3 1 100 3 98 2 400638252 4 3 2 100 100 3 48 3 387806766 2 3 699118378 100 371255050 53 804684832 197217720 1 153175513 4 625855660 3 1 999999999 3 132294377 2 207868204 1000000000 2 225202610 100 999999999 3 607160337 586838884 999999999 2 2 100 999999999 72 3 588175668 2 2 1 427727826 1000000000 3 1 100 2 9 1 779009402 100 3 3 1000000000 1000000000 301408972 2 1000000000 100 2 27 201238540 100 49757290 14 998645846 2 2 1 4 292678792 1 2 452792670 1000000000 2 115192647 515006471 3 3 2 163592637 549432548 2 110629430 803061495 4 3 3 713458743 999999999 1 232415301 100 397986566 65 2 100 999999999 1 913663288 475576299 79599546 62711377 1 404696558 1000000000 344580310 355699065 1000000000 100 99694839 3 3 637320062 1 460765579 3 999999999 2 217585714 3 999999999 2 478452455 999999999 1000000000 2 724564983 66434218 3 2 2 1000000000 1000000000 1 4469475 1000000000 999999999 90055928 1 999999999 1000000000 488516079 1 1000000000 723284552 647366837 1 543383962 764857696 2 41522173 4 308024713 3 2 999999999 153855548 3 2 630783940 100 3 2 999999999 4 627313199 3 135818523 100 127108945 1 606735969 100 574575067 9 19089712 3 3 1 365482087 971250614 97597 28576180 999999999 999999999 3 361042743 1000000000 84082569 375561153 2 914040527 100 1 2 999999999 489345280 108542079 3 160776118 100 1 1 671771882 1000000000 458242975 1 999999999 100 2 11 3 190048202 1 3 999999999 1000000000 3 233117279 1000000000 999999999 2 47219043 499812538 999999999 1 1 900930753 3 3 1 100 4 84 3 4 100 2 71 977912389 734778827 532290378 1 1000000000 3 198570665 2 1000000000 100 75322340 3 205684158 100 1 3 2 270189690 1 1 4 100 2 91 946260157 2 1 1 999999999 234259462 1 104118482 100 999999999 43 2 2 736436882 1 1 755742919 1000000000 2 2 4 410312616 3 176330867 759115178 100 3 1 632902334 4 3 3 1000000000 4 606716047 3 4 1000000000 2 374349453 259765240 2 1 1 1000000000 999999999 313743023 2 3 982500203 1 839934728 621335426 20082604 2 3 4 40276081 1 3 874810763 1000000000 1 903855415 3 999999999 1 701097245 100 1000000000 14 1 100 102245557 1 1 4 100 1 40 4 773392332 2 3 109588419 516866303 95880941 3 4 413460114 3 2 3 402700402 2 1 100 999999999 49 1 904027769 100 278679397 3 3 1000000000 2 174737436 1000000000 1000000000 711006329 2 100 470997877 1 2 999999999 4 90975763 3 880984255 1000000000 1 3 999999999 100 1 92 3 100 1 64 1000000000 760355100 2 1 4 198068727 2 2 1000000000 916764387 127932786 3 271589777 216429783 1 1 999999999 100 3 89 100 916630865 1 2 407111787 999999999 158724311 2 3 811153361 1 12686097 999999999 1000000000 3 780175482 422251405 1000000000 332267304 3 576202195 4 1 2 1000000000 100 450060632 3 688697997 456509775 2 1 4 142306207 2 3 2 100 1 66 100 100 2 80 100 999999999 1 4861357 2 477765917 1 413635441 632200338 3 1 2 999999999 388726895 726514352 2 2 1000000000 1 621800414 999999999 100 361399062 76 588778144 302958057 3 3 587962907 2 570433024 1 3 1000000000 1 197472206 945684593 999999999 725490874 3 377279890 1000000000 2 469488179 598618548 1000000000 1 2 100 351514573 1 3 900200350 242692999 164767257 3 1000000000 1000000000 990110168 2 100 1000000000 3 875437474 4 867643142 2 2 999999999 3 618585901 2 3 49194494 2 1 3 440178503 1 1 4 783105139 2 2 826551905 100 1 49 251333014 100 1 2 70829133 100 3 26 1000000000 634373833 687984129 3 126406469 999999999 3 3 999999999 1000000000 141127510 2 999999999 3 768481208 2 3 348674172 2 208198940 3 560442205 2 3 100 2 22 1 4 100 3 56 999999999 1000000000 38408940 1 1000000000 100 872721048 64 1000000000 352351844 795508322 1 100 616551719 3 3 1000000000 4 998306795 2 3 1000000000 1 638408569 270079655 4 13920983 1 245635459 1000000000 2 2 2 43534587 1 1 372315310 428364244 1 1 1000000000 445823784 2 2 999999999 4 618409559 1 349725997 3 3 2 513324740 2 1 1 809198703 3 2 1 1000000000 4 120887411 1 999999999 4 37069733 2 57695794 1000000000 17394064 1 100 39439397 2 35075686 76553835 3 3 2 2 999999999 1 235322552 1000000000 743670139 3 3 2 999999999 1 354427649 2 611627491 1 2 3 131597407 2 130390896 275678673 999999999 1 1 697757447 999999999 3 614333645 189832940 1000000000 2 3 999999999 396025382 2 2 1000000000 100 3 62 999999999 999999999 1 713021361 142421367 2 48241495 1 3 565428755 1 2 4 999999999 1 344277279 4 314723735 2 2 4 100 2 31 2 243229745 1 59406209 2 501785784 1 334445275 543390985 2 25843304 1 163708539 999999999 3 3 216458893 858261817 2 730048733 999999999 130079639 121158886 3 3 1000000000 1 859457977 999999999 734992451 64730372 1 249097053 100 3 2 2 475952396 1 3 990898699 2 1 1 100 999999999 2 217038469 702326696 999999999 3 1 3 332461468 2 3 3 999999999 2 930212147 999999999 999999999 13776769 2 903145896 4 200741956 3 1000000000 354487415 2 1 4 345870621 1 11170728 1000000000 527180352 2 1 1000000000 935367125 2 688653704 3 525092475 2 3 999999999 4 888595089 3 1000000000 100 3 32 1000000000 1000000000 3 165697225 843094006 3 3 1 4 21218471 2 2 999999999 1000000000 3 218565021 38475058 4 38289611 2 999999999 999999999 3 97982365 100 100 70 2 820459816 1000000000 228363612 2 241065083 1000000000 1 1 1000000000 999999999 2 756841576 1000000000 1000000000 244626410 3 4 911940777 2 39960172 100 492122489 3 2 3 750409238 1 2 999999999 919338507 247646166 1 3 999999999 1 419422452 1000000000 1000000000 432922762 516684653 159636198 2 132750702 1 999999999 306100163 2 1 406955220 100 2 1 564769898 999999999 3 3 100 1000000000 3 881233701 568263512 100 2 43 2 251894516 1 3 1000000000 293794518 859896680 2 3 929445484 2 1 999999999 3 976671636 2 269564282 100 1 3 204388631 3 2 2 312920545 1000000000 309279031 2 1000000000 1000000000 245797795 1 997867345 170075009 374134420 2 402854259 831040336 3 3 100 461180180 3 3 999999999 1000000000 534911742 345724526 3 999999999 1 79992930 1000000000 100 968047634 19 1000000000 100 2 16 268284003 3 3 1 100 999999999 57 187975571 4 999999999 2 471976874 999999999 878891013 1 3 4 249842301 1 1 4 1000000000 2 812085677 6565870 999999999 5153895 286487589 100 305987626 2 48247012 999999999 553819129 274277625 13275303 690839093 999999999 2 3 100 380837481 37 96807255 804494411 2 1 1 770491971 1000000000 3 1 501599341 999999999 2 3 100 999999999 83 1 999999999 999999999 470395372 2
If Alice reaches row \(R\) before Bob reaches row \(C\), then it's game over for Alice. Since each player now wants to get to the finish as slowly as possible, both have a simple dominating strategy of only moving \(1\) unit in their direction each turn, and \(R\) and \(C\) are the only things that matter. If \(R \le C\), Bob can always force Alice to reach row \(R\) first by moving \(1\) unit right at a time. Alice also only moves \(1\) unit at a time, because if she moves any faster, she'll just get stuck sooner. Example: Alice moves first: ``` [ ][ ][ ][ ] [x][ ][ ][ ] [ ][ ][ ][ ] ``` Bob: ``` [ ][ ][ ][ ] [ ][x][ ][ ] [ ][ ][ ][ ] ``` Alice moves, and gets stuck to watch Bob stroll to the finish line: ``` [ ][ ][ ][ ] [ ][ ][ ][ ] [ ][x][ ][ ] ``` Conversely, if \(R > C\), then Alice can always force a win by moving \(1\) step at a time. Therefore we output "`YES`" if and only if \(R > C\), regardless of the values of \(A\) and \(B\).
#include <iostream> using namespace std; int main() { int T; cin >> T; for (int t = 1; t <= T; t++) { cout << "Case #" << t << ": "; int R, C, A, B; cin >> R >> C >> A >> B; cout << (R > C ? "YES" : "NO") << endl; } return 0; }
Case #1: NO Case #2: NO Case #3: NO Case #4: NO Case #5: NO Case #6: NO Case #7: NO Case #8: NO Case #9: NO Case #10: NO Case #11: NO Case #12: NO Case #13: NO Case #14: NO Case #15: NO Case #16: NO Case #17: NO Case #18: NO Case #19: YES Case #20: YES Case #21: NO Case #22: NO Case #23: NO Case #24: NO Case #25: NO Case #26: NO Case #27: NO Case #28: NO Case #29: NO Case #30: NO Case #31: NO Case #32: NO Case #33: NO Case #34: NO Case #35: NO Case #36: NO Case #37: NO Case #38: NO Case #39: NO Case #40: NO Case #41: NO Case #42: NO Case #43: NO Case #44: NO Case #45: NO Case #46: NO Case #47: NO Case #48: NO Case #49: NO Case #50: NO Case #51: NO Case #52: NO Case #53: NO Case #54: NO Case #55: YES Case #56: YES Case #57: YES Case #58: YES Case #59: YES Case #60: YES Case #61: YES Case #62: YES Case #63: YES Case #64: NO Case #65: NO Case #66: NO Case #67: NO Case #68: NO Case #69: NO Case #70: NO Case #71: NO Case #72: NO Case #73: NO Case #74: NO Case #75: NO Case #76: NO Case #77: NO Case #78: NO Case #79: NO Case #80: NO Case #81: NO Case #82: NO Case #83: NO Case #84: NO Case #85: NO Case #86: NO Case #87: NO Case #88: NO Case #89: NO Case #90: NO Case #91: NO Case #92: NO Case #93: NO Case #94: NO Case #95: NO Case #96: NO Case #97: NO Case #98: NO Case #99: NO Case #100: NO Case #101: NO Case #102: NO Case #103: NO Case #104: NO Case #105: NO Case #106: NO Case #107: NO Case #108: NO Case #109: YES Case #110: YES Case #111: YES Case #112: YES Case #113: YES Case #114: YES Case #115: YES Case #116: YES Case #117: YES Case #118: YES Case #119: YES Case #120: YES Case #121: YES Case #122: YES Case #123: YES Case #124: YES Case #125: YES Case #126: YES Case #127: YES Case #128: YES Case #129: YES Case #130: YES Case #131: YES Case #132: YES Case #133: NO Case #134: NO Case #135: NO Case #136: NO Case #137: NO Case #138: NO Case #139: NO Case #140: NO Case #141: NO Case #142: NO Case #143: NO Case #144: NO Case #145: NO Case #146: NO Case #147: NO Case #148: NO Case #149: NO Case #150: NO Case #151: NO Case #152: NO Case #153: NO Case #154: NO Case #155: NO Case #156: NO Case #157: NO Case #158: NO Case #159: NO Case #160: NO Case #161: NO Case #162: NO Case #163: NO Case #164: NO Case #165: NO Case #166: NO Case #167: NO Case #168: NO Case #169: NO Case #170: NO Case #171: NO Case #172: NO Case #173: NO Case #174: NO Case #175: NO Case #176: NO Case #177: NO Case #178: NO Case #179: NO Case #180: NO Case #181: YES Case #182: YES Case #183: YES Case #184: YES Case #185: YES Case #186: YES Case #187: YES Case #188: YES Case #189: YES Case #190: YES Case #191: YES Case #192: YES Case #193: YES Case #194: YES Case #195: YES Case #196: YES Case #197: YES Case #198: YES Case #199: YES Case #200: YES Case #201: YES Case #202: YES Case #203: YES Case #204: YES Case #205: YES Case #206: YES Case #207: YES Case #208: YES Case #209: YES Case #210: YES Case #211: YES Case #212: YES Case #213: YES Case #214: YES Case #215: YES Case #216: YES Case #217: YES Case #218: YES Case #219: YES Case #220: YES Case #221: NO Case #222: NO Case #223: NO Case #224: NO Case #225: NO Case #226: NO Case #227: NO Case #228: NO Case #229: NO Case #230: NO Case #231: NO Case #232: NO Case #233: NO Case #234: NO Case #235: NO Case #236: NO Case #237: NO Case #238: NO Case #239: NO Case #240: NO Case #241: NO Case #242: NO Case #243: NO Case #244: NO Case #245: NO Case #246: NO Case #247: NO Case #248: NO Case #249: NO Case #250: NO Case #251: NO Case #252: NO Case #253: YES Case #254: YES Case #255: YES Case #256: YES Case #257: YES Case #258: YES Case #259: YES Case #260: YES Case #261: YES Case #262: YES Case #263: YES Case #264: YES Case #265: YES Case #266: YES Case #267: YES Case #268: YES Case #269: YES Case #270: YES Case #271: YES Case #272: YES Case #273: YES Case #274: YES Case #275: YES Case #276: YES Case #277: YES Case #278: YES Case #279: YES Case #280: YES Case #281: YES Case #282: YES Case #283: YES Case #284: YES Case #285: YES Case #286: YES Case #287: YES Case #288: YES Case #289: YES Case #290: YES Case #291: YES Case #292: YES Case #293: YES Case #294: YES Case #295: YES Case #296: YES Case #297: YES Case #298: YES Case #299: YES Case #300: YES Case #301: YES Case #302: YES Case #303: YES Case #304: YES Case #305: YES Case #306: YES Case #307: YES Case #308: YES Case #309: NO Case #310: NO Case #311: NO Case #312: NO Case #313: NO Case #314: NO Case #315: NO Case #316: NO Case #317: NO Case #318: NO Case #319: NO Case #320: NO Case #321: NO Case #322: NO Case #323: NO Case #324: NO Case #325: YES Case #326: NO Case #327: YES Case #328: NO Case #329: YES Case #330: YES Case #331: YES Case #332: NO Case #333: YES Case #334: YES Case #335: NO Case #336: NO Case #337: YES Case #338: YES Case #339: NO Case #340: NO Case #341: YES Case #342: YES Case #343: NO Case #344: YES Case #345: NO Case #346: NO Case #347: NO Case #348: NO Case #349: YES Case #350: NO Case #351: YES Case #352: YES Case #353: NO Case #354: YES Case #355: YES Case #356: YES Case #357: NO Case #358: NO Case #359: YES Case #360: NO Case #361: YES Case #362: NO Case #363: NO Case #364: NO Case #365: YES Case #366: NO Case #367: YES Case #368: NO Case #369: NO Case #370: NO Case #371: NO Case #372: YES Case #373: NO Case #374: YES Case #375: NO Case #376: YES Case #377: NO Case #378: NO Case #379: YES Case #380: YES Case #381: YES Case #382: YES Case #383: YES Case #384: YES Case #385: NO Case #386: NO Case #387: YES Case #388: YES Case #389: YES Case #390: YES Case #391: NO Case #392: YES Case #393: NO Case #394: NO Case #395: YES Case #396: NO Case #397: YES Case #398: YES Case #399: NO Case #400: YES Case #401: YES Case #402: YES Case #403: YES Case #404: NO Case #405: NO Case #406: YES Case #407: YES Case #408: NO Case #409: NO Case #410: NO Case #411: NO Case #412: YES Case #413: YES Case #414: YES Case #415: NO Case #416: YES Case #417: YES Case #418: NO Case #419: YES Case #420: NO Case #421: NO Case #422: NO Case #423: NO Case #424: NO Case #425: NO Case #426: NO Case #427: NO Case #428: NO Case #429: NO Case #430: NO Case #431: YES Case #432: NO Case #433: NO Case #434: NO Case #435: YES Case #436: NO Case #437: YES Case #438: NO Case #439: YES Case #440: NO Case #441: YES Case #442: YES Case #443: YES Case #444: NO Case #445: NO Case #446: NO Case #447: NO Case #448: NO Case #449: YES Case #450: YES Case #451: YES Case #452: NO Case #453: NO Case #454: NO Case #455: NO Case #456: NO Case #457: YES Case #458: YES Case #459: NO Case #460: YES Case #461: YES Case #462: YES Case #463: NO Case #464: NO Case #465: NO Case #466: NO Case #467: NO Case #468: YES Case #469: NO Case #470: NO Case #471: NO Case #472: YES Case #473: NO Case #474: NO Case #475: NO Case #476: YES Case #477: YES Case #478: YES Case #479: YES Case #480: NO Case #481: NO Case #482: YES Case #483: NO Case #484: NO Case #485: YES Case #486: NO Case #487: NO Case #488: YES Case #489: YES Case #490: NO Case #491: YES Case #492: NO Case #493: YES Case #494: NO Case #495: NO Case #496: NO Case #497: YES Case #498: YES Case #499: YES Case #500: YES Case #501: YES Case #502: YES Case #503: YES Case #504: NO Case #505: NO Case #506: YES Case #507: NO Case #508: YES Case #509: NO Case #510: NO Case #511: NO Case #512: NO Case #513: NO Case #514: NO Case #515: YES Case #516: YES Case #517: NO Case #518: YES Case #519: NO Case #520: NO Case #521: NO Case #522: NO Case #523: NO Case #524: NO Case #525: YES Case #526: NO Case #527: NO Case #528: YES Case #529: NO Case #530: YES Case #531: YES Case #532: NO Case #533: YES Case #534: NO Case #535: NO Case #536: NO Case #537: NO Case #538: NO Case #539: YES Case #540: YES Case #541: NO Case #542: YES Case #543: YES Case #544: NO Case #545: YES Case #546: YES Case #547: NO Case #548: YES Case #549: NO Case #550: NO Case #551: YES Case #552: NO Case #553: NO Case #554: NO Case #555: NO Case #556: YES Case #557: NO Case #558: NO Case #559: NO Case #560: NO Case #561: YES Case #562: NO Case #563: NO Case #564: YES Case #565: YES Case #566: YES Case #567: NO Case #568: NO Case #569: YES Case #570: NO Case #571: YES Case #572: NO Case #573: YES Case #574: YES Case #575: YES Case #576: NO Case #577: NO Case #578: YES Case #579: NO Case #580: NO Case #581: NO Case #582: NO Case #583: YES Case #584: YES Case #585: YES Case #586: NO Case #587: NO Case #588: YES Case #589: NO Case #590: NO Case #591: NO Case #592: NO Case #593: YES Case #594: NO Case #595: NO Case #596: YES Case #597: NO Case #598: NO Case #599: NO Case #600: NO
[ "852013469652032.jpg", "842253013944047.jpg" ]
C
"“An apple a day keeps the doctor away” is Steve’s motto. His other motto, “You can never ha(...TRUNCATED)
"90\n3\n6 3 1 2 5\n2\n7 7 7\n1\n1\n3\n1 9 1 1 4\n4\n1 9 1 1 4 9 9\n4\n1 9 10 1 4 6 9\n3\n1000000000 (...TRUNCATED)
"If there's only one element, we don't care what it is, a \\(1\\) will match it. \n\nOtherwise, let'(...TRUNCATED)
"#include <algorithm>\n#include <iostream>\n#include <vector>\nusing namespace std;\n\nconst int INF(...TRUNCATED)
"Case #1: 4\nCase #2: 7\nCase #3: 1\nCase #4: -1\nCase #5: 6\nCase #6: -1\nCase #7: 1000000002\nCase(...TRUNCATED)
[ "1563872647765708.jpg" ]
D
"You and your friends have drawn a really big connected graph in sidewalk chalk with \\(N\\) nodes ((...TRUNCATED)
"160\n13 15\n1 2\n2 3\n2 4\n4 5\n3 5\n5 6\n6 7\n6 8\n8 9\n8 12\n8 13\n9 10\n10 11\n11 12\n12 13\n5\n(...TRUNCATED)
"It's easier to think about this problem if instead of thinking about which foot we're standing on, (...TRUNCATED)
"#include <algorithm>\n#include <iostream>\n#include <queue>\n#include <set>\n#include <vector>\nusi(...TRUNCATED)
"Case #1: 5\nCase #2: -2\nCase #3: -2\nCase #4: 0\nCase #5: 270676\nCase #6: 121294\nCase #7: 305198(...TRUNCATED)
[ "903178538089777.jpg" ]
A1
"*This problem shares some similarities with A2, with key differences in bold.*\n\nProblem solving s(...TRUNCATED)
"79\n1 1 3\n0 2 4\n5 5 1\n0 1 1\n1 1 2\n97 1 99\n97 1 100\n100 100 1\n1 1 100\n73 11 11\n51 80 87\n9(...TRUNCATED)
"Each single provides \\(2\\) buns and \\(1\\) patty. Each double provides \\(2\\) buns and \\(2\\) (...TRUNCATED)
"#include <iostream>\nusing namespace std;\n\nint main() {\n int T;\n cin >> T;\n for (int t = 1;(...TRUNCATED)
"Case #1: YES\nCase #2: NO\nCase #3: YES\nCase #4: YES\nCase #5: YES\nCase #6: YES\nCase #7: NO\nCas(...TRUNCATED)
[ "1367507087507489.jpg" ]
A2
"*This problem shares some similarities with A1, with key differences in bold.*\n\nProblem solving s(...TRUNCATED)
"80\n2 3 5\n2 3 2\n2 3 1\n5 1 100\n1 3 100\n1 1 1000000000000\n314 512 1024\n10 13 11234567890\n1000(...TRUNCATED)
"Let's think about what ingredient is limiting us. If we've bought \\(0\\) singles, we're limited by(...TRUNCATED)
"#include <algorithm>\n#include <iostream>\nusing namespace std;\n\nusing int64 = long long;\n\nint6(...TRUNCATED)
"Case #1: 3\nCase #2: 1\nCase #3: 0\nCase #4: 199\nCase #5: 100\nCase #6: 1999999999999\nCase #7: 3\(...TRUNCATED)
[ "181863494933248.jpg" ]

No dataset card yet

Downloads last month
8