結果
問題 | No.1486 ロボット |
ユーザー |
![]() |
提出日時 | 2021-04-23 22:28:59 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 16 ms / 2,000 ms |
コード長 | 433 bytes |
コンパイル時間 | 2,853 ms |
コンパイル使用メモリ | 191,956 KB |
最終ジャッジ日時 | 2025-01-21 00:09:38 |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
ソースコード
#define rep(i, n) for (int i = 0; i < (int)(n); i++)#define ALL(v) v.begin(), v.end()typedef long long ll;#include <bits/stdc++.h>using namespace std;int main(){ll a,b,c,d,e;cin>>a>>b>>c>>d>>e;ll f=lcm(a+b,c+d);ll cnt=0,cnt1=0;for(int i=0;i<f;i++){if(i%(a+b)<a && i%(c+d)<c) cnt++;}for(int i=0;i<e%f;i++){if(i%(a+b)<a && i%(c+d)<c) cnt1++;}cout<<e/f*cnt+cnt1<<endl;return 0;}