摘要: #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;} 阅读全文
posted @ 2013-06-15 11:29 OpenSoucre 阅读(192) 评论(0) 推荐(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 阅读全文
posted @ 2013-06-15 11:28 OpenSoucre 阅读(189) 评论(0) 推荐(0) 编辑