LoginSignup
0
0

More than 3 years have passed since last update.

AtCoder Beginner Contest 178

Posted at

過去最低パフォーマンスを計測したコンテストです。
戒めとして記憶に残したいと思います。

A - Not

C++
#include<iostream>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<utility>
#include<iomanip>
#include<map>
#include<queue>
#include<cmath>
#include<cstdio>

#define rep(i,n) for(int i=0; i<(n); ++i)
#define pai 3.1415926535897932384

using namespace std;
using ll =long long;
using P = pair<int,int>;

int main(int argc, const char * argv[]) {

    int a;
    cin >> a;

    if(a==0) cout << 1 << endl;
    else cout << 0 << endl;

    return 0;
}

B - Product Max

C++
#include<iostream>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<utility>
#include<iomanip>
#include<map>
#include<queue>
#include<cmath>
#include<cstdio>

#define rep(i,n) for(int i=0; i<(n); ++i)
#define pai 3.1415926535897932384

using namespace std;
using ll =long long;
using P = pair<int,int>;

int main(int argc, const char * argv[]) {

    ll a, b, c, d;
    cin >> a >> b >> c >> d;

    ll Ans = -9223372036854775808;

    Ans = max(a*c, Ans);
    Ans = max(a*d, Ans);
    Ans = max(b*c, Ans);
    Ans = max(b*d, Ans);

    cout << Ans << endl;

    return 0;
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0