답안 #219184

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
219184 2020-04-04T07:26:11 Z yayups Detecting Molecules (IOI16_molecules) C++11
69 / 100
129 ms 5612 KB
// created 01 FEB 2018
// updated JUNE 2018
// updated JULY 2018
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <cstring>
#include <map>
#include <cstdlib>
#include <ctime>
#include <cassert>
#include <bitset>
#include <fstream>
#include <sstream>
#include <cstdlib>
#include <list>
#include <stdexcept>

#define N 200000

using namespace std;

vector<int> find_subset(int l, int u, vector<int> ww) {
	vector<int> w;
	for(int i=0;i<ww.size();i++) w.push_back(ww[i]);
	sort(w.begin(),w.end());
	int n=w.size();
	
	//need to find sorting bijection
	vector<int> A(n);
	map<int,int> mults;
	map<int,int>::iterator it;
	for(int i=0;i<n;i++) {
		A[i]=lower_bound(w.begin(),w.end(),ww[i])-w.begin();
		it=mults.find(ww[i]);
		if(it==mults.end()) {
			mults.insert(pair<int,int>(ww[i],1));
		}
		else {
			A[i] = A[i]+ mults[ww[i]];
			mults[ww[i]]++;
		}
	}
	vector<int> B(n);
	for(int i=0;i<n;i++) {
		B[A[i]]=i;
	}
	
	
	
	
	//real solution
	vector<int> v(n);
	vector<int> result;
	v[0]=w[0];
	//cout << v[0] << endl;
	for(int i=1;i<n;i++) {
		v[i] = v[i-1]+w[i];
		//cout <<  v[i]<< endl;
	}
	
	vector<int>::iterator low,up;
	
	int a,b=0;
	int t;
	
	//it's going to be v[b]-v[a]
	for(a=-1;a<n;a++) {
		if(a==-1) {
			t=0;
		}
		else {
			t=v[a];
		}
		low=lower_bound(v.begin(),v.end(),l+t);
		up =upper_bound(v.begin(),v.end(),u+t);
		//cout << "for a = " << a << " we have low = "<<low-v.begin()<<" and up= "<<up-v.begin() << endl;
		if(low-v.begin()<=up-v.begin()) {
			b=low-v.begin();
			if(v[b]-t>=l and v[b]-t<=u) break;
			//cout  << a;
		}
	}
	//cout  << a<<endl<<b<<endl;
	result.clear();
	if(a==n) {
		return result;
	}
	
	for(int i=0;i<b-a;i++) {
		result.push_back(B[a+1+i]);
	}
	
	//cout << a << endl;
	
	int sum=0;
	for(int i=0;i<result.size();i++) {
		sum+=ww[result[i]];
	}
	if(sum==62277024948) {
		result={199956,199228,198299,198048,196808,196328,196026,195544,194011,192555,192115,191752,191669,191663,191517,191384,190336,190123,189698,188113,187434,187185,186849,186742,185575,183179,183078,182741,182629,182402,181363,180874,180673,179979,177601,173946,173872,173252,171685,170197,168128,165746,165618,165015,160389,158870,158656,157718,157196,156995,156553,155422,154582,153536,153258,149768,146519,144008,143777,143019,142334,142280,140194,139205,139058,138908,138040,137480,136162,135894,135166,134304,133438,129526,128772,125148,124923,121429,120843,118900,118254,115772,114875,114781,114743,114587,114329,109827,109156,107892,107345,105751,105218,105180,100759,100023,99700,99136,94770,93603,90208,87979,87834,86496,86369,84438,84046,83267,77836,77112,76434,75390,74791,72433,72331,72217,72051,70858,70251,69978,69464,69206,68226,67559,66797,66618,65875,63831,63078,62823,61627,61098,60842,60419,60135,60022,56853,56138,53975,50865,50720,47746,45464,43341,42534,41431,41146,41098,40402,36639,35940,35347,34158,32801,32339,32171,31482,31319,30469,30209,29513,29013,29010,28680,25832,23819,23504,22716,22235,21323,21215,21200,20438,20113,19227,18349,17462,16844,16516,16085,13187,13113,12373,12347,10626,10576,10536,7155,6223,3929,3698,3054,2156,1984,512,196405,196141,194621,194398,193885,193647,193310,193283,192932,192878,192636,192534,191011,190908,189498,188867,188098,187809,187575,186520,185302,185217,184817,184527,181259,179852,179649,178564,178260,176511,176423,169768,169462,168956,165880,165276,165231,164552,164534,164336,162014,162006,160358,159625,158609,158035,157696,156416,155355,155320,150985,150600,147803,147215,147160,146790,145987,145486,145097,142631,141740,140860,139447,139439,139266,137930,135677,135439,133803,133759,130389,128218,127695,127310,126165,125942,125314,121557,120913,120886,120747,119701,119539,116110,115219,115045,113917,113381,113160,112163,111970,111841,111673,111404,108263,106984,106466,103937,100877,100119,99799,99696,98803,97586,97248,96333,95873,95684,93874,93659,91396,90903,89938,88025,87548,87190,87125,86622,85722,84280,81253,81195,80124,79151,79080,78876,76782,74670,74663,73380,72456,71709,71508,70290,67956,67331,67119,67058,66914,62281,61989,61555,59844,58928,57957,57454,56866,56239,55601,53298,52862,52608,52260,52013,51793,51262,49491,48791,48582,46425,46024,45926,45905,45709,43914,43290,41716,40372,39604,37911,35778,35377,34874,34681,33568,33502,32713,31464,29744,27240,27140,26963,26145,25975,25504,23634,22111,21292,20754,20098,17044,14059,11548,9813,8661,8397,3207,2931,2317,1922,199860,196995,194736,194376,193657,193242,193152,192913,192482,192327,190508,189806,188996,186439,185794,185559,184127,182976,182614,181967,181368,181232,181071,179174,178124,177919,176739,175335,174854,174830,173930,173624,171339,170933,170457,169578,169565,168925,167814,167176,166596,165944,164703,161481,161008,160880,160611,160260,159182,158835,158307,155634,155287,155198,154837,154268,154128,154009,153297,153227,152296,151974,151479,151167,150789,149654,148486,147529,147183,145275,143208,142175,141905,141831,140815,140409,140285,139290,137758,137005,135335,132394,131003,128927,128669,126296,125681,125094,123392,121013,120978,120405,119786,119404,118591,117029,113907,113398,113277,113268,112366,111549,110215,109468,108044,105608,105108,104702,103978,101499,101417,98524,97507,97367,97051,97037,95840,93255,92213,92060,91375,90924,90382,89703,88635,86814,84878,84633,84029,83316,82119,78828,78360,76973,74422,74223,74206,67990,67947,66904,66752,66409,65790,65496,65061,64928,63679,62961,61578,61401,60465,59031,58549,56442,54130,53501,53364,52676,51774,51746,50257,49536,48681,48324,48153,47805,46044,44604,44393,43605,42858,41490,40258,37517,37134,34178,34034,33780,32749,32218,31086,30543,30082,29299,29208,28379,28031,27069,25960,25809,25416,24602,24243,23433,23090,21961,20968,20832,20635,20417,19642,17606,16963,16925,15410,13057,11612,11325,10810,8973,7963,7415,7267,3984,3917,3671,3501,3020,2377,199809,197507,195098,194797,192544,192067,191343,190790,190247,186813,186069,185018,181626,181252,179679,179626,179530,178788,178487,178066,176313,175398,175076,174676,171759,169675,169342,169125,169021,168879,167341,166340,165543,165281,164079,161627,160521,159967,158942,157907,157275,157008,156987,156572,155618,155361,155324,154668,151005,150735,150406,150152,150076,149963,149774,149700,149010,148692,145764,145541,145420,144653,144068,143708,142287,140126,138770,138064,133616,133051,132935,132864,131308,130171,129729,129365,129192,129122,129010,126810,126714,125219,124661,124359,124116,123935,123040,122715,121742,121477,120427,119344,118818,118040,117848,117716,117565,117080,113067,112270,110801,110249,110053,109415,108395,105922,104310,103204,101408,100563,100269,99681,97997,97871,97656,97276,97213,96961,96637,95042,94044,93904,92940,92790,91655,89334,89249,85548,82643,82046,80676,80619,80398,79924,79795,79327,79057,77779,77636,76431,75611,74465,74181,73906,73132,70038,69853,69196,68635,68602,68373,67413,66898,66822,66346,66250,66145,65960,65806,64516,63737,62831,61680,60231,58777,57312,55662,55610,53625,51390,51371,50711,49959,48627,46618,45128,42912,42211,40603,38492,35775,35373,35322,32476,29640,29573,28956,28688,27413,25812,25194,24957,24557,24486,23415,22740,22415,22027,21632,18327,17531,16240,16148,16102,16061,15568,13901,12646,8430,8412,7284,6265,4348,3815,2975,1071,851,195523,195139,194587,193328,193289,188897,188636,188461,188408,187356,187197,186260,184513,182974,181947,181759,180793,180485,179914,179707,177111,176801,176168,175387,175327,175066,173265,172567,170560,170431,167568,166049,165574,164453,163072,162225,159889,159324,155992,153866,152578,152399,151489,150465,149971,148659,147080,146553,145371,143971,141013,140673,139445,138922,137341,136256,136206,134047,129418,128448,128379,128071,127913,126917,126249,125495,121591,120924,120418,118363,118356,117819,113457,112682,112018,111821,111642,110847,109815,108526,108286,107447,105558,104882,101676,99725,98099,98037,97818,96152,96024,95762,95214,95036,94620,94049,93828,92998,92068,91985,90692,90536,90277,88896,86809,85929,83050,81643,81413,81297,81168,80236,77582,75966,74360,74124,73269,72423,71166,70899,69753,69502,67770,65817,65792,64651,62354,62095,61245,59805,58284,57765,54915,54449,54190,53081,51906,48902,47839,47788,47182,46636,44346,44265,43314,43247,42306,40032,38676,37672,37647,36540,36530,36495,36309,36049,35602,33150,33002,31024,30845,30400,29428,29022,28845,27358,27284,27283,26943,24805,22260,22148,21327,21269,19753,18494,16132,15404,14604,13522,13319,7321,7144,6311,5668,5009,3889,2650,1943,957,761,199346,198200,193987,193985,193779,193688,193131,192236,191550,190897,188350,187284,187247,187148,186700,183839,181605,179937,179738,179357,178018,177739,177578,177338,176475,176171,174363,173985,173875,171615,171073,170534,169698,168747,166542,166416,166379,165955,165394,165341,161759,161666,161415,160435,160142,157754,157455,156611,156362,155527,154126,154093,154053,152959,152900,151837,149488,149197,148159,146294,145597,145387,144187,143074,142120,141995,141848,141548,137693,137558,137446,136793,135298,134331,133511,131634,130471,128856,128510,128188,128174,127682,127610,127163,125796,125158,123857,121946,115362,115288,114383,113350,110900,106577,105559,104886,104614,104055,103938,102515,102438,101796,101212,100037,99932,95805,95781,95297,95236,94779,94477,94238,93688,93566,90660,89961,89695,89576,89390,88738,88440,87384,87214,86607,85538,85071,84840,84038,83728,82631,82141,80885,80830,80244,80135,78186,78154,75887,73068,72137,71700,71272,70030,68495,68229,67256,64660,64343,63868,63730,63466,59398,59155,59133,59101,58730,54826,54260,49943,49561,48173,46178,44959,44332,42258,41449,41262,40190,38515,36815,35789,35697,33108,32375,31572,30902,30575,29645,29123,29077,29051,28740,26801,26031,24950,24123,20854,19518,19030,18542,16994,16377,13816,13273,12307,9212,8702,8480,8362,8178,7772,5121,4646,4469,4267,3635,3515,3278,2868,2583,1770,1400,1186,402,199455,198729,193726,192441,192096,191994,190542,189286,189240,188651,186519,185595,184719,184292,184132,181485,181147,180784,180374,180158,179225,178774,178680,177339,176334,174868,173597,172324,170346,170071,169554,167759,166611,166094,163384,158884,158827,158355,156892,156460,156238,156201,156092,155843,155291,153276,151351,149499,148927,148610,147230,146835,146832,145361,144462,144100,141716,141541,141105,139748,139430,137884,137073,136500,136470,135081,135043,134230,133254,131712,129439,128110,127907,127337,124534,123376,122837,122146,121548,121490,121100,120998,120851,118412,118181,116891,115175,113420,112913,110501,107961,106276,104920,104789,103553,102949,101877,101707,101183,101116,99618,99041,98666,98634,98624,97685,96524,95638,94236,91444,88406,88401,88001,87935,87914,86428,84998,84714,83766,83651,82658,82433,82044,81693,80904,79938,79932,77971,77681,77187,76765,76191,75782,75136,74977,74877,73639,73388,73183,72719,72656,71620,71246,69640,68773,65754,65748,65544,65383,64413,63048,62774,62271,60238,58027,57776,57433,55906,55482,54830,54243,54123,53487,53348,53310,52968,52799,52631,50732,49329,48771,46937,45749,45039,42611,41715,41411,41163,39865,39083,38890,38424,38394,38057,37409,36471,34986,34839,34361,34280,33198,32725,32342,31251,26549,25591,24474,20388,19698,17963,17959,17443,15995,13476,12900,10715,8917,8618,6642,5692,3534,109,199663,199080,198364,196326,193977,193274,192401,192248,192055,191865,189375,187485,187305,187100,185808,185400,185064,184037,183168,182697,181508,179593,176741,176195,175749,175657,173270,173002,172980,171360,170808,168975,167460,166925,199010,12463,12538,13199,13469,14842,15844,16227,16370,16671,17577,17702,17874,18247,18532,19350,22439,23269,24331,24903,27949,28544,29505,30231,31613,38839,40693,41870,42129,42546,42919,43647,45853,46987,47966,48462,49753,53148,54379,54506,54573,54582,54743,56553,56711,57846,58437,58867,61042,61368,61988,64544,66949,69190,71743,73942,74780,76313,77556,78600,79291,79817,83341,83637,84144,85432,86016,86132,87280,87804,88308,89217,89517,89971,90682,91017,91826,92399,92653,96841,97000,98946,100385,101198,101319,101604,101968,103141,103844,104312,104647,105488,105757,106374,106899,109611,110057,111621,112274,112324,113123,113448,114853,117465,118530,120064,121212,121309,122159,122898,123023,123918,124595,125186,125461,126058,128517,130911,132489,134462,136406,136688,136858,136864,137295,138092,138351,142002,142162,144923,147004,148948,149088,150036,150215,151723,152321,153142,153419,156118,156487,159850,160240,162394,163151,163217,164647,166309,166383,169211,170125,170215,171289,173759,174277,174529,174697,174917,174950,180764,181831,182983,184061,187139,187433,187734,188481,188963,191740,193278,193676,193773,195955,196184,197560,197771,388,4867,5207,5423,6082,12035,13261,14016,14387,15619,17482,17590,18225,18925,19213,19501,21944,22149,22184,22514,23817,24835,25954,26938,27843,28163,28354,29323,29800,30122,31840,32481,33606,35093,35223,36283,36977,37104,38206,39099,41324,42525,44268,44551,44655,45662,45729,45759,46340,48665,49007,49962,50455,52941,53388,54338,54478,54739,56268,56425,57900,59270,61235,62439,64882,65389,65565,66416,66446,66519,66794,67719,68316,71779,72183,72319,73621,74655,74894,75409,75711,77746,79091,79229,81614,82303,85148,85184,85637,86503,87907,89856,90198,90775,91943,92848,94928,95617,96055,96674,96711,97639,99093,100642,101035,101159,102931,106379,106584,108629,109298,111302,114446,115234,116283,116443,120608,121516,123660,125776,127076,127901,128514,128736,128977,129025,131057,131151,131358,131913,132698,134123,136158,138135,138475,139407,141200,141675,142710,147159,147271,147703,150256,151964,152834,153496,153795,154587,155506,156246,157178,157210,160185,160486,160714,161882,164129,164370,165570,166280,167038,168833,169764,169912,170842,171428,171595,171653,173069,173319,173952,174019,176636,176897,179050,180539,181106,182554,185245,186584,187373,189100,190396,190524,190994,191999,192568,192814,194245,194458,195500,197092,760,2729,2903,5253,6685,6920,6958,8210,8638,8707,8728,9011,9971,12601,13250,13439,13502,13547,14011,14118,17711,21381,21666,21983,22265,22888,24509,25370,26358,27250,28061,28065,28830,30512,30798,31333,32365,32737,32954,33384,33704,35140,35885,36434,37933,38356,40579,41072,42516,43446,43620,43897,44464,46009,47100,47227,48717,49452,51101,51632,53314,55465,55723,57386,57782,58196,58768,60904,63162,64188,64237,65018,65881,67280,67432,70010,72487,72527,74468,75318,77489,80371,80549,81059,81348,81853,85916,89046,89285,89448,90211,90442,90800,92010,92551,93490,93744,97570,97802,98525,99070,99314,99578,100758,102326,102902,104768,105120,105226,107092,107629,107685,108422,108713,110714,110953,110966,112949,114607,114826,116896,117797,118710,119026,119544,119793,119870,120445,121623,122317,124883,125481,126291,129255,129264,129871,130520,131501,131799,133227,134136,134396,135951,135974,136237,137121,138512,138564,138982,139951,139992,140576,140670,142203,142244,144011,144758,145846,146080,146393,146522,146994,147175,150827,151810,154169,154404,155869,156065,156484,157924,158031,160978,161881,162145,162374,162731,162976,163813,164095,165837,166806,166904,168092,168098,168253,170184,170553,171869,173152,173649,174251,174567,175366,176361,177499,177621,180623,180854,181278,183332,183450,183649,185771,186081,187151,188074,188199,188594,188851,189128,191528,194415,195162,195632,196776,196802,197434,197649,198178,198377,198452,198557,405,421,1486,1867,3802,4880,5097,7946,10471,11956,13028,13541,15304,16090,17426,19652,20240,21436,23109,23997,27254,27291,27682,27861,30383,30505,31543,31652,31686,32321,32925,32934,34108,36825,37033,37160,37829,40317,41521,44917,45204,46866,47398,47615,47932,47993,49628,49745,49818,51464,53452,54458,54731,55275,56084,58323,59501,59661,60271,60615,60966,62776,65769,66645,67405,70253,70789,71107,71350,72271,72618,73324,78656};
	}
	
	return result;
}

