最后WA了三个点,这只gcd有问题么。。。

P4057 [Code+#1] 晨跑

爆int了
by cszmc2004 @ 2018-08-08 13:26:28


@[newworld](/space/show?uid=35490) 题目上说a,b,c <= 100000,为哈会爆。。。
by 旗木五五开 @ 2018-08-08 13:50:43


@[旗木五五开](/space/show?uid=68972) a*b*c就爆int了,10^18怎麼可能不爆??
by cszmc2004 @ 2018-08-08 14:19:07


@[newworld](/space/show?uid=35490) 哦哦,蟹蟹大佬ヾ(◍°∇°◍)ノ゙
by 旗木五五开 @ 2018-08-08 14:20:52


帮个忙 ```cpp #include <bits/stdc++.h> using namespace std; int main(int argc, char** argv) { long long a=0,b=0,c=0,day=1; bool ap=false,bp=false,cp=false; int aw=0,bw=0,cw=0; cin>>a>>b>>c; for(int i=0; i<100; i--) { if(ap==true) { ap=false; } if(bp==true) { bp=false; } if(cp==true) { cp=false; } if(aw==a-1) { ap=true; aw=0; } if(bw==b-1) { bp=true; bw=0; } if(cw=c-1) { cp==true; cw=0; } if(ap==true&&bp==true&&cp==true){ break; } aw++; bw++; cw++; day++; } cout<<day; return 0; } ```
by hudongdong @ 2019-07-22 20:59:35


|