We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- All Contests
- HourRank 18
- Where's the Marble?
- Discussions
Where's the Marble?
Where's the Marble?
Sort by
recency
|
12 Discussions
|
Please Login in order to post a comment
include
include
include
include
include
include
include
void swap(int a[],int i,int j){ int temp; temp=a[i]; a[i]=a[j]; a[j]=temp;
}
int main(){ int m; int n; scanf("%d %d",&m,&n); int A[10]={0}; A[m-1]=1; for(int a0 = 0; a0 < n; a0++){ int a; int b; scanf("%d %d",&a,&b); // your code goes here swap(A,a-1,b-1);
}
Dont we already know the last cup from the inputs offered
javascript renamed m to current
current = (current == a) ? b : current == b ? a : current;
finally log "current"