Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Konano committed Jul 9, 2018
1 parent f56da85 commit 89acb68
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 22 deletions.
44 changes: 22 additions & 22 deletions HCF-MoreKeys/morekey.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <cstdio>
//#include <cmath>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <string>
Expand Down Expand Up @@ -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)});
Expand All @@ -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)});
Expand All @@ -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)});
Expand All @@ -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)});
Expand All @@ -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)});
Expand All @@ -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)});
Expand All @@ -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)});
Expand Down
1 change: 1 addition & 0 deletions HCF-MoreKeys/portal-sample.txt
Original file line number Diff line number Diff line change
@@ -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":"��•�x���о���"},"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":"���]��ɽ�����ŏR"},"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":"�Ǵ�������԰"}}}}}

0 comments on commit 89acb68

Please sign in to comment.