{"id":2664,"date":"2022-04-26T02:15:48","date_gmt":"2022-04-25T17:15:48","guid":{"rendered":"https:\/\/k.foolslab.net\/dailyreport\/?p=2664"},"modified":"2022-04-26T02:15:48","modified_gmt":"2022-04-25T17:15:48","slug":"2022-4-25%e6%9c%88","status":"publish","type":"post","link":"https:\/\/k.foolslab.net\/dailyreport\/2022-4-25%e6%9c%88\/","title":{"rendered":"2022\/4\/25(\u6708)"},"content":{"rendered":"\n<p>\u4eca\u65e5\u89e3\u3044\u305f\u7af6\u30d7\u30ed\u306e\u554f\u984c\u3002<\/p>\n\n\n\n<p>\u7af6\u30d7\u30ed\u5178\u578b90\u554f<\/p>\n\n\n\n<p>030 K Factors: 1~N\u307e\u3067\u5168\u3066\u7d20\u56e0\u6570\u5206\u89e3\u3059\u308c\u3070$O(N\\sqrt{N})$\u3067\u89e3\u3051\u308b\u304c\u3001\u3053\u308c\u3067\u306f\u9045\u3059\u304e\u308b\u306e\u3067Osa_k\u6cd5\u3067\u9ad8\u901f\u5316\u3059\u308b\u3068$O(N\\log N)$\u306b\u306a\u308b\u3002$N=10^7$\u306a\u306e\u3067$N\\log N$\u304c\u901a\u308b\u304b\u3069\u3046\u304b\u306f\u5fae\u5999\u306a\u3068\u3053\u308d\u3060\u304c\u3001C++\u306a\u3089\u30ae\u30ea\u30ae\u30ea\u901a\u308b\u3002\u914d\u5217\u306bvector\u3092\u4f7f\u3063\u305f\u3089TLE\u3057\u305f\u306e\u3067\u751f\u914d\u5217\u3092\u7528\u3044\u305f\u3002<\/p>\n\n\n\n<p>\u3053\u3093\u306a\u3054\u308a\u62bc\u3057\u89e3\u6cd5\u306f\u307e\u305a\u60f3\u5b9a\u89e3\u3067\u306f\u306a\u3044\u3060\u308d\u3046\u306a\u3068\u601d\u3063\u305f\u306e\u3067\u5225\u306e\u3084\u308a\u65b9\u3082\u8003\u3048\u305f\u3002\u307e\u305a\u30a8\u30e9\u30c8\u30b9\u30c6\u30cd\u30b9\u306e\u7be9\u3067N\u4ee5\u4e0b\u306e\u7d20\u6570\u3092\u5168\u5217\u6319\u3002$O(N\\log \\log N)$\u306b\u306a\u308b\u3002\u305d\u308c\u304b\u3089\u305d\u308c\u305e\u308c\u306e\u7d20\u6570\u3092\u7d20\u56e0\u6570\u3068\u3057\u3066\u4f7f\u3046N\u4ee5\u4e0b\u306e\u6570\u3092\u3001\u5c0f\u3055\u3044\u7d20\u6570\u304b\u3089DFS\u3067\u5168\u63a2\u7d22\u3002\u540c\u3058\u6570\u3092\u4e8c\u5ea6\u8abf\u3079\u308b\u3053\u3068\u306f\u306a\u3044(\u306f\u305a)\u306a\u306e\u3067\u4e00\u5fdc$O(N)$\u306b\u306a\u3063\u3066\u3044\u308b\u306f\u305a\uff1f\uff1f300ms\u7a0b\u5ea6\u3068\u4f59\u88d5\u3092\u6301\u3063\u3066\u901a\u3063\u305f\u3002<\/p>\n\n\n\n<p>\u60f3\u5b9a\u89e3\u306f\u3082\u3063\u3068\u304d\u308c\u3044\u3060\u3063\u305f\u3002\u554f\u984c\u3068\u3057\u3066\u3044\u308b\u306e\u306f\u305d\u308c\u305e\u308c\u306e\u6570\u304c\u4f55\u7a2e\u985e\u306e\u7d20\u56e0\u6570\u3092\u6301\u3063\u3066\u3044\u308b\u304b\u306a\u306e\u3067\u3001c[2], c[4], c[6]&#8230;\u306b1\u3092\u8db3\u3059\u3001c[3], c[6], c[9]&#8230;\u306b1\u3092\u8db3\u3059\u3001c[5], c[10], c[15]&#8230;\u306b1\u3092\u8db3\u3059\u3001\u3068\u3044\u3046\u98a8\u306b\u30a8\u30e9\u30c8\u30b9\u30c6\u30cd\u30b9\u306e\u7be9\u306e\u3088\u3046\u306a\u3084\u308a\u65b9\u3067\u6570\u3048\u3066\u3044\u304f\u3068\u3044\u3046\u3084\u308a\u65b9\u3060\u3063\u305f\u3002\u982d\u304c\u826f\u3059\u304e\u308b\u3002\u30a8\u30e9\u30c8\u30b9\u30c6\u30cd\u30b9\u306e\u7be9\u3068\u540c\u3058\u9077\u79fb\u306a\u306e\u3067\u8a08\u7b97\u91cf\u306f$O(N\\log \\log N)$\u306b\u306a\u308b\u3002<\/p>\n\n\n\n<p>017 Crossing Segments \u96e3\u6613\u5ea6\u26067\u3060\u304c\u81ea\u529b\u3067\u89e3\u3051\u305f\u3002\u3046\u308c\u3057\u3044\uff01<\/p>\n\n\n\n<p>\u307e\u305a\u5168\u7d44\u307f\u5408\u308f\u305b\u3092\u8abf\u3079\u3066$O(M^2)$\u3067\u89e3\u3044\u305f\u3002\u3053\u308c\u3067\u5c0f\u8ab2\u984c1\u306f\u901a\u308b\u3002$(L_i, R_i)$\u3068$(L_j, R_j)$\u304c\u4ea4\u308f\u3063\u3066\u3044\u308b\u304b\u8abf\u3079\u308b\u3068\u304d\u3001$L_j, R_j$\u306e\u4e8c\u3064\u306e\u3046\u3061\u7247\u65b9\u304c\u533a\u9593$(L_i, R_i)$\u306e\u4e2d\u306b\u5165\u3063\u3066\u3044\u3066\u3082\u3046\u7247\u65b9\u304c\u533a\u9593$[L_i, R_i]$\u306e\u5916\u306b\u3042\u308b\u306a\u3089\u3070\u4ea4\u308f\u3063\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<p>\u6b21\u306b\u3001\u300c\u533a\u9593\u3092\u6761\u4ef6\u306b\u6570\u3048\u3066\u3044\u308b\u300d\u3042\u305f\u308a\u304c\u9ad8\u901f\u5316\u3067\u304d\u305d\u3046\u306b\u898b\u3048\u305f\u306e\u3067\u9ad8\u901f\u5316\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u307e\u305a\u305d\u308c\u305e\u308c\u306e\u70b9\u306b\u3064\u3044\u3066\u8fba\u60c5\u5831\u3092\u6301\u3063\u3066\u304a\u304f\u3002(\u4f8b\u3048\u3070g\u3068\u3044\u30462\u6b21\u5143\u914d\u5217\u3092\u6301\u3063\u3066\u304a\u304d\u3001(L,R)=(3,5)\u3068\u3044\u3046\u7dda\u5206\u304c\u3042\u3063\u305f\u3089g[3].push_back(5), g[5].push_back(3)\u3068\u3057\u3066\u304a\u304f\u3002)<\/p>\n\n\n\n<p>\u305d\u3057\u3066$(L_i, R_i)$\u3068\u4ea4\u308f\u308b\u7dda\u5206\u3092\u5217\u6319\u3059\u308b\u5834\u5408\u3001$g[L_i + 1]$\u304b\u3089$g[R_i &#8211; 1]$\u307e\u3067\u306e\u5404\u70b9\u306b\u3064\u3044\u3066\u3001$L_i &#8211; 1$\u4ee5\u4e0b\u306e\u5024\u3068$R_i + 1$\u4ee5\u4e0a\u306e\u5024\u306e\u6570\u3092\u8abf\u3079\u308b\u3002\u4e8b\u524d\u306b\u30bd\u30fc\u30c8\u3057\u3066\u304a\u3051\u3070\u4e8c\u5206\u63a2\u7d22\u3067\u89e3\u304f\u3053\u3068\u304c\u3067\u304d\u308b\u3002\u4e8c\u91cd\u306b\u30ab\u30a6\u30f3\u30c8\u3057\u3066\u3057\u307e\u3046\u306e\u3067\u00f72\u3059\u308b\u3053\u3068\u306b\u3060\u3051\u6c17\u3092\u4ed8\u3051\u308b\u3068$O(MN\\log N)$\u3067\u89e3\u3051\u308b\u306f\u305a\u3002<\/p>\n\n\n\n<p>$MN=10^8$\u306a\u306e\u3067\u304b\u306a\u308a\u304d\u3064\u304f\u3001\u305d\u306e\u307e\u307e\u3067\u306fTLE\u3002\u3088\u304f\u8003\u3048\u305f\u3089$L_i-1$\u4ee5\u4e0b\u306e\u5024\u3068$R_i + 1$\u4ee5\u4e0a\u306e\u5024\u306e\u6570\u306e\u4e21\u65b9\u3092\u6570\u3048\u3066\u3044\u305f\u306e\u3092\u3069\u3061\u3089\u304b\u7247\u65b9\u6570\u3048\u308b\u3060\u3051\u306b\u3059\u308c\u3070\u3001\u305d\u3082\u305d\u3082\u4e8c\u91cd\u306b\u30ab\u30a6\u30f3\u30c8\u3059\u308b\u3053\u3068\u306f\u306a\u3044\u306e\u3067\u00f72\u3059\u308b\u5fc5\u8981\u3082\u306a\u3044\u3002\u8fba\u3082\u4e21\u5074\u304b\u3089\u5f35\u308b\u5fc5\u8981\u306f\u306a\u3044\u3002\u3053\u308c\u306b\u6c17\u3092\u4ed8\u3051\u305f\u30892\u500d\u9ad8\u901f\u5316\u306b\u306a\u3063\u3066\u901a\u3063\u305f\u3002<\/p>\n\n\n\n<p>\u6700\u5f8c\u3001\u300c\u533a\u9593\u5185\u306e\u5168\u3066\u306e\u70b9\u306b\u3064\u3044\u3066\u6570\u3048\u3066\u3044\u308b\u300d\u3042\u305f\u308a\u304c\u9ad8\u901f\u5316\u3067\u304d\u305d\u3046\u306b\u898b\u3048\u305f\u306e\u3067\u9ad8\u901f\u5316\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u8003\u5bdf\u306e\u305f\u3081\u306bL\u3068R\u3092\u4e8c\u6b21\u5143\u5e73\u9762\u306b\u30d7\u30ed\u30c3\u30c8\u3057\u3066\u307f\u305f\u3089\u3001\u5404\u8fba\u306b\u3064\u3044\u3066\u3042\u308b\u77e9\u5f62\u9818\u57df\u306e\u4e2d\u306e\u70b9\u3092\u6570\u3048\u308c\u3070\u3044\u3044\u3053\u3068\u304c\u4e00\u77ac\u3067\u5206\u304b\u3063\u3066\u3057\u307e\u3063\u305f\u3002\u3053\u3046\u3044\u3046\u5834\u5408\u306f\u5e73\u9762\u8d70\u67fb\u6cd5\u3092\u3059\u308c\u3070\u901a\u308b\u3002\u9069\u5b9c\u30bd\u30fc\u30c8\u3057\u3066\u533a\u9593\u306e\u70b9\u306e\u6570\u306e\u7ba1\u7406\u306bBIT\u3092\u4f7f\u3048\u3070$O(M\\log N)$\u3067\u901a\u308b\u3002\u7d42\u308f\u308a\u3002<\/p>\n\n\n\n<p>\u6c17\u6301\u3061\u3088\u304b\u3063\u305f\uff5e\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u306a\u3093\u304b\u3059\u3054\u305d\u3046\u306a\u306e\u3067\u30e1\u30e2\u3002Chromium\u306e\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u306e\u89e3\u8aac\u3092\u6771\u5927\u8b1b\u7fa9\u304b\u306a\u3093\u304b\u3067\u3084\u3063\u3066\u305f\u3089\u3057\u3044\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/docs.google.com\/presentation\/d\/12wd3hLkXVny0b5LnzizmH_3xe8zJ2WY5_9JprfIkp-o\/edit#slide=id.g121fb644ce9_0_434\">https:\/\/docs.google.com\/presentation\/d\/12wd3hLkXVny0b5LnzizmH_3xe8zJ2WY5_9JprfIkp-o\/edit#slide=id.g121fb644ce9_0_434<\/a><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u658e\u85e4\u74b0\u300c\u3072\u304d\u3053\u3082\u308a\u306f\u306a\u305c\u300e\u6cbb\u308b\u300f\u306e\u304b\uff1f\u300d\u8aad\u4e86\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u7fa9\u52d9\u3068\u6b32\u671b\u306e\u533a\u5225\u304c\u3064\u304b\u306a\u3044\u72b6\u614b\u3060\u3068\u8eab\u52d5\u304d\u304c\u3068\u308c\u306a\u304f\u306a\u308b\u3001\u3068\u3044\u3046\u306e\u306f\u304b\u306a\u308a\u5fc3\u5f53\u305f\u308a\u304c\u3042\u308b\u8a71\u3060\u3068\u601d\u3063\u305f\u3002\u3057\u304b\u3057\u3053\u3053\u3067\u8a00\u3046\u300c\u7fa9\u52d9\u300d\u306e\u6b63\u4f53\u304c\u4eca\u4e00\u3064\u63b4\u3081\u306a\u304f\u3066\u6d88\u5316\u4e0d\u826f\u3002<\/li><li>\u4ed6\u8005\u3068\u306e\u5bfe\u8a71\u3092\u3059\u308b\u306b\u3042\u305f\u308a\u3001\u30e1\u30fc\u30eb\u3084\u96fb\u8a71\u3067\u306f\u30c0\u30e1\u3067\u76f4\u63a5\u4f1a\u3063\u3066\u8a71\u3092\u3059\u308b\u306e\u3067\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u3001\u3068\u3044\u3046\u306e\u3092\u304b\u306a\u308a\u5ff5\u62bc\u3057\u3057\u3066\u3044\u305f\u306e\u304c\u6c17\u306b\u306a\u3063\u305f\u3002\u305d\u308c\u306a\u308a\u8aac\u660e\u3082\u3057\u3066\u3044\u305f\u304c\u4eca\u4e00\u3064\u30d4\u30f3\u3068\u6765\u305a\u3002\u601d\u3046\u306b\u3001\u300c\u52d8\u3050\u308a\u300d\u304c\u767a\u751f\u3059\u308b\u3088\u3046\u306a\u30b3\u30df\u30e5\u30cb\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u3044\u3051\u306a\u3044\u306e\u3060\u3068\u3044\u3046\u8a71\u3068\u89e3\u91c8\u3057\u305f\u3002<\/li><li>\u300c\u4ed6\u8005\u3068\u306e\u5bfe\u8a71\u300d\u306e\u5fc5\u9808\u6027\u3092\u7406\u8ad6\u7684\u306a\u9762\u304b\u3089\u8aac\u660e\u3057\u3066\u304f\u308c\u305f\u306e\u304c\u304b\u306a\u308a\u826f\u304b\u3063\u305f\u3002<\/li><\/ul>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u663c\u306b\u30c1\u30e3\u30fc\u30cf\u30f3\u3092\u4f5c\u3063\u305f\u3002\u30c1\u30e3\u30fc\u30cf\u30f3\u3092\u4f5c\u308b\u306e\u306b\u3061\u3087\u3063\u3068\u305a\u3064\u6163\u308c\u3066\u304d\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u8155\u7acb\u3066\u4f0f\u305b\u3092\u3084\u3063\u305f\u3002\u660e\u65e5\u306f\u8179\u7b4b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u65e5\u89e3\u3044\u305f\u7af6\u30d7\u30ed\u306e\u554f\u984c\u3002 \u7af6\u30d7\u30ed\u5178\u578b90\u554f 030 K Factors: 1~N\u307e\u3067\u5168\u3066\u7d20\u56e0\u6570\u5206\u89e3\u3059\u308c\u3070$O(N\\sqrt{N})$\u3067\u89e3\u3051\u308b\u304c\u3001\u3053\u308c\u3067\u306f\u9045\u3059\u304e\u308b\u306e\u3067Osa_k\u6cd5\u3067\u9ad8\u901f\u5316\u3059\u308b\u3068$O(N\\log N)$\u306b\u306a\u308b &hellip; <\/p>\n<div><a href=\"https:\/\/k.foolslab.net\/dailyreport\/2022-4-25%e6%9c%88\/\" class=\"more\">Read more &raquo;<span class=\"screen-reader-text\"> &#8220;2022\/4\/25(\u6708)&#8221;<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2664","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/k.foolslab.net\/dailyreport\/wp-json\/wp\/v2\/posts\/2664","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/k.foolslab.net\/dailyreport\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/k.foolslab.net\/dailyreport\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/k.foolslab.net\/dailyreport\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/k.foolslab.net\/dailyreport\/wp-json\/wp\/v2\/comments?post=2664"}],"version-history":[{"count":3,"href":"https:\/\/k.foolslab.net\/dailyreport\/wp-json\/wp\/v2\/posts\/2664\/revisions"}],"predecessor-version":[{"id":2667,"href":"https:\/\/k.foolslab.net\/dailyreport\/wp-json\/wp\/v2\/posts\/2664\/revisions\/2667"}],"wp:attachment":[{"href":"https:\/\/k.foolslab.net\/dailyreport\/wp-json\/wp\/v2\/media?parent=2664"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/k.foolslab.net\/dailyreport\/wp-json\/wp\/v2\/categories?post=2664"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/k.foolslab.net\/dailyreport\/wp-json\/wp\/v2\/tags?post=2664"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}