結果

問題 No.1486 ロボット
ユーザー Mr_uts1_quizerMr_uts1_quizer
提出日時 2021-04-23 22:05:16
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 9 ms / 2,000 ms
コード長 402 bytes
コンパイル時間 1,449 ms
コンパイル使用メモリ 166,808 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-04 08:06:27
合計ジャッジ時間 2,164 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a,b,c,d,e;
  cin >> a >> b >> c >> d >> e;
  int count=0;
  for(int i=0;i<(a+b)*(c+d);i++){
    if(i%(a+b)<a && i%(c+d)<c){
      count++;
    }
  }
  int x = e / ((a+b)*(c+d));
  int y = e % ((a+b)*(c+d));
  int ct = 0;
  for(int i=0;i<y;i++){
    if(i%(a+b)<a && i%(c+d)<c){
      ct++;
    }
  }
  cout << count * x + ct << endl; 
}
0