1137D - Cooperative Game - CodeForces Solution


constructive algorithms interactive number theory *2400

Please click on ads to support us..

C++ Code:

// Problem: D. Cooperative Game
// Contest: Codeforces - Codeforces Round 545 (Div. 1)
// URL: https://codeforces.com/contest/1137/problem/D
// Memory Limit: 512 MB
// Time Limit: 1000 ms
// By : Ali Hossam

/*
 أَحَسِبَ النَّاسُ أَن يُتْرَكُوا أَن يَقُولُوا آمَنَّا وَهُمْ لَا يُفْتَنُونَ ۝ وَلَقَدْ فَتَنَّا الَّذِينَ مِن قَبْلِهِمْ فَلَيَعْلَمَنَّ اللَّهُ الَّذِينَ صَدَقُوا وَلَيَعْلَمَنَّ الْكَاذِبِينَ ۝
 */
#include <bits/stdc++.h>
#define Ali_Hossam ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
using namespace std;
void findAim()
{
    bool flag = 1 ;
    while(flag)
    {
        cout << "next 0\n" ;
        cout.flush() ;
        int n ;
        cin >> n ;
        for(int i = 0 ; i < n ; i ++)
        {
            string s ;
            cin >> s ;
        }
        cout << "next 0 1\n" ;
        cout.flush() ;
        cin >> n ;
        if(n == 2)
            flag = 0 ;
        for(int i = 0 ; i < n ; i ++)
        {
            string s ;
            cin >> s ;
        }
    }
    return ;
}
void Ast7mo()
{
    bool flag = 1 ;
    while(flag)
    {
        cout << "next 0 1 2 3 4 5 6 7 8 9\n" ;
        cout.flush() ;
        int n ;
        cin >> n ;
        if(n == 1)
            flag = 0 ;
        for(int i = 0 ; i < n ; i ++)
        {
            string s ;
            cin >> s ;
        }
    }
    cout << "done" << "\n" ;
    return ;
}
int main()
{
    Ali_Hossam
    findAim() ;
    Ast7mo() ;
}


Comments

Submit
0 Comments
More Questions

1006B - Polycarp's Practice
1422A - Fence
21D - Traveling Graph
1559B - Mocha and Red and Blue
1579C - Ticks
268B - Buttons
898A - Rounding
1372B - Omkar and Last Class of Math
1025D - Recovering BST
439A - Devu the Singer and Churu the Joker
1323A - Even Subset Sum Problem
1095A - Repeating Cipher
630F - Selection of Personnel
630K - Indivisibility
20B - Equation
600B - Queries about less or equal elements
1015A - Points in Segments
1593B - Make it Divisible by 25
680C - Bear and Prime 100
1300A - Non-zero
1475E - Advertising Agency
1345B - Card Constructions
1077B - Disturbed People
653A - Bear and Three Balls
794A - Bank Robbery
157A - Game Outcome
3B - Lorry
1392A - Omkar and Password
489A - SwapSort
932A - Palindromic Supersequence