結果

問題 No.1486 ロボット
ユーザー tarattata1tarattata1
提出日時 2021-04-23 08:20:22
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 903 bytes
コンパイル時間 699 ms
コンパイル使用メモリ 87,140 KB
実行使用メモリ 91,516 KB
最終ジャッジ日時 2023-09-17 10:47:46
合計ジャッジ時間 4,467 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
7,664 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 TLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <iterator>
#include <cassert>
#include <numeric>
#include <functional>
#include <ctime>
#pragma warning(disable:4996) 

using namespace std;

int calc(int a, int b, int c, int d, int e)
{
    int cnt = 0;
    int i;
    for (i = 0; i < e; i++) {
        if (i % (a + b) < a && i % (c + d) < c) {
            cnt++;
        }
    }
    return cnt;
}

int main()
{
    int a, b, c, d, e;
    scanf("%d%d%d%d%d", &a, &b, &c, &d, &e);

    int lim = (a + b)*(c + d);
    int ans = 0;
    /*
    if (e > lim) {
        int ans0 = calc(a, b, c, d, lim);
        ans += ans0 * (e / lim);
        e %= lim;
    }*/
    ans += calc(a, b, c, d, e);
    printf("%d\n", ans);

    return 0;
}

0