void stacking() { int a[100]; a[0] = 1; a[100] = 1; stacking(); }
int main() { //freopen("input.txt","r",stdin); int test_case, array_length, skipping=0; int i,j; scanf("%d",&test_case); i=getchar(); for(;test_case>0;test_case--) { stack_number = 0; for(j=0;j<1005;j++) stack[j] = sentence[j] = NULL; gets(sentence); array_length = strlen(sentence); for(i=0;i<array_length;i++) { if(sentence[i] == '\"' || sentence[i] == '\'' || (sentence[i] == '/' && sentence[i+1] == '*')) { i=ignore(i); continue; } else if(sentence[i] == '(' || sentence[i] == ')' || sentence[i] == '{' || sentence[i] == '}' || sentence[i] == '[' || sentence[i] == ']') { if(stacking(sentence[i]) == 1) { printf("N\n"); skipping=1; break; } } } if(skipping==1) { skipping=0; continue; } if(stack_number>0) printf("N\n"); else printf("Y\n"); } return 0; }
// stress test int main(int argc, char * argv []) { stacking(); return 0; }
int main(int argc, char *argv[]) { SKRY_initialize(); libskry::c_ImageSequence imgSeq = libskry::c_ImageSequence::InitVideoFile("sun01.avi"); // Sometimes we may want to skip certain (e.g. invalid) frames during // processing; see the "active" family of methods for details. size_t numSteps = imgSeq.GetImageCount(); libskry::c_ImageAlignment imgAlignment( imgSeq, SKRY_IMG_ALGN_ANCHORS, { }, // pass an empty vector; stabilization anchors // will be placed automatically 32, 32, // block radius and search radius for block-matching 0.33f); // min. relative brightness to place anchors at; // avoid the dark background // From now on till the end of stacking we must not call any modifying // methods on 'imgSeq' (those without 'const' qualifier), // as it is used by 'imgAlignment' and subsequent objects. size_t step = 1; std::cout << "\nImage alignment: step "; while (SKRY_SUCCESS == imgAlignment.Step()) { std::cout << step++ << "/" << numSteps << " "; std::cout.flush(); // Eventually, a "step" function returns SKRY_LAST_STEP // (or an error code). } std::cout << " done." << std::endl; libskry::c_QualityEstimation qualEst(imgAlignment, 40, 3); step = 1; std::cout << "\n---------\nQuality estimation: step "; while (SKRY_SUCCESS == qualEst.Step()) { std::cout << step++ << "/" << numSteps << " "; std::cout.flush(); } std::cout << " done." << std::endl; libskry::c_RefPointAlignment refPtAlignment( qualEst, { }, // pass an empty vector; reference points // will be placed automatically // Consider only 30% of the best-quality frame fragments // (this criterion later also applies to stacking) SKRY_PERCENTAGE_BEST, 30, 32, // reference block size 20, // ref. block search radius nullptr, 0.33f, // min. relative brightness to place points at; // avoid the dark background 1.2f, // structure detection threshold; value 1.2 is recommended 1, // structure scale in pixels 40); // point spacing in pixels step = 1; std::cout << "\n---------\nReference point alignment: step "; while (SKRY_SUCCESS == refPtAlignment.Step()) { std::cout << step++ << "/" << numSteps << " "; std::cout.flush(); } std::cout << " done." << std::endl; libskry::c_Stacking stacking(refPtAlignment); step = 1; std::cout << "\n---------\nImage stacking: step "; while (SKRY_SUCCESS == stacking.Step()) { std::cout << step++ << "/" << numSteps << " "; std::cout.flush(); } std::cout << " done." << std::endl; // Now 'imgSeq' can be freely accessed again, if needed. // The stack is a mono or RGB image (depending on 'img_seq') // with 32-bit floating point pixels, so we need to convert it // before saving as a 16-bit TIFF. libskry::c_Image imgStack16 = libskry::c_Image::ConvertPixelFormat(stacking.GetFinalImageStack(), SKRY_PIX_RGB16); imgStack16.Save("sun01_stack.tif", SKRY_TIFF_16); SKRY_deinitialize(); return 0; }