|
|
Show all threads Hide all threads Show all messages Hide all messages | A Question | lasercat | 1292. Mars Space Stations | 24 Jan 2023 09:55 | 2 | I get WA 1 with calculating distance in this way for(int i=0;i<len;i++) { ans+=pow(((int)(buf[i]-'0')),3); } while accepted in this way for(int i=0;i<len;i++) { ans+=(buf[i]-'0')*(buf[i]-'0')*(buf[i]-'0'); } WHY?!!!! Is this a bug on judge or bug in function?!! the compiler is g++ why not try this ans+=round(pow(((int)(buf[i]-'0')),3)); | Who has TIME LIMIT (+) | Виктор Крупко | 1292. Mars Space Stations | 29 Apr 2014 13:50 | 8 | 1000=1^3+0^3+0^3+0^3=1 1=1^3=1 IF THE DISTANCE BETWEEN TWO POINTS = 1 THAT FOLLOWING TOO WILL BE 1. USE BREAK It is wrong. "Oh, by the way! The value of SMK is always divisible by 3. It’s normal for Martians – all their numbers are divisible by 3." On another if the previous number is equal to next that break f(153)=1^3+5^3+3^3=1+125+27=153 =)) That's really so! :) Thank you! I've got AC! Its my solution: [code deleted] Edited by author 21.06.2007 01:35 Edited by moderator 06.12.2019 20:30 Your prog get AC, but look at this test: 1 33333 313 1 log of my prog: 2) 55 3) 250 4) 133 5) 55 6) 250 7) 133 8) 55 9) 250 10) 133 11) 55 12) 250 13) 133 14) 55 15) 250 16) 133 17) 55 18) 250 19) 133 20) 55 21) 250 22) 133 23) 55 24) 250 25) 133 26) 55 27) 250 ----- there is period! And you never get dist[j]==dist[j-1] And your prog get TLE on my test: ||| 33333 1) ||| 33333 313 1 2) ||| 33333 313 1 3) ||| 33333 313 1 4) ||| 33333 313 1 5) ||| 33333 313 1 i) ||| 33333 313 1 33333) ||| 33333 313 1 But there is no such tests => AC. =) [code deleted] Edited by author 02.12.2011 18:57 Edited by moderator 06.12.2019 20:31 313 isn't divisible by 3. | Statement | Sevenk | 1292. Mars Space Stations | 6 Nov 2009 16:58 | 2 | So if the distance from the (I-1)-th to I-th stations is X, than the distance between I-th and (I+1)th stations is F(X). than->then? | This description must be wrong! | Zieve Cheng | 1292. Mars Space Stations | 23 May 2004 14:59 | 2 | (for example F(12) = 13 + 23 = 9). The right must be:(for example F(12) = 1^3+2^3=9). |
|
|
|