McDic's blog

By McDic, 6 years ago, In English

Hello. I am using Polygon to prepare problems.

This is my generator below:

#include <iostream>
#include "testlib.h"

long long int max2(long long int a, long long int b){
	return a>b ? a : b;
}

long long int ten(int x){
	long long int s=1;
	for(int i=0; i<x; i++) s *= 10;
	return s;
}

int main(int argc, char* argv[]){
	registerGen(argc, argv, 1);
	
	std::cout << rnd.next(1LL, atoll(argv[1])) << " ";
	std::cout << rnd.next(1LL, atoll(argv[2])) << " ";
	std::cout << rnd.next(1LL, atoll(argv[3])) << " ";
	std::cout << rnd.next(max2(1, atoll(argv[4])/10), max2(100, atoll(argv[4]))) << std::endl;
}

Is there any wrong thing? It always verdict FL in invocation and tests. Thank you for reading this.

EDIT 1 This is the log occurs when I try to generate inputs. ERROR: Unexpected verdict Can't prepare input file 'C:\Contesters\Work\invoker-prod\work\polygon2\34b2efc622c48530be13ce1989b01907\check-bc2d7412ca16433314f5a03914c1d409\run\input.fd0138e687.txt'.FAILED. Input:

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

1) Did tests generated?
2) Did you use some validators?
3) How do you generate tests?

In generator I don't see anything wrong.

  • »
    »
    6 years ago, # ^ |
    Rev. 4   Vote: I like it 0 Vote: I do not like it

    This is my validator below:

    #include "testlib.h"
    
    long long int ten(int x){
    	long long int s=1;
    	for(int i=0; i<x; i++) s *= 10;
    	return s;
    }
    
    int main(int argc, char* argv[]) {
        registerValidation(argc, argv);
        long long int a = inf.readLong(1, ten(18), "a"); inf.readSpace();
        long long int b = inf.readLong(1, ten(18), "b"); inf.readSpace(); 
        long long int n = inf.readLong(1, ten(18), "n"); inf.readSpace();
        long long int r = inf.readLong(1, ten(9) , "r"); inf.readEoln();
        inf.readEof();
        return 0;
    }
    

    I just generate tests like large_power_series_generator 10 10 10 100 > {4-10} but it says there is an error.

    EDIT 1: I used this generator and validator but generation failed. For your information, I used default checker.

    • »
      »
      »
      6 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      > $ as it is a single test generator.

    • »
      »
      »
      6 years ago, # ^ |
        Vote: I like it +10 Vote: I do not like it

      To generate multitest you must in generator before cout write startTest(test_index);

      or generate singletest with > $

    • »
      »
      »
      6 years ago, # ^ |
        Vote: I like it +12 Vote: I do not like it

      It's useful to run a generator locally. Just put that generator and testlib.h library in the same directory, so it could be included. You can also download a validator and run it on that file. In Linux, the commands would be:

      ./larger_power 10 10 10 100 > in.txt

      ./my_validator < in.txt

      or just ./larger_power 10 10 10 100 | ./my_validator

      You can also see the produced test with your eyes, to see if it looks fine.

      If everything is ok in your machine, most likely you don't use the Polygon script correctly.

      • »
        »
        »
        »
        6 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Thanks a lot for all people who answered!!