|
|
вернуться в форумgive me a wrong test please My program works like that: int sum = 0; int sum1 = 0; int i = 0; for( int j = 0; j < s; j++) { cin >> temp; sum1 += temp; if( sum1 > n + j + 1) { cout << "NO" << endl; return 0; } if( temp < 3) { sum = 0; i = j + 1; } else { sum += temp; if( sum > n + j - i + 1) { cout << "NO" << endl; return 0; } } } cout << "YES" << endl; ==========> WA in #12 V_V |
|
|