Submission #9244171


Source Code Expand

Copy
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <numeric>
#include <unordered_map>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <memory>
#include <iomanip>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
constexpr long long MOD = 1e9 + 7;
constexpr long long MAX = 1000000;

//long long MOD = 998244353;
constexpr ll INF = 1e17;
constexpr double PI = 3.141592653589793;
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }


template<typename T>
T gcd(T a, T b) {
    T c = 1;
    while (c != 0) {
        c = a % b;
        a = b;
        b = c;
    }
    return a;
}

template<typename T>
T lcm(T a, T b) {
    return a * b / gcd(a, b);
}



int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    ll a, b;
    cin >> a >> b;
    cout << lcm(a, b) << "\n";
    return 0;
}

Submission Info

Submission Time
Task C - Snack
User mmatthew_43
Language C++14 (GCC 5.4.1)
Score 300
Code Size 1085 Byte
Status
Exec Time 1 ms
Memory 256 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 00-sample-01.txt, 00-sample-02.txt, 00-sample-03.txt
All 300 / 300 00-sample-01.txt, 00-sample-02.txt, 00-sample-03.txt, 01-small-01.txt, 01-small-02.txt, 01-small-03.txt, 02-large-01.txt, 02-large-02.txt, 02-large-03.txt, 03-coprime-01.txt, 03-coprime-02.txt, 03-coprime-03.txt, 04-multiple-01.txt, 04-multiple-02.txt, 04-multiple-03.txt, 05-corner-01.txt, 05-corner-02.txt
Case Name Status Exec Time Memory
00-sample-01.txt 1 ms 256 KB
00-sample-02.txt 1 ms 256 KB
00-sample-03.txt 1 ms 256 KB
01-small-01.txt 1 ms 256 KB
01-small-02.txt 1 ms 256 KB
01-small-03.txt 1 ms 256 KB
02-large-01.txt 1 ms 256 KB
02-large-02.txt 1 ms 256 KB
02-large-03.txt 1 ms 256 KB
03-coprime-01.txt 1 ms 256 KB
03-coprime-02.txt 1 ms 256 KB
03-coprime-03.txt 1 ms 256 KB
04-multiple-01.txt 1 ms 256 KB
04-multiple-02.txt 1 ms 256 KB
04-multiple-03.txt 1 ms 256 KB
05-corner-01.txt 1 ms 256 KB
05-corner-02.txt 1 ms 256 KB