Codeforces Round #386 (Div. 2), problem: (C) Tram Solution in C/C++
Codeforces Round #386 (Div. 2), problem: (C) Tram Solution in C/C++ #include<stdio.h> typedef unsigned u; u x1,x2,s; u F(u p,u d,u k) { if(k==2)return-1; if(!p&&d==-1u)return F(p,-d,k); if(p==s&&d==1)return F(p,-d,k); if(k==1&&p==x2)++k; if(k==0&&p==x1)++k; return 1+F(p+d,d,k); } int main() …