Location>code7788 >text

"Tips & Tricks

Popularity:675 ℃/2024-07-24 09:31:15

Father of the anti-suspension score

7.23 Mock rounds played.
Rhubarb: This Noi system is really **, T3 first handed over the sub violence, 60pts, and then played (he thought) the correct solution, one point, why can not take my highest score counted ah

OK, here's where the usefulness of the opposite shot comes in: to prevent us from looking like rhubarb * * *.

What's a counterpart for?

The right shot is to prevent their own code hanging or thinking false and they do not know, so they create data with the number, with the absolute correct violence and their own "correct" code each run once, compare the answer.

(architecture) formwork

create data

Random number templates:

//<Manual plus range>
#include <iostream>
#include <chrono>
#include <random>
using namespace std;
int main()
{
	// random number seed
	unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
	mt19937 rand_num(seed); // large random number
	uniform_int_distribution<long long> dist(0, 1000000000); // given scope
	cout << dist(rand_num) << endl;
	return 0;
}

take a picture of each other

#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
int main(){
	system("g++ -o Bao"); //code of violence
	system("g++ -o Jie"); //“correct solution (a math. equation)”coding
	system("g++ -o data"); //数据coding
	int cnt = 0;
	while(true){
		system("./data > "); //Input data to the center
		//system("/usr/bin/time -f \"%es,%MKB\" ./Jie < > ");
		//system("/usr/bin/time -f \"%es,%MKB\" ./Bao < > ");
		system("./Jie < > ");
		system("./Bao < > ");
		if(system("diff -Z")){
			printf("Wa\n"); break;
		}
		printf("%d\n",++cnt);
	}
	return 0;
}



Note: Excerpted fromSenior's Blogcap (a poem)csdn