[解題報告][ZeroJudge][d575] 末日審判 七月 12, 2010 程式碼, ZeroJudge 本文总阅读量次 最佳化版本最快秒數曾為 29ms。 1234567891011121314151617/*Problem: d575(fast)Language: C++Result: AC (35ms, 645KB) on ZeroJudgeAuthor: m80126colin at 2010-07-12 16:42:24Solution: Math*/#import <iostream>#define A long longA a,b,c,d,e,f,r;inline bool z(A& g) { //input optimization while ((f=getchar())==32||f==10); for (g=(e=f-'-')?f-48:0;++f&&(f=getchar())-32&&f-10;g=g*10+(e?f-48:48-f)); return f;}inline A y(A x) {return (x>0)?x:-x;} //absmain() {for (;z(a)&z(b)&z(c)&z(d)&z(r);puts((y(c-a)+y(d-b)>r?"alive":"die")));} 短碼版12345678910/*Problem: d575Language: C++Result: AC (90ms, 690KB) on ZeroJudgeAuthor: m80126colin at 2010-07-12 14:33:10Solution: Math*/#include <iostream>inline long long ab(long long x) {return x>0 ? x : -x;}int main() {for (long long a,b,c,d,r;~scanf("%lld%lld%lld%lld%lld",&a,&b,&c,&d,&r);puts((ab(c-a)+ab(d-b) >r ? "alive" : "die"))) ;} Newer [解題報告][ZeroJudge][d583] 幼稚的企鵝 Older [解題報告][ZeroJudge][d573] CRC騎士團