{"image_url":null,"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Flogfiles.hatenablog.com%2Fentry%2F20140902%2F1409647889\" title=\"UVa11296 Counting Solutions to an Integral Equation - Logfiles\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","url":"https://logfiles.hatenablog.com/entry/20140902/1409647889","author_url":"https://blog.hatena.ne.jp/moistx/","categories":["UVa"],"published":"2014-09-02 17:51:29","height":"190","type":"rich","description":"\u6982\u8981 \u975e\u8ca0\u6574\u6570 n \u304c\u4e0e\u3048\u3089\u308c\u308b\u3002x. y, z \u3092\u975e\u8ca0\u6574\u6570\u3068\u3057\u3066\u3001x+2y+2z = n \u3068\u306a\u308b\u30d1\u30bf\u30fc\u30f3\u6570\u3092\u6c42\u3081\u3088\u3002 \u305f\u3060\u3057 n \u89e3\u7b54 TLE\u306b\u306a\u3089\u306a\u3044\u3088\u3046\u306b\u4e00\u91cd\u30eb\u30fc\u30d7\u4ee5\u5185\u3067\u89e3\u304d\u305f\u3044\u3002x+Y=n \u3068\u66f8\u304d\u63db\u3048\u308b\u3068\u3001Y \u306f\u5076\u6570\u3067\u3042\u308b\u5fc5\u8981\u6027\u304c\u751f\u3058\u308b\u3002\u3088\u3063\u3066\u554f\u984c\u6587\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u89e3\u91c8\u3057\u76f4\u3059\u3002 \u300cn\u4ee5\u4e0b\u306e\u975e\u8ca0\u6574\u6570x\u304c\u3042\u308b\u3002n-x \u304c\u5076\u6570\u3067\u3042\u308b\u3068\u304d\u3001 (n-x)/2 \u3092\uff12\u3064\u306b\u5206\u3051\u308b\u30d1\u30bf\u30fc\u30f3\u6570\u3092\u6c42\u3081\u3088\u3002\u300d \u3059\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b O(n) \u3067\u89e3\u304c\u6c42\u307e\u308b\u3002 #include <iostream> using namespace std; int main() { int n; while(cin >> n) { \u2026","blog_url":"https://logfiles.hatenablog.com/","version":"1.0","width":"100%","provider_name":"Hatena Blog","author_name":"moistx","blog_title":"Logfiles","provider_url":"https://hatena.blog","title":"UVa11296 Counting Solutions to an Integral Equation"}