You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The bolded part is meant to be the testing row to see how the whole program works during compiling,it was expected to output the queue from 0 to n,however, it can only output a '1'.Please help if you know where the bug is,thanks!
The text was updated successfully, but these errors were encountered:
The goal of the 'cout' testing code is not clear. Its output depends on how many teleports there are (represented by n), more specifically, it will out put b[1:n], but I think what you want is b[0:m].
#include
using namespace std;
bool b[105];
int main(){
int n,m,x,y;
cin>>n>>m;
b[0]=1;
for(int i=1;i<=n;i++){
cin>>x>>y;
for(int j=x+1;j<=y;j++) {
b[j]=1;
}`
The bolded part is meant to be the testing row to see how the whole program works during compiling,it was expected to output the queue from 0 to n,however, it can only output a '1'.Please help if you know where the bug is,thanks!
The text was updated successfully, but these errors were encountered: