ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1608. Lucky Tickets 2008

Aneto Give me some tests please WA 16 [3] // Problem 1608. Lucky Tickets 2008 5 Apr 2008 21:11

There was an error with data input using StreamTokenizer, so be careful if you are using it.

Edited by author 05.04.2008 21:15

Edited by author 06.04.2008 04:02
Sasha Bar [TNU] Re: Give me some tests please WA 16 [1] // Problem 1608. Lucky Tickets 2008 10 May 2009 21:08
Thank you! Scanner() got AC.

int main()
{
    int n;
    cin>>n;
    int i;
    for(i=0;i<n/2;i++)
        cout<<i+1<<" "<<n-i<<" ";
    if(n%2!=0)
        cout<<((int)n/2)+1<<" ";
    cout<<endl;
    cout<<"1 ";
    for(i=3;i<n;i+=2)
        cout<<i<<" ";
    int p=n;
    if(p%2!=0)
    {    p-=1;
        cout<<n<<" "; }
    for(p=p;p>1;p-=2)
        cout<<p<<" ";
    return 0;
}
input1:
1651 1654654564
output1:
1043406233

intput2:
77251 78156464666454
output2:
37919407177871

intput3:
1 999999999999
output3:
537412247190

input4:
101231 1000000000000000000
output4:
391773528202165271

input5:
123456789 987654321
output5:
567000597

input6:
202250020115 3000200002203254
output6:
1339741370499750