Блог пользователя McDic

Автор McDic, 6 лет назад, По-английски

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:

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
6 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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 лет назад, # ^ |
    Rev. 4   Проголосовать: нравится 0 Проголосовать: не нравится

    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 лет назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      > $ as it is a single test generator.

    • »
      »
      »
      6 лет назад, # ^ |
        Проголосовать: нравится +10 Проголосовать: не нравится

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

      or generate singletest with > $

    • »
      »
      »
      6 лет назад, # ^ |
        Проголосовать: нравится +12 Проголосовать: не нравится

      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.