<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>phyllo_algo</author_name>
  <author_url>https://blog.hatena.ne.jp/phyllo_algo/</author_url>
  <blog_title>れどこだ目指すよ！　(；`・ω・）</blog_title>
  <blog_url>https://phyllo-algo.hatenadiary.org/</blog_url>
  <categories>
    <anon>こどふぉす</anon>
  </categories>
  <description>大虐殺と聞いて。解法は教えてもらった。ムズすぎでは・・・ 問題 高さh1のカエルと高さh2の花があり、1秒後にはカエルは高さが(x1*h1+y1) mod M、花は(x2*h2+y2) mod Mになる。 カエルの高さがa1、花の高さがa2に同時になるような最短時間を求めよ。そのような時間がなければ-1を返す。 2 0 考え方 問題Aなので、パッと見、周期を求めて最小公倍数的な感じかと思うが、よく考える必要がある。 hがaとなる周期を考える。 (x*h+y) mod Mを愚直に計算していって、「①最初にaとなるタイミング」と「②次にaとなるタイミング」をみつければよい。見つからなければ解なし。…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fphyllo-algo.hatenadiary.org%2Fentry%2F20150527%2F1432737957&quot; title=&quot;Codeforces 547A. Mike and Frog - れどこだ目指すよ！　(；`・ω・）&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2015-05-27 23:45:57</published>
  <title>Codeforces 547A. Mike and Frog</title>
  <type>rich</type>
  <url>https://phyllo-algo.hatenadiary.org/entry/20150527/1432737957</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