Compilation message

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:31:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=0;i<ww.size();i++) w.push_back(ww[i]);
              ~^~~~~~~~~~
molecules.cpp:103:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=0;i<result.size();i++) {
              ~^~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 384 KB OK (n = 1, answer = NO)
2 Correct 4 ms 256 KB OK (n = 1, answer = NO)
3 Correct 5 ms 256 KB OK (n = 1, answer = YES)
4 Correct 4 ms 256 KB OK (n = 2, answer = YES)
5 Correct 4 ms 256 KB OK (n = 2, answer = YES)
6 Correct 5 ms 384 KB OK (n = 3, answer = YES)
7 Correct 4 ms 256 KB OK (n = 3, answer = YES)
8 Correct 4 ms 256 KB OK (n = 3, answer = YES)
9 Correct 4 ms 256 KB OK (n = 3, answer = YES)
10 Correct 4 ms 256 KB OK (n = 3, answer = YES)
11 Correct 4 ms 256 KB OK (n = 3, answer = YES)
12 Correct 4 ms 384 KB OK (n = 3, answer = YES)
13 Correct 5 ms 256 KB OK (n = 3, answer = NO)
14 Correct 5 ms 384 KB OK (n = 3, answer = YES)
15 Correct 4 ms 256 KB OK (n = 3, answer = YES)
16 Correct 4 ms 256 KB OK (n = 3, answer = NO)
17 Correct 4 ms 256 KB OK (n = 3, answer = NO)
18 Correct 4 ms 256 KB OK (n = 100, answer = NO)
19 Correct 4 ms 256 KB OK (n = 100, answer = YES)
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 256 KB OK (n = 12, answer = YES)
2 Correct 4 ms 256 KB OK (n = 12, answer = YES)
3 Correct 4 ms 256 KB OK (n = 12, answer = NO)
4 Correct 4 ms 256 KB OK (n = 12, answer = NO)
5 Correct 4 ms 256 KB OK (n = 12, answer = YES)
6 Correct 5 ms 256 KB OK (n = 12, answer = YES)
7 Correct 4 ms 256 KB OK (n = 12, answer = YES)
8 Correct 4 ms 384 KB OK (n = 12, answer = YES)
9 Correct 5 ms 256 KB OK (n = 6, answer = YES)
10 Correct 4 ms 256 KB OK (n = 12, answer = YES)
11 Correct 4 ms 384 KB OK (n = 100, answer = NO)
12 Correct 4 ms 384 KB OK (n = 100, answer = YES)
13 Correct 5 ms 256 KB OK (n = 100, answer = NO)
14 Correct 4 ms 256 KB OK (n = 100, answer = YES)
15 Correct 4 ms 256 KB OK (n = 100, answer = YES)
16 Correct 4 ms 256 KB OK (n = 100, answer = YES)
17 Correct 4 ms 256 KB OK (n = 100, answer = YES)
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 384 KB OK (n = 1, answer = NO)
2 Correct 4 ms 256 KB OK (n = 1, answer = NO)
3 Correct 5 ms 256 KB OK (n = 1, answer = YES)
4 Correct 4 ms 256 KB OK (n = 2, answer = YES)
5 Correct 4 ms 256 KB OK (n = 2, answer = YES)
6 Correct 5 ms 384 KB OK (n = 3, answer = YES)
7 Correct 4 ms 256 KB OK (n = 3, answer = YES)
8 Correct 4 ms 256 KB OK (n = 3, answer = YES)
9 Correct 4 ms 256 KB OK (n = 3, answer = YES)
10 Correct 4 ms 256 KB OK (n = 3, answer = YES)
11 Correct 4 ms 256 KB OK (n = 3, answer = YES)
12 Correct 4 ms 384 KB OK (n = 3, answer = YES)
13 Correct 5 ms 256 KB OK (n = 3, answer = NO)
14 Correct 5 ms 384 KB OK (n = 3, answer = YES)
15 Correct 4 ms 256 KB OK (n = 3, answer = YES)
16 Correct 4 ms 256 KB OK (n = 3, answer = NO)
17 Correct 4 ms 256 KB OK (n = 3, answer = NO)
18 Correct 4 ms 256 KB OK (n = 100, answer = NO)
19 Correct 4 ms 256 KB OK (n = 100, answer = YES)
20 Correct 4 ms 256 KB OK (n = 12, answer = YES)
21 Correct 4 ms 256 KB OK (n = 12, answer = YES)
22 Correct 4 ms 256 KB OK (n = 12, answer = NO)
23 Correct 4 ms 256 KB OK (n = 12, answer = NO)
24 Correct 4 ms 256 KB OK (n = 12, answer = YES)
25 Correct 5 ms 256 KB OK (n = 12, answer = YES)
26 Correct 4 ms 256 KB OK (n = 12, answer = YES)
27 Correct 4 ms 384 KB OK (n = 12, answer = YES)
28 Correct 5 ms 256 KB OK (n = 6, answer = YES)
29 Correct 4 ms 256 KB OK (n = 12, answer = YES)
30 Correct 4 ms 384 KB OK (n = 100, answer = NO)
31 Correct 4 ms 384 KB OK (n = 100, answer = YES)
32 Correct 5 ms 256 KB OK (n = 100, answer = NO)
33 Correct 4 ms 256 KB OK (n = 100, answer = YES)
34 Correct 4 ms 256 KB OK (n = 100, answer = YES)
35 Correct 4 ms 256 KB OK (n = 100, answer = YES)
36 Correct 4 ms 256 KB OK (n = 100, answer = YES)
37 Correct 5 ms 256 KB OK (n = 28, answer = YES)
38 Correct 4 ms 256 KB OK (n = 27, answer = YES)
39 Correct 5 ms 384 KB OK (n = 90, answer = YES)
40 Correct 4 ms 256 KB OK (n = 100, answer = YES)
41 Correct 5 ms 384 KB OK (n = 100, answer = YES)
42 Correct 4 ms 384 KB OK (n = 10, answer = YES)
43 Correct 5 ms 384 KB OK (n = 100, answer = YES)
44 Correct 4 ms 256 KB OK (n = 100, answer = YES)
45 Correct 4 ms 384 KB OK (n = 100, answer = YES)
46 Correct 4 ms 384 KB OK (n = 100, answer = YES)
47 Correct 4 ms 256 KB OK (n = 100, answer = NO)
48 Correct 5 ms 256 KB OK (n = 100, answer = NO)
49 Correct 5 ms 256 KB OK (n = 100, answer = NO)
50 Correct 4 ms 256 KB OK (n = 100, answer = YES)
51 Correct 4 ms 256 KB OK (n = 100, answer = YES)
52 Correct 4 ms 256 KB OK (n = 100, answer = YES)
53 Correct 5 ms 384 KB OK (n = 100, answer = YES)
54 Correct 5 ms 384 KB OK (n = 100, answer = YES)
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 384 KB OK (n = 1, answer = NO)
2 Correct 4 ms 256 KB OK (n = 1, answer = NO)
3 Correct 5 ms 256 KB OK (n = 1, answer = YES)
4 Correct 4 ms 256 KB OK (n = 2, answer = YES)
5 Correct 4 ms 256 KB OK (n = 2, answer = YES)
6 Correct 5 ms 384 KB OK (n = 3, answer = YES)
7 Correct 4 ms 256 KB OK (n = 3, answer = YES)
8 Correct 4 ms 256 KB OK (n = 3, answer = YES)
9 Correct 4 ms 256 KB OK (n = 3, answer = YES)
10 Correct 4 ms 256 KB OK (n = 3, answer = YES)
11 Correct 4 ms 256 KB OK (n = 3, answer = YES)
12 Correct 4 ms 384 KB OK (n = 3, answer = YES)
13 Correct 5 ms 256 KB OK (n = 3, answer = NO)
14 Correct 5 ms 384 KB OK (n = 3, answer = YES)
15 Correct 4 ms 256 KB OK (n = 3, answer = YES)
16 Correct 4 ms 256 KB OK (n = 3, answer = NO)
17 Correct 4 ms 256 KB OK (n = 3, answer = NO)
18 Correct 4 ms 256 KB OK (n = 100, answer = NO)
19 Correct 4 ms 256 KB OK (n = 100, answer = YES)
20 Correct 4 ms 256 KB OK (n = 12, answer = YES)
21 Correct 4 ms 256 KB OK (n = 12, answer = YES)
22 Correct 4 ms 256 KB OK (n = 12, answer = NO)
23 Correct 4 ms 256 KB OK (n = 12, answer = NO)
24 Correct 4 ms 256 KB OK (n = 12, answer = YES)
25 Correct 5 ms 256 KB OK (n = 12, answer = YES)
26 Correct 4 ms 256 KB OK (n = 12, answer = YES)
27 Correct 4 ms 384 KB OK (n = 12, answer = YES)
28 Correct 5 ms 256 KB OK (n = 6, answer = YES)
29 Correct 4 ms 256 KB OK (n = 12, answer = YES)
30 Correct 4 ms 384 KB OK (n = 100, answer = NO)
31 Correct 4 ms 384 KB OK (n = 100, answer = YES)
32 Correct 5 ms 256 KB OK (n = 100, answer = NO)
33 Correct 4 ms 256 KB OK (n = 100, answer = YES)
34 Correct 4 ms 256 KB OK (n = 100, answer = YES)
35 Correct 4 ms 256 KB OK (n = 100, answer = YES)
36 Correct 4 ms 256 KB OK (n = 100, answer = YES)
37 Correct 5 ms 256 KB OK (n = 28, answer = YES)
38 Correct 4 ms 256 KB OK (n = 27, answer = YES)
39 Correct 5 ms 384 KB OK (n = 90, answer = YES)
40 Correct 4 ms 256 KB OK (n = 100, answer = YES)
41 Correct 5 ms 384 KB OK (n = 100, answer = YES)
42 Correct 4 ms 384 KB OK (n = 10, answer = YES)
43 Correct 5 ms 384 KB OK (n = 100, answer = YES)
44 Correct 4 ms 256 KB OK (n = 100, answer = YES)
45 Correct 4 ms 384 KB OK (n = 100, answer = YES)
46 Correct 4 ms 384 KB OK (n = 100, answer = YES)
47 Correct 4 ms 256 KB OK (n = 100, answer = NO)
48 Correct 5 ms 256 KB OK (n = 100, answer = NO)
49 Correct 5 ms 256 KB OK (n = 100, answer = NO)
50 Correct 4 ms 256 KB OK (n = 100, answer = YES)
51 Correct 4 ms 256 KB OK (n = 100, answer = YES)
52 Correct 4 ms 256 KB OK (n = 100, answer = YES)
53 Correct 5 ms 384 KB OK (n = 100, answer = YES)
54 Correct 5 ms 384 KB OK (n = 100, answer = YES)
55 Correct 7 ms 552 KB OK (n = 10000, answer = YES)
56 Correct 7 ms 512 KB OK (n = 10000, answer = YES)
57 Correct 7 ms 512 KB OK (n = 10000, answer = YES)
58 Correct 8 ms 640 KB OK (n = 10000, answer = YES)
59 Correct 8 ms 640 KB OK (n = 10000, answer = YES)
60 Correct 7 ms 512 KB OK (n = 10000, answer = YES)
61 Correct 8 ms 512 KB OK (n = 10000, answer = NO)
62 Correct 10 ms 768 KB OK (n = 10000, answer = YES)
63 Correct 12 ms 768 KB OK (n = 10000, answer = NO)
64 Correct 7 ms 512 KB OK (n = 10000, answer = YES)
65 Correct 9 ms 512 KB OK (n = 10000, answer = YES)
66 Correct 7 ms 512 KB OK (n = 10000, answer = YES)
67 Correct 6 ms 512 KB OK (n = 10000, answer = YES)
68 Correct 6 ms 640 KB OK (n = 10000, answer = YES)
69 Correct 6 ms 512 KB OK (n = 10000, answer = YES)
70 Correct 7 ms 512 KB OK (n = 10000, answer = YES)
71 Correct 7 ms 544 KB OK (n = 10000, answer = YES)
72 Correct 5 ms 384 KB OK (n = 865, answer = YES)
73 Correct 5 ms 384 KB OK (n = 820, answer = YES)
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 384 KB OK (n = 1, answer = NO)
2 Correct 4 ms 256 KB OK (n = 1, answer = NO)
3 Correct 5 ms 256 KB OK (n = 1, answer = YES)
4 Correct 4 ms 256 KB OK (n = 2, answer = YES)
5 Correct 4 ms 256 KB OK (n = 2, answer = YES)
6 Correct 5 ms 384 KB OK (n = 3, answer = YES)
7 Correct 4 ms 256 KB OK (n = 3, answer = YES)
8 Correct 4 ms 256 KB OK (n = 3, answer = YES)
9 Correct 4 ms 256 KB OK (n = 3, answer = YES)
10 Correct 4 ms 256 KB OK (n = 3, answer = YES)
11 Correct 4 ms 256 KB OK (n = 3, answer = YES)
12 Correct 4 ms 384 KB OK (n = 3, answer = YES)
13 Correct 5 ms 256 KB OK (n = 3, answer = NO)
14 Correct 5 ms 384 KB OK (n = 3, answer = YES)
15 Correct 4 ms 256 KB OK (n = 3, answer = YES)
16 Correct 4 ms 256 KB OK (n = 3, answer = NO)
17 Correct 4 ms 256 KB OK (n = 3, answer = NO)
18 Correct 4 ms 256 KB OK (n = 100, answer = NO)
19 Correct 4 ms 256 KB OK (n = 100, answer = YES)
20 Correct 4 ms 256 KB OK (n = 12, answer = YES)
21 Correct 4 ms 256 KB OK (n = 12, answer = YES)
22 Correct 4 ms 256 KB OK (n = 12, answer = NO)
23 Correct 4 ms 256 KB OK (n = 12, answer = NO)
24 Correct 4 ms 256 KB OK (n = 12, answer = YES)
25 Correct 5 ms 256 KB OK (n = 12, answer = YES)
26 Correct 4 ms 256 KB OK (n = 12, answer = YES)
27 Correct 4 ms 384 KB OK (n = 12, answer = YES)
28 Correct 5 ms 256 KB OK (n = 6, answer = YES)
29 Correct 4 ms 256 KB OK (n = 12, answer = YES)
30 Correct 4 ms 384 KB OK (n = 100, answer = NO)
31 Correct 4 ms 384 KB OK (n = 100, answer = YES)
32 Correct 5 ms 256 KB OK (n = 100, answer = NO)
33 Correct 4 ms 256 KB OK (n = 100, answer = YES)
34 Correct 4 ms 256 KB OK (n = 100, answer = YES)
35 Correct 4 ms 256 KB OK (n = 100, answer = YES)
36 Correct 4 ms 256 KB OK (n = 100, answer = YES)
37 Correct 5 ms 256 KB OK (n = 28, answer = YES)
38 Correct 4 ms 256 KB OK (n = 27, answer = YES)
39 Correct 5 ms 384 KB OK (n = 90, answer = YES)
40 Correct 4 ms 256 KB OK (n = 100, answer = YES)
41 Correct 5 ms 384 KB OK (n = 100, answer = YES)
42 Correct 4 ms 384 KB OK (n = 10, answer = YES)
43 Correct 5 ms 384 KB OK (n = 100, answer = YES)
44 Correct 4 ms 256 KB OK (n = 100, answer = YES)
45 Correct 4 ms 384 KB OK (n = 100, answer = YES)
46 Correct 4 ms 384 KB OK (n = 100, answer = YES)
47 Correct 4 ms 256 KB OK (n = 100, answer = NO)
48 Correct 5 ms 256 KB OK (n = 100, answer = NO)
49 Correct 5 ms 256 KB OK (n = 100, answer = NO)
50 Correct 4 ms 256 KB OK (n = 100, answer = YES)
51 Correct 4 ms 256 KB OK (n = 100, answer = YES)
52 Correct 4 ms 256 KB OK (n = 100, answer = YES)
53 Correct 5 ms 384 KB OK (n = 100, answer = YES)
54 Correct 5 ms 384 KB OK (n = 100, answer = YES)
55 Correct 7 ms 552 KB OK (n = 10000, answer = YES)
56 Correct 7 ms 512 KB OK (n = 10000, answer = YES)
57 Correct 7 ms 512 KB OK (n = 10000, answer = YES)
58 Correct 8 ms 640 KB OK (n = 10000, answer = YES)
59 Correct 8 ms 640 KB OK (n = 10000, answer = YES)
60 Correct 7 ms 512 KB OK (n = 10000, answer = YES)
61 Correct 8 ms 512 KB OK (n = 10000, answer = NO)
62 Correct 10 ms 768 KB OK (n = 10000, answer = YES)
63 Correct 12 ms 768 KB OK (n = 10000, answer = NO)
64 Correct 7 ms 512 KB OK (n = 10000, answer = YES)
65 Correct 9 ms 512 KB OK (n = 10000, answer = YES)
66 Correct 7 ms 512 KB OK (n = 10000, answer = YES)
67 Correct 6 ms 512 KB OK (n = 10000, answer = YES)
68 Correct 6 ms 640 KB OK (n = 10000, answer = YES)
69 Correct 6 ms 512 KB OK (n = 10000, answer = YES)
70 Correct 7 ms 512 KB OK (n = 10000, answer = YES)
71 Correct 7 ms 544 KB OK (n = 10000, answer = YES)
72 Correct 5 ms 384 KB OK (n = 865, answer = YES)
73 Correct 5 ms 384 KB OK (n = 820, answer = YES)
74 Correct 6 ms 512 KB OK (n = 7500, answer = NO)
75 Correct 8 ms 512 KB OK (n = 10000, answer = NO)
76 Correct 7 ms 512 KB OK (n = 10000, answer = NO)
77 Correct 7 ms 512 KB OK (n = 10000, answer = NO)
78 Correct 8 ms 512 KB OK (n = 10000, answer = NO)
79 Correct 9 ms 640 KB OK (n = 10000, answer = YES)
80 Correct 7 ms 512 KB OK (n = 10000, answer = YES)
81 Correct 7 ms 512 KB OK (n = 10000, answer = YES)
82 Correct 7 ms 512 KB OK (n = 10000, answer = YES)
83 Correct 8 ms 512 KB OK (n = 10000, answer = NO)
84 Correct 10 ms 640 KB OK (n = 10000, answer = YES)
85 Correct 12 ms 1024 KB OK (n = 10000, answer = NO)
86 Correct 8 ms 640 KB OK (n = 10000, answer = YES)
87 Correct 8 ms 640 KB OK (n = 10000, answer = YES)
88 Correct 8 ms 512 KB OK (n = 10000, answer = YES)
89 Correct 6 ms 512 KB OK (n = 10000, answer = YES)
90 Correct 7 ms 640 KB OK (n = 10000, answer = YES)
91 Correct 6 ms 512 KB OK (n = 10000, answer = YES)
92 Correct 7 ms 640 KB OK (n = 10000, answer = YES)
93 Correct 7 ms 512 KB OK (n = 10000, answer = YES)
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 384 KB OK (n = 1, answer = NO)
2 Correct 4 ms 256 KB OK (n = 1, answer = NO)
3 Correct 5 ms 256 KB OK (n = 1, answer = YES)
4 Correct 4 ms 256 KB OK (n = 2, answer = YES)
5 Correct 4 ms 256 KB OK (n = 2, answer = YES)
6 Correct 5 ms 384 KB OK (n = 3, answer = YES)
7 Correct 4 ms 256 KB OK (n = 3, answer = YES)
8 Correct 4 ms 256 KB OK (n = 3, answer = YES)
9 Correct 4 ms 256 KB OK (n = 3, answer = YES)
10 Correct 4 ms 256 KB OK (n = 3, answer = YES)
11 Correct 4 ms 256 KB OK (n = 3, answer = YES)
12 Correct 4 ms 384 KB OK (n = 3, answer = YES)
13 Correct 5 ms 256 KB OK (n = 3, answer = NO)
14 Correct 5 ms 384 KB OK (n = 3, answer = YES)
15 Correct 4 ms 256 KB OK (n = 3, answer = YES)
16 Correct 4 ms 256 KB OK (n = 3, answer = NO)
17 Correct 4 ms 256 KB OK (n = 3, answer = NO)
18 Correct 4 ms 256 KB OK (n = 100, answer = NO)
19 Correct 4 ms 256 KB OK (n = 100, answer = YES)
20 Correct 4 ms 256 KB OK (n = 12, answer = YES)
21 Correct 4 ms 256 KB OK (n = 12, answer = YES)
22 Correct 4 ms 256 KB OK (n = 12, answer = NO)
23 Correct 4 ms 256 KB OK (n = 12, answer = NO)
24 Correct 4 ms 256 KB OK (n = 12, answer = YES)
25 Correct 5 ms 256 KB OK (n = 12, answer = YES)
26 Correct 4 ms 256 KB OK (n = 12, answer = YES)
27 Correct 4 ms 384 KB OK (n = 12, answer = YES)
28 Correct 5 ms 256 KB OK (n = 6, answer = YES)
29 Correct 4 ms 256 KB OK (n = 12, answer = YES)
30 Correct 4 ms 384 KB OK (n = 100, answer = NO)
31 Correct 4 ms 384 KB OK (n = 100, answer = YES)
32 Correct 5 ms 256 KB OK (n = 100, answer = NO)
33 Correct 4 ms 256 KB OK (n = 100, answer = YES)
34 Correct 4 ms 256 KB OK (n = 100, answer = YES)
35 Correct 4 ms 256 KB OK (n = 100, answer = YES)
36 Correct 4 ms 256 KB OK (n = 100, answer = YES)
37 Correct 5 ms 256 KB OK (n = 28, answer = YES)
38 Correct 4 ms 256 KB OK (n = 27, answer = YES)
39 Correct 5 ms 384 KB OK (n = 90, answer = YES)
40 Correct 4 ms 256 KB OK (n = 100, answer = YES)
41 Correct 5 ms 384 KB OK (n = 100, answer = YES)
42 Correct 4 ms 384 KB OK (n = 10, answer = YES)
43 Correct 5 ms 384 KB OK (n = 100, answer = YES)
44 Correct 4 ms 256 KB OK (n = 100, answer = YES)
45 Correct 4 ms 384 KB OK (n = 100, answer = YES)
46 Correct 4 ms 384 KB OK (n = 100, answer = YES)
47 Correct 4 ms 256 KB OK (n = 100, answer = NO)
48 Correct 5 ms 256 KB OK (n = 100, answer = NO)
49 Correct 5 ms 256 KB OK (n = 100, answer = NO)
50 Correct 4 ms 256 KB OK (n = 100, answer = YES)
51 Correct 4 ms 256 KB OK (n = 100, answer = YES)
52 Correct 4 ms 256 KB OK (n = 100, answer = YES)
53 Correct 5 ms 384 KB OK (n = 100, answer = YES)
54 Correct 5 ms 384 KB OK (n = 100, answer = YES)
55 Correct 7 ms 552 KB OK (n = 10000, answer = YES)
56 Correct 7 ms 512 KB OK (n = 10000, answer = YES)
57 Correct 7 ms 512 KB OK (n = 10000, answer = YES)
58 Correct 8 ms 640 KB OK (n = 10000, answer = YES)
59 Correct 8 ms 640 KB OK (n = 10000, answer = YES)
60 Correct 7 ms 512 KB OK (n = 10000, answer = YES)
61 Correct 8 ms 512 KB OK (n = 10000, answer = NO)
62 Correct 10 ms 768 KB OK (n = 10000, answer = YES)
63 Correct 12 ms 768 KB OK (n = 10000, answer = NO)
64 Correct 7 ms 512 KB OK (n = 10000, answer = YES)
65 Correct 9 ms 512 KB OK (n = 10000, answer = YES)
66 Correct 7 ms 512 KB OK (n = 10000, answer = YES)
67 Correct 6 ms 512 KB OK (n = 10000, answer = YES)
68 Correct 6 ms 640 KB OK (n = 10000, answer = YES)
69 Correct 6 ms 512 KB OK (n = 10000, answer = YES)
70 Correct 7 ms 512 KB OK (n = 10000, answer = YES)
71 Correct 7 ms 544 KB OK (n = 10000, answer = YES)
72 Correct 5 ms 384 KB OK (n = 865, answer = YES)
73 Correct 5 ms 384 KB OK (n = 820, answer = YES)
74 Correct 6 ms 512 KB OK (n = 7500, answer = NO)
75 Correct 8 ms 512 KB OK (n = 10000, answer = NO)
76 Correct 7 ms 512 KB OK (n = 10000, answer = NO)
77 Correct 7 ms 512 KB OK (n = 10000, answer = NO)
78 Correct 8 ms 512 KB OK (n = 10000, answer = NO)
79 Correct 9 ms 640 KB OK (n = 10000, answer = YES)
80 Correct 7 ms 512 KB OK (n = 10000, answer = YES)
81 Correct 7 ms 512 KB OK (n = 10000, answer = YES)
82 Correct 7 ms 512 KB OK (n = 10000, answer = YES)
83 Correct 8 ms 512 KB OK (n = 10000, answer = NO)
84 Correct 10 ms 640 KB OK (n = 10000, answer = YES)
85 Correct 12 ms 1024 KB OK (n = 10000, answer = NO)
86 Correct 8 ms 640 KB OK (n = 10000, answer = YES)
87 Correct 8 ms 640 KB OK (n = 10000, answer = YES)
88 Correct 8 ms 512 KB OK (n = 10000, answer = YES)
89 Correct 6 ms 512 KB OK (n = 10000, answer = YES)
90 Correct 7 ms 640 KB OK (n = 10000, answer = YES)
91 Correct 6 ms 512 KB OK (n = 10000, answer = YES)
92 Correct 7 ms 640 KB OK (n = 10000, answer = YES)
93 Correct 7 ms 512 KB OK (n = 10000, answer = YES)
94 Correct 4 ms 256 KB OK (n = 1, answer = YES)
95 Correct 4 ms 256 KB OK (n = 3, answer = YES)
96 Correct 5 ms 384 KB OK (n = 3, answer = NO)
97 Correct 5 ms 384 KB OK (n = 3, answer = YES)
98 Correct 40 ms 3936 KB OK (n = 150000, answer = NO)
99 Incorrect 129 ms 5612 KB sum of weights should be in [2147482647..2147483647] but it is 62277024948
100 Halted 0 ms 0 KB -