摘要:
#include <iostream>#define LL long longusing namespace std;int main(){ LL n,k; cin >> n >>k; LL split = n%2 ? n/2+1 : n/2; if( k <= split ) cout<<-1+2*k<<endl; else cout<<2*(k-split)<<endl; return 0;} 阅读全文
摘要:
#include <iostream>#include <vector>#include <string>#include <algorithm>using namespace std;int main(){ string text; cin >> text; vector<int> heavyPos,metalPos; size_t pos = 0; while((pos = text.find("heavy",pos)) != string::npos) heavyPos.push_back(pos 阅读全文