|
|
Show all threads Hide all threads Show all messages Hide all messages | WA7 | Mortus | 1608. Lucky Tickets 2008 | 12 Jan 2024 00:41 | 1 | WA7 Mortus 12 Jan 2024 00:41 | WA19 | Alexs | 1608. Lucky Tickets 2008 | 5 Mar 2021 00:08 | 1 | WA19 Alexs 5 Mar 2021 00:08 .I'm already tired of solving this number..Mods please give me 19th test case... | Is 1001 unlucky or 1010? | roman velichkin | 1608. Lucky Tickets 2008 | 8 Nov 2019 10:25 | 1 | I didn't get this task. Is 1001 unlucky number or 1010? | WA 7, WA 8 | 💻Evgeny Nemtsev [UrFU FT-17]'` | 1608. Lucky Tickets 2008 | 10 Aug 2017 22:53 | 1 | WA 7, WA 8 💻Evgeny Nemtsev [UrFU FT-17]'` 10 Aug 2017 22:53 | Give me some tests please WA 16 | Aneto | 1608. Lucky Tickets 2008 | 17 Nov 2015 19:08 | 4 | 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 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 | WA18 | Nisarg Shah | 1608. Lucky Tickets 2008 | 15 Dec 2008 10:49 | 1 | WA18 Nisarg Shah 15 Dec 2008 10:49 I had WA7....corrected one error but now getting WA18...Mods please give me 18th test case... Thanks... Edited by author 09.01.2009 13:12 | How to solve this? I get TLE10 (-) | rohit | 1608. Lucky Tickets 2008 | 10 Aug 2008 00:08 | 2 | Count F(n) - number of lucky tickets in range 1..n, the answer is F(b) - F(a-1). If n=4567, then F(4567) is number of 1-digit lucky numbers + number of 2-digit lucky numbers + number of 3-digit lucky numbers. With 4 digit numbers it's a bit harder - if first digit is 1..3, then remainder can be anything sustaining luckiness (i.e. there is no effect from upper border). Also first digit can't be 5,6,7. If first digit is 4, the last one can be anything except 4 - so you have multiplier 9 for the next step. This is not everything, but the basic idea. | wa7 | zhang_xiao | 1608. Lucky Tickets 2008 | 10 Aug 2008 00:04 | 4 | wa7 zhang_xiao 31 Mar 2008 15:33 boss I wa7.......... I want data zhangxiao19901124@gmail.com Re: wa7 zhang_xiao 31 Mar 2008 18:35 Now Wa 10...... Can somebody E-mail me an AC program,I want to Find out the problem! Thanks a lot zhangxiao19901124@gmail.com You can try use int64. I use extended at first,but Wrong answer. And use int64,I get AC. Re: wa7 Denis Koshman 10 Aug 2008 00:04 Just compare it with brute force solution for first 10'000'000 values. Also check that values 10, 100, 1000, 10'000, ..., 10^18 come in ascdending order - this way you'll check for overflow. Signed int64 is enough here if you perform no redundant additions/multiplications (i.e. if resulting values only increase during execution). |
|
|
|