|
|
back to boardwa 3 Posted by Simen 30 Nov 2019 23:25 whats problem on test 3?? что за проблема на 3 тесте?? Re: wa 3 Yep Why my code get WA3? #define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <vector> #include <cstring> #include <set> #include <map> #include <cmath> #include <algorithm> using namespace std; #define ll long long const ll nmax = 100005; const ll inf = 1234567890123; ll A, B, C; ll X, Y, Z; int main() { cin>>A>>B>>C; cin>>X>>Y>>Z;
if(Z > C) cout<<"There are no miracles in life"; else { ll ess = (ll)0; if(X > A) ess += X - A; if(Y > B) ess += Y - B; if(C - Z >= ess) cout<<"It is a kind of magic"; else cout<<"There are no miracles in life"; }
return 0; } or more simple #define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <vector> #include <cstring> #include <set> #include <map> #include <cmath> #include <algorithm> using namespace std; #define ll long long const ll nmax = 100005; const ll inf = 1234567890123; ll A, B, C; ll X, Y, Z; int main() { cin>>A>>B>>C; cin>>X>>Y>>Z;
if(X > A) C -= (X - A); if(Y > B) C -= (Y - B); if(Z <= C) cout<<"It is a kind of magic"; else cout<<"There are no miracles in life";
return 0; } Re: wa 3 try 3 3 2 5 0 3 answer YES |
|
|