Codeforces Round 1133 (Div. 1, Div. 2) is coming soon! Register here. ×

how to debug intractive problem ???

Revision en1, by i_am_not_special, 2025-05-18 12:58:36

recent contest c1 problem

my solution int n; cin >> n; int x; cout << "digit" << endl; cin >> x; cout << "digit" << endl; cin >> x; vector v = {2, 3, 5, 7}; int i = 0; int cnt = 0; while(i < 4) {

cout << "div " << v[i] << endl;
   int x;
   cin >> x;
   cnt++;
   if(x == 0)
   { 
     if(i == 0 && cnt == 3)
     {
        break;
     }

    if(i == 0 && cnt == 4)
     {
          break;
     }

    if(i == 1 && cnt == 3)
    {
       break;
    }
     i++;
     cnt = 0;
   }

}

cout << "mul " << n << endl;
    cin >> x;
    cout <<"! " << endl;

I don't know why my solution is wrong please give me some idea why its wrong

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English i_am_not_special 2025-05-18 13:02:55 87
en1 English i_am_not_special 2025-05-18 12:58:36 863 Initial revision (published)