悲催啊

P2911 [USACO08OCT] Bovine Bones G

你试一试把算出来的答案代入例子。程序思路本身的问题。
by 湾湾本人 @ 2017-05-13 20:32:16


```cpp #include<iostream> #include<cstdio> #include<cstring> using namespace std; int a,b,c,d,big=-1,h,z[100]; int main() { cin>>a>>b>>c; d=a+b+c; for(int aa=1;aa<=a;aa++) for(int bb=1;bb<=b;bb++) for(int cc=1;cc<=c;cc++) { z[aa+bb+cc]++; } for(int aa=1;aa<=d;aa++) { if(z[aa]>big) { h=aa; big=z[aa]; } } cout<<h; return 0; } ```
by tuliwei @ 2017-06-02 13:11:31


```cpp var s1,s2,s3,h,i,j,d:longint; a:array[1..1000] of longint; begin read(s1,s2,s3); for i:=1 to s1 do begin for j:=1 to s2 do begin for h:=1 to s3 do begin d:=i+j+h; inc(a[d]); end; end; end; for i:=1 to s1+s2+s3 do if a[i]<a[i+1] then d:=i+1; write(d); end. ```
by yuzoe @ 2017-06-16 17:17:28


|