From 89acb68553d97ede7a4a486307879b9a441b4ea7 Mon Sep 17 00:00:00 2001 From: Konano Date: Mon, 9 Jul 2018 11:38:40 +0800 Subject: [PATCH] fix bug --- HCF-MoreKeys/morekey.cpp | 44 +++++++++++++++++----------------- HCF-MoreKeys/portal-sample.txt | 1 + 2 files changed, 23 insertions(+), 22 deletions(-) create mode 100644 HCF-MoreKeys/portal-sample.txt diff --git a/HCF-MoreKeys/morekey.cpp b/HCF-MoreKeys/morekey.cpp index 14fd88d..4dcdffb 100644 --- a/HCF-MoreKeys/morekey.cpp +++ b/HCF-MoreKeys/morekey.cpp @@ -1,5 +1,5 @@ #include -//#include +#include #include #include #include @@ -370,9 +370,9 @@ inline void OutputResult() tot=0; MK(i, ii, 1) nMK(j, jj, 1) nMK(k, kk, jj+1) if (Level[FieldLabel=GetFL(i,j,k)]>=QLevel) nMK(h, hh, 1) if (h!=i && h!=j && h!=k && inField(i,j,k,h) && - Level[FieldLabel=GetFL(i,j,h)]>=QLevel-1 && - Level[FieldLabel=GetFL(i,h,k)]>=QLevel-1 && - Level[FieldLabel=GetFL(h,j,k)]>=QLevel-1) + Level[GetFL(i,j,h)]>=QLevel-1 && + Level[GetFL(i,h,k)]>=QLevel-1 && + Level[GetFL(h,j,k)]>=QLevel-1) { if ((int)qmin.size()==minField) qmin.pop(); qmin.push((Field){FieldLabel,Area(i,j,k)}); @@ -382,9 +382,9 @@ inline void OutputResult() } nMK(i, ii, 1) nMK(j, jj, ii+1) nMK(k, kk, jj+1) if (Level[FieldLabel=GetFL(i,j,k)]>=QLevel) MK(h, hh, 1) if (h!=i && h!=j && h!=k && inField(i,j,k,h) && - Level[FieldLabel=GetFL(i,j,h)]>=QLevel-1 && - Level[FieldLabel=GetFL(i,h,k)]>=QLevel-1 && - Level[FieldLabel=GetFL(h,j,k)]>=QLevel-1) + Level[GetFL(i,j,h)]>=QLevel-1 && + Level[GetFL(i,h,k)]>=QLevel-1 && + Level[GetFL(h,j,k)]>=QLevel-1) { if ((int)qmin.size()==minField) qmin.pop(); qmin.push((Field){FieldLabel,Area(i,j,k)}); @@ -406,9 +406,9 @@ inline void OutputResult() tot=0; MK(i, ii, 1) MK(j, jj, ii+1) nMK(k, kk, 1) if (Level[FieldLabel=GetFL(i,j,k)]>=QLevel) nMK(h, hh, 1) if (h!=i && h!=j && h!=k && inField(i,j,k,h) && - Level[FieldLabel=GetFL(i,j,h)]>=QLevel-1 && - Level[FieldLabel=GetFL(i,h,k)]>=QLevel-1 && - Level[FieldLabel=GetFL(h,j,k)]>=QLevel-1) + Level[GetFL(i,j,h)]>=QLevel-1 && + Level[GetFL(i,h,k)]>=QLevel-1 && + Level[GetFL(h,j,k)]>=QLevel-1) { if ((int)qmin.size()==minField) qmin.pop(); qmin.push((Field){FieldLabel,Area(i,j,k)}); @@ -418,9 +418,9 @@ inline void OutputResult() } MK(i, ii, 1) nMK(j, jj, 1) nMK(k, kk, jj+1) if (Level[FieldLabel=GetFL(i,j,k)]>=QLevel) MK(h, hh, 1) if (h!=i && h!=j && h!=k && inField(i,j,k,h) && - Level[FieldLabel=GetFL(i,j,h)]>=QLevel-1 && - Level[FieldLabel=GetFL(i,h,k)]>=QLevel-1 && - Level[FieldLabel=GetFL(h,j,k)]>=QLevel-1) + Level[GetFL(i,j,h)]>=QLevel-1 && + Level[GetFL(i,h,k)]>=QLevel-1 && + Level[GetFL(h,j,k)]>=QLevel-1) { if ((int)qmin.size()==minField) qmin.pop(); qmin.push((Field){FieldLabel,Area(i,j,k)}); @@ -442,9 +442,9 @@ inline void OutputResult() tot=0; MK(i, ii, 1) MK(j, jj, ii+1) MK(k, kk, jj+1) if (Level[FieldLabel=GetFL(i,j,k)]>=QLevel) nMK(h, hh, 1) if (h!=i && h!=j && h!=k && inField(i,j,k,h) && - Level[FieldLabel=GetFL(i,j,h)]>=QLevel-1 && - Level[FieldLabel=GetFL(i,h,k)]>=QLevel-1 && - Level[FieldLabel=GetFL(h,j,k)]>=QLevel-1) + Level[GetFL(i,j,h)]>=QLevel-1 && + Level[GetFL(i,h,k)]>=QLevel-1 && + Level[GetFL(h,j,k)]>=QLevel-1) { if ((int)qmin.size()==minField) qmin.pop(); qmin.push((Field){FieldLabel,Area(i,j,k)}); @@ -454,9 +454,9 @@ inline void OutputResult() } MK(i, ii, 1) MK(j, jj, ii+1) nMK(k, kk, 1) if (Level[FieldLabel=GetFL(i,j,k)]>=QLevel) MK(h, hh, 1) if (h!=i && h!=j && h!=k && inField(i,j,k,h) && - Level[FieldLabel=GetFL(i,j,h)]>=QLevel-1 && - Level[FieldLabel=GetFL(i,h,k)]>=QLevel-1 && - Level[FieldLabel=GetFL(h,j,k)]>=QLevel-1) + Level[GetFL(i,j,h)]>=QLevel-1 && + Level[GetFL(i,h,k)]>=QLevel-1 && + Level[GetFL(h,j,k)]>=QLevel-1) { if ((int)qmin.size()==minField) qmin.pop(); qmin.push((Field){FieldLabel,Area(i,j,k)}); @@ -478,9 +478,9 @@ inline void OutputResult() tot=0; MK(i, ii, 1) MK(j, jj, ii+1) MK(k, kk, jj+1) if (Level[FieldLabel=GetFL(i,j,k)]>=QLevel) MK(h, hh, 1) if (h!=i && h!=j && h!=k && inField(i,j,k,h) && - Level[FieldLabel=GetFL(i,j,h)]>=QLevel-1 && - Level[FieldLabel=GetFL(i,h,k)]>=QLevel-1 && - Level[FieldLabel=GetFL(h,j,k)]>=QLevel-1) + Level[GetFL(i,j,h)]>=QLevel-1 && + Level[GetFL(i,h,k)]>=QLevel-1 && + Level[GetFL(h,j,k)]>=QLevel-1) { if ((int)qmin.size()==minField) qmin.pop(); qmin.push((Field){FieldLabel,Area(i,j,k)}); diff --git a/HCF-MoreKeys/portal-sample.txt b/HCF-MoreKeys/portal-sample.txt new file mode 100644 index 0000000..509f085 --- /dev/null +++ b/HCF-MoreKeys/portal-sample.txt @@ -0,0 +1 @@ +{"maps":{"idOthers":{"label":"Others","state":1,"bkmrk":{}}},"portals":{"idMoreKeys":{"label":"MoreKeys","state":1,"bkmrk":{"id1495894525260050":{"guid":"fb42ae0c7a4b4ac5b4c1d56fed714a05.16","latlng":"23.334517,116.675998","label":"Stone"},"id1495894525992131":{"guid":"0c551a1ba00346459eb6a9cdf6a1fe5a.11","latlng":"23.335977,116.676696","label":"金山中学大门"},"id1495894526392282":{"guid":"b98e7d867df24d06b954221b0122c5ce.16","latlng":"23.369273,116.706253","label":"裂开的狮子"},"id1495894527176499":{"guid":"c91162d510ad435b96d34283aeb7da76.16","latlng":"23.433004,116.738147","label":"外砂站(同三高速/汕汾高速)"}}},"idOthers":{"label":"Others","state":1,"bkmrk":{"id1495894527476510":{"guid":"11333ba5d4244acdaae6701c6b754bff.16","latlng":"23.359681,116.711976","label":"吉"},"id1495894527772650":{"guid":"6a427584b49a4d89ad571c1a9a2a071f.16","latlng":"23.374765,116.739457","label":"大印象石象"},"id1495894528043733":{"guid":"51058ee3a3d14818ac8bd6e0749aaca5.16","latlng":"23.393093,116.70238","label":"金禧花园"},"id1495894528393861":{"guid":"21fdde5230a54708b90542019ac62e4e.16","latlng":"23.356281,116.690662","label":"Lion Guard Of Chaofeng Hotel"},"id149589452871499":{"guid":"90f4c5d48dac404bb8b3cdf4606cbe75.16","latlng":"23.364266,116.743151","label":"阳光海岸"},"id14958945290021070":{"guid":"1d71fdc2269840d68a137fa69f099f2c.16","latlng":"23.335452,116.676076","label":"塔山胜景"},"id14958945293431152":{"guid":"d9d811c5a2eb4b81a414ddf2bf95dbd4.16","latlng":"23.368722,116.704081","label":"脑袋进水"},"id14958945310751498":{"guid":"600ea6d4acdd4a6c95043d7511958b10.16","latlng":"23.399858,116.711218","label":"亭"},"id14958945317451538":{"guid":"8dd46fd1aa83406d85f9a16324e2ca88.16","latlng":"23.402525,116.712872","label":"舞女"},"id14958945319781680":{"guid":"7fdd01d08ada40dcb65e21e9d1f9fa1e.16","latlng":"23.369818,116.706988","label":"帝景苑游乐园"},"id14958945325241782":{"guid":"a9ca2bba48e449d0ac1015fb73929f62.16","latlng":"23.364831,116.738553","label":"蜈蚣"},"id14958945327841899":{"guid":"995567b06edc4567ae5b018e13fdcf09.16","latlng":"23.415872,116.629799","label":"商碑"},"id14958945330331963":{"guid":"a0de307600d54459a06a10fa6b8bca8f.16","latlng":"23.365026,116.730814","label":"星洲公园"},"id14958945346032154":{"guid":"cdd1185177fc4de3a890d71230015b2b.16","latlng":"23.364458,116.733985","label":"蛋蛋"},"id14958945348812240":{"guid":"683964d50fe54b0bb905c28b8f7e9aa5.16","latlng":"23.409194,116.717481","label":"黄金万两"},"id14958945354062322":{"guid":"1f962dc3a9984de5bacfdec15c5d6e35.16","latlng":"23.372187,116.735592","label":"众神古庙和大榕树"},"id14958945357212430":{"guid":"0c9c6fbe732d4261bcc88e6de4cc9d52.16","latlng":"23.36191,116.708637","label":"Lion Sculpture"},"id14958945402752640":{"guid":"6819a4ce88874d37855cb986a725a247.16","latlng":"23.405344,116.719239","label":"创美药业"},"id14958945408832762":{"guid":"fd1fdba42b6145ec86f2e860b158c8ca.16","latlng":"23.351153,116.762068","label":"柏佳半岛钟楼"},"id14958945432183050":{"guid":"e20356b0cc084dc38fdbd40445452846.16","latlng":"23.369472,116.676847","label":"衔着木棍的狮子"},"id14958945434793130":{"guid":"001c79a5c93c496dbae0fb4ff160db1e.16","latlng":"23.346586,116.755846","label":"方特欢乐世界"},"id14958945437513231":{"guid":"b44dba00086b4e57ab63cd475cbbc15b.16","latlng":"23.419995,116.628592","label":"大菊花"},"id1495894544553334":{"guid":"cc0a3fdfe84c4ab28767e579f9b1a30c.16","latlng":"23.361863,116.736293","label":"广场的乒乓桌"},"id14958945448803457":{"guid":"4906ad03274e4ac2a3c0ebe681aa9f95.16","latlng":"23.420075,116.628096","label":"大刺猬"},"id1495894545771353":{"guid":"94e3c9d278964a11bc0843155651604c.16","latlng":"23.36288,116.733315","label":"hellokitty"},"id14958945460193669":{"guid":"465e4e06c02b4c6fb6a44a2b48c36684.16","latlng":"23.359876,116.73552","label":"湖中亭"},"id14958945463283748":{"guid":"3db3a7dfb66d4e17a1e5a79ff14f8efe.16","latlng":"23.419544,116.626517","label":"花洒"},"id14958945466503835":{"guid":"0323106290c94985bd18a7d46c0332fc.16","latlng":"23.367942,116.704055","label":"中华世纪坛"},"id14958945479203998":{"guid":"11ac2c24ae834273be4781dcb61353e7.16","latlng":"23.36092,116.735603","label":"推背"},"id1495894548194405":{"guid":"38b35028503246a1b1d9800fe6a1065d.16","latlng":"23.353631,116.691179","label":"两坨球状大腿"},"id14958945484684126":{"guid":"ad8cdd2a6a854078a30b325b18d7f3a1.16","latlng":"23.372959,116.69835","label":"陵園麒麟壁"},"id14958945489664245":{"guid":"698476a8d2c741f9b8b6ea84dffae308.16","latlng":"23.361407,116.735979","label":"星湖潮乐社"},"id1495894549276434":{"guid":"d663187d8ada4390bbe1adb6bda7a63b.16","latlng":"23.358818,116.702343","label":"滑梯"},"id14958945496444454":{"guid":"0f7788c1500949ffa5505b7e78eccdda.16","latlng":"23.353605,116.692397","label":"欢乐小姑娘"},"id14958945511204650":{"guid":"8809c24f215a419a93ebeeb78e2d19c6.16","latlng":"23.353483,116.692588","label":"大娃娃"},"id14958945513954719":{"guid":"0f2d5d2575ac4cda8cf7118fb3525145.11","latlng":"23.359963,116.705929","label":"汕头协华大厦"},"id14958945555804875":{"guid":"aab8fbb6ddd84d948d4ef887e0cc3812.16","latlng":"23.336512,116.689359","label":"Pagoda"},"id14958945558904967":{"guid":"e238e0e12fa948419fd6f50e636d92b2.16","latlng":"23.336388,116.689696","label":"石狮子"},"id14958945561645068":{"guid":"e5f9fbfe2e494d7ea3b9f621fc6277fb.16","latlng":"23.336534,116.688745","label":"Place of Worship"},"id14958945564595141":{"guid":"c98546b872bc4b418a8c400615cae7b4.16","latlng":"23.336762,116.688735","label":"Looking Back to the Entrance Hall"},"id14958945567135221":{"guid":"35b8b8b63b314a4f92107a2deac2daec.16","latlng":"23.336624,116.690028","label":"Pig Monk"},"id14958945573145329":{"guid":"ce38aa4feeb344f0baa802002cd364db.16","latlng":"23.336945,116.68891","label":"Guardians of the World"},"id14958945577085449":{"guid":"4158d244df86400e9c33ccaa03fadbe3.16","latlng":"23.336388,116.690172","label":"Guanyin Fountain"},"id14958945586515575":{"guid":"92b67f3e276f4031a5db5aa033a51667.16","latlng":"23.368622,116.69964","label":"水池…"},"id14958945589305672":{"guid":"c68e1884028a4491bdc3752ee4ef2ed5.16","latlng":"23.36628,116.73969","label":"仿古驿站"},"id14958945591935792":{"guid":"1d17de27a58a4a4f8d21bcea8e196f3a.16","latlng":"23.378852,116.676096","label":"踩着球的麒麟"},"id14958945594905845":{"guid":"20cd7860d82742adb1ad2250fafc397e.16","latlng":"23.375478,116.704974","label":"小区景观"},"id14958945597545978":{"guid":"6be60c6a9c8a4215a38c54eb6f4509c3.16","latlng":"23.369794,116.7007","label":"保龄球"},"id14958945600236071":{"guid":"290fcf8d82f548038be7cfc0c47ff73a.16","latlng":"23.372927,116.696944","label":"石象子"},"id14958945602796149":{"guid":"0a4e426fecba435485334275027fe3fe.16","latlng":"23.369315,116.701892","label":"超聲儀器研究所"},"id14958945605386275":{"guid":"8207668ee6414bf9ad389c045a0ceb24.16","latlng":"23.367017,116.696273","label":"步行街正门"},"id14958945608086318":{"guid":"39c17a51b0bb4cb1aa81187b435e90db.16","latlng":"23.372767,116.702186","label":"精灵Q密"},"id14958945614266444":{"guid":"5992cf034df14ede96913de7dbcf125e.16","latlng":"23.373851,116.704606","label":"奇葩的东西"},"id14958945618136564":{"guid":"213c2fd0aef540b2a7a3646ee6d6af5e.16","latlng":"23.369355,116.696275","label":"交行靠里面的石狮子"},"id1495894562106665":{"guid":"1988223f58d441f5bdb6f230f2673ed0.16","latlng":"23.365575,116.738776","label":"蘑菇亭"},"id1495894562424673":{"guid":"f352113d23f149499c65cdf74a9901f6.16","latlng":"23.367525,116.740374","label":"白亭北"},"id14958945635866877":{"guid":"22f0b0eba02c4d248bd5e12fba8063f7.16","latlng":"23.405841,116.673075","label":"金隔狮"},"id14958945644096996":{"guid":"e8eac33cb56a480fb4dfc13e79032481.16","latlng":"23.369103,116.697586","label":"欢乐的狮子"},"id1495894565288705":{"guid":"fe5ae9cc5a724cdc88ba64e2f9d83892.16","latlng":"23.366082,116.739091","label":"mushroom booth"},"id14958945670187249":{"guid":"db352010793d4f33b905a8068117ea20.16","latlng":"23.369039,116.699493","label":"黑狮子"},"id14958945673097358":{"guid":"f9cb68c4333e480b8824b891e66b5709.16","latlng":"23.406063,116.70558","label":"关帝古庙"},"id14958945675767442":{"guid":"84c7b86efb3448cbb560dd624bc813c1.16","latlng":"23.404252,116.70348","label":"辛氏泗祖祠"},"id14958945678577511":{"guid":"70818246d8244b63adc12b0d98c75550.16","latlng":"23.399889,116.701411","label":"宝塔"},"id14958945681217655":{"guid":"b4e4e06426774ef898c831d0f933cefc.16","latlng":"23.401316,116.702524","label":"辛氏祖祠"},"id14958945683657719":{"guid":"8c25fe753554408f827fe956b771d681.16","latlng":"23.400318,116.701223","label":"浮隴三山國王古廟"},"id14958945686037824":{"guid":"15107060ca5d41e286e9bd78c5f9e1d0.16","latlng":"23.41536,116.717366","label":"纪氏大宗祠"},"id14958945698897927":{"guid":"3d36b2da812640769ca0ad8f5b26f608.16","latlng":"23.402056,116.702343","label":"福德祠"},"id14958945701498091":{"guid":"29a77e121e734ba8930abee194c2a792.16","latlng":"23.411804,116.713775","label":"佛教圣地"},"id14958945706818239":{"guid":"0e68e6836ee84409973fc42ed9c2cfe8.16","latlng":"23.402638,116.677262","label":"麒麟园挡风"},"id14958945709358340":{"guid":"05551ea6f6b24d4092bd41864284fd0c.16","latlng":"23.402818,116.677082","label":"豹子石雕"},"id14958945716258491":{"guid":"a3827240953b40af905593070211f7b1.16","latlng":"23.40347,116.677021","label":"麒麟丸"},"id14958945722468529":{"guid":"5ce07bbc2e5343309c1ed6acfc7a586b.16","latlng":"23.398687,116.675818","label":"太安堂"},"id14958945727888726":{"guid":"76719ddb1a054f89980e91b4860fb367.16","latlng":"23.421131,116.625643","label":"石鸡"},"id14958945748518980":{"guid":"a0f3e0e0da0f41e1ad15d1ba9f956f05.16","latlng":"23.417356,116.625455","label":"花园路里的兔子"},"id14958945761499082":{"guid":"2708b932692744a1920e1d150f3ce0fe.16","latlng":"23.414175,116.71676","label":"壁画"},"id14958945765549134":{"guid":"42eda34c759445d48ce8c460dae714d2.16","latlng":"23.417905,116.627035","label":"足球场"},"id14958945781909262":{"guid":"9d5886521cf84a419ea8c64049a3e326.16","latlng":"23.420538,116.626028","label":"满江红"},"id14958945784699353":{"guid":"3ba241ee12934c37a5391f124feb6794.16","latlng":"23.410299,116.712586","label":"骑豚小孩"},"id14958945787709463":{"guid":"9787d67e9851482c9c41516eb1e789bf.16","latlng":"23.417771,116.625274","label":"汕头的站"},"id14958945790429598":{"guid":"f05025da8c954ff8a1aed3da53f6c5da.16","latlng":"23.417769,116.623365","label":"汕头地震台体应变观测井"},"id14958945793139689":{"guid":"87f62295b7f34fba936c9d0b4f7dc9e6.16","latlng":"23.421373,116.625779","label":"铁云"},"id1495894579894989":{"guid":"03c74210882c427e9676941c48c7ce90.16","latlng":"23.418309,116.625462","label":"水库下的石林"},"id14958945805449929":{"guid":"e9bdfc1a360141d7beb2b3bda4cc3045.16","latlng":"23.417567,116.627538","label":"汕大体育公园"}}}}} \ No newline at end of file