https://codeforces.me/problemset/problem/1323/A
I have found something confusing in this problem.
This is the solution mohammadmahdi.hamidzadeh wrote.
include <bits/stdc++.h>
using namespace std;
int main(){ int t;cin>>t;while(t--){ int n,a=0,x;cin>>n; for(int i=1;i<=n;i++){ cin>>x; if(x%2==0)a=i; } if(a)cout<<1<<endl<<a<<endl; else{ if(n==1)cout<<-1<<endl; else cout<<2<<endl<<1<<" "<<2<<endl; } } }
I changed a little bit in this code.
include <bits/stdc++.h>
using namespace std;
int main(){ int t; cin>>t; while(t--){ int n,a = 0,x; cin>>n; for(int i=1;i<=n;i++){ cin>>x; if(x%2==0)a=i; } if(a)cout<<1<<endl<<a<<endl; else{ if(n==1)cout<<-1<<endl; else cout<<2<<endl<<1<<" "<<2<<endl; } } return 0; } // This is my code
But after this change, the outputs I am getting are wrong. I cannot understand this.
My question is : Where did I messed up?
Try to use codeforces markup to insert code in the post.
Hope that helps you explain your problem properly.
Next time either give links to submission, or use proper formatting to display code.