Google Code Jam 2017
This commit is contained in:
159
puzzles/google_code_jam/2017/0-A.cpp
Normal file
159
puzzles/google_code_jam/2017/0-A.cpp
Normal file
@@ -0,0 +1,159 @@
|
|||||||
|
/*
|
||||||
|
VIM: let g:lcppflags="-std=c++11 -O2 -pthread"
|
||||||
|
VIM: let g:wcppflags="/O2 /EHsc /DWIN32"
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include <sstream>
|
||||||
|
#include <fstream>
|
||||||
|
#include <iomanip>
|
||||||
|
#include <exception>
|
||||||
|
#include <stdexcept>
|
||||||
|
#include <map>
|
||||||
|
#include <set>
|
||||||
|
#include <list>
|
||||||
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
|
#include <memory>
|
||||||
|
#include <functional>
|
||||||
|
#include <algorithm>
|
||||||
|
#include <utility>
|
||||||
|
#include <limits>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
typedef long long ll;
|
||||||
|
typedef std::vector<ll> vec;
|
||||||
|
void check(bool b) { if (!b) std::cerr << "error" << std::endl; }
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
std::string to_string( T t ){
|
||||||
|
std::stringstream ss;
|
||||||
|
ss << t;
|
||||||
|
return ss.str();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Problem: Oversized Pancake Flipper
|
||||||
|
|
||||||
|
Problem
|
||||||
|
|
||||||
|
Last year, the Infinite House of Pancakes introduced a new kind of pancake. It has a happy face made of chocolate chips on one side (the "happy side"), and nothing on the other side (the "blank side").
|
||||||
|
|
||||||
|
You are the head cook on duty. The pancakes are cooked in a single row over a hot surface. As part of its infinite efforts to maximize efficiency, the House has recently given you an oversized pancake flipper that flips exactly K consecutive pancakes. That is, in that range of K pancakes, it changes every happy-side pancake to a blank-side pancake, and vice versa; it does not change the left-to-right order of those pancakes.
|
||||||
|
|
||||||
|
You cannot flip fewer than K pancakes at a time with the flipper, even at the ends of the row (since there are raised borders on both sides of the cooking surface). For example, you can flip the first K pancakes, but not the first K - 1 pancakes.
|
||||||
|
|
||||||
|
Your apprentice cook, who is still learning the job, just used the old-fashioned single-pancake flipper to flip some individual pancakes and then ran to the restroom with it, right before the time when customers come to visit the kitchen. You only have the oversized pancake flipper left, and you need to use it quickly to leave all the cooking pancakes happy side up, so that the customers leave feeling happy with their visit.
|
||||||
|
|
||||||
|
Given the current state of the pancakes, calculate the minimum number of uses of the oversized pancake flipper needed to leave all pancakes happy side up, or state that there is no way to do it.
|
||||||
|
Input
|
||||||
|
|
||||||
|
The first line of the input gives the number of test cases, T. T test cases follow. Each consists of one line with a string S and an integer K. S represents the row of pancakes: each of its characters is either + (which represents a pancake that is initially happy side up) or - (which represents a pancake that is initially blank side up).
|
||||||
|
Output
|
||||||
|
|
||||||
|
For each test case, output one line containing Case #x: y, where x is the test case number (starting from 1) and y is either IMPOSSIBLE if there is no way to get all the pancakes happy side up, or an integer representing the the minimum number of times you will need to use the oversized pancake flipper to do it.
|
||||||
|
Limits
|
||||||
|
|
||||||
|
1 ≤ T ≤ 100.
|
||||||
|
Every character in S is either + or -.
|
||||||
|
2 ≤ K ≤ length of S.
|
||||||
|
Small dataset
|
||||||
|
|
||||||
|
2 ≤ length of S ≤ 10.
|
||||||
|
Large dataset
|
||||||
|
|
||||||
|
2 ≤ length of S ≤ 1000.
|
||||||
|
Sample
|
||||||
|
|
||||||
|
Input
|
||||||
|
|
||||||
|
Output
|
||||||
|
|
||||||
|
|
||||||
|
3
|
||||||
|
---+-++- 3
|
||||||
|
+++++ 4
|
||||||
|
-+-+- 4
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Case #1: 3
|
||||||
|
Case #2: 0
|
||||||
|
Case #3: IMPOSSIBLE
|
||||||
|
|
||||||
|
In Case #1, you can get all the pancakes happy side up by first flipping the leftmost 3 pancakes, getting to ++++-++-, then the rightmost 3, getting to ++++---+, and finally the 3 pancakes that remain blank side up. There are other ways to do it with 3 flips or more, but none with fewer than 3 flips.
|
||||||
|
|
||||||
|
In Case #2, all of the pancakes are already happy side up, so there is no need to flip any of them.
|
||||||
|
|
||||||
|
In Case #3, there is no way to make the second and third pancakes from the left have the same side up, because any flip flips them both. Therefore, there is no way to make all of the pancakes happy side up.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
auto solve_puzzle(std::istream& is)
|
||||||
|
{
|
||||||
|
ll k;
|
||||||
|
std::string s;
|
||||||
|
is >> s >> k;
|
||||||
|
|
||||||
|
int flips = 0;
|
||||||
|
int i = 0;
|
||||||
|
int ie = s.length()-k+1;
|
||||||
|
for ( ; i < ie; ++i ) {
|
||||||
|
if ( s[i] == '-' ) {
|
||||||
|
flips++;
|
||||||
|
for ( int j = i; j < i+k; ++j ){
|
||||||
|
s[j] = (s[j] == '-') ? '+' : '-';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for ( ; i < s.length(); ++i ){
|
||||||
|
if (s[i] == '-'){
|
||||||
|
return std::string("IMPOSSIBLE");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return to_string(flips);
|
||||||
|
}
|
||||||
|
|
||||||
|
void read_input_and_solve( std::istream& is, std::ostream& os )
|
||||||
|
{
|
||||||
|
srand((unsigned)time(NULL));
|
||||||
|
int puzzle_count;
|
||||||
|
|
||||||
|
is >> puzzle_count;
|
||||||
|
is.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
|
||||||
|
for (int i = 1; i <= puzzle_count; i++)
|
||||||
|
{
|
||||||
|
os << "Case #" << i << ": ";
|
||||||
|
auto r = solve_puzzle(is);
|
||||||
|
os << r << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char * argv[])
|
||||||
|
{
|
||||||
|
try{
|
||||||
|
if ( *++argv ) {
|
||||||
|
std::ifstream ifs(*argv);
|
||||||
|
read_input_and_solve( ifs, std::cout );
|
||||||
|
} else {
|
||||||
|
read_input_and_solve( std::cin, std::cout );
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
catch (const std::exception& e)
|
||||||
|
{
|
||||||
|
std::cerr << std::endl
|
||||||
|
<< "std::exception(\"" << e.what() << "\")." << std::endl;
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
std::cerr << std::endl
|
||||||
|
<< "unknown exception." << std::endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
101
puzzles/google_code_jam/2017/0-A.cpp.large.in
Normal file
101
puzzles/google_code_jam/2017/0-A.cpp.large.in
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
100
|
||||||
|
---+-++- 3
|
||||||
|
+++++ 4
|
||||||
|
-+-+- 4
|
||||||
|
-++++++++- 2
|
||||||
|
-++---++++++--+---++-+---+--+-++-++-++--+++++++-++-+++--++---+-+-+----+-+-++----+-+-+-+++-+-+----+------+---+-+------++-+++--+-+-+++---+-++--++-+-++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-++---++++++--+---++-+---+--+-++-++-++--+++++++-++-+++--++---+-+-+----+-+-++----+-+-+-+++-+-+----+------+---+-+------++-+++--+-+-+++---+-++--++-+- 224
|
||||||
|
-++-++++++++++++++++++-+--+ 22
|
||||||
|
+- 2
|
||||||
|
+-+-+-+-+- 2
|
||||||
|
+-++++-+--+++---------+++++-++-+++-+--++---+-+++-----++++--+--+--++-+--++--+-+--++-------++++--+--+++---++-+++-+----+---+--++--+--++--+-++++++---+-----+---+++++--+---+------+-+---++++-++-+-----+-++++-+-+-+-----+-+--+-+++---++++--+--++---------+-+-++---+----+++-++---+++-+++-++-+-+++-+--+++---++-++--+-++--+++++++-++-++---++++++--+----+-+++-+++---+--++-+--+---+-------+++---+-++--++--++++-------+++-++-++-----++-+-+---+-+--++++ 124
|
||||||
|
-+++++++-+ 2
|
||||||
|
-+-+-++--+++++--+-+++++++-+++----++++++++++--+-+-+---+-+-+-+++-++-++-+++----+----+---+-++-+-+--+-+--+++-+-++-++++-++-+-+---++-----+-++---+++++--++---+-+---+---+++++-++-++-+-++--+++-+-++++-++++++--+++------+----++--+---+++---++++++++----+-++----+++---+++-+++++++++--+-++++--+----++-+-+-+--+++++++--+++-++------++++-+++--+++++-+--++-+---+--+++----++++-+-+++-+++++++----++-+-----+-++++--+----++-+++-++++----++-+++++-++++-+++-+++-+-+++++-----++-+++--+---++-++-++++--+-+++++-+---+++++-+----+--+++-++--++++--++--+++---+--++++++++---+-----++++++++-+---++++++++----+-++----+++---+++-+++++++++--+-++++--+----++-+-+-+--+++++++--+++-++------++++-+++--++-+--------+----+--++----+-++--+--+-+++++++-++--++++++-++++-++-++-+---+-+--+-+--++-+----++-+++--+++---++----+-+++-+--++--------+++-+++++--++--++-++--+++-+--+--++--------++++-----++-++---++----+----+++---++++++++-+--+---+-++ 321
|
||||||
|
-+++++++++ 2
|
||||||
|
---------- 10
|
||||||
|
--------++-++---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------++++++++--+--+ 448
|
||||||
|
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3
|
||||||
|
---------- 3
|
||||||
|
++++++++++ 10
|
||||||
|
++----+---++++++-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------++++-+++------ 445
|
||||||
|
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1000
|
||||||
|
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- 3
|
||||||
|
-++++++++- 8
|
||||||
|
--------- 3
|
||||||
|
--++--++++-+----+++---++--++-++----+-+---++-++++-++-------++++-+--+-+--++--++++------+++-+--+------++--++-+-----++-+++++------+++---+---+----+-++-++--+-+-+-+++-+-+++--+--+---++++--+----+---+-+--++-+-+++--+++++--+-----++++----++-++------+-++++++-+-+--+--++--+----++++++++++-++-+--+---+--+-+++-+-+++++---++---++--++-+++++-+-++--+-----+++++++-+-+-+-+--+--++-++-++-+++++--+-+---+++--+---+-++++++--+++++--++-+-++++---+--------+++--+++-+++-++-+++--+--+---++++---+--+++---+++++++++-++++---+--++++--+++-+--++++++-++-++++--+++---+------+-----++-+-+--++-++-+--+--++--++++-++-+ 15
|
||||||
|
+------++++-++-+--++++---+-+-+--+-+++++--++-+++--++--++++-+-+---+--+++++--+---+-++----+-++------+++-++--+++--+-+---++-------------------------------------------------------------------------------------------++++++----+--+-++----+++-+-+-++-+-----++--+---++--++----+-+-+++-++-----++-+++-+--++++-+--++++++---+--++---++-+-+++--+ 207
|
||||||
|
+-+++-++--+--++-----+-+++--+--+++-++----+---+++++++++++----+++++-+----+-+-+++-+---+--++-+-----+-++-+-++++-++++++-++---++--+-+--++++++--+-+-++---++---+-++-+---+-----++-++-----+-++-++-+----++---++----++---++++---++++++--++++--++++++---+-+-+++-+--++--++--+--+-++-+--+++-+++++++--+--++++--+++-++-+--+--+++++------+-+-----+-+-++---++-+-+-+++-+-++---+--+--+-+++-++-++-+++--+----+-+-+--++-+----+-+--+-+--+-+-+--+-+--+++-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-+++-++--+--++-----+-+++--+--+++-++----+---+++++++++++----+++++-+----+-+-+++-+---+--++-+-----+-++-+-++++-++++++-++---++--+-+--++++++--+-+-++---++---+-++-+---+-----++-++-----+-++-++-+----++---++----++---++++---++++++--++++--++++++---+-+-+++-+--++--++--+--+-++-+--+++-+++++++--+--++++--+++-++-+--+--+++++------+-+-----+-+-++---++-+-+-+++-+-++---+--+--+-+++-++-++-+++--+----+-+-+--++-+----+-+--+-+--+-+-+--+-+--+++-+ 569
|
||||||
|
+---+-++-++-++-+-------++--+++-+--+-+-+-++++--++++--++--+--++++++---+++++-+-+-++-++-+-+-++-+++--++-++--+-++-+--++--+----++---++-++-+-++-++++--++++++----+--+---+++-+---+++++++---------++---+-++-++-+++++-++--++-++--+-++++--- 73
|
||||||
|
+-+-+++--+-++-----++-+---+-+-+++---++--++++---+++++--+-+++-+-+---++--+++-++--++ 33
|
||||||
|
+-+-+-+ 3
|
||||||
|
++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++- 2
|
||||||
|
+-+-++--+-+-+-+--++-+-+++-+++++-+---+++-++---+--+-+-+---++-++--+---++++-----+-+--+-+-+--++-+-+----+-------+-++--++--+----+--++++-++++--++-++++-------+++--+++---++++---+---++++--++-++--+++++---+-+-+---+-+-+-++-+-+-++---+-+--+-------+-++--++--+----+--++-++++---++---+----+-+--+-+--++--++-++++---++---+--++-+---+++--+++++-+--+++-----++-----++++-+++- 125
|
||||||
|
-+---+-+-++-++++--+---+--+---++----++---++-+-+-+++--+---+-++-++-++++-+++++++ 7
|
||||||
|
++--+++-++------+++++----+--+-+++++-+-+++----+--+--+-+--+++-+--------------------------------------------------------++---+--++++++-----++++-++-+-----+-+---++++-++-++-+-++---+-+++ 115
|
||||||
|
---------- 5
|
||||||
|
+-+--+-++++--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-+--+-++++--+++ 211
|
||||||
|
-+------++---+++-++++-++--+-+---+--++++--+-++-+--+---++---+--+++---+++++-+++++-+----+--++---+++++------+-++--+-++----++-+-+++-+-+--+++++--+-+---++-+++-++-----+-+-+++++---+-+-++-+-+---++++-+----++---++-+-++-++++++-+-+++++----+----+-+-+++++++--++-++++-++--++----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-++++++--+++---+----+--++-+-+++-++----++-+--+-++-+++--+++-++---+++-----+-----+-++++-++--+++-----++++++-+--++-+--++++--+-+---+-+-++-----++-+-+++--+---+--+++++-+-+-----+++-+-+--+-+-+++----+-++++--+++--+-+--+------+-+-----++++-++++-+-+-------++--+----+--++--++ 620
|
||||||
|
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 998
|
||||||
|
--+-++++++++-+-++++++--++-+++-+++++-++----+--++++++++--+-+++--++++-++---+----++-+--+++++++++------+++----+++++-++--++-----+++--+--++++++-----+++--+-+-+-+-++++++--+-+++-+--++--+-+++++++-++-++-+-+---+-+-++---++-+++++----+-+-++-+++++-+++----+-+--++-+++-++---+++-+---+-+++--++-++++-++++---+++--++++-+-+---++-+-+--+++-+--+++-+-+--+-+++++--+--++++++-+----+++----+++--+-+-++-+-++--+-+----+----+---+++-+--+++-+--++---+-+-+---++--+++--+++++++++-++-+-+++++++--++++-++++-++--+-----+++-+++++---+-+-+++-+---+++++---+---++--++-++--+-++--++-++--+++-------+-+++++-+----+--++++-+-+++++-++-+-+--+-+-++---+-+--+++----+--++--+-+++++-+-++-+-----++++-++-----+-+-++-+--+- 51
|
||||||
|
+---+++++--------++-++-+-+--+---+-++--++++-+-+-+--++-++-+-+++--++---+---+-+--+-----+----+-++-+-----++-+-------++++--+--+-++-+-++----+-++++++-+++++--+-+--++++--+---+-+--+++---++----+----++---+-++-+-+++------++--+--+--+---+-++-++--+++-----++---++++--+-+-++-+ 46
|
||||||
|
-+-+-+-+-+ 2
|
||||||
|
---+--+++++++-+++++-++-------+--+++-++---+++-++--+--++++----+++-+++++-++--++--++++++------+++-+--+++--++-+----++++-+++-++++-++--++-----+-+-+-++-------+++--++++-++++-+--+-+++++++-----+-++-+-++----++--+-++-+++++++++++--+-+---+------+-------++--+++-+--+--+-----+-+---+---+---+++++---+++---++---+---+-----++--+++---++--------+++-+--+---+++++++++++++-----++-+-+-------+-------+---+--+++-++++++--+++++++++-++ 50
|
||||||
|
---++-+-----------------+---+++--+-+ 28
|
||||||
|
+-+-+-------+---+++ 11
|
||||||
|
--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 2
|
||||||
|
---------- 2
|
||||||
|
---+--++-+---++--+-+--+--+++-+---+--++-+---++--+-+--+--+++-+ 30
|
||||||
|
++ 2
|
||||||
|
++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++-++- 3
|
||||||
|
+-+-+-+- 3
|
||||||
|
-++++++++- 10
|
||||||
|
------++-++---++++++++++++--+-+---+-+--++-++++-----+++++-++-+++++---+++-+-------+++---+-+---+++++++-+--+-++-++----+++-+-----+---++++--+++--+++-++++---+-+-+++-+---++++++--+-++++++-++-+-+--++----++++++--+++ 64
|
||||||
|
-+-----++++++++--++-+++--++++++-++--+++++---++--++-+-++-++-+--+---+--+--+---+-+-+-+-+-+++--++-++----++++---+++--+-----+-+++--++-+---+-+--+-----++-++---+-+-+---++-++--++++++--++-++-++-+++-++-++-+----+++-+--+++-+++++++++-+++-+---++-+-+-+++++-+++--++++++-++--+++++---++--++-+-++-++-+--+---+--+--+---+-+-+-+-+-+++--++-++----++++---+++--+-----+-+++--++-+---+-+--+-----++-++---+-+-+---++-++--++++++--++-++-++-+++-++-++-+----+++-+--+++-+++++++++-+-++-+++++-+-+-+-- 220
|
||||||
|
---+---------+++-+--+----+--+-+---+-+++----+++-+-+-+--++-+++-+-+-+--+--+++--+++++---++++---+-+---+-+-+++--+-+------+---+++--++-++--++----+-+++-++---+--+-++-----+---+-+++++-+-++-+-++-+++-++-+--++++--++-+-++-+--++-+-++-+-+-+++---+++++++++---+--+---+++--+++------+-+--++-+--++-++-+---++-+-++-+---+---+--++----++-----+--++---+-+-+-+-+-+--+++++-+---++--+--+--+---+++++-+-+++-+-+------++++-+-++++-++--+++++-++----+++-++-----+++-+--++++++----+-+-+++--+--++-+-+--+++-+--++-+-+---+++---------+++-++-+++-++-++++-------+--+++++--+--+-------++-+++-++++++-+++-+-+-++-++-+-++-+++++++--+-+--+--++-+++-------++--+++-+++--++++--+-----++--++--+-+++------++-+---++-++-+-----++--+++++++-++--++--+--+-+++++----+-++++---+++-+-----+-+ 247
|
||||||
|
+++--+---+--++----+---+++-+--+++-----+---+--+++-+-+-+---+++++++-++-+--+-+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------++-+++-++--++++-+++---+-++---+++++-+++-++---+-+-+-+++-------+--+-++-+- 465
|
||||||
|
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2
|
||||||
|
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 20
|
||||||
|
-+-+-+++-+-++--+++--+++++++++--+---++-++--+-+++---+++--+---+++-+--+---+---++-++--+++++-+---+--------+++++++--+-------++++-+-----+-----+++-++-+--+--+++-----+++--+++-++--++--++++----+--+++--+++++-+---+++++----+--++-+-++-+--++-+++-++--++++++-+-+-----+---++-++++-++---+++---++++-+++-+--+++-++--+---+-++--+--+--++-+-++-+++++-+-+-+-++--++--+--+-----+-+-++--+-+++++-+--++-++++++---+---+++-+-++-+--+--+-----++----+++++--+-+--+--+-+-+++-+-++-+-+--++++++---+-++--++--++--+--++---+---++--+-+--++-++---+--------+-+++---+-+----+--+-++--+-+-+++-+++-++++-+-+--++++-+-+---+---+++-----+++-+++++---++++-+++-++++++++-+++-++----+----+-++-+---++-++-+++-+--+---++--+-+++-++++-++--+++----+-++--+++--+-+-----+-+++-----+---++-+++---+-+---++-+-+-+-------++++--+-++--++++++-----+--++++-+++-+-+-+--++-+----+-+++-+---++----++----++++-++----------+-+--+-+-+++ 226
|
||||||
|
-++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 2
|
||||||
|
---+-----+++++--++++++-+++++++++++---+--++-+++++--++++--+---++++-++-----++--++-+++++----+++++-+++-+-+-----++++++-+++++-+++++---++--+---------++++++++++++-----+++++---++-------++++++ 34
|
||||||
|
+-----++--+++---++--+++++++++++++++--+++++++--+--+--++--+++---+---+----++++-+++--+++++++-----+++++ 12
|
||||||
|
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 3
|
||||||
|
--++++---+--+-+-++++-+--++-+-+-+++--+---+-++------+--+-+-+-+--++--++---++-+----+-++-+-+++++++++++++++++++++++++++--++++---+--+-+-++-+-+--++-+-+-+++--+---+-++------+--+-+-+-+--++--++---++-+----+-++-+-+ 113
|
||||||
|
+++-----++-+---++-+---+++-+++--+-+---++------+--+---+-++++++-+++-+++++++++--+++-+++++++-+---++---+--++---+-+----++--+-+--+-+-++---+--++-+--+-++++--+--+--++--+---+-+-++--+-------+-+++++-----+++---+-++++-++-+-+--+--+-+-----++----+++-++++++--+-+-+-----++-+----+++++--+--++++-+++-++-++--++-++---++-----+--+-++++++-+-+--++++-+-+--+------++++-++-+++-+++++-+-++-++--+---+++-+-++++----------------------------+++++--+-+++--+-+++---+---++-+-+++--++++++-++-+++-+------+---+---------++---+-------+-+++--+++-++--+++-+-++++--++-+-++-+-+--+++-++--+-++-+----++-++-++--++-+++-+-+--++-+++++++-+-----+++++---+++-+----+--+-+-++-++-+-+++++--++++---+------++-+-+-+++++--+-++++-----++-++----+---+--+--++--+--+++--+++++-++-+------+-+-++----+-+-++-++++++----+--+---+-----+-+--+--++-+++---+-+---- 398
|
||||||
|
-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2
|
||||||
|
---+------++--+-+-++-+++-+-+--++-++++++-+---+-+---++++---++++++--+-++++--+--------+++--+++---++--++--+--++--+-+----+-+--+--++---++---+-----+---++----++++++-++--++--+---+--+-+-+-+---++++-+---+++-+-+-++---+----+-+---++++----------+++----+-++-++------++++-++--++-+--++--+----+-+------+++++++++-+--+++++--+--+---+++++---+-++++-+--+--+----++--++-+--+--++++---+-+++-+-+--++++--++-++----+++--+++--++-++----+---++-+--++++++---+-+-++++++++-+-++--++-+--++---+++--+++++---++----+---++-++-+++-+--+-+-+-+-+--+-+++-+---+---+-++-----++++++-+-+--++-----+-+-++++-+-++--+-+-+----+-+-----+++++++-++-+--++---+-+++-+-++--++++--+---+---+++++-++-++--+++++++---+-+----+--+-+-+++++-+--+---+++++++-----++++---+------++---+++--++--++++-++---+-+-+-----++-++-++++++-++-----+++++--+---+-+----+--+-++----+++--+---+------+++++---+-++-- 237
|
||||||
|
-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-+ 2
|
||||||
|
-+---+-+-+++--++--++-+---+---++---++++-+++-++-+--++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-+---+-+-+++--++--++-+---+---++---++++-+++-++-+--+ 135
|
||||||
|
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 1000
|
||||||
|
+++++++---+---++----++-----+-++++--------++++-------++----++---++--+--++----+++-++---++++++-++-+--+-+++-++----++++-++-----+----++++---++-----++-+-++---++-+++-+++----+++--+++++----++-+++------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+++-+++--++++--+++++-+----++++++++----++++++---++++--+++--++-++--++++---+--+++------+--+-++-+---+--++++----+--+++++-++++----+++--+++++--+-+--+++--+---+---++++---++-----++++--+--- 466
|
||||||
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- 500
|
||||||
|
++------------+++++++++------------++++++-++---+++--------+-------+++-------------++-----++++++++++++++-++++++++----------+++++------------++--------++-++++-++-----------------+++++++---+++++++-------+++++++++++++-------++--+++++-++++++++++++++++++++++++++++++++++---+++-+-------+-+-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------+++++++++------------++++++-++---+++--------+-------+++-------------++-----++++++++++++++-++++++++----------+++++------------++--------++-++++-++-----------------+++++++---+++++++-------+++++++++++++-------++--+++++-++++++++++++++++++++++++++++++++++---+++-+-------+-+- 418
|
||||||
|
---++-+-----+++-+--+-+--++--+++++++++++----+-++-+++++--++-+----+----+-+--+---+++++--+-+-+---+++++----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+++--+-+++++---+-++-+-++--++-----------++++-+--+-----++--+-++++-++++-+-++-+++-----++-+-+-+++-----+ 821
|
||||||
|
--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 3
|
||||||
|
-+++++++-- 2
|
||||||
|
++-+--+----+-+-+++++--+---+++-++++---+++-++++----+++++--++++---+-+------+--++++-+-++-+-+-+++-+---+---+++--+--++--+++++----++--++++-+--++++-+--++-+-+--++++++-+--+--+-++-+--+-----++++--++----+++++-++-+---++++----++++++++-+--+-++------+++-++---++++-+---+++++++--+------+-+-+---+-+-++++-++-+---+--++-+-++++++-+++++----++++++--+---------+----++--+--+--+++-++-+++-+-++-+---+--++-----++--+-++-++-----++--+-++++-++---+----+++++++++++-+++++-+-+--++-+-------+++++-+-++--+-+-++-----++-+++-++-+-++---++---+++++++--++++-+--+-+--+----+-+-+++---+--++--+--+--++---++-----+++--++++++++-++++----++--+--+--++--+--++-++++----+--+++--+++-+-----++---+--+-+---+-----++---+++++--+---++----+---++----+++++++---+++++--++-+-+++---++-+-++-+-++--++--++-+-++-+-+---+++--++--++++--++-+----+---++--+++-++-+++-+++--++++--+++-+-+++--++-----++-+-+--+-++++-----+-+--- 165
|
||||||
|
++---++-++-+-+-++++++-+-+-+------+-+---++---+--++-++-+++--+++-+++++++-++--++--+++-+++++--++-+---+----+++-++++-+-+-+++++--+++----++-++++--+----+-+++-+-+----+-++++++-++--+--++++-------+--++-++--+-+-++-+++-++-+++++---+---+--+--+-++-----++++--+---++-+-+-++--+---+++++-++----+--++++-+++-+-+++-+-+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+++--+--+-+-+------+-+-+-++++++-+-+++--+++-++--+--+---++---+-------+--++--++---+-----++--+-+++-++++---+----+-+-+-----++---++++--+----++-++++-+---+-+-++++-+------+--++-++----+++++++-++--+--++-+-+--+---+--+-----+++-+++-++-++-+--+++++----++-+++--+-+-+--++-+++-----+--++++-++----+---+-+---+-+- 639
|
||||||
|
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 1000
|
||||||
|
+-------------++------------------------------------------------------------------------------------------------------------------------+++++++++++++--+ 135
|
||||||
|
++++----++-+---+-++++--++++---++----+--------++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-+++++++++++++++++++++++++++++++++++++++++----++-+---+-++++--++++---++----+-------- 185
|
||||||
|
+-+-+-+-+ 3
|
||||||
|
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3
|
||||||
|
-++++++++- 9
|
||||||
|
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 999
|
||||||
|
--+-----+--+---+-+--+-----++--------++-+---+---+-+++-+++++--+--+--+--------+-+--++--+++--+-+-+++--++-++++-+-+-+-+--+-+++-+-----+-++---++--+--------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------++-+++++-++-+++-+-++-+++++--++++++++--+-+++-+++-+---+-----++-++-++-++++++++-+-++--++---++-+-+---++--+----+-+-+-+-++-+---+-+++++-+--+++--++- 399
|
||||||
|
++--+-+---++--+++--+++--+----+----+-++++--++----+-+++-+++--+-++-++-+++----++-----+-+++++-+-----+++++-++--+++-+-++++++-+++-+++------++++---+-----++-+-+---++---+-+-+--+---+------++---+--+++---+-+++---+---+-+-+++--+--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--+-+---++--+++--+++--+----+----+-++++--++----+-+++-+++--+-++-++-+++----++-----+-+++++-+-----+++++-++--+++-+-++++++-+++-+++------++++---+-----++-+-+---++---+-+-+--+---+------++---+--+++---+-+++---+---+-+-+++--+--++ 525
|
||||||
|
-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 2
|
||||||
|
++--++-++--+-+----+++----+-+-++-----++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--++-++--+-+----+++----+-+-++-----+ 519
|
||||||
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- 2
|
||||||
|
+-+-+-+-+- 3
|
||||||
|
--+++++--+--+++--+--+++---+-+-+-++--+---+-+-++++----+++-++--+-+---++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--+++++--+--+++--+--+++---+++-+-++--+---+-+-++++----+++-++--+-+---+ 146
|
||||||
|
-- 2
|
||||||
|
-----+-------+++-+++++-----+-+-+---+-+--++---+-+-----+--+---++-++-++-+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+++++-+++++++---+-----+++++-+-+-+++-+-++--+++-+-+++++-++-+++--+--+--+-+++ 701
|
||||||
|
++-++---+-++-++--+++++------+++-+---+-+--++-+--++-----+-+++---+-+--++++++--++++++-+---++--+++++-+-++---++----+-++--++-+-++----+--------++----+-++-++++-+++-++--++++-----+---++--+++-+--++-----+--+-+--+---++---+++-++----+----++-++++++++--+++---++++++-+++++++-++---++-+--++--+--+++++--++--++-++-+--++--++++-+--+-----------------------------------------+---+--+++-+--+--++-----++++++---+-+++-+-++--+-++--+++++-+---+++-+-++------++------+-+++--++-----+-+--+++--++++-+--++--+-+--++++-++++++++--++++-+--+----+---+--++----+++++-+++--++---+-++--+++++-++-+-++-+++--+++---+--++++-++++--+--------++---+++------+-------+--+++--+-++--++-++-----++--++--+--+-++--++----+-++- 350
|
||||||
|
+-++++----++--++++--+++-+++++-+-++++-++--+----++++-+----++-+-++-----+--+---+-++-++++------+--+----+-++-+--++--+++++--+-+-++-+-++-++++++++-+++-++-++----+++--+-+++----++++--+++---+------+---+++-+---+-++-+-++-+--+--++-+--++-++++++--+----++-+++-++-++--++--+-+++++--+---++++++-++++--+-++++-++--++++++++-++--+-+--+++--++-++-++-+--+-+++++---++-+-+-+++++++--++------------+++-++--++-++++-++-+++--++-+-+--++---+-++++-+-++++++----+-+-++----++-----+--+-+--+---+-----+---+++++-+-------++++++++-+---++-+++--+++---+----++--++++-++-+-+--++-++---+-+-+--+-----+-+-++-+ 84
|
||||||
|
+---++--+-+---+--++-+-+------+---++-++++-+++-++-+--+++--+++---------+----+-+--++-+-++++++---+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+++--++-+-+++-++--+-+-++++++-+++--+----+---+--+-++---++---+++++++++-++++-+-++--+-+------+++- 462
|
||||||
|
-+ 2
|
||||||
|
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++-+++++++++++------------------------------+++++++++++++ 30
|
||||||
|
++++++-----+-------------------------------++++++++++++------+-----------------------------+++++++++++++--+++++++++++++++++++++++++++++++------+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----+-------------------------------++++++++++++------+-----------------------------+++++++++++++--+++++++++++++++++++++++++++++++------ 803
|
||||||
|
+++++++++++-+++--+++++++++++++++-+++----+++--------------+-----++++------++++--------+++++++++----++---------+------+++++++++++++++++++++---+++++++-+++++++-------------+++++--++-----+-----+++++---++++------++---++++--++++--+++-+++--+++++-+++++++++----++++-+-+++++----++-+-++++++++++---+++---++++-----+++++++++----+++++++-+++-+++---++-+++++++----+++++++++-+------++++++++++-----------++--+--++---++-++-+------+++----++++++--+++----++----++--------------+----------++++++++-++++++----++-+--+++++-------++++++-+++--------------------+++++-+++++++-----+-------++++-------++--+++++++-------++-------------++--------+++++-+-++++++++++++++++ 215
|
||||||
|
++---------+++++++++------------++++++-------------------+-------------++++----++-----+++++-------------------+++----+++++--+-------+++--+++--++++--+++---------------+---+++++++++++++++++++++++--------+-+++------++++++++++-------+-+--++++-----++++++-+----------+++++++--------+++++++------++++++++++++++---++++++---+++-++++-+++-----++++---++++-++-+++++++-++-+++++++--+++++-----+--+++++-+-----++++---+++-++--+--+-+-+++-+++--+++------++-++-+++++++++++-++-+++-++++---+---++++++++---++++++++-+---+-+++-++++++++--++++-+--+-+++++------++--++-+-+++---+--+++-------+----+++++++-----+--+-----++----+-+++++++-++----++++----+----++++---++++----+++-++++++-+--++++++-++++-----+--+++++-+---+-++---+++++--+--+++++-+---+++++++++++-------+++-----------+-------++++---+---++++++++-----------------+---+++++++++------+-+-----+++-+++++++--+++++---+++-+++++----+++-+++++++++++++++++++-+++++++-----+--------+++++++++++++++---------------+++----+---+--++--------+----++++++------------+---+++-------++++ 286
|
||||||
|
--++-+-+++--+++--+++---+-+++---+-+++++----+--+++-+++++++----+++-++-+--+--+----+++-+---++-+-+++--++-+-+----+---++--++++----++++--++-+-++----++----+-------+-+---++-+++++-++-+++------+---++--+-+-+++++++--+---++-+++-++-++-++++-+--+----+-+++----+--+++++-+----+-------++--+-+-+--++-++++-+-+-++++-+-+---+++--++++---+-++++-+--++-+---++--++-+--+-+--+++-+-+---+--+++--+++-+++-+-+--+--+-++-+++--++-----+----++-++-+----+++++-+---+-++--+--++-+-+--+++-+--++-+++--+++--++-++-+--+-+-+-+--+-+-+-+--+++++--++++-+---+-+-+-+-+-++-+++--+-+------++-+--+--++-+-++-++++-++++-++++-+--------++++-+-+-++++--++-++--++--++-+--+++-+-+--+++---++- 58
|
||||||
101
puzzles/google_code_jam/2017/0-A.cpp.small-attempt0.in
Normal file
101
puzzles/google_code_jam/2017/0-A.cpp.small-attempt0.in
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
100
|
||||||
|
---+-++- 3
|
||||||
|
+++++ 4
|
||||||
|
-+-+- 4
|
||||||
|
+-- 2
|
||||||
|
--++++ 2
|
||||||
|
-+++++++-+ 2
|
||||||
|
-+-+-+-+-+ 2
|
||||||
|
+-- 3
|
||||||
|
+-+-+-+-+- 2
|
||||||
|
+-+- 3
|
||||||
|
--- 2
|
||||||
|
-+--+- 4
|
||||||
|
+-++++++ 8
|
||||||
|
--+ 2
|
||||||
|
+--- 3
|
||||||
|
++- 2
|
||||||
|
-------+ 7
|
||||||
|
-+-+ 3
|
||||||
|
--++ 3
|
||||||
|
--+- 2
|
||||||
|
-++++++++- 8
|
||||||
|
-+-- 3
|
||||||
|
---------- 10
|
||||||
|
---- 2
|
||||||
|
++ 2
|
||||||
|
---------- 5
|
||||||
|
-++++++++- 10
|
||||||
|
-+- 3
|
||||||
|
-+++ 3
|
||||||
|
-++---- 3
|
||||||
|
+-+ 3
|
||||||
|
---+-- 6
|
||||||
|
------ 3
|
||||||
|
-++----- 2
|
||||||
|
--+- 3
|
||||||
|
+- 2
|
||||||
|
+--- 2
|
||||||
|
++++ 2
|
||||||
|
--------- 3
|
||||||
|
-++++++++- 9
|
||||||
|
--+-++ 2
|
||||||
|
---+ 2
|
||||||
|
+-+-+-+- 3
|
||||||
|
-++-+--+ 4
|
||||||
|
---- 3
|
||||||
|
+++++-++ 5
|
||||||
|
--+++--+ 5
|
||||||
|
-++ 3
|
||||||
|
+++- 3
|
||||||
|
-++- 2
|
||||||
|
+++- 2
|
||||||
|
+++-++++ 7
|
||||||
|
+----+++ 5
|
||||||
|
-+++++++++ 2
|
||||||
|
-+++++++-- 2
|
||||||
|
++---- 4
|
||||||
|
----- 4
|
||||||
|
+-+--+- 3
|
||||||
|
--++ 2
|
||||||
|
+-+ 2
|
||||||
|
-+-+---++- 4
|
||||||
|
--- 3
|
||||||
|
-+-+ 2
|
||||||
|
---------- 2
|
||||||
|
-+-- 2
|
||||||
|
+++ 3
|
||||||
|
++++ 3
|
||||||
|
+-+-+-+ 3
|
||||||
|
+++---- 4
|
||||||
|
++-+ 2
|
||||||
|
++--- 3
|
||||||
|
-+---+--+ 4
|
||||||
|
+--+ 2
|
||||||
|
-++- 3
|
||||||
|
-++ 2
|
||||||
|
++-- 2
|
||||||
|
-++----+ 4
|
||||||
|
---+- 3
|
||||||
|
-++++++++- 2
|
||||||
|
+-+-+-+-+- 3
|
||||||
|
--+ 3
|
||||||
|
-+++ 2
|
||||||
|
++++++++++ 10
|
||||||
|
---------- 3
|
||||||
|
+++---+--- 2
|
||||||
|
-+ 2
|
||||||
|
+++ 2
|
||||||
|
+--+ 3
|
||||||
|
++-- 3
|
||||||
|
+++-+ 5
|
||||||
|
-------- 8
|
||||||
|
-+- 2
|
||||||
|
+-+- 2
|
||||||
|
+-++ 2
|
||||||
|
+-++ 3
|
||||||
|
++- 3
|
||||||
|
---+ 3
|
||||||
|
++-+ 3
|
||||||
|
-- 2
|
||||||
|
+-+-+-+-+ 3
|
||||||
6
puzzles/google_code_jam/2017/0-A.cpp.test
Normal file
6
puzzles/google_code_jam/2017/0-A.cpp.test
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
5
|
||||||
|
---+-++- 3
|
||||||
|
+++++ 4
|
||||||
|
-+-+- 4
|
||||||
|
----+++++++ 1
|
||||||
|
-++--++-+-+-+ 5
|
||||||
159
puzzles/google_code_jam/2017/0-B.cpp
Normal file
159
puzzles/google_code_jam/2017/0-B.cpp
Normal file
@@ -0,0 +1,159 @@
|
|||||||
|
/*
|
||||||
|
VIM: let g:lcppflags="-std=c++11 -O2 -pthread"
|
||||||
|
VIM: let g:wcppflags="/O2 /EHsc /DWIN32"
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include <sstream>
|
||||||
|
#include <fstream>
|
||||||
|
#include <iomanip>
|
||||||
|
#include <exception>
|
||||||
|
#include <stdexcept>
|
||||||
|
#include <map>
|
||||||
|
#include <set>
|
||||||
|
#include <list>
|
||||||
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
|
#include <memory>
|
||||||
|
#include <functional>
|
||||||
|
#include <algorithm>
|
||||||
|
#include <utility>
|
||||||
|
#include <limits>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
typedef long long ll;
|
||||||
|
typedef std::vector<ll> vec;
|
||||||
|
void check(bool b) { if (!b) std::cerr << "error" << std::endl; }
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
std::string to_string( T t ){
|
||||||
|
std::stringstream ss;
|
||||||
|
ss << t;
|
||||||
|
return ss.str();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Problem B. Tidy Numbers
|
||||||
|
Confused? Read the quick-start guide.
|
||||||
|
Small input
|
||||||
|
5 points
|
||||||
|
You may try multiple times, with penalties for wrong submissions.
|
||||||
|
Large input
|
||||||
|
15 points
|
||||||
|
You must solve the small input first.
|
||||||
|
You have 8 minutes to solve 1 input file. (Judged after contest.)
|
||||||
|
Problem
|
||||||
|
|
||||||
|
Tatiana likes to keep things tidy. Her toys are sorted from smallest to largest, her pencils are sorted from shortest to longest and her computers from oldest to newest. One day, when practicing her counting skills, she noticed that some integers, when written in base 10 with no leading zeroes, have their digits sorted in non-decreasing order. Some examples of this are 8, 123, 555, and 224488. She decided to call these numbers tidy. Numbers that do not have this property, like 20, 321, 495 and 999990, are not tidy.
|
||||||
|
|
||||||
|
She just finished counting all positive integers in ascending order from 1 to N. What was the last tidy number she counted?
|
||||||
|
Input
|
||||||
|
|
||||||
|
The first line of the input gives the number of test cases, T. T lines follow. Each line describes a test case with a single integer N, the last number counted by Tatiana.
|
||||||
|
Output
|
||||||
|
|
||||||
|
For each test case, output one line containing Case #x: y, where x is the test case number (starting from 1) and y is the last tidy number counted by Tatiana.
|
||||||
|
Limits
|
||||||
|
|
||||||
|
1 ≤ T ≤ 100.
|
||||||
|
Small dataset
|
||||||
|
|
||||||
|
1 ≤ N ≤ 1000.
|
||||||
|
Large dataset
|
||||||
|
|
||||||
|
1 ≤ N ≤ 1018.
|
||||||
|
Sample
|
||||||
|
|
||||||
|
Input
|
||||||
|
|
||||||
|
Output
|
||||||
|
|
||||||
|
|
||||||
|
4
|
||||||
|
132
|
||||||
|
1000
|
||||||
|
7
|
||||||
|
111111111111111110
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Case #1: 129
|
||||||
|
Case #2: 999
|
||||||
|
Case #3: 7
|
||||||
|
Case #4: 99999999999999999
|
||||||
|
|
||||||
|
Note that the last sample case would not appear in the Small dataset.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
auto solve_puzzle(std::istream& is)
|
||||||
|
{
|
||||||
|
std::string n;
|
||||||
|
is >> n;
|
||||||
|
|
||||||
|
for ( int i = 0; i < n.length()-1; ){
|
||||||
|
if ( n[i] <= n[i+1] ) {
|
||||||
|
++i;
|
||||||
|
} else {
|
||||||
|
while ( i >= 0 && --n[i] < '0' ) {
|
||||||
|
--i;
|
||||||
|
}
|
||||||
|
if ( i < 0 ) {
|
||||||
|
return std::string("something is wrong.");
|
||||||
|
}
|
||||||
|
if ( i == 0 && n[i] == '0' ) {
|
||||||
|
n = std::string( n.length()-1, '9');
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
for ( int j = i+1; j < n.length(); ++j ) {
|
||||||
|
n[j] = '9';
|
||||||
|
}
|
||||||
|
--i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
|
||||||
|
void read_input_and_solve( std::istream& is, std::ostream& os )
|
||||||
|
{
|
||||||
|
srand((unsigned)time(NULL));
|
||||||
|
int puzzle_count;
|
||||||
|
|
||||||
|
is >> puzzle_count;
|
||||||
|
is.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
|
||||||
|
for (int i = 1; i <= puzzle_count; i++)
|
||||||
|
{
|
||||||
|
os << "Case #" << i << ": ";
|
||||||
|
auto r = solve_puzzle(is);
|
||||||
|
os << r << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char * argv[])
|
||||||
|
{
|
||||||
|
try{
|
||||||
|
if ( *++argv ) {
|
||||||
|
std::ifstream ifs(*argv);
|
||||||
|
read_input_and_solve( ifs, std::cout );
|
||||||
|
} else {
|
||||||
|
read_input_and_solve( std::cin, std::cout );
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
catch (const std::exception& e)
|
||||||
|
{
|
||||||
|
std::cerr << std::endl
|
||||||
|
<< "std::exception(\"" << e.what() << "\")." << std::endl;
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
std::cerr << std::endl
|
||||||
|
<< "unknown exception." << std::endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
101
puzzles/google_code_jam/2017/0-B.cpp.large.in
Normal file
101
puzzles/google_code_jam/2017/0-B.cpp.large.in
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
100
|
||||||
|
132
|
||||||
|
1000
|
||||||
|
7
|
||||||
|
111111111111111110
|
||||||
|
1000000000000000000
|
||||||
|
959798857587567
|
||||||
|
43477899
|
||||||
|
71123566779
|
||||||
|
400514348429604398
|
||||||
|
666603345995689864
|
||||||
|
533
|
||||||
|
60322605208664241
|
||||||
|
11111111102244778
|
||||||
|
12246788999668899
|
||||||
|
12001123579
|
||||||
|
999999999999999999
|
||||||
|
22057370054667840
|
||||||
|
637
|
||||||
|
934010629695734211
|
||||||
|
11122003
|
||||||
|
111111122222222207
|
||||||
|
832354831424371238
|
||||||
|
111113455566666776
|
||||||
|
737351771047945138
|
||||||
|
418997373735364302
|
||||||
|
87
|
||||||
|
22234456890
|
||||||
|
43999999
|
||||||
|
211222334444567789
|
||||||
|
11222333445566623
|
||||||
|
1
|
||||||
|
835
|
||||||
|
68
|
||||||
|
322223445578889000
|
||||||
|
61344578
|
||||||
|
63
|
||||||
|
447894926990349645
|
||||||
|
516764369855276840
|
||||||
|
329999999999999
|
||||||
|
65999999999
|
||||||
|
712336778899999
|
||||||
|
11111111000
|
||||||
|
13557848
|
||||||
|
111111111109077
|
||||||
|
11122333331
|
||||||
|
80
|
||||||
|
551827015686761912
|
||||||
|
616108304267359558
|
||||||
|
533761910124648418
|
||||||
|
640644838994347044
|
||||||
|
693679388759159895
|
||||||
|
511133455666780
|
||||||
|
122346778877888999
|
||||||
|
634786521656636590
|
||||||
|
513947463518994342
|
||||||
|
439
|
||||||
|
219
|
||||||
|
61133778888
|
||||||
|
22203456889
|
||||||
|
11222335566777775
|
||||||
|
61
|
||||||
|
708173776881532728
|
||||||
|
563705935632477692
|
||||||
|
111111111111110863
|
||||||
|
52274789357
|
||||||
|
259364073089726476
|
||||||
|
11111111109
|
||||||
|
12234773968
|
||||||
|
61223344466689998
|
||||||
|
354992304834257322
|
||||||
|
122345788897778
|
||||||
|
81345569
|
||||||
|
429874446374190392
|
||||||
|
11111222334555690
|
||||||
|
152679758475359765
|
||||||
|
663847161101103282
|
||||||
|
57894566
|
||||||
|
123897977999778
|
||||||
|
622223444466688
|
||||||
|
111111111111108
|
||||||
|
43999999999999999
|
||||||
|
41122456
|
||||||
|
511123444555566678
|
||||||
|
220
|
||||||
|
5
|
||||||
|
805164181836956955
|
||||||
|
11111222344666117
|
||||||
|
48557779
|
||||||
|
110476676308197
|
||||||
|
973507579171348913
|
||||||
|
81111246677888999
|
||||||
|
488655711035942417
|
||||||
|
916217325839103001
|
||||||
|
135526289467942878
|
||||||
|
12511579
|
||||||
|
892417814763979377
|
||||||
|
111222223334442
|
||||||
|
859761602938240917
|
||||||
|
219999999999999999
|
||||||
|
11222221
|
||||||
101
puzzles/google_code_jam/2017/0-B.cpp.small-attempt0.in
Normal file
101
puzzles/google_code_jam/2017/0-B.cpp.small-attempt0.in
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
100
|
||||||
|
132
|
||||||
|
1000
|
||||||
|
7
|
||||||
|
554
|
||||||
|
916
|
||||||
|
214
|
||||||
|
299
|
||||||
|
452
|
||||||
|
154
|
||||||
|
713
|
||||||
|
569
|
||||||
|
704
|
||||||
|
934
|
||||||
|
173
|
||||||
|
947
|
||||||
|
696
|
||||||
|
637
|
||||||
|
626
|
||||||
|
280
|
||||||
|
686
|
||||||
|
394
|
||||||
|
306
|
||||||
|
317
|
||||||
|
885
|
||||||
|
334
|
||||||
|
816
|
||||||
|
168
|
||||||
|
991
|
||||||
|
789
|
||||||
|
562
|
||||||
|
379
|
||||||
|
220
|
||||||
|
922
|
||||||
|
994
|
||||||
|
810
|
||||||
|
604
|
||||||
|
544
|
||||||
|
419
|
||||||
|
831
|
||||||
|
117
|
||||||
|
844
|
||||||
|
341
|
||||||
|
373
|
||||||
|
377
|
||||||
|
529
|
||||||
|
48
|
||||||
|
1
|
||||||
|
226
|
||||||
|
355
|
||||||
|
587
|
||||||
|
906
|
||||||
|
570
|
||||||
|
948
|
||||||
|
553
|
||||||
|
375
|
||||||
|
929
|
||||||
|
760
|
||||||
|
740
|
||||||
|
625
|
||||||
|
987
|
||||||
|
599
|
||||||
|
682
|
||||||
|
620
|
||||||
|
46
|
||||||
|
942
|
||||||
|
790
|
||||||
|
835
|
||||||
|
692
|
||||||
|
754
|
||||||
|
851
|
||||||
|
594
|
||||||
|
996
|
||||||
|
367
|
||||||
|
701
|
||||||
|
822
|
||||||
|
531
|
||||||
|
471
|
||||||
|
351
|
||||||
|
110
|
||||||
|
878
|
||||||
|
236
|
||||||
|
251
|
||||||
|
148
|
||||||
|
42
|
||||||
|
732
|
||||||
|
133
|
||||||
|
128
|
||||||
|
207
|
||||||
|
343
|
||||||
|
32
|
||||||
|
382
|
||||||
|
715
|
||||||
|
234
|
||||||
|
29
|
||||||
|
101
|
||||||
|
999
|
||||||
|
839
|
||||||
|
456
|
||||||
|
314
|
||||||
|
6
|
||||||
13
puzzles/google_code_jam/2017/0-B.cpp.test
Normal file
13
puzzles/google_code_jam/2017/0-B.cpp.test
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
12
|
||||||
|
132
|
||||||
|
1000
|
||||||
|
7
|
||||||
|
111111111111111110
|
||||||
|
111111111111111111
|
||||||
|
111111111111111112
|
||||||
|
111111111111111121
|
||||||
|
10
|
||||||
|
11
|
||||||
|
21
|
||||||
|
999991
|
||||||
|
987654321
|
||||||
206
puzzles/google_code_jam/2017/0-C.cpp
Normal file
206
puzzles/google_code_jam/2017/0-C.cpp
Normal file
@@ -0,0 +1,206 @@
|
|||||||
|
/*
|
||||||
|
VIM: let g:lcppflags="-std=c++11 -O2 -pthread"
|
||||||
|
VIM: let g:wcppflags="/O2 /EHsc /DWIN32"
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include <sstream>
|
||||||
|
#include <fstream>
|
||||||
|
#include <iomanip>
|
||||||
|
#include <exception>
|
||||||
|
#include <stdexcept>
|
||||||
|
#include <map>
|
||||||
|
#include <set>
|
||||||
|
#include <list>
|
||||||
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
|
#include <memory>
|
||||||
|
#include <functional>
|
||||||
|
#include <algorithm>
|
||||||
|
#include <utility>
|
||||||
|
#include <limits>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
typedef long long ll;
|
||||||
|
typedef std::vector<ll> vec;
|
||||||
|
void check(bool b) { if (!b) std::cerr << "error" << std::endl; }
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
std::string to_string( T t ){
|
||||||
|
std::stringstream ss;
|
||||||
|
ss << t;
|
||||||
|
return ss.str();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Problem C. Bathroom Stalls
|
||||||
|
Confused? Read the quick-start guide.
|
||||||
|
Small input 1
|
||||||
|
5 points
|
||||||
|
You may try multiple times, with penalties for wrong submissions.
|
||||||
|
Small input 2
|
||||||
|
10 points
|
||||||
|
You must solve small input 1 first.
|
||||||
|
You may try multiple times, with penalties for wrong submissions.
|
||||||
|
Large input
|
||||||
|
15 points
|
||||||
|
You must solve all small inputs first.
|
||||||
|
You have 8 minutes to solve 1 input file. (Judged after contest.)
|
||||||
|
Problem
|
||||||
|
|
||||||
|
A certain bathroom has N + 2 stalls in a single row; the stalls on the left and right ends are permanently occupied by the bathroom guards. The other N stalls are for users.
|
||||||
|
|
||||||
|
Whenever someone enters the bathroom, they try to choose a stall that is as far from other people as possible. To avoid confusion, they follow deterministic rules: For each empty stall S, they compute two values LS and RS, each of which is the number of empty stalls between S and the closest occupied stall to the left or right, respectively. Then they consider the set of stalls with the farthest closest neighbor, that is, those S for which min(LS, RS) is maximal. If there is only one such stall, they choose it; otherwise, they choose the one among those where max(LS, RS) is maximal. If there are still multiple tied stalls, they choose the leftmost stall among those.
|
||||||
|
|
||||||
|
K people are about to enter the bathroom; each one will choose their stall before the next arrives. Nobody will ever leave.
|
||||||
|
|
||||||
|
When the last person chooses their stall S, what will the values of max(LS, RS) and min(LS, RS) be?
|
||||||
|
Solving this problem
|
||||||
|
|
||||||
|
This problem has 2 Small datasets and 1 Large dataset. You must solve the first Small dataset before you can attempt the second Small dataset. You will be able to retry either of the Small datasets (with a time penalty). You will be able to make a single attempt at the Large, as usual, only after solving both Small datasets.
|
||||||
|
Input
|
||||||
|
|
||||||
|
The first line of the input gives the number of test cases, T. T lines follow. Each line describes a test case with two integers N and K, as described above.
|
||||||
|
Output
|
||||||
|
|
||||||
|
For each test case, output one line containing Case #x: y z, where x is the test case number (starting from 1), y is max(LS, RS), and z is min(LS, RS) as calculated by the last person to enter the bathroom for their chosen stall S.
|
||||||
|
Limits
|
||||||
|
|
||||||
|
1 ≤ T ≤ 100.
|
||||||
|
1 ≤ K ≤ N.
|
||||||
|
Small dataset 1
|
||||||
|
|
||||||
|
1 ≤ N ≤ 1000.
|
||||||
|
Small dataset 2
|
||||||
|
|
||||||
|
1 ≤ N ≤ 106.
|
||||||
|
Large dataset
|
||||||
|
|
||||||
|
1 ≤ N ≤ 1018.
|
||||||
|
Sample
|
||||||
|
|
||||||
|
Input
|
||||||
|
|
||||||
|
Output
|
||||||
|
|
||||||
|
|
||||||
|
5
|
||||||
|
4 2
|
||||||
|
5 2
|
||||||
|
6 2
|
||||||
|
1000 1000
|
||||||
|
1000 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Case #1: 1 0
|
||||||
|
Case #2: 1 0
|
||||||
|
Case #3: 1 1
|
||||||
|
Case #4: 0 0
|
||||||
|
Case #5: 500 499
|
||||||
|
|
||||||
|
In Case #1, the first person occupies the leftmost of the middle two stalls, leaving the following configuration (O stands for an occupied stall and . for an empty one): O.O..O. Then, the second and last person occupies the stall immediately to the right, leaving 1 empty stall on one side and none on the other.
|
||||||
|
|
||||||
|
In Case #2, the first person occupies the middle stall, getting to O..O..O. Then, the second and last person occupies the leftmost stall.
|
||||||
|
|
||||||
|
In Case #3, the first person occupies the leftmost of the two middle stalls, leaving O..O...O. The second person then occupies the middle of the three consecutive empty stalls.
|
||||||
|
|
||||||
|
In Case #4, every stall is occupied at the end, no matter what the stall choices are.
|
||||||
|
|
||||||
|
In Case #5, the first and only person chooses the leftmost middle stall.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
auto solve_puzzle(std::istream& is)
|
||||||
|
{
|
||||||
|
long long n, k;
|
||||||
|
is >> n >> k;
|
||||||
|
|
||||||
|
long long sec=1;
|
||||||
|
for ( long long kk = k; kk; kk>>=1, sec<<=1 ); //exp2( (int)ceil(log2( k+1 )) );
|
||||||
|
long long empty = n - sec +1;
|
||||||
|
long long min = empty / sec;
|
||||||
|
long long rem = empty % sec;
|
||||||
|
long long max = min;
|
||||||
|
if ( (rem - (sec/2)) >= (k-sec/2+1) ) {
|
||||||
|
max = min += 1;
|
||||||
|
} else if ( rem >= (k-sec/2+1) ) {
|
||||||
|
max = min + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
int best_min, best_max, best_place;
|
||||||
|
std::vector<int> v( n, 0);
|
||||||
|
for ( int i = 0; i <k; ++i ){
|
||||||
|
best_min = best_max = best_place = -1;
|
||||||
|
for ( int j = 0; j < n; ++j ){
|
||||||
|
if ( v[j] == 0 ){
|
||||||
|
int Ls = 0;
|
||||||
|
int Rs = 0;
|
||||||
|
for ( int l = j-1; l >= 0 && v[l] == 0; --l ) {
|
||||||
|
++Ls;
|
||||||
|
}
|
||||||
|
for ( int l = j+1; l < n && v[l] == 0; ++l ) {
|
||||||
|
++Rs;
|
||||||
|
}
|
||||||
|
int j_min = std::min(Ls,Rs);
|
||||||
|
int j_max = std::max(Ls,Rs);
|
||||||
|
if ( best_min < j_min
|
||||||
|
|| best_min == j_min && best_max < j_max ) {
|
||||||
|
best_place = j;
|
||||||
|
best_min = j_min;
|
||||||
|
best_max = j_max;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
v[best_place] = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( best_min != min || best_max != max ) {
|
||||||
|
std::cout << "Error: " << n << " " << k << " -> " << best_max << " " << best_min << " -> ";
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return to_string(max) + ' ' + to_string(min);
|
||||||
|
}
|
||||||
|
|
||||||
|
void read_input_and_solve( std::istream& is, std::ostream& os )
|
||||||
|
{
|
||||||
|
srand((unsigned)time(NULL));
|
||||||
|
int puzzle_count;
|
||||||
|
|
||||||
|
is >> puzzle_count;
|
||||||
|
is.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
|
||||||
|
for (int i = 1; i <= puzzle_count; i++)
|
||||||
|
{
|
||||||
|
os << "Case #" << i << ": ";
|
||||||
|
auto r = solve_puzzle(is);
|
||||||
|
os << r << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char * argv[])
|
||||||
|
{
|
||||||
|
try{
|
||||||
|
if ( *++argv ) {
|
||||||
|
std::ifstream ifs(*argv);
|
||||||
|
read_input_and_solve( ifs, std::cout );
|
||||||
|
} else {
|
||||||
|
read_input_and_solve( std::cin, std::cout );
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
catch (const std::exception& e)
|
||||||
|
{
|
||||||
|
std::cerr << std::endl
|
||||||
|
<< "std::exception(\"" << e.what() << "\")." << std::endl;
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
std::cerr << std::endl
|
||||||
|
<< "unknown exception." << std::endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
101
puzzles/google_code_jam/2017/0-C.cpp.large.in
Normal file
101
puzzles/google_code_jam/2017/0-C.cpp.large.in
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
100
|
||||||
|
4 2
|
||||||
|
5 2
|
||||||
|
6 2
|
||||||
|
1000 1000
|
||||||
|
1000 1
|
||||||
|
269639213832377145 218587941046017697
|
||||||
|
1000000000000000000 999999999999999999
|
||||||
|
3 2
|
||||||
|
999999999999999999 499999999999999999
|
||||||
|
4 1
|
||||||
|
668341121334534581 591831111931901869
|
||||||
|
843981288894233951 836118714517585228
|
||||||
|
945682405453310331 930137152964936188
|
||||||
|
1000000000000000000 515967293261010268
|
||||||
|
2 2
|
||||||
|
999999999999999999 2
|
||||||
|
999999999999999999 1
|
||||||
|
557773365873651863 433657597269936048
|
||||||
|
470357284687624961 465272805884932703
|
||||||
|
859339772011689605 850470686637380285
|
||||||
|
1000000000000000000 423539247696576513
|
||||||
|
885654231297338110 868783668763557338
|
||||||
|
500000000000000000 144115188075855871
|
||||||
|
475107990807880016 423838645740559881
|
||||||
|
500210432495132500 475218035771004752
|
||||||
|
1000000000000000000 288230376151711744
|
||||||
|
712434934486126209 655441552681487773
|
||||||
|
517898442890704467 510739807188874235
|
||||||
|
500000000000000000 211769623848288257
|
||||||
|
492408943224446400 449913890046268385
|
||||||
|
1000000000000000000 576460752303423488
|
||||||
|
500000000000000000 1
|
||||||
|
436799301461228071 334458662975501327
|
||||||
|
551725169707420240 447544064593549517
|
||||||
|
999999999999999999 315688400457403789
|
||||||
|
999999999999999999 281199860788757469
|
||||||
|
1000000000000000000 500000000000000000
|
||||||
|
783316230712782086 595777393360210055
|
||||||
|
1000000000000000000 1
|
||||||
|
1000000000000000000 285820433199623439
|
||||||
|
335491074737669100 334330472279997369
|
||||||
|
1000000000000000000 2
|
||||||
|
500000000000000000 249999999999999999
|
||||||
|
671128818681845645 657162671176557143
|
||||||
|
1000000000000000000 128
|
||||||
|
621848267382355875 513061740851211765
|
||||||
|
620709114489069689 561052157631120549
|
||||||
|
1000000000000000000 576460752303423487
|
||||||
|
754351791313269511 662492955343788084
|
||||||
|
999999999999999999 423539247696576512
|
||||||
|
260222518013235646 200825789885773025
|
||||||
|
999999999999999999 128
|
||||||
|
500000000000000000 127
|
||||||
|
999999999999999999 288230376151711744
|
||||||
|
500000000000000000 211769623848288256
|
||||||
|
500000000000000000 499999999999999999
|
||||||
|
500000000000000000 192574160422978183
|
||||||
|
1 1
|
||||||
|
533283560088006067 420767236738818234
|
||||||
|
5 1
|
||||||
|
500000000000000000 249999999999999998
|
||||||
|
284333970464112733 281881333309083400
|
||||||
|
500000000000000000 276797978694361766
|
||||||
|
1000000000000000000 127
|
||||||
|
606396682546681871 552445695279163753
|
||||||
|
999999999999999999 423539247696576511
|
||||||
|
629638422545821907 616905742791965238
|
||||||
|
467163576877400343 453353183346155900
|
||||||
|
1000000000000000000 499999999999999999
|
||||||
|
984169059153767404 919650541763890568
|
||||||
|
500000000000000000 288230376151711743
|
||||||
|
459303330549253103 354258733377361820
|
||||||
|
706421450595222891 577383454797323910
|
||||||
|
500000000000000000 288230376151711744
|
||||||
|
500000000000000000 144115188075855872
|
||||||
|
999999999999999999 999999999999999999
|
||||||
|
596762737424636988 549296365800254767
|
||||||
|
999999999999999999 542880209398027072
|
||||||
|
745466796740962662 566438651515174493
|
||||||
|
771714791233584502 586624946725800577
|
||||||
|
2 1
|
||||||
|
999999999999999999 499999999999999997
|
||||||
|
999999999999999999 999999999999999998
|
||||||
|
999999999999999999 576460752303423488
|
||||||
|
500000000000000000 250000000000000000
|
||||||
|
999999999999999999 576460752303423487
|
||||||
|
500000000000000000 144023652154826936
|
||||||
|
999999999999999999 288230376151711743
|
||||||
|
963604811278562488 871383857349021475
|
||||||
|
999999999999999999 499999999999999998
|
||||||
|
500000000000000000 2
|
||||||
|
1000000000000000000 423539247696576512
|
||||||
|
500000000000000000 500000000000000000
|
||||||
|
1000000000000000000 288230376151711743
|
||||||
|
1000000000000000000 1000000000000000000
|
||||||
|
3 1
|
||||||
|
1000000000000000000 414586384712426690
|
||||||
|
500000000000000000 128
|
||||||
|
1000000000000000000 499999999999999998
|
||||||
|
999999999999999999 127
|
||||||
101
puzzles/google_code_jam/2017/0-C.cpp.small-1-attempt0.in
Normal file
101
puzzles/google_code_jam/2017/0-C.cpp.small-1-attempt0.in
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
100
|
||||||
|
4 2
|
||||||
|
5 2
|
||||||
|
6 2
|
||||||
|
1000 1000
|
||||||
|
1000 1
|
||||||
|
1000 255
|
||||||
|
495 490
|
||||||
|
955 825
|
||||||
|
823 758
|
||||||
|
999 512
|
||||||
|
500 1
|
||||||
|
602 471
|
||||||
|
1000 2
|
||||||
|
984 870
|
||||||
|
788 631
|
||||||
|
4 1
|
||||||
|
754 730
|
||||||
|
2 2
|
||||||
|
550 424
|
||||||
|
361 359
|
||||||
|
1000 310
|
||||||
|
999 488
|
||||||
|
948 715
|
||||||
|
833 785
|
||||||
|
500 248
|
||||||
|
483 443
|
||||||
|
799 728
|
||||||
|
982 910
|
||||||
|
930 797
|
||||||
|
999 498
|
||||||
|
657 497
|
||||||
|
3 2
|
||||||
|
999 256
|
||||||
|
536 492
|
||||||
|
389 353
|
||||||
|
500 172
|
||||||
|
1000 128
|
||||||
|
1000 498
|
||||||
|
1000 127
|
||||||
|
500 255
|
||||||
|
1000 488
|
||||||
|
999 2
|
||||||
|
999 497
|
||||||
|
999 511
|
||||||
|
886 686
|
||||||
|
849 679
|
||||||
|
500 405
|
||||||
|
500 244
|
||||||
|
1000 256
|
||||||
|
1 1
|
||||||
|
999 127
|
||||||
|
500 256
|
||||||
|
268 256
|
||||||
|
500 117
|
||||||
|
999 998
|
||||||
|
968 756
|
||||||
|
748 662
|
||||||
|
440 358
|
||||||
|
1000 507
|
||||||
|
999 999
|
||||||
|
5 1
|
||||||
|
500 249
|
||||||
|
415 389
|
||||||
|
733 606
|
||||||
|
1000 499
|
||||||
|
719 619
|
||||||
|
500 2
|
||||||
|
667 502
|
||||||
|
1000 999
|
||||||
|
842 834
|
||||||
|
999 502
|
||||||
|
999 487
|
||||||
|
1000 500
|
||||||
|
999 412
|
||||||
|
924 784
|
||||||
|
1000 512
|
||||||
|
999 499
|
||||||
|
484 370
|
||||||
|
500 128
|
||||||
|
999 128
|
||||||
|
500 250
|
||||||
|
737 643
|
||||||
|
500 499
|
||||||
|
2 1
|
||||||
|
500 245
|
||||||
|
580 503
|
||||||
|
415 384
|
||||||
|
3 1
|
||||||
|
500 500
|
||||||
|
500 127
|
||||||
|
501 499
|
||||||
|
449 374
|
||||||
|
500 116
|
||||||
|
1000 511
|
||||||
|
500 67
|
||||||
|
999 1
|
||||||
|
1000 489
|
||||||
|
999 255
|
||||||
|
908 826
|
||||||
|
579 516
|
||||||
101
puzzles/google_code_jam/2017/0-C.cpp.small-1-attempt1.in
Normal file
101
puzzles/google_code_jam/2017/0-C.cpp.small-1-attempt1.in
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
100
|
||||||
|
4 2
|
||||||
|
5 2
|
||||||
|
6 2
|
||||||
|
1000 1000
|
||||||
|
1000 1
|
||||||
|
1000 2
|
||||||
|
999 256
|
||||||
|
477 413
|
||||||
|
999 999
|
||||||
|
500 248
|
||||||
|
1000 507
|
||||||
|
2 1
|
||||||
|
775 755
|
||||||
|
999 509
|
||||||
|
634 516
|
||||||
|
999 1
|
||||||
|
675 548
|
||||||
|
1000 488
|
||||||
|
1000 500
|
||||||
|
500 1
|
||||||
|
500 500
|
||||||
|
500 117
|
||||||
|
473 368
|
||||||
|
500 249
|
||||||
|
746 681
|
||||||
|
1000 999
|
||||||
|
1000 512
|
||||||
|
576 472
|
||||||
|
999 498
|
||||||
|
500 250
|
||||||
|
1000 499
|
||||||
|
1 1
|
||||||
|
661 650
|
||||||
|
999 998
|
||||||
|
963 859
|
||||||
|
500 2
|
||||||
|
459 401
|
||||||
|
500 116
|
||||||
|
851 841
|
||||||
|
452 431
|
||||||
|
1000 127
|
||||||
|
706 601
|
||||||
|
500 256
|
||||||
|
271 264
|
||||||
|
353 334
|
||||||
|
458 386
|
||||||
|
983 972
|
||||||
|
999 488
|
||||||
|
4 1
|
||||||
|
1000 498
|
||||||
|
1000 307
|
||||||
|
303 249
|
||||||
|
999 255
|
||||||
|
447 429
|
||||||
|
751 709
|
||||||
|
1000 128
|
||||||
|
490 379
|
||||||
|
2 2
|
||||||
|
500 255
|
||||||
|
1000 511
|
||||||
|
500 147
|
||||||
|
1000 255
|
||||||
|
999 2
|
||||||
|
736 712
|
||||||
|
5 1
|
||||||
|
459 389
|
||||||
|
999 428
|
||||||
|
721 701
|
||||||
|
762 718
|
||||||
|
999 127
|
||||||
|
999 487
|
||||||
|
457 375
|
||||||
|
263 223
|
||||||
|
882 832
|
||||||
|
500 499
|
||||||
|
999 512
|
||||||
|
622 468
|
||||||
|
999 511
|
||||||
|
772 648
|
||||||
|
500 245
|
||||||
|
382 303
|
||||||
|
665 555
|
||||||
|
906 785
|
||||||
|
999 128
|
||||||
|
500 128
|
||||||
|
500 244
|
||||||
|
745 655
|
||||||
|
3 1
|
||||||
|
1000 489
|
||||||
|
1000 256
|
||||||
|
772 746
|
||||||
|
999 499
|
||||||
|
719 715
|
||||||
|
500 127
|
||||||
|
3 2
|
||||||
|
500 83
|
||||||
|
578 496
|
||||||
|
841 747
|
||||||
|
999 497
|
||||||
|
341 311
|
||||||
101
puzzles/google_code_jam/2017/0-C.cpp.small-2-attempt0.in
Normal file
101
puzzles/google_code_jam/2017/0-C.cpp.small-2-attempt0.in
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
100
|
||||||
|
4 2
|
||||||
|
5 2
|
||||||
|
6 2
|
||||||
|
1000 1000
|
||||||
|
1000 1
|
||||||
|
500000 128
|
||||||
|
500000 262144
|
||||||
|
1000000 475713
|
||||||
|
273180 234987
|
||||||
|
1000000 499998
|
||||||
|
1 1
|
||||||
|
1000000 524288
|
||||||
|
500000 250000
|
||||||
|
593902 591002
|
||||||
|
1000000 262144
|
||||||
|
818872 805605
|
||||||
|
548568 457631
|
||||||
|
263640 233705
|
||||||
|
726786 614733
|
||||||
|
3 1
|
||||||
|
500000 127
|
||||||
|
1000000 1000000
|
||||||
|
500000 1
|
||||||
|
500000 262143
|
||||||
|
1000000 500000
|
||||||
|
1000000 128
|
||||||
|
1000000 513847
|
||||||
|
574988 467803
|
||||||
|
758001 714027
|
||||||
|
1000000 999999
|
||||||
|
781545 590920
|
||||||
|
988596 896785
|
||||||
|
500000 131071
|
||||||
|
908603 723827
|
||||||
|
733966 669136
|
||||||
|
500000 2
|
||||||
|
999999 262143
|
||||||
|
1000000 262143
|
||||||
|
999999 999999
|
||||||
|
766127 659378
|
||||||
|
1000000 2
|
||||||
|
999999 128
|
||||||
|
999999 475711
|
||||||
|
5 1
|
||||||
|
3 2
|
||||||
|
295947 238386
|
||||||
|
757044 746415
|
||||||
|
730543 605080
|
||||||
|
1000000 499999
|
||||||
|
999999 499999
|
||||||
|
325525 322371
|
||||||
|
4 1
|
||||||
|
603563 601080
|
||||||
|
658631 605203
|
||||||
|
999999 2
|
||||||
|
970467 889873
|
||||||
|
622769 599758
|
||||||
|
999999 405596
|
||||||
|
584177 483967
|
||||||
|
999999 499998
|
||||||
|
500000 249998
|
||||||
|
291258 282674
|
||||||
|
2 1
|
||||||
|
1000000 127
|
||||||
|
345422 321324
|
||||||
|
999999 524288
|
||||||
|
1000000 311529
|
||||||
|
482389 402157
|
||||||
|
781705 743207
|
||||||
|
404823 382661
|
||||||
|
500000 171016
|
||||||
|
319994 257667
|
||||||
|
500000 500000
|
||||||
|
999999 475712
|
||||||
|
999999 503941
|
||||||
|
261684 255887
|
||||||
|
999999 1
|
||||||
|
999999 127
|
||||||
|
972908 809732
|
||||||
|
999999 999998
|
||||||
|
500000 499999
|
||||||
|
444422 378048
|
||||||
|
500000 249999
|
||||||
|
1000000 524287
|
||||||
|
999999 262144
|
||||||
|
500000 131072
|
||||||
|
1000000 475712
|
||||||
|
500000 244670
|
||||||
|
430690 393246
|
||||||
|
830432 720895
|
||||||
|
2 2
|
||||||
|
653741 620007
|
||||||
|
675827 659444
|
||||||
|
500000 237857
|
||||||
|
500000 237856
|
||||||
|
999999 524287
|
||||||
|
999999 499997
|
||||||
|
1000000 1
|
||||||
|
873816 815962
|
||||||
|
351794 313043
|
||||||
30
puzzles/google_code_jam/2017/0-C.cpp.test
Normal file
30
puzzles/google_code_jam/2017/0-C.cpp.test
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
29
|
||||||
|
4 2
|
||||||
|
5 2
|
||||||
|
6 2
|
||||||
|
1000 1000
|
||||||
|
1000 1
|
||||||
|
64 1
|
||||||
|
64 2
|
||||||
|
64 3
|
||||||
|
64 4
|
||||||
|
64 5
|
||||||
|
64 6
|
||||||
|
64 7
|
||||||
|
64 8
|
||||||
|
65 1
|
||||||
|
65 2
|
||||||
|
65 3
|
||||||
|
65 4
|
||||||
|
65 5
|
||||||
|
65 6
|
||||||
|
65 7
|
||||||
|
65 8
|
||||||
|
66 1
|
||||||
|
66 2
|
||||||
|
66 3
|
||||||
|
66 4
|
||||||
|
66 5
|
||||||
|
66 6
|
||||||
|
66 7
|
||||||
|
66 8
|
||||||
235
puzzles/google_code_jam/2017/0-D.cpp
Normal file
235
puzzles/google_code_jam/2017/0-D.cpp
Normal file
@@ -0,0 +1,235 @@
|
|||||||
|
/*
|
||||||
|
VIM: let g:lcppflags="-std=c++11 -O2 -pthread"
|
||||||
|
VIM: let g:wcppflags="/O2 /EHsc /DWIN32"
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include <sstream>
|
||||||
|
#include <fstream>
|
||||||
|
#include <iomanip>
|
||||||
|
#include <exception>
|
||||||
|
#include <stdexcept>
|
||||||
|
#include <map>
|
||||||
|
#include <set>
|
||||||
|
#include <list>
|
||||||
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
|
#include <memory>
|
||||||
|
#include <functional>
|
||||||
|
#include <algorithm>
|
||||||
|
#include <utility>
|
||||||
|
#include <limits>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
typedef long long ll;
|
||||||
|
typedef std::vector<ll> vec;
|
||||||
|
void check(bool b) { if (!b) std::cerr << "error" << std::endl; }
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
std::string to_string( T t ){
|
||||||
|
std::stringstream ss;
|
||||||
|
ss << t;
|
||||||
|
return ss.str();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Problem D. Fashion Show
|
||||||
|
Confused? Read the quick-start guide.
|
||||||
|
Small input
|
||||||
|
10 points
|
||||||
|
You may try multiple times, with penalties for wrong submissions.
|
||||||
|
Large input
|
||||||
|
25 points
|
||||||
|
You must solve the small input first.
|
||||||
|
You have 8 minutes to solve 1 input file. (Judged after contest.)
|
||||||
|
Problem
|
||||||
|
|
||||||
|
You are about to host a fashion show to show off three new styles of clothing. The show will be held on a stage which is in the most fashionable of all shapes: an N-by-N grid of cells.
|
||||||
|
|
||||||
|
Each cell in the grid can be empty (which we represent with a . character) or can contain one fashion model. The models come in three types, depending on the clothing style they are wearing: +, x, and the super-trendy o. A cell with a + or x model in it adds 1 style point to the show. A cell with an o model in it adds 2 style points. Empty cells add no style points.
|
||||||
|
|
||||||
|
To achieve the maximum artistic effect, there are rules on how models can be placed relative to each other.
|
||||||
|
|
||||||
|
Whenever any two models share a row or column, at least one of the two must be a +.
|
||||||
|
Whenever any two models share a diagonal of the grid, at least one of the two must be an x.
|
||||||
|
|
||||||
|
Formally, a model located in row i0 and column j0 and a model located in row i1 and column j1 share a row if and only if i0 = i1, they share a column if and only if j0 = j1, and they share a diagonal if and only if i0 + j0 = i1 + j1 or i0 - j0 = i1 - j1.
|
||||||
|
|
||||||
|
For example, the following grid is not legal:
|
||||||
|
...
|
||||||
|
x+o
|
||||||
|
.+.
|
||||||
|
|
||||||
|
The middle row has a pair of models (x and o) that does not include a +. The diagonal starting at the + in the bottom row and running up to the o in the middle row has two models, and neither of them is an x.
|
||||||
|
|
||||||
|
However, the following grid is legal. No row, column, or diagonal violates the rules.
|
||||||
|
+.x
|
||||||
|
+x+
|
||||||
|
o..
|
||||||
|
|
||||||
|
Your artistic advisor has already placed M models in certain cells, following these rules. You are free to place any number (including zero) of additional models of whichever types you like. You may not remove existing models, but you may upgrade as many existing + and x models into o models as you wish, as long as the above rules are not violated.
|
||||||
|
|
||||||
|
Your task is to find a legal way of placing and/or upgrading models that earns the maximum possible number of style points.
|
||||||
|
Input
|
||||||
|
|
||||||
|
The first line of the input gives the number of test cases, T. T test cases follow. Each test case begins with one line with two integers N and M, as described above. Then, M more lines follow; the i-th of these lines has a +, x, or o character (the type of the model) and two integers Ri and Ci (the position of the model). The rows of the grid are numbered 1 through N, from top to bottom. The columns of the grid are numbered 1 through N, from left to right.
|
||||||
|
Output
|
||||||
|
|
||||||
|
For each test case, first output one line containing Case #x: y z, where x is the test case number (starting from 1), y is the number of style points earned in your arrangement, and z is the total number of models you have added and/or substituted in. Then, for each model that you have added or substituted in, output exactly one line in exactly the same format described in the Input section, where the character is the type of the model that you have added or substituted in. These z lines can be in any order.
|
||||||
|
|
||||||
|
If there are multiple valid answers, you may output any one of them.
|
||||||
|
Limits
|
||||||
|
|
||||||
|
1 ≤ T ≤ 100.
|
||||||
|
1 ≤ N ≤ 100.
|
||||||
|
1 ≤ Ci ≤ N, for all i.
|
||||||
|
0 ≤ M ≤ N2.
|
||||||
|
No two pre-placed models appear in the same cell.
|
||||||
|
It is guaranteed that the set of pre-placed models follows the rules.
|
||||||
|
Small dataset
|
||||||
|
|
||||||
|
Ri = 1, for all i. (Any models that are pre-placed are in the top row. Note that you may add/replace models in that row and/or add models in other rows.)
|
||||||
|
Large dataset
|
||||||
|
|
||||||
|
1 ≤ Ri ≤ N, for all i.
|
||||||
|
Sample
|
||||||
|
|
||||||
|
Input
|
||||||
|
|
||||||
|
Output
|
||||||
|
|
||||||
|
|
||||||
|
3
|
||||||
|
2 0
|
||||||
|
1 1
|
||||||
|
o 1 1
|
||||||
|
3 4
|
||||||
|
+ 2 3
|
||||||
|
+ 2 1
|
||||||
|
x 3 1
|
||||||
|
+ 2 2
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Case #1: 4 3
|
||||||
|
o 2 2
|
||||||
|
+ 2 1
|
||||||
|
x 1 1
|
||||||
|
Case #2: 2 0
|
||||||
|
Case #3: 6 2
|
||||||
|
o 2 3
|
||||||
|
x 1 2
|
||||||
|
|
||||||
|
The sample output displays one set of answers to the sample cases. Other answers may be possible. Note that the last sample case would not appear in the Small dataset.
|
||||||
|
|
||||||
|
In sample case #1, the grid is 2-by-2 and is initially blank. The output corresponds to the following grid. (In these explanations, we will use . to denote a blank cell.)
|
||||||
|
x.
|
||||||
|
+o
|
||||||
|
|
||||||
|
In sample case #2, the only cell is already occupied by an o model, and it is impossible to add a new model or replace the o model.
|
||||||
|
|
||||||
|
In sample case #3, the grid looks like this before you place any models:
|
||||||
|
...
|
||||||
|
+++
|
||||||
|
x..
|
||||||
|
|
||||||
|
The output corresponds to this grid:
|
||||||
|
.x.
|
||||||
|
++o
|
||||||
|
x..
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
auto solve_puzzle(std::istream& is)
|
||||||
|
{
|
||||||
|
long long n, k;
|
||||||
|
is >> n >> k;
|
||||||
|
|
||||||
|
long long sec=1;
|
||||||
|
for ( long long kk = k; kk; kk>>=1, sec<<=1 ); //exp2( (int)ceil(log2( k+1 )) );
|
||||||
|
long long empty = n - sec +1;
|
||||||
|
long long min = empty / sec;
|
||||||
|
long long rem = empty % sec;
|
||||||
|
long long max = min;
|
||||||
|
if ( (rem - (sec/2)) >= (k-sec/2+1) ) {
|
||||||
|
max = min += 1;
|
||||||
|
} else if ( rem >= (k-sec/2+1) ) {
|
||||||
|
max = min + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
int best_min, best_max, best_place;
|
||||||
|
std::vector<int> v( n, 0);
|
||||||
|
for ( int i = 0; i <k; ++i ){
|
||||||
|
best_min = best_max = best_place = -1;
|
||||||
|
for ( int j = 0; j < n; ++j ){
|
||||||
|
if ( v[j] == 0 ){
|
||||||
|
int Ls = 0;
|
||||||
|
int Rs = 0;
|
||||||
|
for ( int l = j-1; l >= 0 && v[l] == 0; --l ) {
|
||||||
|
++Ls;
|
||||||
|
}
|
||||||
|
for ( int l = j+1; l < n && v[l] == 0; ++l ) {
|
||||||
|
++Rs;
|
||||||
|
}
|
||||||
|
int j_min = std::min(Ls,Rs);
|
||||||
|
int j_max = std::max(Ls,Rs);
|
||||||
|
if ( best_min < j_min
|
||||||
|
|| best_min == j_min && best_max < j_max ) {
|
||||||
|
best_place = j;
|
||||||
|
best_min = j_min;
|
||||||
|
best_max = j_max;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
v[best_place] = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( best_min != min || best_max != max ) {
|
||||||
|
std::cout << "Error: " << n << " " << k << " -> " << best_max << " " << best_min << " -> ";
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return to_string(max) + ' ' + to_string(min);
|
||||||
|
}
|
||||||
|
|
||||||
|
void read_input_and_solve( std::istream& is, std::ostream& os )
|
||||||
|
{
|
||||||
|
srand((unsigned)time(NULL));
|
||||||
|
int puzzle_count;
|
||||||
|
|
||||||
|
is >> puzzle_count;
|
||||||
|
is.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
|
||||||
|
for (int i = 1; i <= puzzle_count; i++)
|
||||||
|
{
|
||||||
|
os << "Case #" << i << ": ";
|
||||||
|
auto r = solve_puzzle(is);
|
||||||
|
os << r << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char * argv[])
|
||||||
|
{
|
||||||
|
try{
|
||||||
|
if ( *++argv ) {
|
||||||
|
std::ifstream ifs(*argv);
|
||||||
|
read_input_and_solve( ifs, std::cout );
|
||||||
|
} else {
|
||||||
|
read_input_and_solve( std::cin, std::cout );
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
catch (const std::exception& e)
|
||||||
|
{
|
||||||
|
std::cerr << std::endl
|
||||||
|
<< "std::exception(\"" << e.what() << "\")." << std::endl;
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
std::cerr << std::endl
|
||||||
|
<< "unknown exception." << std::endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
9
puzzles/google_code_jam/2017/0-D.cpp.test
Normal file
9
puzzles/google_code_jam/2017/0-D.cpp.test
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
3
|
||||||
|
2 0
|
||||||
|
1 1
|
||||||
|
o 1 1
|
||||||
|
3 4
|
||||||
|
+ 2 3
|
||||||
|
+ 2 1
|
||||||
|
x 3 1
|
||||||
|
+ 2 2
|
||||||
157
puzzles/google_code_jam/2017/1B-A.cpp
Normal file
157
puzzles/google_code_jam/2017/1B-A.cpp
Normal file
@@ -0,0 +1,157 @@
|
|||||||
|
/*
|
||||||
|
VIM: let g:lcppflags="-std=c++11 -O2 -pthread"
|
||||||
|
VIM: let g:wcppflags="/O2 /EHsc /DWIN32"
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include <sstream>
|
||||||
|
#include <fstream>
|
||||||
|
#include <iomanip>
|
||||||
|
#include <exception>
|
||||||
|
#include <stdexcept>
|
||||||
|
#include <map>
|
||||||
|
#include <set>
|
||||||
|
#include <list>
|
||||||
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
|
#include <memory>
|
||||||
|
#include <functional>
|
||||||
|
#include <algorithm>
|
||||||
|
#include <utility>
|
||||||
|
#include <limits>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
typedef long long ll;
|
||||||
|
typedef std::vector<ll> vec;
|
||||||
|
void check(bool b) { if (!b) std::cerr << "error" << std::endl; }
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
std::string to_string( T t ){
|
||||||
|
std::stringstream ss;
|
||||||
|
ss << t;
|
||||||
|
return ss.str();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Problem A. Steed 2: Cruise Control
|
||||||
|
Confused? Read the quick-start guide.
|
||||||
|
Small input
|
||||||
|
11 points
|
||||||
|
You may try multiple times, with penalties for wrong submissions.
|
||||||
|
Large input
|
||||||
|
14 points
|
||||||
|
You must solve the small input first.
|
||||||
|
You have 8 minutes to solve 1 input file. (Judged after contest.)
|
||||||
|
Problem
|
||||||
|
|
||||||
|
Annie is a bus driver with a high-stress job. She tried to unwind by going on a Caribbean cruise, but that also turned out to be stressful, so she has recently taken up horseback riding.
|
||||||
|
|
||||||
|
Today, Annie is riding her horse to the east along a long and narrow one-way road that runs west to east. She is currently at kilometer 0 of the road, and her destination is at kilometer D; kilometers along the road are numbered from west to east.
|
||||||
|
|
||||||
|
There are N other horses traveling east on the same road; all of them will go on traveling forever, and all of them are currently between Annie's horse and her destination. The i-th of these horses is initially at kilometer Ki and is traveling at its maximum speed of Si kilometers per hour.
|
||||||
|
|
||||||
|
Horses are very polite, and a horse H1 will not pass (move ahead of) another horse H2 that started off ahead of H1. (Two or more horses can share the same position for any amount of time; you may consider the horses to be single points.) Horses (other than Annie's) travel at their maximum speeds, except that whenever a horse H1 catches up to another slower horse H2, H1 reduces its speed to match the speed of H2.
|
||||||
|
|
||||||
|
Annie's horse, on the other hand, does not have a maximum speed and can travel at any speed that Annie chooses, as long as it does not pass another horse. To ensure a smooth ride for her and her horse, Annie wants to choose a single constant "cruise control" speed for her horse for the entire trip, from her current position to the destination, such that her horse will not pass any other horses. What is the maximum such speed that she can choose?
|
||||||
|
Input
|
||||||
|
|
||||||
|
The first line of the input gives the number of test cases, T; T test cases follow. Each test case begins with two integers D and N: the destination position of all of the horses (in kilometers) and the number of other horses on the road. Then, N lines follow. The i-th of those lines has two integers Ki and Si: the initial position (in kilometers) and maximum speed (in kilometers per hour) of the i-th of the other horses on the road.
|
||||||
|
Output
|
||||||
|
|
||||||
|
For each test case, output one line containing Case #x: y, where x is the test case number (starting from 1) and y is the maximum constant speed (in kilometers per hour) that Annie can use without colliding with other horses. y will be considered correct if it is within an absolute or relative error of 10-6 of the correct answer. See the FAQ for an explanation of what that means, and what formats of real numbers we accept.
|
||||||
|
Limits
|
||||||
|
|
||||||
|
1 ≤ T ≤ 100.
|
||||||
|
0 < Ki < D ≤ 109, for all i.
|
||||||
|
Ki ≠ Mj, for all i ≠ j. (No two horses start in the same position.)
|
||||||
|
1 ≤ Si ≤ 10000.
|
||||||
|
Small dataset
|
||||||
|
|
||||||
|
1 ≤ N ≤ 2.
|
||||||
|
Large dataset
|
||||||
|
|
||||||
|
1 ≤ N ≤ 1000.
|
||||||
|
Sample
|
||||||
|
|
||||||
|
Input
|
||||||
|
|
||||||
|
Output
|
||||||
|
|
||||||
|
|
||||||
|
3
|
||||||
|
2525 1
|
||||||
|
2400 5
|
||||||
|
300 2
|
||||||
|
120 60
|
||||||
|
60 90
|
||||||
|
100 2
|
||||||
|
80 100
|
||||||
|
70 10
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Case #1: 101.000000
|
||||||
|
Case #2: 100.000000
|
||||||
|
Case #3: 33.333333
|
||||||
|
|
||||||
|
In sample case #1, there is one other (very slow!) horse on the road; it will reach Annie's destination after 25 hours. Anything faster than 101 kilometers per hour would cause Annie to pass the horse before reaching the destination.
|
||||||
|
|
||||||
|
In sample case #2, there are two other horses on the road. The faster horse will catch up to the slower horse at kilometer 240 after 2 hours. Both horses will then go at the slower horse's speed for 1 more hour, until the horses reach Annie's destination at kilometer 300. The maximum speed that Annie can choose without passing another horse is 100 kilometers per hour.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
auto solve_puzzle(std::istream& is)
|
||||||
|
{
|
||||||
|
long long n, d, k, s;
|
||||||
|
double mt = 0;
|
||||||
|
is >> d >> n;
|
||||||
|
for ( auto i = 0; i < n; ++i ) {
|
||||||
|
is >> k >> s;
|
||||||
|
double t = double(d - k) / s;
|
||||||
|
mt = std::max( mt, t);
|
||||||
|
}
|
||||||
|
|
||||||
|
return d / mt;
|
||||||
|
}
|
||||||
|
|
||||||
|
void read_input_and_solve( std::istream& is, std::ostream& os )
|
||||||
|
{
|
||||||
|
srand((unsigned)time(NULL));
|
||||||
|
int puzzle_count;
|
||||||
|
|
||||||
|
is >> puzzle_count;
|
||||||
|
is.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
|
||||||
|
for (int i = 1; i <= puzzle_count; i++)
|
||||||
|
{
|
||||||
|
os << "Case #" << i << ": ";
|
||||||
|
auto r = solve_puzzle(is);
|
||||||
|
os << std::fixed << r << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char * argv[])
|
||||||
|
{
|
||||||
|
try{
|
||||||
|
if ( *++argv ) {
|
||||||
|
std::ifstream ifs(*argv);
|
||||||
|
read_input_and_solve( ifs, std::cout );
|
||||||
|
} else {
|
||||||
|
read_input_and_solve( std::cin, std::cout );
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
catch (const std::exception& e)
|
||||||
|
{
|
||||||
|
std::cerr << std::endl
|
||||||
|
<< "std::exception(\"" << e.what() << "\")." << std::endl;
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
std::cerr << std::endl
|
||||||
|
<< "unknown exception." << std::endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
7371
puzzles/google_code_jam/2017/1B-A.cpp.large.in
Normal file
7371
puzzles/google_code_jam/2017/1B-A.cpp.large.in
Normal file
File diff suppressed because it is too large
Load Diff
211
puzzles/google_code_jam/2017/1B-A.cpp.small-attempt0.in
Normal file
211
puzzles/google_code_jam/2017/1B-A.cpp.small-attempt0.in
Normal file
@@ -0,0 +1,211 @@
|
|||||||
|
99
|
||||||
|
2525 1
|
||||||
|
2400 5
|
||||||
|
300 2
|
||||||
|
120 60
|
||||||
|
60 90
|
||||||
|
2 1
|
||||||
|
1 10000
|
||||||
|
131077822 1
|
||||||
|
105930950 3608
|
||||||
|
951474064 1
|
||||||
|
605617783 1854
|
||||||
|
932241924 1
|
||||||
|
250413260 5563
|
||||||
|
251976750 1
|
||||||
|
37523298 6912
|
||||||
|
99152721 1
|
||||||
|
58354860 1926
|
||||||
|
783018707 1
|
||||||
|
88121307 4131
|
||||||
|
639338367 1
|
||||||
|
291203113 6378
|
||||||
|
672514796 1
|
||||||
|
170175618 8738
|
||||||
|
287774565 1
|
||||||
|
190526946 9796
|
||||||
|
38994305 1
|
||||||
|
10780080 6841
|
||||||
|
1000000000 1
|
||||||
|
999999999 1
|
||||||
|
285136113 1
|
||||||
|
112216518 9297
|
||||||
|
273333115 1
|
||||||
|
199748352 7776
|
||||||
|
241712373 1
|
||||||
|
233348860 4651
|
||||||
|
1000000000 2
|
||||||
|
100 10000
|
||||||
|
200 10000
|
||||||
|
652009174 1
|
||||||
|
338724449 352
|
||||||
|
352537441 1
|
||||||
|
208600649 3594
|
||||||
|
1000000000 2
|
||||||
|
999999996 3
|
||||||
|
999999997 2
|
||||||
|
402968800 1
|
||||||
|
146355729 3814
|
||||||
|
900178370 1
|
||||||
|
691948054 3451
|
||||||
|
123392396 1
|
||||||
|
62644635 2299
|
||||||
|
609693185 1
|
||||||
|
482964044 9690
|
||||||
|
289799855 1
|
||||||
|
119110900 10000
|
||||||
|
613708385 1
|
||||||
|
207593466 436
|
||||||
|
10624065 1
|
||||||
|
7660000 5131
|
||||||
|
319827779 1
|
||||||
|
233417751 5372
|
||||||
|
704981430 1
|
||||||
|
434585122 6050
|
||||||
|
557998694 1
|
||||||
|
385991442 4632
|
||||||
|
238116277 1
|
||||||
|
124154500 3903
|
||||||
|
599586097 1
|
||||||
|
168139845 2005
|
||||||
|
2 1
|
||||||
|
1 1
|
||||||
|
372391542 1
|
||||||
|
359873480 177
|
||||||
|
413918839 1
|
||||||
|
254928106 1093
|
||||||
|
842764022 1
|
||||||
|
658957576 4070
|
||||||
|
784534362 1
|
||||||
|
268746719 8114
|
||||||
|
205951222 1
|
||||||
|
114775068 901
|
||||||
|
306794940 1
|
||||||
|
304497843 1344
|
||||||
|
1000000000 2
|
||||||
|
2 2
|
||||||
|
1 3
|
||||||
|
694325937 2
|
||||||
|
34215164 1166
|
||||||
|
582636968 9692
|
||||||
|
472533887 1
|
||||||
|
108306906 1794
|
||||||
|
1000000000 2
|
||||||
|
999999998 3
|
||||||
|
999999999 2
|
||||||
|
726480404 1
|
||||||
|
327840527 9277
|
||||||
|
475150098 1
|
||||||
|
407953706 4021
|
||||||
|
1000000000 2
|
||||||
|
12345675 3
|
||||||
|
12345676 2
|
||||||
|
388370869 1
|
||||||
|
381026582 410
|
||||||
|
585584419 1
|
||||||
|
525156031 4916
|
||||||
|
392533744 1
|
||||||
|
147506468 7033
|
||||||
|
601128505 1
|
||||||
|
41357453 5135
|
||||||
|
739344631 1
|
||||||
|
432447251 7431
|
||||||
|
899094944 1
|
||||||
|
644586485 1113
|
||||||
|
541000239 1
|
||||||
|
138218162 4140
|
||||||
|
334146606 2
|
||||||
|
105422380 7667
|
||||||
|
285743300 2394
|
||||||
|
524065206 1
|
||||||
|
145094512 4290
|
||||||
|
690438607 1
|
||||||
|
417609260 8697
|
||||||
|
634155725 1
|
||||||
|
369081537 64
|
||||||
|
71029611 1
|
||||||
|
63620453 8392
|
||||||
|
788982628 1
|
||||||
|
764761697 1715
|
||||||
|
1000000000 2
|
||||||
|
999000000 10000
|
||||||
|
998000000 10000
|
||||||
|
586330136 1
|
||||||
|
416104919 7260
|
||||||
|
974323101 1
|
||||||
|
364680900 2441
|
||||||
|
140899898 1
|
||||||
|
5967101 9667
|
||||||
|
527347037 1
|
||||||
|
83937058 6980
|
||||||
|
1000000000 1
|
||||||
|
1 1
|
||||||
|
838241117 1
|
||||||
|
369982007 1821
|
||||||
|
204099020 1
|
||||||
|
146539679 7474
|
||||||
|
756005869 1
|
||||||
|
733105085 9319
|
||||||
|
905751325 1
|
||||||
|
617152714 8229
|
||||||
|
386505314 1
|
||||||
|
108917676 801
|
||||||
|
121872146 1
|
||||||
|
111514347 6707
|
||||||
|
885278578 1
|
||||||
|
113187929 9117
|
||||||
|
17305691 1
|
||||||
|
5104584 7370
|
||||||
|
279273193 1
|
||||||
|
269999131 5890
|
||||||
|
715117710 1
|
||||||
|
530291656 6727
|
||||||
|
750837609 1
|
||||||
|
392277806 5209
|
||||||
|
243133077 1
|
||||||
|
188915973 6229
|
||||||
|
96964909 1
|
||||||
|
86353596 7617
|
||||||
|
538785005 1
|
||||||
|
171300038 4040
|
||||||
|
1000000000 2
|
||||||
|
998000000 1
|
||||||
|
999000000 1
|
||||||
|
1000000000 1
|
||||||
|
1 10000
|
||||||
|
581217043 1
|
||||||
|
61393681 2377
|
||||||
|
395351612 1
|
||||||
|
124892568 8238
|
||||||
|
731299822 1
|
||||||
|
44667286 1729
|
||||||
|
200000 2
|
||||||
|
5001 1
|
||||||
|
5000 6
|
||||||
|
230520328 1
|
||||||
|
210198390 1254
|
||||||
|
717440572 1
|
||||||
|
240408593 7958
|
||||||
|
741024937 1
|
||||||
|
519308978 8851
|
||||||
|
646254995 1
|
||||||
|
330233771 3441
|
||||||
|
163010463 1
|
||||||
|
98094045 1777
|
||||||
|
472730072 1
|
||||||
|
352244381 2127
|
||||||
|
1000000000 2
|
||||||
|
999999997 3
|
||||||
|
999999998 2
|
||||||
|
199204510 1
|
||||||
|
36606297 2361
|
||||||
|
747306642 1
|
||||||
|
547707522 3524
|
||||||
|
315995728 1
|
||||||
|
214982115 1703
|
||||||
|
563697987 1
|
||||||
|
200471299 1186
|
||||||
|
1000000000 1
|
||||||
|
999999999 10000
|
||||||
|
636835443 1
|
||||||
|
329016383 7064
|
||||||
211
puzzles/google_code_jam/2017/1B-A.cpp.small-attempt1.in
Normal file
211
puzzles/google_code_jam/2017/1B-A.cpp.small-attempt1.in
Normal file
@@ -0,0 +1,211 @@
|
|||||||
|
99
|
||||||
|
2525 1
|
||||||
|
2400 5
|
||||||
|
300 2
|
||||||
|
120 60
|
||||||
|
60 90
|
||||||
|
217798240 1
|
||||||
|
146305889 2493
|
||||||
|
578646110 1
|
||||||
|
327436111 4593
|
||||||
|
1000000000 2
|
||||||
|
200 10000
|
||||||
|
100 10000
|
||||||
|
1000000000 2
|
||||||
|
1 3
|
||||||
|
2 2
|
||||||
|
881458398 1
|
||||||
|
73810895 3157
|
||||||
|
633405391 1
|
||||||
|
496207442 6899
|
||||||
|
883217560 1
|
||||||
|
224024440 6891
|
||||||
|
350158605 1
|
||||||
|
271437889 1261
|
||||||
|
481808395 1
|
||||||
|
444999355 705
|
||||||
|
2 1
|
||||||
|
1 1
|
||||||
|
210795822 1
|
||||||
|
153235796 9787
|
||||||
|
764300047 1
|
||||||
|
7918341 3650
|
||||||
|
438404410 1
|
||||||
|
161644530 245
|
||||||
|
225048616 2
|
||||||
|
205554115 5442
|
||||||
|
119329397 7763
|
||||||
|
558665977 1
|
||||||
|
168331113 473
|
||||||
|
554270087 1
|
||||||
|
428631798 1304
|
||||||
|
103938028 1
|
||||||
|
86935470 7256
|
||||||
|
368142083 1
|
||||||
|
62100946 7506
|
||||||
|
774554103 1
|
||||||
|
2057397 8188
|
||||||
|
583591774 1
|
||||||
|
77758148 1626
|
||||||
|
1000000000 2
|
||||||
|
999999998 2
|
||||||
|
999999997 3
|
||||||
|
140465638 1
|
||||||
|
31605168 4609
|
||||||
|
1000000000 2
|
||||||
|
999000000 10000
|
||||||
|
998000000 10000
|
||||||
|
8375319 1
|
||||||
|
6578994 9729
|
||||||
|
887712751 1
|
||||||
|
35481916 2027
|
||||||
|
150597703 1
|
||||||
|
120145099 784
|
||||||
|
328103945 1
|
||||||
|
218796640 4802
|
||||||
|
271876415 1
|
||||||
|
26636391 523
|
||||||
|
1000000000 1
|
||||||
|
1 1
|
||||||
|
351414589 1
|
||||||
|
23600972 3860
|
||||||
|
826255493 1
|
||||||
|
753199378 8367
|
||||||
|
901004493 1
|
||||||
|
786546073 8897
|
||||||
|
930321148 1
|
||||||
|
85163498 5829
|
||||||
|
336785670 1
|
||||||
|
260273545 2258
|
||||||
|
1000000000 2
|
||||||
|
12345675 3
|
||||||
|
12345676 2
|
||||||
|
914416975 1
|
||||||
|
520419911 4951
|
||||||
|
785552906 1
|
||||||
|
187912472 8725
|
||||||
|
1000000000 2
|
||||||
|
999999997 2
|
||||||
|
999999996 3
|
||||||
|
909064024 1
|
||||||
|
311653078 8551
|
||||||
|
582070780 1
|
||||||
|
158556123 2280
|
||||||
|
827863677 1
|
||||||
|
251181503 8764
|
||||||
|
281011441 1
|
||||||
|
31470674 1773
|
||||||
|
137901999 1
|
||||||
|
77530065 9919
|
||||||
|
701904230 1
|
||||||
|
571989024 6151
|
||||||
|
969772496 1
|
||||||
|
378138363 7578
|
||||||
|
919779276 1
|
||||||
|
743616381 8628
|
||||||
|
799111592 1
|
||||||
|
259277564 3583
|
||||||
|
207193013 1
|
||||||
|
162840052 5336
|
||||||
|
579399351 1
|
||||||
|
378718338 6282
|
||||||
|
194575361 1
|
||||||
|
7334937 8549
|
||||||
|
386345255 1
|
||||||
|
73238698 8641
|
||||||
|
444899403 1
|
||||||
|
362050643 8868
|
||||||
|
545641344 1
|
||||||
|
80005227 9973
|
||||||
|
223154579 1
|
||||||
|
163780193 1766
|
||||||
|
773579333 1
|
||||||
|
635384022 1759
|
||||||
|
210098839 1
|
||||||
|
67336376 8487
|
||||||
|
148301041 1
|
||||||
|
130688490 5159
|
||||||
|
50176833 1
|
||||||
|
33679018 9287
|
||||||
|
196447240 1
|
||||||
|
63873687 6860
|
||||||
|
603801760 1
|
||||||
|
90787527 1865
|
||||||
|
607270292 1
|
||||||
|
116729301 4219
|
||||||
|
903992442 1
|
||||||
|
124461139 2924
|
||||||
|
776043559 1
|
||||||
|
141783089 8812
|
||||||
|
787677742 1
|
||||||
|
111691601 9810
|
||||||
|
896132473 1
|
||||||
|
775805818 3862
|
||||||
|
1000000000 1
|
||||||
|
999999999 10000
|
||||||
|
566422823 1
|
||||||
|
437348831 3048
|
||||||
|
1000000000 1
|
||||||
|
999999999 1
|
||||||
|
42258299 1
|
||||||
|
19445470 1580
|
||||||
|
465548193 1
|
||||||
|
350203484 4103
|
||||||
|
369399516 1
|
||||||
|
102065855 7900
|
||||||
|
982874977 1
|
||||||
|
201421822 4255
|
||||||
|
2 1
|
||||||
|
1 10000
|
||||||
|
1000000000 2
|
||||||
|
999000000 1
|
||||||
|
998000000 1
|
||||||
|
725109723 1
|
||||||
|
657831348 6991
|
||||||
|
171324792 1
|
||||||
|
36804169 3291
|
||||||
|
343261516 1
|
||||||
|
256718599 8823
|
||||||
|
664927195 1
|
||||||
|
426817489 163
|
||||||
|
784156838 1
|
||||||
|
632837726 2001
|
||||||
|
685205785 1
|
||||||
|
678253740 8193
|
||||||
|
188129370 1
|
||||||
|
14024495 2249
|
||||||
|
145485345 1
|
||||||
|
109326555 6822
|
||||||
|
999699829 1
|
||||||
|
321325543 194
|
||||||
|
669956611 1
|
||||||
|
173732674 1408
|
||||||
|
1000000000 2
|
||||||
|
999999999 2
|
||||||
|
999999998 3
|
||||||
|
808249863 1
|
||||||
|
696710811 3632
|
||||||
|
916809197 1
|
||||||
|
699131269 1251
|
||||||
|
879968862 1
|
||||||
|
87260137 5208
|
||||||
|
758390455 1
|
||||||
|
207898600 6962
|
||||||
|
180806630 1
|
||||||
|
34681201 8846
|
||||||
|
930370495 2
|
||||||
|
856463599 6698
|
||||||
|
531958788 3099
|
||||||
|
280205321 1
|
||||||
|
204256775 6099
|
||||||
|
856985737 1
|
||||||
|
38795534 5021
|
||||||
|
200000 2
|
||||||
|
5000 5
|
||||||
|
5001 1
|
||||||
|
548732047 1
|
||||||
|
134998525 4337
|
||||||
|
1000000000 1
|
||||||
|
1 10000
|
||||||
|
944329142 1
|
||||||
|
527227192 2960
|
||||||
211
puzzles/google_code_jam/2017/1B-A.cpp.test
Normal file
211
puzzles/google_code_jam/2017/1B-A.cpp.test
Normal file
@@ -0,0 +1,211 @@
|
|||||||
|
99
|
||||||
|
2525 1
|
||||||
|
2400 5
|
||||||
|
300 2
|
||||||
|
120 60
|
||||||
|
60 90
|
||||||
|
2 1
|
||||||
|
1 10000
|
||||||
|
131077822 1
|
||||||
|
105930950 3608
|
||||||
|
951474064 1
|
||||||
|
605617783 1854
|
||||||
|
932241924 1
|
||||||
|
250413260 5563
|
||||||
|
251976750 1
|
||||||
|
37523298 6912
|
||||||
|
99152721 1
|
||||||
|
58354860 1926
|
||||||
|
783018707 1
|
||||||
|
88121307 4131
|
||||||
|
639338367 1
|
||||||
|
291203113 6378
|
||||||
|
672514796 1
|
||||||
|
170175618 8738
|
||||||
|
287774565 1
|
||||||
|
190526946 9796
|
||||||
|
38994305 1
|
||||||
|
10780080 6841
|
||||||
|
1000000000 1
|
||||||
|
999999999 1
|
||||||
|
285136113 1
|
||||||
|
112216518 9297
|
||||||
|
273333115 1
|
||||||
|
199748352 7776
|
||||||
|
241712373 1
|
||||||
|
233348860 4651
|
||||||
|
1000000000 2
|
||||||
|
100 10000
|
||||||
|
200 10000
|
||||||
|
652009174 1
|
||||||
|
338724449 352
|
||||||
|
352537441 1
|
||||||
|
208600649 3594
|
||||||
|
1000000000 2
|
||||||
|
999999996 3
|
||||||
|
999999997 2
|
||||||
|
402968800 1
|
||||||
|
146355729 3814
|
||||||
|
900178370 1
|
||||||
|
691948054 3451
|
||||||
|
123392396 1
|
||||||
|
62644635 2299
|
||||||
|
609693185 1
|
||||||
|
482964044 9690
|
||||||
|
289799855 1
|
||||||
|
119110900 10000
|
||||||
|
613708385 1
|
||||||
|
207593466 436
|
||||||
|
10624065 1
|
||||||
|
7660000 5131
|
||||||
|
319827779 1
|
||||||
|
233417751 5372
|
||||||
|
704981430 1
|
||||||
|
434585122 6050
|
||||||
|
557998694 1
|
||||||
|
385991442 4632
|
||||||
|
238116277 1
|
||||||
|
124154500 3903
|
||||||
|
599586097 1
|
||||||
|
168139845 2005
|
||||||
|
2 1
|
||||||
|
1 1
|
||||||
|
372391542 1
|
||||||
|
359873480 177
|
||||||
|
413918839 1
|
||||||
|
254928106 1093
|
||||||
|
842764022 1
|
||||||
|
658957576 4070
|
||||||
|
784534362 1
|
||||||
|
268746719 8114
|
||||||
|
205951222 1
|
||||||
|
114775068 901
|
||||||
|
306794940 1
|
||||||
|
304497843 1344
|
||||||
|
1000000000 2
|
||||||
|
2 2
|
||||||
|
1 3
|
||||||
|
694325937 2
|
||||||
|
34215164 1166
|
||||||
|
582636968 9692
|
||||||
|
472533887 1
|
||||||
|
108306906 1794
|
||||||
|
1000000000 2
|
||||||
|
999999998 3
|
||||||
|
999999999 2
|
||||||
|
726480404 1
|
||||||
|
327840527 9277
|
||||||
|
475150098 1
|
||||||
|
407953706 4021
|
||||||
|
1000000000 2
|
||||||
|
12345675 3
|
||||||
|
12345676 2
|
||||||
|
388370869 1
|
||||||
|
381026582 410
|
||||||
|
585584419 1
|
||||||
|
525156031 4916
|
||||||
|
392533744 1
|
||||||
|
147506468 7033
|
||||||
|
601128505 1
|
||||||
|
41357453 5135
|
||||||
|
739344631 1
|
||||||
|
432447251 7431
|
||||||
|
899094944 1
|
||||||
|
644586485 1113
|
||||||
|
541000239 1
|
||||||
|
138218162 4140
|
||||||
|
334146606 2
|
||||||
|
105422380 7667
|
||||||
|
285743300 2394
|
||||||
|
524065206 1
|
||||||
|
145094512 4290
|
||||||
|
690438607 1
|
||||||
|
417609260 8697
|
||||||
|
634155725 1
|
||||||
|
369081537 64
|
||||||
|
71029611 1
|
||||||
|
63620453 8392
|
||||||
|
788982628 1
|
||||||
|
764761697 1715
|
||||||
|
1000000000 2
|
||||||
|
999000000 10000
|
||||||
|
998000000 10000
|
||||||
|
586330136 1
|
||||||
|
416104919 7260
|
||||||
|
974323101 1
|
||||||
|
364680900 2441
|
||||||
|
140899898 1
|
||||||
|
5967101 9667
|
||||||
|
527347037 1
|
||||||
|
83937058 6980
|
||||||
|
1000000000 1
|
||||||
|
1 1
|
||||||
|
838241117 1
|
||||||
|
369982007 1821
|
||||||
|
204099020 1
|
||||||
|
146539679 7474
|
||||||
|
756005869 1
|
||||||
|
733105085 9319
|
||||||
|
905751325 1
|
||||||
|
617152714 8229
|
||||||
|
386505314 1
|
||||||
|
108917676 801
|
||||||
|
121872146 1
|
||||||
|
111514347 6707
|
||||||
|
885278578 1
|
||||||
|
113187929 9117
|
||||||
|
17305691 1
|
||||||
|
5104584 7370
|
||||||
|
279273193 1
|
||||||
|
269999131 5890
|
||||||
|
715117710 1
|
||||||
|
530291656 6727
|
||||||
|
750837609 1
|
||||||
|
392277806 5209
|
||||||
|
243133077 1
|
||||||
|
188915973 6229
|
||||||
|
96964909 1
|
||||||
|
86353596 7617
|
||||||
|
538785005 1
|
||||||
|
171300038 4040
|
||||||
|
1000000000 2
|
||||||
|
998000000 1
|
||||||
|
999000000 1
|
||||||
|
1000000000 1
|
||||||
|
1 10000
|
||||||
|
581217043 1
|
||||||
|
61393681 2377
|
||||||
|
395351612 1
|
||||||
|
124892568 8238
|
||||||
|
731299822 1
|
||||||
|
44667286 1729
|
||||||
|
200000 2
|
||||||
|
5001 1
|
||||||
|
5000 6
|
||||||
|
230520328 1
|
||||||
|
210198390 1254
|
||||||
|
717440572 1
|
||||||
|
240408593 7958
|
||||||
|
741024937 1
|
||||||
|
519308978 8851
|
||||||
|
646254995 1
|
||||||
|
330233771 3441
|
||||||
|
163010463 1
|
||||||
|
98094045 1777
|
||||||
|
472730072 1
|
||||||
|
352244381 2127
|
||||||
|
1000000000 2
|
||||||
|
999999997 3
|
||||||
|
999999998 2
|
||||||
|
199204510 1
|
||||||
|
36606297 2361
|
||||||
|
747306642 1
|
||||||
|
547707522 3524
|
||||||
|
315995728 1
|
||||||
|
214982115 1703
|
||||||
|
563697987 1
|
||||||
|
200471299 1186
|
||||||
|
1000000000 1
|
||||||
|
999999999 10000
|
||||||
|
636835443 1
|
||||||
|
329016383 7064
|
||||||
243
puzzles/google_code_jam/2017/1B-B.cpp
Normal file
243
puzzles/google_code_jam/2017/1B-B.cpp
Normal file
@@ -0,0 +1,243 @@
|
|||||||
|
/*
|
||||||
|
VIM: let g:lcppflags="-std=c++11 -O2 -pthread"
|
||||||
|
VIM: let g:wcppflags="/O2 /EHsc /DWIN32"
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include <sstream>
|
||||||
|
#include <fstream>
|
||||||
|
#include <iomanip>
|
||||||
|
#include <exception>
|
||||||
|
#include <stdexcept>
|
||||||
|
#include <unordered_set>
|
||||||
|
#include <unordered_map>
|
||||||
|
#include <map>
|
||||||
|
#include <set>
|
||||||
|
#include <list>
|
||||||
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
|
#include <memory>
|
||||||
|
#include <functional>
|
||||||
|
#include <algorithm>
|
||||||
|
#include <utility>
|
||||||
|
#include <limits>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
typedef long long ll;
|
||||||
|
typedef std::vector<ll> vec;
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
std::string to_string( T t ){
|
||||||
|
std::stringstream ss;
|
||||||
|
ss << t;
|
||||||
|
return ss.str();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Problem B. Stable Neigh-bors
|
||||||
|
Confused? Read the quick-start guide.
|
||||||
|
Small input
|
||||||
|
13 points
|
||||||
|
You may try multiple times, with penalties for wrong submissions.
|
||||||
|
Large input
|
||||||
|
22 points
|
||||||
|
You must solve the small input first.
|
||||||
|
You have 8 minutes to solve 1 input file. (Judged after contest.)
|
||||||
|
Problem
|
||||||
|
|
||||||
|
You are lucky enough to own N pet unicorns. Each of your unicorns has either one or two of the following kinds of hairs in its mane: red hairs, yellow hairs, and blue hairs. The color of a mane depends on exactly which sorts of colored hairs it contains:
|
||||||
|
|
||||||
|
A mane with only one color of hair appears to be that color. For example, a mane with only blue hairs is blue.
|
||||||
|
A mane with red and yellow hairs appears orange.
|
||||||
|
A mane with yellow and blue hairs appears green.
|
||||||
|
A mane with red and blue hairs appears violet.
|
||||||
|
|
||||||
|
You have R, O, Y, G, B, and V unicorns with red, orange, yellow, green, blue, and violet manes, respectively.
|
||||||
|
|
||||||
|
You have just built a circular stable with N stalls, arranged in a ring such that each stall borders two other stalls. You would like to put exactly one of your unicorns in each of these stalls. However, unicorns need to feel rare and special, so no unicorn can be next to another unicorn that shares at least one of the hair colors in its mane. For example, a unicorn with an orange mane cannot be next to a unicorn with a violet mane, since both of those manes have red hairs. Similarly, a unicorn with a green mane cannot be next to a unicorn with a yellow mane, since both of those have yellow hairs.
|
||||||
|
|
||||||
|
Is it possible to place all of your unicorns? If so, provide any one arrangement.
|
||||||
|
Input
|
||||||
|
|
||||||
|
The first line of the input gives the number of test cases, T. T test cases follow. Each consists of one line with seven integers: N, R, O, Y, G, B, and V.
|
||||||
|
Output
|
||||||
|
|
||||||
|
For each test case, output one line containing Case #x: y, where x is the test case number (starting from 1) and y is IMPOSSIBLE if it is not possible to place all the unicorns, or a string of N characters representing the placements of unicorns in stalls, starting at a point of your choice and reading clockwise around the circle. Use R to represent each unicorn with a red mane, O to represent each unicorn with an orange mane, and so on with Y, G, B, and V. This arrangement must obey the rules described in the statement above.
|
||||||
|
|
||||||
|
If multiple arrangements are possible, you may print any of them.
|
||||||
|
Limits
|
||||||
|
|
||||||
|
1 ≤ T ≤ 100.
|
||||||
|
3 ≤ N ≤ 1000.
|
||||||
|
R + O + Y + G + B + V = N.
|
||||||
|
0 ≤ Z for each Z in {R, O, Y, G, B, V}.
|
||||||
|
Small dataset
|
||||||
|
|
||||||
|
O = G = V = 0. (Each unicorn has only one hair color in its mane.)
|
||||||
|
Large dataset
|
||||||
|
|
||||||
|
No restrictions beyond the general limits. (Each unicorn may have either one or two hair colors in its mane.)
|
||||||
|
Sample
|
||||||
|
|
||||||
|
Input
|
||||||
|
|
||||||
|
Output
|
||||||
|
|
||||||
|
|
||||||
|
4
|
||||||
|
6 2 0 2 0 2 0
|
||||||
|
3 1 0 2 0 0 0
|
||||||
|
6 2 0 1 1 2 0
|
||||||
|
4 0 0 2 0 0 2
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Case #1: RYBRBY
|
||||||
|
Case #2: IMPOSSIBLE
|
||||||
|
Case #3: YBRGRB
|
||||||
|
Case #4: YVYV
|
||||||
|
|
||||||
|
Note that the last two sample cases would not appear in the Small dataset.
|
||||||
|
|
||||||
|
For sample case #1, there are many possible answers; for example, another is BYBRYR. Note that BYRYRB would not be a valid answer; remember that the stalls form a ring, and the first touches the last!
|
||||||
|
|
||||||
|
In sample case #2, there are only three stalls, and each stall is a neighbor of the other two, so the two unicorns with yellow manes would have to be neighbors, which is not allowed.
|
||||||
|
|
||||||
|
For sample case #3, note that arranging the unicorns in the same color pattern as the Google logo (BRYBGR) would not be valid, since a unicorn with a blue mane would be a neighbor of a unicorn with a green mane, and both of those manes share blue hairs.
|
||||||
|
|
||||||
|
In sample case #4, no two unicorns with yellow manes can be neighbors, and no two unicorns with violet manes can be neighbors.
|
||||||
|
*/
|
||||||
|
|
||||||
|
const char ch[] = "ROYGBV";
|
||||||
|
|
||||||
|
int rel[6][6]={
|
||||||
|
//r o y g b v
|
||||||
|
{ 0, 0, 1, 1, 1, 0}, // r
|
||||||
|
{ 0, 0, 0, 0, 1, 0}, // o
|
||||||
|
{ 1, 0, 0, 0, 1, 1}, // y
|
||||||
|
{ 1, 0, 0, 0, 0, 0}, // g
|
||||||
|
{ 1, 1, 1, 0, 0, 0}, // b
|
||||||
|
{ 0, 0, 1, 0, 0, 0}, // v
|
||||||
|
};
|
||||||
|
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
template<> struct hash<vec>
|
||||||
|
{
|
||||||
|
typedef vec argument_type;
|
||||||
|
typedef std::size_t result_type;
|
||||||
|
result_type operator()(const argument_type& v) const
|
||||||
|
{
|
||||||
|
result_type h = 0;
|
||||||
|
for ( auto i: v )
|
||||||
|
h = std::hash<long long>{}(i) ^ ( h << 1);
|
||||||
|
return h;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
std::unordered_map<vec, std::string> precalc;
|
||||||
|
|
||||||
|
std::string rec_solve( int n, char cb, char ce, vec& v )
|
||||||
|
{
|
||||||
|
#if 1
|
||||||
|
vec key = v;
|
||||||
|
key.push_back( cb );
|
||||||
|
key.push_back( ce );
|
||||||
|
auto it = precalc.find(key);
|
||||||
|
if ( precalc.end() != it )
|
||||||
|
return it->second;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if ( n == 1 ) {
|
||||||
|
for ( int i = 0; i < v.size(); ++i) {
|
||||||
|
if ( v[i] && rel[cb][i] && rel[ce][i] ) {
|
||||||
|
auto value = std::string() + ch[i];
|
||||||
|
precalc.insert(std::make_pair(key,value));
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for ( int i =0; i < v.size(); ++i) {
|
||||||
|
if ( v[i] && rel[ce][i] ) {
|
||||||
|
--v[i];
|
||||||
|
auto ret = rec_solve( n-1, cb, i, v );
|
||||||
|
++v[i];
|
||||||
|
|
||||||
|
if ( !ret.empty() ) {
|
||||||
|
auto value = ret + ch[i];
|
||||||
|
precalc.insert( std::make_pair(key,value) );
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
precalc.insert(std::make_pair(key,std::string()));
|
||||||
|
return std::string();
|
||||||
|
}
|
||||||
|
|
||||||
|
auto solve_puzzle(std::istream& is)
|
||||||
|
{
|
||||||
|
vec v(6,0);
|
||||||
|
int n;
|
||||||
|
is >> n;
|
||||||
|
for ( int i = 0; i < v.size(); ++i ) {
|
||||||
|
is >> v[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
for ( int i = 0; i < v.size(); ++i) {
|
||||||
|
if ( v[i] ) {
|
||||||
|
--v[i];
|
||||||
|
auto ret = rec_solve( n-1, i, i, v );
|
||||||
|
++v[i];
|
||||||
|
|
||||||
|
if ( !ret.empty() )
|
||||||
|
return ret + ch[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return std::string("IMPOSSIBLE");
|
||||||
|
}
|
||||||
|
|
||||||
|
void read_input_and_solve( std::istream& is, std::ostream& os )
|
||||||
|
{
|
||||||
|
srand((unsigned)time(NULL));
|
||||||
|
int puzzle_count;
|
||||||
|
|
||||||
|
is >> puzzle_count;
|
||||||
|
is.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
|
||||||
|
for (int i = 1; i <= puzzle_count; i++)
|
||||||
|
{
|
||||||
|
os << "Case #" << i << ": ";
|
||||||
|
auto r = solve_puzzle(is);
|
||||||
|
os << r << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char * argv[])
|
||||||
|
{
|
||||||
|
try{
|
||||||
|
if ( *++argv ) {
|
||||||
|
std::ifstream ifs(*argv);
|
||||||
|
read_input_and_solve( ifs, std::cout );
|
||||||
|
} else {
|
||||||
|
read_input_and_solve( std::cin, std::cout );
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
catch (const std::exception& e)
|
||||||
|
{
|
||||||
|
std::cerr << std::endl
|
||||||
|
<< "std::exception(\"" << e.what() << "\")." << std::endl;
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
std::cerr << std::endl
|
||||||
|
<< "unknown exception." << std::endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
100
puzzles/google_code_jam/2017/1B-B.cpp.small-attempt0.in
Normal file
100
puzzles/google_code_jam/2017/1B-B.cpp.small-attempt0.in
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
99
|
||||||
|
6 2 0 2 0 2 0
|
||||||
|
3 1 0 2 0 0 0
|
||||||
|
536 96 0 242 0 198 0
|
||||||
|
614 166 0 303 0 145 0
|
||||||
|
91 16 0 35 0 40 0
|
||||||
|
999 250 0 500 0 249 0
|
||||||
|
290 111 0 116 0 63 0
|
||||||
|
559 277 0 16 0 266 0
|
||||||
|
619 134 0 283 0 202 0
|
||||||
|
1000 0 0 501 0 499 0
|
||||||
|
999 500 0 0 0 499 0
|
||||||
|
794 167 0 369 0 258 0
|
||||||
|
309 83 0 129 0 97 0
|
||||||
|
442 79 0 146 0 217 0
|
||||||
|
1000 500 0 0 0 500 0
|
||||||
|
287 45 0 103 0 139 0
|
||||||
|
6 3 0 3 0 0 0
|
||||||
|
788 187 0 243 0 358 0
|
||||||
|
3 3 0 0 0 0 0
|
||||||
|
5 3 0 1 0 1 0
|
||||||
|
999 333 0 333 0 333 0
|
||||||
|
679 324 0 247 0 108 0
|
||||||
|
90 34 0 42 0 14 0
|
||||||
|
5 1 0 2 0 2 0
|
||||||
|
315 92 0 134 0 89 0
|
||||||
|
4 0 0 2 0 2 0
|
||||||
|
999 250 0 250 0 499 0
|
||||||
|
3 0 0 2 0 1 0
|
||||||
|
1000 250 0 500 0 250 0
|
||||||
|
518 85 0 247 0 186 0
|
||||||
|
771 169 0 266 0 336 0
|
||||||
|
393 93 0 170 0 130 0
|
||||||
|
41 0 0 39 0 2 0
|
||||||
|
118 17 0 14 0 87 0
|
||||||
|
250 61 0 74 0 115 0
|
||||||
|
1000 499 0 1 0 500 0
|
||||||
|
990 17 0 645 0 328 0
|
||||||
|
866 301 0 326 0 239 0
|
||||||
|
727 260 0 206 0 261 0
|
||||||
|
225 103 0 67 0 55 0
|
||||||
|
4 1 0 1 0 2 0
|
||||||
|
676 198 0 163 0 315 0
|
||||||
|
443 129 0 129 0 185 0
|
||||||
|
999 1 0 499 0 499 0
|
||||||
|
516 382 0 93 0 41 0
|
||||||
|
627 125 0 266 0 236 0
|
||||||
|
415 100 0 157 0 158 0
|
||||||
|
883 282 0 186 0 415 0
|
||||||
|
509 63 0 199 0 247 0
|
||||||
|
789 169 0 227 0 393 0
|
||||||
|
318 103 0 195 0 20 0
|
||||||
|
4 1 0 2 0 1 0
|
||||||
|
52 7 0 20 0 25 0
|
||||||
|
857 342 0 260 0 255 0
|
||||||
|
881 76 0 383 0 422 0
|
||||||
|
495 127 0 317 0 51 0
|
||||||
|
518 196 0 163 0 159 0
|
||||||
|
261 93 0 103 0 65 0
|
||||||
|
547 187 0 262 0 98 0
|
||||||
|
76 17 0 36 0 23 0
|
||||||
|
248 90 0 101 0 57 0
|
||||||
|
938 423 0 228 0 287 0
|
||||||
|
589 146 0 200 0 243 0
|
||||||
|
375 141 0 129 0 105 0
|
||||||
|
932 463 0 293 0 176 0
|
||||||
|
167 35 0 74 0 58 0
|
||||||
|
572 119 0 171 0 282 0
|
||||||
|
519 61 0 232 0 226 0
|
||||||
|
183 53 0 42 0 88 0
|
||||||
|
238 112 0 33 0 93 0
|
||||||
|
3 1 0 1 0 1 0
|
||||||
|
6 2 0 3 0 1 0
|
||||||
|
371 138 0 107 0 126 0
|
||||||
|
408 245 0 76 0 87 0
|
||||||
|
1000 333 0 333 0 334 0
|
||||||
|
4 3 0 0 0 1 0
|
||||||
|
152 36 0 85 0 31 0
|
||||||
|
537 261 0 186 0 90 0
|
||||||
|
599 182 0 241 0 176 0
|
||||||
|
491 224 0 222 0 45 0
|
||||||
|
608 304 0 9 0 295 0
|
||||||
|
180 90 0 7 0 83 0
|
||||||
|
231 107 0 36 0 88 0
|
||||||
|
866 321 0 129 0 416 0
|
||||||
|
568 206 0 90 0 272 0
|
||||||
|
811 282 0 268 0 261 0
|
||||||
|
784 328 0 76 0 380 0
|
||||||
|
4 2 0 1 0 1 0
|
||||||
|
357 110 0 162 0 85 0
|
||||||
|
119 57 0 30 0 32 0
|
||||||
|
4 2 0 0 0 2 0
|
||||||
|
371 131 0 141 0 99 0
|
||||||
|
172 67 0 38 0 67 0
|
||||||
|
268 87 0 102 0 79 0
|
||||||
|
5 2 0 3 0 0 0
|
||||||
|
892 293 0 45 0 554 0
|
||||||
|
849 134 0 367 0 348 0
|
||||||
|
374 20 0 43 0 311 0
|
||||||
|
7 2 0 3 0 2 0
|
||||||
5
puzzles/google_code_jam/2017/1B-B.cpp.test
Normal file
5
puzzles/google_code_jam/2017/1B-B.cpp.test
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
4
|
||||||
|
6 2 0 2 0 2 0
|
||||||
|
3 1 0 2 0 0 0
|
||||||
|
6 2 0 1 1 2 0
|
||||||
|
4 0 0 2 0 0 2
|
||||||
97
puzzles/google_code_jam/2017/1B-C.cpp
Normal file
97
puzzles/google_code_jam/2017/1B-C.cpp
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
/*
|
||||||
|
VIM: let g:lcppflags="-std=c++11 -O2 -pthread"
|
||||||
|
VIM: let g:wcppflags="/O2 /EHsc /DWIN32"
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include <sstream>
|
||||||
|
#include <fstream>
|
||||||
|
#include <iomanip>
|
||||||
|
#include <exception>
|
||||||
|
#include <stdexcept>
|
||||||
|
#include <map>
|
||||||
|
#include <set>
|
||||||
|
#include <list>
|
||||||
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
|
#include <memory>
|
||||||
|
#include <functional>
|
||||||
|
#include <algorithm>
|
||||||
|
#include <utility>
|
||||||
|
#include <limits>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
typedef long long ll;
|
||||||
|
typedef std::vector<ll> vec;
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
std::string to_string( T t ){
|
||||||
|
std::stringstream ss;
|
||||||
|
ss << t;
|
||||||
|
return ss.str();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
*/
|
||||||
|
|
||||||
|
auto solve_puzzle(std::istream& is)
|
||||||
|
{
|
||||||
|
long long n, k;
|
||||||
|
is >> n >> k;
|
||||||
|
|
||||||
|
long long sec=1;
|
||||||
|
for ( long long kk = k; kk; kk>>=1, sec<<=1 ); //exp2( (int)ceil(log2( k+1 )) );
|
||||||
|
long long empty = n - sec +1;
|
||||||
|
long long min = empty / sec;
|
||||||
|
long long rem = empty % sec;
|
||||||
|
long long max = min;
|
||||||
|
if ( (rem - (sec/2)) >= (k-sec/2+1) ) {
|
||||||
|
max = min += 1;
|
||||||
|
} else if ( rem >= (k-sec/2+1) ) {
|
||||||
|
max = min + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return to_string(max) + ' ' + to_string(min);
|
||||||
|
}
|
||||||
|
|
||||||
|
void read_input_and_solve( std::istream& is, std::ostream& os )
|
||||||
|
{
|
||||||
|
srand((unsigned)time(NULL));
|
||||||
|
int puzzle_count;
|
||||||
|
|
||||||
|
is >> puzzle_count;
|
||||||
|
is.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
|
||||||
|
for (int i = 1; i <= puzzle_count; i++)
|
||||||
|
{
|
||||||
|
os << "Case #" << i << ": ";
|
||||||
|
auto r = solve_puzzle(is);
|
||||||
|
os << r << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char * argv[])
|
||||||
|
{
|
||||||
|
try{
|
||||||
|
if ( *++argv ) {
|
||||||
|
std::ifstream ifs(*argv);
|
||||||
|
read_input_and_solve( ifs, std::cout );
|
||||||
|
} else {
|
||||||
|
read_input_and_solve( std::cin, std::cout );
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
catch (const std::exception& e)
|
||||||
|
{
|
||||||
|
std::cerr << std::endl
|
||||||
|
<< "std::exception(\"" << e.what() << "\")." << std::endl;
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
std::cerr << std::endl
|
||||||
|
<< "unknown exception." << std::endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
9
puzzles/google_code_jam/2017/1B-C.cpp.test
Normal file
9
puzzles/google_code_jam/2017/1B-C.cpp.test
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
3
|
||||||
|
2 0
|
||||||
|
1 1
|
||||||
|
o 1 1
|
||||||
|
3 4
|
||||||
|
+ 2 3
|
||||||
|
+ 2 1
|
||||||
|
x 3 1
|
||||||
|
+ 2 2
|
||||||
107
puzzles/google_code_jam/2017/1C-A.cpp
Normal file
107
puzzles/google_code_jam/2017/1C-A.cpp
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
/*
|
||||||
|
VIM: let g:lcppflags="-std=c++11 -O2 -pthread"
|
||||||
|
VIM: let g:wcppflags="/O2 /EHsc /DWIN32"
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include <sstream>
|
||||||
|
#include <fstream>
|
||||||
|
#include <iomanip>
|
||||||
|
#include <exception>
|
||||||
|
#include <stdexcept>
|
||||||
|
#include <map>
|
||||||
|
#include <set>
|
||||||
|
#include <list>
|
||||||
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
|
#include <memory>
|
||||||
|
#include <functional>
|
||||||
|
#include <algorithm>
|
||||||
|
#include <utility>
|
||||||
|
#include <limits>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
typedef long long ll;
|
||||||
|
typedef std::vector<ll> vec;
|
||||||
|
void check(bool b) { if (!b) std::cerr << "error" << std::endl; }
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
std::string to_string( T t ){
|
||||||
|
std::stringstream ss;
|
||||||
|
ss << t;
|
||||||
|
return ss.str();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
*/
|
||||||
|
|
||||||
|
auto solve_puzzle(std::istream& is)
|
||||||
|
{
|
||||||
|
long long n, k, r, h;
|
||||||
|
is >> n >> k;
|
||||||
|
std::vector<std::pair<double,double>> v;
|
||||||
|
for ( int i = 0; i < n; ++i){
|
||||||
|
is >> r >> h;
|
||||||
|
v.push_back(std::make_pair(r*r,2*h*r));
|
||||||
|
}
|
||||||
|
|
||||||
|
double mrr = 0, s2rh = 0;
|
||||||
|
for ( int i = 0; i < k; ++i ) {
|
||||||
|
|
||||||
|
auto mit = v.begin();
|
||||||
|
for ( auto it = v.begin(); it != v.end(); ++it ) {
|
||||||
|
if ( (std::max(it->first-mrr,0.) + it->second)
|
||||||
|
> (std::max(mit->first-mrr,0.) + mit->second) ) {
|
||||||
|
mit = it;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mrr = std::max(mit->first, mrr );
|
||||||
|
s2rh += mit->second;
|
||||||
|
mit->first = 0;
|
||||||
|
mit->second = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 3.14159265359 * (s2rh + mrr);
|
||||||
|
}
|
||||||
|
|
||||||
|
void read_input_and_solve( std::istream& is, std::ostream& os )
|
||||||
|
{
|
||||||
|
srand((unsigned)time(NULL));
|
||||||
|
int puzzle_count;
|
||||||
|
|
||||||
|
is >> puzzle_count;
|
||||||
|
is.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
|
||||||
|
for (int i = 1; i <= puzzle_count; i++)
|
||||||
|
{
|
||||||
|
os << "Case #" << i << ": ";
|
||||||
|
auto r = solve_puzzle(is);
|
||||||
|
os << std::fixed << r << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char * argv[])
|
||||||
|
{
|
||||||
|
try{
|
||||||
|
if ( *++argv ) {
|
||||||
|
std::ifstream ifs(*argv);
|
||||||
|
read_input_and_solve( ifs, std::cout );
|
||||||
|
} else {
|
||||||
|
read_input_and_solve( std::cin, std::cout );
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
catch (const std::exception& e)
|
||||||
|
{
|
||||||
|
std::cerr << std::endl
|
||||||
|
<< "std::exception(\"" << e.what() << "\")." << std::endl;
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
std::cerr << std::endl
|
||||||
|
<< "unknown exception." << std::endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
15334
puzzles/google_code_jam/2017/1C-A.cpp.large.in
Normal file
15334
puzzles/google_code_jam/2017/1C-A.cpp.large.in
Normal file
File diff suppressed because it is too large
Load Diff
648
puzzles/google_code_jam/2017/1C-A.cpp.small-attempt0.in
Normal file
648
puzzles/google_code_jam/2017/1C-A.cpp.small-attempt0.in
Normal file
@@ -0,0 +1,648 @@
|
|||||||
|
100
|
||||||
|
2 1
|
||||||
|
100 20
|
||||||
|
200 10
|
||||||
|
2 2
|
||||||
|
100 20
|
||||||
|
200 10
|
||||||
|
3 2
|
||||||
|
100 10
|
||||||
|
100 10
|
||||||
|
100 10
|
||||||
|
4 2
|
||||||
|
9 3
|
||||||
|
7 1
|
||||||
|
10 1
|
||||||
|
8 4
|
||||||
|
5 2
|
||||||
|
28752 2204
|
||||||
|
233159 34
|
||||||
|
212577 67
|
||||||
|
22402 2436
|
||||||
|
24406 2314
|
||||||
|
5 1
|
||||||
|
3050 321426
|
||||||
|
19152 67
|
||||||
|
3581 346450
|
||||||
|
3459 352788
|
||||||
|
18793 66
|
||||||
|
5 3
|
||||||
|
107279 769686
|
||||||
|
701700 117673
|
||||||
|
167682 492427
|
||||||
|
91990 897610
|
||||||
|
169351 487574
|
||||||
|
3 1
|
||||||
|
3681 339791
|
||||||
|
3000 340491
|
||||||
|
14111 19
|
||||||
|
6 4
|
||||||
|
90712 240219
|
||||||
|
24012 907494
|
||||||
|
54694 398412
|
||||||
|
432837 50344
|
||||||
|
46872 464899
|
||||||
|
289478 75276
|
||||||
|
3 1
|
||||||
|
12893 95
|
||||||
|
3895 394714
|
||||||
|
3150 344897
|
||||||
|
10 2
|
||||||
|
16965 88
|
||||||
|
17707 77
|
||||||
|
3583 385383
|
||||||
|
3058 317744
|
||||||
|
3691 364027
|
||||||
|
13264 82
|
||||||
|
3575 378812
|
||||||
|
3652 344750
|
||||||
|
3736 343814
|
||||||
|
3508 330134
|
||||||
|
3 1
|
||||||
|
468538 200606
|
||||||
|
422793 222311
|
||||||
|
823036 114201
|
||||||
|
3 2
|
||||||
|
450984 20097
|
||||||
|
29412 308154
|
||||||
|
127512 71079
|
||||||
|
8 3
|
||||||
|
28722 2683
|
||||||
|
28984 2487
|
||||||
|
20776 2890
|
||||||
|
28062 2854
|
||||||
|
21327 2537
|
||||||
|
21311 2086
|
||||||
|
261763 73
|
||||||
|
299382 55
|
||||||
|
3 1
|
||||||
|
26803 2809
|
||||||
|
296637 43
|
||||||
|
21553 2068
|
||||||
|
2 1
|
||||||
|
10315 89
|
||||||
|
3735 380130
|
||||||
|
10 5
|
||||||
|
841425 570406
|
||||||
|
622715 684363
|
||||||
|
391699 877621
|
||||||
|
475976 85485
|
||||||
|
867824 117828
|
||||||
|
820417 274651
|
||||||
|
460525 520488
|
||||||
|
415875 584552
|
||||||
|
73739 561780
|
||||||
|
356931 459465
|
||||||
|
6 1
|
||||||
|
611195 60106
|
||||||
|
79917 459683
|
||||||
|
686458 53516
|
||||||
|
47825 768144
|
||||||
|
300813 122124
|
||||||
|
107991 340181
|
||||||
|
4 1
|
||||||
|
3134 304196
|
||||||
|
17352 45
|
||||||
|
3938 326457
|
||||||
|
3821 342208
|
||||||
|
4 2
|
||||||
|
3025 385204
|
||||||
|
11182 95
|
||||||
|
3457 365287
|
||||||
|
3364 355954
|
||||||
|
8 5
|
||||||
|
161253 209496
|
||||||
|
266133 126936
|
||||||
|
237636 142158
|
||||||
|
246123 137256
|
||||||
|
401964 84042
|
||||||
|
56028 602946
|
||||||
|
43624 774387
|
||||||
|
199752 169119
|
||||||
|
7 5
|
||||||
|
3407 361417
|
||||||
|
3820 305860
|
||||||
|
3448 375993
|
||||||
|
17889 12
|
||||||
|
3315 330369
|
||||||
|
14580 81
|
||||||
|
3216 321387
|
||||||
|
9 5
|
||||||
|
119016 47957
|
||||||
|
911183 6264
|
||||||
|
14508 393414
|
||||||
|
142506 40052
|
||||||
|
705432 8091
|
||||||
|
97092 58786
|
||||||
|
115362 49476
|
||||||
|
841464 6783
|
||||||
|
37791 151032
|
||||||
|
2 1
|
||||||
|
23252 2253
|
||||||
|
291150 22
|
||||||
|
4 1
|
||||||
|
60722 927442
|
||||||
|
207926 270847
|
||||||
|
204932 274804
|
||||||
|
228019 246980
|
||||||
|
10 7
|
||||||
|
20668 2348
|
||||||
|
24138 2808
|
||||||
|
28247 2947
|
||||||
|
27421 2446
|
||||||
|
21248 2872
|
||||||
|
212108 78
|
||||||
|
248891 4
|
||||||
|
26366 2625
|
||||||
|
265239 60
|
||||||
|
21101 2626
|
||||||
|
3 2
|
||||||
|
227633 99179
|
||||||
|
197992 198255
|
||||||
|
296752 712179
|
||||||
|
10 2
|
||||||
|
517558 68794
|
||||||
|
251694 141461
|
||||||
|
773851 46010
|
||||||
|
113834 312779
|
||||||
|
758083 46967
|
||||||
|
954043 37320
|
||||||
|
399140 89204
|
||||||
|
72906 488367
|
||||||
|
498291 71454
|
||||||
|
148418 239896
|
||||||
|
3 1
|
||||||
|
14384 44
|
||||||
|
3603 348942
|
||||||
|
3506 362843
|
||||||
|
2 1
|
||||||
|
22841 2101
|
||||||
|
266311 46
|
||||||
|
4 2
|
||||||
|
503920 44855
|
||||||
|
32877 687512
|
||||||
|
305170 74068
|
||||||
|
41900 539459
|
||||||
|
9 5
|
||||||
|
121278 335916
|
||||||
|
49938 815796
|
||||||
|
763164 53382
|
||||||
|
995193 40936
|
||||||
|
42804 951762
|
||||||
|
320943 126936
|
||||||
|
412641 98728
|
||||||
|
194184 209797
|
||||||
|
363834 111972
|
||||||
|
7 2
|
||||||
|
534604 298264
|
||||||
|
667175 946976
|
||||||
|
585085 42295
|
||||||
|
988419 790912
|
||||||
|
747607 112993
|
||||||
|
295508 61209
|
||||||
|
12507 839210
|
||||||
|
5 2
|
||||||
|
74551 270664
|
||||||
|
85985 234672
|
||||||
|
61219 329608
|
||||||
|
82961 243226
|
||||||
|
88723 227430
|
||||||
|
4 3
|
||||||
|
690494 75276
|
||||||
|
765142 67932
|
||||||
|
130462 398412
|
||||||
|
65016 799459
|
||||||
|
8 2
|
||||||
|
3598 306753
|
||||||
|
3135 339250
|
||||||
|
3207 394971
|
||||||
|
3839 343538
|
||||||
|
17137 58
|
||||||
|
3983 341127
|
||||||
|
3048 395053
|
||||||
|
14159 72
|
||||||
|
7 3
|
||||||
|
45094 150189
|
||||||
|
943788 74854
|
||||||
|
205010 552728
|
||||||
|
278943 384698
|
||||||
|
675966 283335
|
||||||
|
370976 766942
|
||||||
|
807800 367088
|
||||||
|
3 1
|
||||||
|
13543 41
|
||||||
|
3339 379583
|
||||||
|
3275 300190
|
||||||
|
7 4
|
||||||
|
231360 692359
|
||||||
|
438406 418340
|
||||||
|
424091 670737
|
||||||
|
633156 571637
|
||||||
|
76049 642124
|
||||||
|
708234 250144
|
||||||
|
486842 780458
|
||||||
|
5 3
|
||||||
|
115884 171626
|
||||||
|
111592 178227
|
||||||
|
73554 270396
|
||||||
|
573426 34684
|
||||||
|
571909 34776
|
||||||
|
3 2
|
||||||
|
132804 78474
|
||||||
|
641886 16236
|
||||||
|
91512 113883
|
||||||
|
10 6
|
||||||
|
50616 190281
|
||||||
|
30996 310726
|
||||||
|
23868 403522
|
||||||
|
752913 12792
|
||||||
|
40698 236652
|
||||||
|
618936 15561
|
||||||
|
329004 29274
|
||||||
|
167314 57564
|
||||||
|
807044 11934
|
||||||
|
88578 108732
|
||||||
|
9 5
|
||||||
|
3710 301656
|
||||||
|
3034 312960
|
||||||
|
3649 381954
|
||||||
|
3459 359273
|
||||||
|
18341 29
|
||||||
|
3161 313459
|
||||||
|
3787 324821
|
||||||
|
3790 392478
|
||||||
|
12733 67
|
||||||
|
8 6
|
||||||
|
286965 8
|
||||||
|
23713 2264
|
||||||
|
26680 2868
|
||||||
|
20938 2036
|
||||||
|
212880 7
|
||||||
|
24672 2617
|
||||||
|
20737 2110
|
||||||
|
24300 2861
|
||||||
|
10 7
|
||||||
|
25735 2820
|
||||||
|
239111 20
|
||||||
|
20656 2753
|
||||||
|
243477 41
|
||||||
|
24090 2196
|
||||||
|
28383 2951
|
||||||
|
232612 30
|
||||||
|
20995 2363
|
||||||
|
29218 2340
|
||||||
|
22791 2509
|
||||||
|
7 2
|
||||||
|
207798 102243
|
||||||
|
40915 519269
|
||||||
|
138316 153604
|
||||||
|
119710 177478
|
||||||
|
106925 198699
|
||||||
|
763856 27814
|
||||||
|
850482 24981
|
||||||
|
4 2
|
||||||
|
26069 2784
|
||||||
|
21092 2654
|
||||||
|
207015 32
|
||||||
|
23249 2802
|
||||||
|
4 1
|
||||||
|
3473 345428
|
||||||
|
12178 69
|
||||||
|
3062 385768
|
||||||
|
3003 395718
|
||||||
|
9 6
|
||||||
|
254154 11
|
||||||
|
23765 2432
|
||||||
|
22124 2355
|
||||||
|
21508 2082
|
||||||
|
217005 100
|
||||||
|
22116 2346
|
||||||
|
26287 2308
|
||||||
|
24886 2168
|
||||||
|
23887 2326
|
||||||
|
8 5
|
||||||
|
427103 202694
|
||||||
|
147708 586097
|
||||||
|
859848 100682
|
||||||
|
273487 316546
|
||||||
|
544874 158883
|
||||||
|
257265 336506
|
||||||
|
137327 630402
|
||||||
|
301457 287176
|
||||||
|
5 3
|
||||||
|
696696 3519
|
||||||
|
211497 11592
|
||||||
|
334152 7337
|
||||||
|
72072 34017
|
||||||
|
722568 3393
|
||||||
|
2 1
|
||||||
|
91664 991298
|
||||||
|
502966 180661
|
||||||
|
5 2
|
||||||
|
279869 591892
|
||||||
|
999512 185180
|
||||||
|
816212 765779
|
||||||
|
449521 794129
|
||||||
|
276214 764063
|
||||||
|
5 3
|
||||||
|
236652 66402
|
||||||
|
126854 123876
|
||||||
|
155992 100737
|
||||||
|
175491 89544
|
||||||
|
573426 27404
|
||||||
|
4 3
|
||||||
|
43780 939044
|
||||||
|
290109 141710
|
||||||
|
117509 349857
|
||||||
|
403171 101970
|
||||||
|
3 2
|
||||||
|
662048 62069
|
||||||
|
921546 44591
|
||||||
|
126294 325373
|
||||||
|
2 1
|
||||||
|
241159 16
|
||||||
|
21727 2032
|
||||||
|
10 7
|
||||||
|
364951 220533
|
||||||
|
96036 838058
|
||||||
|
126291 637288
|
||||||
|
96546 833631
|
||||||
|
571447 140842
|
||||||
|
745206 108002
|
||||||
|
766468 105006
|
||||||
|
419829 191706
|
||||||
|
80892 994953
|
||||||
|
664441 121130
|
||||||
|
2 1
|
||||||
|
29902 2375
|
||||||
|
215604 24
|
||||||
|
9 3
|
||||||
|
670756 291135
|
||||||
|
967018 277777
|
||||||
|
339936 410718
|
||||||
|
117893 384842
|
||||||
|
792250 596819
|
||||||
|
274160 630121
|
||||||
|
255722 506821
|
||||||
|
258969 929042
|
||||||
|
266181 57537
|
||||||
|
10 5
|
||||||
|
22436 2247
|
||||||
|
22267 2954
|
||||||
|
24447 2344
|
||||||
|
20253 2571
|
||||||
|
232899 89
|
||||||
|
26524 2345
|
||||||
|
297228 50
|
||||||
|
23328 2544
|
||||||
|
285313 14
|
||||||
|
21581 2089
|
||||||
|
3 2
|
||||||
|
28685 2235
|
||||||
|
240725 77
|
||||||
|
22867 2065
|
||||||
|
2 1
|
||||||
|
933736 456786
|
||||||
|
627639 291153
|
||||||
|
10 10
|
||||||
|
1000000 1000000
|
||||||
|
1000000 1000000
|
||||||
|
1000000 1000000
|
||||||
|
1000000 1000000
|
||||||
|
1000000 1000000
|
||||||
|
1000000 1000000
|
||||||
|
1000000 1000000
|
||||||
|
1000000 1000000
|
||||||
|
1000000 1000000
|
||||||
|
1000000 1000000
|
||||||
|
3 2
|
||||||
|
51880 132315
|
||||||
|
624974 477314
|
||||||
|
737715 520411
|
||||||
|
8 6
|
||||||
|
133680 516532
|
||||||
|
506216 306651
|
||||||
|
590480 105825
|
||||||
|
568250 879437
|
||||||
|
642216 382526
|
||||||
|
85700 349697
|
||||||
|
294980 256567
|
||||||
|
580780 267768
|
||||||
|
4 3
|
||||||
|
703129 499529
|
||||||
|
783718 258451
|
||||||
|
435283 873866
|
||||||
|
932206 460745
|
||||||
|
4 3
|
||||||
|
3177 343581
|
||||||
|
3717 317791
|
||||||
|
3659 325788
|
||||||
|
10196 50
|
||||||
|
5 1
|
||||||
|
29730 2818
|
||||||
|
26577 2093
|
||||||
|
250803 59
|
||||||
|
28661 2607
|
||||||
|
254429 48
|
||||||
|
5 1
|
||||||
|
128086 221968
|
||||||
|
143851 889618
|
||||||
|
822231 382815
|
||||||
|
352838 584964
|
||||||
|
724177 628873
|
||||||
|
1 1
|
||||||
|
1 1
|
||||||
|
7 4
|
||||||
|
28458 239932
|
||||||
|
408177 16728
|
||||||
|
12276 556206
|
||||||
|
25704 265639
|
||||||
|
10472 652023
|
||||||
|
91512 74613
|
||||||
|
24552 278103
|
||||||
|
3 2
|
||||||
|
127428 171054
|
||||||
|
126936 171717
|
||||||
|
641732 33966
|
||||||
|
3 1
|
||||||
|
948764 65782
|
||||||
|
578276 107927
|
||||||
|
261458 238706
|
||||||
|
8 6
|
||||||
|
952793 749222
|
||||||
|
222361 966493
|
||||||
|
107160 732441
|
||||||
|
811288 781409
|
||||||
|
560984 688155
|
||||||
|
184527 14675
|
||||||
|
743872 308572
|
||||||
|
40090 342338
|
||||||
|
5 3
|
||||||
|
35853 281736
|
||||||
|
16354 617652
|
||||||
|
223041 45288
|
||||||
|
73593 137256
|
||||||
|
215118 46956
|
||||||
|
5 2
|
||||||
|
19105 69
|
||||||
|
16248 30
|
||||||
|
3877 358106
|
||||||
|
3888 356905
|
||||||
|
3482 365982
|
||||||
|
7 4
|
||||||
|
571529 934447
|
||||||
|
720568 834596
|
||||||
|
582685 654831
|
||||||
|
80947 885730
|
||||||
|
399200 271424
|
||||||
|
320055 378197
|
||||||
|
98648 485555
|
||||||
|
5 1
|
||||||
|
21060 2242
|
||||||
|
211660 62
|
||||||
|
21389 2907
|
||||||
|
21246 2382
|
||||||
|
242654 80
|
||||||
|
7 2
|
||||||
|
282446 263216
|
||||||
|
540289 137601
|
||||||
|
402649 184638
|
||||||
|
669672 111016
|
||||||
|
324693 228968
|
||||||
|
259680 286292
|
||||||
|
437582 169898
|
||||||
|
2 1
|
||||||
|
10893 36
|
||||||
|
3434 324251
|
||||||
|
6 1
|
||||||
|
26143 2904
|
||||||
|
21127 2849
|
||||||
|
226043 50
|
||||||
|
20083 2876
|
||||||
|
29197 2986
|
||||||
|
207094 22
|
||||||
|
2 1
|
||||||
|
18186 28
|
||||||
|
3773 343969
|
||||||
|
6 4
|
||||||
|
156401 543614
|
||||||
|
112787 753826
|
||||||
|
298840 284506
|
||||||
|
754060 112752
|
||||||
|
241228 352454
|
||||||
|
601005 141466
|
||||||
|
4 1
|
||||||
|
22560 2011
|
||||||
|
25119 2104
|
||||||
|
27069 2654
|
||||||
|
266234 49
|
||||||
|
8 4
|
||||||
|
610703 150055
|
||||||
|
213563 319252
|
||||||
|
509420 993745
|
||||||
|
992198 235552
|
||||||
|
898961 775370
|
||||||
|
536886 690947
|
||||||
|
585378 106275
|
||||||
|
562177 312361
|
||||||
|
10 4
|
||||||
|
573452 321987
|
||||||
|
316995 20159
|
||||||
|
457046 96056
|
||||||
|
45650 1290
|
||||||
|
804759 761842
|
||||||
|
728648 869674
|
||||||
|
548312 170683
|
||||||
|
961932 10739
|
||||||
|
75001 439268
|
||||||
|
634952 122474
|
||||||
|
8 5
|
||||||
|
960876 22678
|
||||||
|
199752 109089
|
||||||
|
34317 634984
|
||||||
|
56028 388926
|
||||||
|
28152 774039
|
||||||
|
45356 480438
|
||||||
|
26691 816408
|
||||||
|
30996 703018
|
||||||
|
10 5
|
||||||
|
14250 687594
|
||||||
|
471045 575208
|
||||||
|
407148 3040
|
||||||
|
924165 833811
|
||||||
|
283372 47442
|
||||||
|
533549 396898
|
||||||
|
276115 21146
|
||||||
|
699134 682661
|
||||||
|
435975 596917
|
||||||
|
78333 463034
|
||||||
|
4 2
|
||||||
|
764440 278946
|
||||||
|
476080 969984
|
||||||
|
753672 173413
|
||||||
|
943459 963059
|
||||||
|
4 2
|
||||||
|
832540 659791
|
||||||
|
648843 83560
|
||||||
|
510300 568414
|
||||||
|
397468 467232
|
||||||
|
2 2
|
||||||
|
27347 951048
|
||||||
|
28934 898884
|
||||||
|
9 6
|
||||||
|
132830 107235
|
||||||
|
158600 89811
|
||||||
|
579756 24569
|
||||||
|
190995 74578
|
||||||
|
135090 105441
|
||||||
|
15592 913547
|
||||||
|
969839 14687
|
||||||
|
923258 15428
|
||||||
|
99113 143715
|
||||||
|
3 2
|
||||||
|
416556 8602
|
||||||
|
8602 416556
|
||||||
|
21252 168606
|
||||||
|
10 4
|
||||||
|
3033 393547
|
||||||
|
3131 341673
|
||||||
|
17906 94
|
||||||
|
3017 320962
|
||||||
|
3502 326409
|
||||||
|
12889 83
|
||||||
|
3511 365462
|
||||||
|
11430 19
|
||||||
|
3296 396245
|
||||||
|
3508 351604
|
||||||
|
8 6
|
||||||
|
3408 306846
|
||||||
|
3493 343100
|
||||||
|
18432 55
|
||||||
|
3055 315007
|
||||||
|
3182 362724
|
||||||
|
19640 81
|
||||||
|
3663 310839
|
||||||
|
3755 317947
|
||||||
|
6 4
|
||||||
|
69832 942057
|
||||||
|
166152 395937
|
||||||
|
345506 190404
|
||||||
|
428904 153381
|
||||||
|
599256 109779
|
||||||
|
666414 98716
|
||||||
|
2 1
|
||||||
|
87844 391252
|
||||||
|
117256 293112
|
||||||
|
2 1
|
||||||
|
262857 156391
|
||||||
|
403210 101953
|
||||||
|
9 5
|
||||||
|
308826 59644
|
||||||
|
103974 177156
|
||||||
|
43586 422604
|
||||||
|
75924 242606
|
||||||
|
29526 623844
|
||||||
|
34632 531867
|
||||||
|
60606 303924
|
||||||
|
140868 130758
|
||||||
|
206739 89096
|
||||||
16
puzzles/google_code_jam/2017/1C-A.cpp.test
Normal file
16
puzzles/google_code_jam/2017/1C-A.cpp.test
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
4
|
||||||
|
2 1
|
||||||
|
100 20
|
||||||
|
200 10
|
||||||
|
2 2
|
||||||
|
100 20
|
||||||
|
200 10
|
||||||
|
3 2
|
||||||
|
100 10
|
||||||
|
100 10
|
||||||
|
100 10
|
||||||
|
4 2
|
||||||
|
9 3
|
||||||
|
7 1
|
||||||
|
10 1
|
||||||
|
8 4
|
||||||
92
puzzles/google_code_jam/2017/1C-B.cpp
Normal file
92
puzzles/google_code_jam/2017/1C-B.cpp
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
/*
|
||||||
|
VIM: let g:lcppflags="-std=c++11 -O2 -pthread"
|
||||||
|
VIM: let g:wcppflags="/O2 /EHsc /DWIN32"
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include <sstream>
|
||||||
|
#include <fstream>
|
||||||
|
#include <iomanip>
|
||||||
|
#include <exception>
|
||||||
|
#include <stdexcept>
|
||||||
|
#include <map>
|
||||||
|
#include <set>
|
||||||
|
#include <list>
|
||||||
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
|
#include <memory>
|
||||||
|
#include <functional>
|
||||||
|
#include <algorithm>
|
||||||
|
#include <utility>
|
||||||
|
#include <limits>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
typedef long long ll;
|
||||||
|
typedef std::vector<ll> vec;
|
||||||
|
void check(bool b) { if (!b) std::cerr << "error" << std::endl; }
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
std::string to_string( T t ){
|
||||||
|
std::stringstream ss;
|
||||||
|
ss << t;
|
||||||
|
return ss.str();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
*/
|
||||||
|
|
||||||
|
auto solve_puzzle(std::istream& is)
|
||||||
|
{
|
||||||
|
long long n, d, k, s;
|
||||||
|
double mt = 0;
|
||||||
|
is >> d >> n;
|
||||||
|
for ( auto i = 0; i < n; ++i ) {
|
||||||
|
is >> k >> s;
|
||||||
|
double t = double(d - k) / s;
|
||||||
|
mt = std::max( mt, t);
|
||||||
|
}
|
||||||
|
|
||||||
|
return d / mt;
|
||||||
|
}
|
||||||
|
|
||||||
|
void read_input_and_solve( std::istream& is, std::ostream& os )
|
||||||
|
{
|
||||||
|
srand((unsigned)time(NULL));
|
||||||
|
int puzzle_count;
|
||||||
|
|
||||||
|
is >> puzzle_count;
|
||||||
|
is.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
|
||||||
|
for (int i = 1; i <= puzzle_count; i++)
|
||||||
|
{
|
||||||
|
os << "Case #" << i << ": ";
|
||||||
|
auto r = solve_puzzle(is);
|
||||||
|
os << std::fixed << r << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char * argv[])
|
||||||
|
{
|
||||||
|
try{
|
||||||
|
if ( *++argv ) {
|
||||||
|
std::ifstream ifs(*argv);
|
||||||
|
read_input_and_solve( ifs, std::cout );
|
||||||
|
} else {
|
||||||
|
read_input_and_solve( std::cin, std::cout );
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
catch (const std::exception& e)
|
||||||
|
{
|
||||||
|
std::cerr << std::endl
|
||||||
|
<< "std::exception(\"" << e.what() << "\")." << std::endl;
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
std::cerr << std::endl
|
||||||
|
<< "unknown exception." << std::endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
211
puzzles/google_code_jam/2017/1C-B.cpp.test
Normal file
211
puzzles/google_code_jam/2017/1C-B.cpp.test
Normal file
@@ -0,0 +1,211 @@
|
|||||||
|
99
|
||||||
|
2525 1
|
||||||
|
2400 5
|
||||||
|
300 2
|
||||||
|
120 60
|
||||||
|
60 90
|
||||||
|
2 1
|
||||||
|
1 10000
|
||||||
|
131077822 1
|
||||||
|
105930950 3608
|
||||||
|
951474064 1
|
||||||
|
605617783 1854
|
||||||
|
932241924 1
|
||||||
|
250413260 5563
|
||||||
|
251976750 1
|
||||||
|
37523298 6912
|
||||||
|
99152721 1
|
||||||
|
58354860 1926
|
||||||
|
783018707 1
|
||||||
|
88121307 4131
|
||||||
|
639338367 1
|
||||||
|
291203113 6378
|
||||||
|
672514796 1
|
||||||
|
170175618 8738
|
||||||
|
287774565 1
|
||||||
|
190526946 9796
|
||||||
|
38994305 1
|
||||||
|
10780080 6841
|
||||||
|
1000000000 1
|
||||||
|
999999999 1
|
||||||
|
285136113 1
|
||||||
|
112216518 9297
|
||||||
|
273333115 1
|
||||||
|
199748352 7776
|
||||||
|
241712373 1
|
||||||
|
233348860 4651
|
||||||
|
1000000000 2
|
||||||
|
100 10000
|
||||||
|
200 10000
|
||||||
|
652009174 1
|
||||||
|
338724449 352
|
||||||
|
352537441 1
|
||||||
|
208600649 3594
|
||||||
|
1000000000 2
|
||||||
|
999999996 3
|
||||||
|
999999997 2
|
||||||
|
402968800 1
|
||||||
|
146355729 3814
|
||||||
|
900178370 1
|
||||||
|
691948054 3451
|
||||||
|
123392396 1
|
||||||
|
62644635 2299
|
||||||
|
609693185 1
|
||||||
|
482964044 9690
|
||||||
|
289799855 1
|
||||||
|
119110900 10000
|
||||||
|
613708385 1
|
||||||
|
207593466 436
|
||||||
|
10624065 1
|
||||||
|
7660000 5131
|
||||||
|
319827779 1
|
||||||
|
233417751 5372
|
||||||
|
704981430 1
|
||||||
|
434585122 6050
|
||||||
|
557998694 1
|
||||||
|
385991442 4632
|
||||||
|
238116277 1
|
||||||
|
124154500 3903
|
||||||
|
599586097 1
|
||||||
|
168139845 2005
|
||||||
|
2 1
|
||||||
|
1 1
|
||||||
|
372391542 1
|
||||||
|
359873480 177
|
||||||
|
413918839 1
|
||||||
|
254928106 1093
|
||||||
|
842764022 1
|
||||||
|
658957576 4070
|
||||||
|
784534362 1
|
||||||
|
268746719 8114
|
||||||
|
205951222 1
|
||||||
|
114775068 901
|
||||||
|
306794940 1
|
||||||
|
304497843 1344
|
||||||
|
1000000000 2
|
||||||
|
2 2
|
||||||
|
1 3
|
||||||
|
694325937 2
|
||||||
|
34215164 1166
|
||||||
|
582636968 9692
|
||||||
|
472533887 1
|
||||||
|
108306906 1794
|
||||||
|
1000000000 2
|
||||||
|
999999998 3
|
||||||
|
999999999 2
|
||||||
|
726480404 1
|
||||||
|
327840527 9277
|
||||||
|
475150098 1
|
||||||
|
407953706 4021
|
||||||
|
1000000000 2
|
||||||
|
12345675 3
|
||||||
|
12345676 2
|
||||||
|
388370869 1
|
||||||
|
381026582 410
|
||||||
|
585584419 1
|
||||||
|
525156031 4916
|
||||||
|
392533744 1
|
||||||
|
147506468 7033
|
||||||
|
601128505 1
|
||||||
|
41357453 5135
|
||||||
|
739344631 1
|
||||||
|
432447251 7431
|
||||||
|
899094944 1
|
||||||
|
644586485 1113
|
||||||
|
541000239 1
|
||||||
|
138218162 4140
|
||||||
|
334146606 2
|
||||||
|
105422380 7667
|
||||||
|
285743300 2394
|
||||||
|
524065206 1
|
||||||
|
145094512 4290
|
||||||
|
690438607 1
|
||||||
|
417609260 8697
|
||||||
|
634155725 1
|
||||||
|
369081537 64
|
||||||
|
71029611 1
|
||||||
|
63620453 8392
|
||||||
|
788982628 1
|
||||||
|
764761697 1715
|
||||||
|
1000000000 2
|
||||||
|
999000000 10000
|
||||||
|
998000000 10000
|
||||||
|
586330136 1
|
||||||
|
416104919 7260
|
||||||
|
974323101 1
|
||||||
|
364680900 2441
|
||||||
|
140899898 1
|
||||||
|
5967101 9667
|
||||||
|
527347037 1
|
||||||
|
83937058 6980
|
||||||
|
1000000000 1
|
||||||
|
1 1
|
||||||
|
838241117 1
|
||||||
|
369982007 1821
|
||||||
|
204099020 1
|
||||||
|
146539679 7474
|
||||||
|
756005869 1
|
||||||
|
733105085 9319
|
||||||
|
905751325 1
|
||||||
|
617152714 8229
|
||||||
|
386505314 1
|
||||||
|
108917676 801
|
||||||
|
121872146 1
|
||||||
|
111514347 6707
|
||||||
|
885278578 1
|
||||||
|
113187929 9117
|
||||||
|
17305691 1
|
||||||
|
5104584 7370
|
||||||
|
279273193 1
|
||||||
|
269999131 5890
|
||||||
|
715117710 1
|
||||||
|
530291656 6727
|
||||||
|
750837609 1
|
||||||
|
392277806 5209
|
||||||
|
243133077 1
|
||||||
|
188915973 6229
|
||||||
|
96964909 1
|
||||||
|
86353596 7617
|
||||||
|
538785005 1
|
||||||
|
171300038 4040
|
||||||
|
1000000000 2
|
||||||
|
998000000 1
|
||||||
|
999000000 1
|
||||||
|
1000000000 1
|
||||||
|
1 10000
|
||||||
|
581217043 1
|
||||||
|
61393681 2377
|
||||||
|
395351612 1
|
||||||
|
124892568 8238
|
||||||
|
731299822 1
|
||||||
|
44667286 1729
|
||||||
|
200000 2
|
||||||
|
5001 1
|
||||||
|
5000 6
|
||||||
|
230520328 1
|
||||||
|
210198390 1254
|
||||||
|
717440572 1
|
||||||
|
240408593 7958
|
||||||
|
741024937 1
|
||||||
|
519308978 8851
|
||||||
|
646254995 1
|
||||||
|
330233771 3441
|
||||||
|
163010463 1
|
||||||
|
98094045 1777
|
||||||
|
472730072 1
|
||||||
|
352244381 2127
|
||||||
|
1000000000 2
|
||||||
|
999999997 3
|
||||||
|
999999998 2
|
||||||
|
199204510 1
|
||||||
|
36606297 2361
|
||||||
|
747306642 1
|
||||||
|
547707522 3524
|
||||||
|
315995728 1
|
||||||
|
214982115 1703
|
||||||
|
563697987 1
|
||||||
|
200471299 1186
|
||||||
|
1000000000 1
|
||||||
|
999999999 10000
|
||||||
|
636835443 1
|
||||||
|
329016383 7064
|
||||||
115
puzzles/google_code_jam/2017/1C-C.cpp
Normal file
115
puzzles/google_code_jam/2017/1C-C.cpp
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
/*
|
||||||
|
VIM: let g:lcppflags="-std=c++11 -O2 -pthread"
|
||||||
|
VIM: let g:wcppflags="/O2 /EHsc /DWIN32"
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include <sstream>
|
||||||
|
#include <fstream>
|
||||||
|
#include <iomanip>
|
||||||
|
#include <exception>
|
||||||
|
#include <stdexcept>
|
||||||
|
#include <map>
|
||||||
|
#include <set>
|
||||||
|
#include <list>
|
||||||
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
|
#include <memory>
|
||||||
|
#include <functional>
|
||||||
|
#include <algorithm>
|
||||||
|
#include <utility>
|
||||||
|
#include <limits>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
typedef long long ll;
|
||||||
|
typedef std::vector<ll> vec;
|
||||||
|
void check(bool b) { if (!b) std::cerr << "error" << std::endl; }
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
std::string to_string( T t ){
|
||||||
|
std::stringstream ss;
|
||||||
|
ss << t;
|
||||||
|
return ss.str();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
*/
|
||||||
|
|
||||||
|
auto solve_puzzle(std::istream& is)
|
||||||
|
{
|
||||||
|
long long n, k;
|
||||||
|
is >> n >> k;
|
||||||
|
double u, p;
|
||||||
|
is >> u;
|
||||||
|
std::vector<double> v;
|
||||||
|
for ( auto i = 0; i < n; ++i ) {
|
||||||
|
is >> p;
|
||||||
|
v.push_back(p);
|
||||||
|
}
|
||||||
|
std::sort(v.begin(), v.end());
|
||||||
|
|
||||||
|
for ( int i = 1; i < v.size() && u > 0.; ++i) {
|
||||||
|
if ( v[i-1] == v[i] )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
double dd = std::min( (v[i] - v[i-1])*i, u );
|
||||||
|
u -= dd;
|
||||||
|
double d = dd / i;
|
||||||
|
for ( int j = 0; j < i; ++j )
|
||||||
|
v[j] += d;
|
||||||
|
}
|
||||||
|
if ( u > 0. ) {
|
||||||
|
double d = u/n;
|
||||||
|
for ( int j = 0; j < n; ++j )
|
||||||
|
v[j] += d;
|
||||||
|
}
|
||||||
|
|
||||||
|
double pp = 1.0;
|
||||||
|
for ( auto p : v ) {
|
||||||
|
pp *= (p > 1.) ? 1. : p;
|
||||||
|
}
|
||||||
|
|
||||||
|
return pp;
|
||||||
|
}
|
||||||
|
|
||||||
|
void read_input_and_solve( std::istream& is, std::ostream& os )
|
||||||
|
{
|
||||||
|
srand((unsigned)time(NULL));
|
||||||
|
int puzzle_count;
|
||||||
|
|
||||||
|
is >> puzzle_count;
|
||||||
|
is.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
|
||||||
|
for (int i = 1; i <= puzzle_count; i++)
|
||||||
|
{
|
||||||
|
os << "Case #" << i << ": ";
|
||||||
|
auto r = solve_puzzle(is);
|
||||||
|
os << std::fixed << r << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char * argv[])
|
||||||
|
{
|
||||||
|
try{
|
||||||
|
if ( *++argv ) {
|
||||||
|
std::ifstream ifs(*argv);
|
||||||
|
read_input_and_solve( ifs, std::cout );
|
||||||
|
} else {
|
||||||
|
read_input_and_solve( std::cin, std::cout );
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
catch (const std::exception& e)
|
||||||
|
{
|
||||||
|
std::cerr << std::endl
|
||||||
|
<< "std::exception(\"" << e.what() << "\")." << std::endl;
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
std::cerr << std::endl
|
||||||
|
<< "unknown exception." << std::endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
301
puzzles/google_code_jam/2017/1C-C.cpp.small-1-attempt0.in
Normal file
301
puzzles/google_code_jam/2017/1C-C.cpp.small-1-attempt0.in
Normal file
@@ -0,0 +1,301 @@
|
|||||||
|
100
|
||||||
|
4 4
|
||||||
|
1.4000
|
||||||
|
0.5000 0.7000 0.8000 0.6000
|
||||||
|
2 2
|
||||||
|
1.0000
|
||||||
|
0.0000 0.0000
|
||||||
|
2 2
|
||||||
|
0.0000
|
||||||
|
0.9000 0.8000
|
||||||
|
2 2
|
||||||
|
0.1000
|
||||||
|
0.4000 0.5000
|
||||||
|
46 46
|
||||||
|
18.9044
|
||||||
|
0.7154 0.4918 0.5486 0.4188 0.0032 0.0550 0.2440 0.5427 0.7392 0.2352 0.2845 0.3242 0.8237 0.9652 0.8020 0.2435 0.6080 0.6678 0.0666 0.8306 0.4022 0.4026 0.3240 0.7261 0.3377 0.6782 0.6797 0.3252 0.3546 0.5295 0.3406 0.4610 0.6270 0.8909 0.7266 0.0029 0.4924 0.7246 0.7673 0.6747 0.8269 0.8002 0.5126 0.2053 0.1180 0.5986
|
||||||
|
45 45
|
||||||
|
20.2731
|
||||||
|
0.1249 0.4999 0.0641 0.2959 0.7659 0.7833 0.3710 0.9187 0.1414 0.7350 0.7815 0.1854 0.9533 0.5795 0.0909 0.9392 0.8477 0.7516 0.6471 0.1234 0.4186 0.1389 0.4020 0.2943 0.0672 0.9318 0.9198 0.6003 0.5887 0.6658 0.5544 0.0317 0.9013 0.5551 0.6366 0.0071 0.7471 0.5287 0.9525 0.5371 0.0439 0.1550 0.0583 0.9021 0.1149
|
||||||
|
46 46
|
||||||
|
20.8862
|
||||||
|
0.5068 0.0937 0.4789 0.6435 0.5893 0.7213 0.6938 0.9643 0.3770 0.7191 0.4497 0.6291 0.4302 0.2927 0.2361 0.2405 0.3105 0.0738 0.1374 0.3474 0.3661 0.1447 0.0364 0.9506 0.7556 0.9729 0.9160 0.3690 0.7428 0.2112 0.3367 0.2619 0.2798 0.1778 0.6369 0.2480 0.2869 0.7787 0.7745 0.1222 0.0544 0.9518 0.6733 0.4848 0.8736 0.2296
|
||||||
|
45 45
|
||||||
|
18.0577
|
||||||
|
0.6316 0.4380 0.8640 0.8056 0.2813 0.4087 0.2428 0.6750 0.5792 0.3920 0.8306 0.2543 0.5291 0.0566 0.4204 0.0926 0.5541 0.1615 0.3159 0.3079 0.6986 0.4459 0.4549 0.8667 0.5838 0.8695 0.3373 0.9090 0.2723 0.3897 0.7994 0.9171 0.0562 0.2645 0.9717 0.8428 0.1174 0.7483 0.4062 0.2604 0.3112 0.1895 0.7312 0.9817 0.2748
|
||||||
|
50 50
|
||||||
|
0.0000
|
||||||
|
0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333
|
||||||
|
1 1
|
||||||
|
0.0000
|
||||||
|
1.0000
|
||||||
|
50 50
|
||||||
|
0.0049
|
||||||
|
0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999
|
||||||
|
2 2
|
||||||
|
0.3333
|
||||||
|
0.0000 0.0000
|
||||||
|
47 47
|
||||||
|
17.1236
|
||||||
|
0.9347 0.0415 0.8434 0.3034 0.5177 0.2473 0.9839 0.5954 0.5268 0.7502 0.8364 0.2927 0.5123 0.6228 0.9609 0.5635 0.1377 0.8309 0.8360 0.3324 0.5967 0.3310 0.5328 0.4674 0.8578 0.1835 0.0073 0.0101 0.5740 0.8678 0.5485 0.1350 0.8652 0.4107 0.7431 0.3951 0.6967 0.8080 0.4107 0.6123 0.1571 0.0982 0.7472 0.0220 0.1543 0.4604 0.1762
|
||||||
|
49 49
|
||||||
|
19.9977
|
||||||
|
0.2446 0.4615 0.5516 0.7485 0.7715 0.0610 0.9301 0.2967 0.6177 0.1842 0.3082 0.9384 0.3362 0.4159 0.5356 0.0459 0.6463 0.2904 0.5887 0.7836 0.6084 0.4419 0.4200 0.6325 0.8805 0.0500 0.3024 0.4937 0.0405 0.3095 0.1824 0.0590 0.2621 0.7098 0.0441 0.1058 0.4702 0.3460 0.7204 0.3496 0.5998 0.8344 0.0197 0.0846 0.1642 0.4400 0.2772 0.1972 0.1850
|
||||||
|
50 50
|
||||||
|
19.5831
|
||||||
|
0.7686 0.9759 0.1898 0.8237 0.0768 0.4146 0.3337 0.5998 0.2561 0.3789 0.1955 0.9198 0.6710 0.3385 0.7070 0.1038 0.4232 0.9162 0.9449 0.4646 0.3961 0.0747 0.2158 0.2223 0.2882 0.1752 0.3673 0.4799 0.8576 0.9859 0.2635 0.7078 0.6387 0.1947 0.4966 0.6814 0.6621 0.4287 0.8610 0.6304 0.9489 0.0131 0.0108 0.5837 0.4697 0.5171 0.3170 0.5041 0.1738 0.7022
|
||||||
|
48 48
|
||||||
|
15.5335
|
||||||
|
0.1896 0.6848 0.5967 0.0581 0.9564 0.9841 0.3567 0.5228 0.3201 0.3028 0.3127 0.7645 0.2689 0.5411 0.3877 0.0082 0.3810 0.8196 0.5254 0.5500 0.8604 0.5138 0.1365 0.1755 0.3708 0.9512 0.4195 0.3589 0.4937 0.8717 0.8594 0.4256 0.1409 0.8767 0.9724 0.5388 0.2426 0.7759 0.9093 0.9680 0.0388 0.8323 0.2734 0.2875 0.1319 0.6820 0.8556 0.9755
|
||||||
|
48 48
|
||||||
|
17.4046
|
||||||
|
0.1517 0.2404 0.3958 0.1122 0.0791 0.6592 0.1826 0.2089 0.2643 0.3480 0.5350 0.6974 0.0627 0.3264 0.5699 0.0096 0.8301 0.1435 0.1215 0.9356 0.5206 0.5863 0.9039 0.3693 0.4026 0.4827 0.3742 0.8799 0.3597 0.1922 0.6985 0.6127 0.3572 0.7473 0.5391 0.4200 0.9264 0.7771 0.6484 0.9652 0.3422 0.4119 0.2245 0.9659 0.3241 0.5956 0.5377 0.7116
|
||||||
|
1 1
|
||||||
|
1.0000
|
||||||
|
0.0000
|
||||||
|
48 48
|
||||||
|
25.3747
|
||||||
|
0.9126 0.6654 0.9003 0.8896 0.6031 0.2240 0.4705 0.0074 0.3006 0.5159 0.0887 0.4976 0.8176 0.5981 0.6894 0.1055 0.1891 0.0025 0.2220 0.8166 0.6088 0.0138 0.0995 0.4954 0.0059 0.8524 0.9015 0.8585 0.3493 0.9159 0.0156 0.3536 0.8964 0.2108 0.3118 0.9252 0.1082 0.7143 0.0738 0.2668 0.5242 0.0060 0.0825 0.0905 0.6779 0.2246 0.3853 0.5364
|
||||||
|
48 48
|
||||||
|
17.5512
|
||||||
|
0.2457 0.7250 0.3072 0.4589 0.8257 0.3447 0.3504 0.9725 0.7545 0.9936 0.1749 0.4313 0.4722 0.7480 0.6519 0.4760 0.6639 0.4229 0.5034 0.8789 0.1550 0.1912 0.6976 0.3319 0.2164 0.6218 0.1962 0.4254 0.2992 0.6709 0.7758 0.5300 0.2515 0.4758 0.0753 0.4115 0.5882 0.7254 0.5275 0.0074 0.2733 0.9476 0.9967 0.6710 0.7066 0.5700 0.7108 0.9700
|
||||||
|
49 49
|
||||||
|
13.9250
|
||||||
|
0.6230 0.0306 0.8576 0.8036 0.8327 0.9727 0.7442 0.1096 0.1534 0.1132 0.6206 0.8523 0.9654 0.6054 0.0575 0.4986 0.7230 0.3259 0.4620 0.7424 0.1720 0.4309 0.1393 0.3895 0.3174 0.8588 0.7138 0.2203 0.3497 0.2650 0.9077 0.8771 0.2778 0.3086 0.9297 0.7822 0.5224 0.7155 0.0395 0.5792 0.7728 0.7980 0.7185 0.9105 0.8643 0.6430 0.9146 0.9542 0.8867
|
||||||
|
46 46
|
||||||
|
23.2624
|
||||||
|
0.2104 0.7988 0.0217 0.2110 0.4778 0.5109 0.0198 0.2256 0.4561 0.4770 0.3338 0.8891 0.0896 0.5344 0.2917 0.3429 0.1327 0.4247 0.5543 0.7492 0.4219 0.2888 0.4604 0.0168 0.4443 0.8673 0.8503 0.2710 0.9232 0.0649 0.8618 0.7232 0.0102 0.3394 0.6813 0.6163 0.8194 0.2941 0.5188 0.0988 0.2079 0.5853 0.9739 0.6465 0.4797 0.9971
|
||||||
|
50 50
|
||||||
|
50.0000
|
||||||
|
0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
|
||||||
|
50 50
|
||||||
|
17.7718
|
||||||
|
0.4704 0.1139 0.1598 0.7921 0.4786 0.9082 0.3404 0.9548 0.9621 0.1263 0.4881 0.0684 0.2571 0.9368 0.6519 0.7921 0.7128 0.3785 0.3269 0.3887 0.0931 0.0069 0.1040 0.5963 0.1832 0.8394 0.9299 0.5560 0.2386 0.5765 0.0403 0.7424 0.7081 0.9454 0.3051 0.4637 0.3677 0.2604 0.1941 0.8299 0.0492 0.6463 0.5546 0.3730 0.2237 0.3507 0.9129 0.9247 0.1702 0.5450
|
||||||
|
50 50
|
||||||
|
0.0000
|
||||||
|
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
|
||||||
|
49 49
|
||||||
|
18.8554
|
||||||
|
0.5447 0.3279 0.3496 0.5530 0.2691 0.0261 0.8593 0.7191 0.1428 0.3676 0.8704 0.9173 0.5955 0.2191 0.2368 0.9522 0.7659 0.5717 0.6509 0.9354 0.4940 0.6619 0.2174 0.2480 0.1939 0.6075 0.5962 0.0933 0.8256 0.2638 0.8426 0.5052 0.7854 0.0938 0.3826 0.2435 0.5134 0.8715 0.3279 0.9585 0.7420 0.5842 0.7544 0.5526 0.5663 0.7180 0.5953 0.5118 0.3832
|
||||||
|
46 46
|
||||||
|
17.4129
|
||||||
|
0.3334 0.2501 0.6494 0.5157 0.5757 0.9133 0.6138 0.0881 0.6461 0.7117 0.6308 0.3032 0.0737 0.4983 0.4350 0.8848 0.9258 0.0798 0.0161 0.4285 0.5212 0.7406 0.9999 0.7856 0.3871 0.4512 0.9877 0.7571 0.8985 0.8126 0.6014 0.9914 0.0720 0.8517 0.3030 0.4492 0.1818 0.0603 0.6160 0.6787 0.6214 0.0057 0.6503 0.7497 0.8529 0.0913
|
||||||
|
49 49
|
||||||
|
18.0752
|
||||||
|
0.9959 0.1892 0.7425 0.2521 0.2053 0.4298 0.7490 0.5356 0.0265 0.3065 0.1012 0.6464 0.3141 0.4596 0.1912 0.4385 0.4405 0.1484 0.8112 0.0115 0.1916 0.5413 0.7187 0.7941 0.5120 0.9204 0.2686 0.4590 0.0481 0.5374 0.4833 0.5638 0.5549 0.9635 0.6315 0.3793 0.1177 0.7509 0.5007 0.2324 0.9289 0.1595 0.9506 0.0071 0.7467 0.4739 0.1126 0.7508 0.2275
|
||||||
|
47 47
|
||||||
|
16.6106
|
||||||
|
0.8618 0.5065 0.5072 0.1291 0.2683 0.3774 0.2424 0.9640 0.7790 0.3480 0.8534 0.5954 0.0429 0.6312 0.2265 0.4473 0.5472 0.5083 0.7284 0.9599 0.6802 0.2429 0.6457 0.6160 0.1954 0.6977 0.8078 0.5420 0.1014 0.0685 0.0746 0.9219 0.0323 0.9413 0.8604 0.4941 0.4876 0.4853 0.5572 0.6323 0.5773 0.3530 0.1529 0.7336 0.1934 0.9784 0.9712
|
||||||
|
45 45
|
||||||
|
16.0882
|
||||||
|
0.3990 0.9257 0.6817 0.3678 0.1831 0.6253 0.9811 0.3917 0.7960 0.3572 0.2757 0.6815 0.7457 0.1272 0.5043 0.8783 0.6435 0.1070 0.3148 0.1607 0.3857 0.8468 0.9279 0.5076 0.3211 0.8730 0.1234 0.1750 0.9630 0.7514 0.3834 0.4326 0.9523 0.3248 0.0660 0.1943 0.4902 0.1023 0.8384 0.6347 0.6469 0.6623 0.1930 0.6257 0.5427
|
||||||
|
50 50
|
||||||
|
20.5888
|
||||||
|
0.4813 0.5247 0.3465 0.2944 0.7188 0.1773 0.6439 0.6476 0.5601 0.6157 0.8483 0.6818 0.2118 0.8049 0.0099 0.2293 0.0827 0.1066 0.6576 0.8628 0.2532 0.8315 0.5331 0.5189 0.8230 0.4069 0.6337 0.4435 0.9725 0.8979 0.5665 0.3467 0.8561 0.2730 0.5186 0.9627 0.9735 0.9306 0.4632 0.7617 0.0865 0.2148 0.7140 0.7498 0.9301 0.3440 0.7779 0.8203 0.5015 0.4742
|
||||||
|
50 50
|
||||||
|
0.0000
|
||||||
|
0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700 0.8700
|
||||||
|
49 49
|
||||||
|
18.4676
|
||||||
|
0.4570 0.5611 0.9853 0.9255 0.8305 0.6375 0.6628 0.7608 0.3090 0.2105 0.7197 0.2810 0.2281 0.4663 0.5774 0.2116 0.1599 0.7726 0.8620 0.3443 0.5222 0.3551 0.4958 0.6747 0.6163 0.5101 0.2412 0.3660 0.5655 0.2729 0.9027 0.6774 0.3835 0.1455 0.1468 0.5048 0.1527 0.9994 0.9886 0.5297 0.1198 0.1204 0.0259 0.3374 0.1428 0.1964 0.6936 0.8847 0.3440
|
||||||
|
48 48
|
||||||
|
19.7061
|
||||||
|
0.3478 0.5713 0.3779 0.5072 0.0287 0.8067 0.3675 0.9917 0.0819 0.5831 0.6516 0.2856 0.8625 0.4198 0.1396 0.2588 0.3231 0.7588 0.3394 0.4498 0.5720 0.6981 0.0642 0.6950 0.0372 0.8620 0.1492 0.7432 0.5738 0.1698 0.5921 0.7729 0.2998 0.5953 0.1437 0.4612 0.3407 0.6473 0.3067 0.1102 0.3496 0.4800 0.6935 0.3653 0.6182 0.7087 0.7471 0.7965
|
||||||
|
47 47
|
||||||
|
20.3093
|
||||||
|
0.2457 0.2940 0.5538 0.7085 0.2739 0.2072 0.8742 0.6973 0.8636 0.1778 0.4747 0.9487 0.9820 0.2944 0.1635 0.8565 0.1776 0.8137 0.0695 0.6708 0.1432 0.3034 0.4412 0.7788 0.1580 0.5779 0.5701 0.3821 0.6586 0.5541 0.3326 0.1907 0.0886 0.7107 0.9245 0.4773 0.2123 0.1067 0.9885 0.9706 0.3576 0.6494 0.3849 0.4096 0.6722 0.3220 0.3936
|
||||||
|
45 45
|
||||||
|
16.0765
|
||||||
|
0.3281 0.3441 0.5413 0.2183 0.7718 0.2400 0.6424 0.3925 0.8204 0.8606 0.7339 0.2915 0.4870 0.6017 0.0865 0.8239 0.1570 0.6165 0.4213 0.2376 0.5246 0.8679 0.1751 0.5514 0.8626 0.6291 0.1383 0.0910 0.5163 0.2864 0.4159 0.7542 0.5741 0.2048 0.7529 0.6521 0.7920 0.6844 0.9139 0.3558 0.2201 0.7211 0.7130 0.9955 0.9638
|
||||||
|
50 50
|
||||||
|
18.1656
|
||||||
|
0.2961 0.3312 0.3249 0.0856 0.5348 0.3105 0.0212 0.3981 0.2003 0.2673 0.7762 0.5724 0.3068 0.9880 0.7263 0.1260 0.3533 0.4085 0.9839 0.3220 0.9228 0.4140 0.5457 0.1946 0.0984 0.5502 0.1898 0.4229 0.7896 0.9937 0.6168 0.5216 0.7649 0.4345 0.1617 0.7389 0.1307 0.3504 0.3345 0.9757 0.9357 0.3281 0.4314 0.8569 0.6810 0.5285 0.5180 0.7820 0.8271 0.6839
|
||||||
|
45 45
|
||||||
|
17.7192
|
||||||
|
0.2876 0.9406 0.4247 0.4233 0.1282 0.9361 0.6562 0.1140 0.8152 0.7791 0.8299 0.4687 0.7758 0.6252 0.0718 0.4781 0.1847 0.1440 0.0179 0.8528 0.4578 0.7815 0.3216 0.4890 0.0429 0.9948 0.6255 0.0997 0.7633 0.4774 0.7809 0.0541 0.5922 0.9462 0.8500 0.3604 0.5399 0.5957 0.6246 0.8736 0.1209 0.6425 0.4209 0.8772 0.1325
|
||||||
|
50 50
|
||||||
|
0.0050
|
||||||
|
0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999
|
||||||
|
1 1
|
||||||
|
0.5000
|
||||||
|
0.5000
|
||||||
|
47 47
|
||||||
|
20.1298
|
||||||
|
0.5263 0.2240 0.0582 0.8895 0.0594 0.2222 0.5763 0.6423 0.6811 0.9274 0.0416 0.3410 0.1967 0.0741 0.9056 0.5865 0.2189 0.1552 0.0844 0.1098 0.0397 0.0266 0.9985 0.9965 0.6924 0.2942 0.2673 0.3469 0.1471 0.1439 0.0426 0.4905 0.0978 0.8963 0.2455 0.2455 0.4455 0.0324 0.8394 0.9791 0.5316 0.0508 0.2524 0.6383 0.3859 0.6042 0.0831
|
||||||
|
49 49
|
||||||
|
16.7738
|
||||||
|
0.3755 0.3543 0.8835 0.8139 0.3112 0.6504 0.7461 0.8687 0.4596 0.9911 0.0153 0.5318 0.5056 0.6493 0.9170 0.8011 0.2073 0.0147 0.7009 0.2596 0.4356 0.8010 0.8190 0.4883 0.4775 0.2997 0.7869 0.3990 0.7558 0.1776 0.7279 0.4634 0.1983 0.0818 0.5556 0.1555 0.7509 0.6201 0.8147 0.6619 0.2328 0.9798 0.5420 0.2578 0.0980 0.1796 0.6097 0.5233 0.3642
|
||||||
|
45 45
|
||||||
|
14.8325
|
||||||
|
0.3498 0.8710 0.9936 0.0956 0.4553 0.5073 0.0110 0.8206 0.1959 0.4080 0.9163 0.9935 0.4970 0.9268 0.5035 0.3127 0.8752 0.9353 0.3257 0.0633 0.7018 0.2024 0.3787 0.7517 0.2525 0.6154 0.3432 0.4519 0.6734 0.4000 0.6653 0.0822 0.9718 0.5920 0.6366 0.6597 0.3099 0.3065 0.8609 0.8340 0.3108 0.9701 0.4749 0.6504 0.5389
|
||||||
|
50 50
|
||||||
|
0.0000
|
||||||
|
0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999 0.9999
|
||||||
|
2 2
|
||||||
|
0.3333
|
||||||
|
0.5000 0.5000
|
||||||
|
48 48
|
||||||
|
17.7700
|
||||||
|
0.4541 0.5271 0.9784 0.8982 0.2472 0.1148 0.4869 0.8782 0.1566 0.7634 0.4476 0.2642 0.5352 0.0039 0.7936 0.0056 0.9359 0.2055 0.4390 0.6703 0.6476 0.4662 0.6862 0.7393 0.2924 0.6249 0.0196 0.4320 0.8851 0.1205 0.2925 0.4334 0.8917 0.7736 0.5433 0.9457 0.6676 0.5165 0.8485 0.2004 0.7332 0.6953 0.4043 0.3932 0.9397 0.4007 0.3853 0.8505
|
||||||
|
50 50
|
||||||
|
0.6901
|
||||||
|
0.5160 0.3303 0.7287 0.2187 0.8871 0.1090 0.5983 0.8091 0.2791 0.5109 0.7255 0.0539 0.5154 0.3512 0.3724 0.2108 0.0932 0.6196 0.7417 0.9926 0.2665 0.7205 0.8265 0.0857 0.8733 0.1224 0.7951 0.2443 0.9318 0.9641 0.3158 0.1842 0.0863 0.2683 0.7744 0.8764 0.7742 0.0770 0.8928 0.6915 0.6759 0.6986 0.1546 0.9438 0.0507 0.6598 0.3337 0.1761 0.3483 0.2215
|
||||||
|
46 46
|
||||||
|
18.5421
|
||||||
|
0.7218 0.7147 0.0136 0.7508 0.2848 0.0654 0.9741 0.9275 0.4510 0.5953 0.8047 0.9039 0.0419 0.1410 0.8228 0.6112 0.5469 0.1256 0.0636 0.0137 0.6814 0.6312 0.7037 0.4114 0.9032 0.1631 0.9196 0.5149 0.5016 0.5498 0.1390 0.1233 0.7961 0.5776 0.8615 0.8522 0.4333 0.2487 0.3450 0.7912 0.3917 0.2616 0.0262 0.5098 0.4189 0.4035
|
||||||
|
46 46
|
||||||
|
19.7828
|
||||||
|
0.5639 0.8624 0.3234 0.1477 0.6151 0.2327 0.1559 0.9069 0.6876 0.6195 0.4011 0.2055 0.4309 0.7218 0.6613 0.4286 0.0706 0.2220 0.0453 0.1622 0.0501 0.5460 0.6461 0.7399 0.2327 0.4191 0.5136 0.4011 0.6246 0.5097 0.2706 0.5112 0.9049 0.3704 0.9434 0.1377 0.3326 0.7418 0.7138 0.2825 0.0398 0.9102 0.9920 0.5614 0.4555 0.3422
|
||||||
|
50 50
|
||||||
|
1.0000
|
||||||
|
0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333
|
||||||
|
48 48
|
||||||
|
15.6565
|
||||||
|
0.5278 0.0193 0.5228 0.9456 0.0042 0.4213 0.3143 0.1608 0.0384 0.0638 0.8872 0.5882 0.7778 0.9988 0.4062 0.2415 0.6068 0.9229 0.6517 0.2949 0.8587 0.8225 0.6691 0.7629 0.0603 0.7937 0.4531 0.9658 0.0482 0.4362 0.5506 0.5961 0.5315 0.8928 0.7345 0.2305 0.9510 0.5585 0.2370 0.5918 0.4599 0.0583 0.8880 0.4601 0.4840 0.4067 0.9645 0.5794
|
||||||
|
50 50
|
||||||
|
20.1453
|
||||||
|
0.5223 0.9386 0.3428 0.8949 0.2337 0.0743 0.0566 0.9195 0.5789 0.7683 0.8006 0.3973 0.1638 0.5191 0.0944 0.8016 0.5780 0.4758 0.5266 0.0596 0.5054 0.2222 0.5740 0.9795 0.4551 0.7777 0.6755 0.4735 0.1502 0.5201 0.3517 0.4328 0.9762 0.0526 0.4705 0.7914 0.5992 0.7149 0.6669 0.6696 0.6458 0.6524 0.0319 0.8520 0.9563 0.2312 0.9324 0.4259 0.7900 0.2482
|
||||||
|
1 1
|
||||||
|
0.3333
|
||||||
|
0.0000
|
||||||
|
50 50
|
||||||
|
23.3005
|
||||||
|
0.3152 0.0637 0.5317 0.3872 0.7202 0.0381 0.5297 0.5268 0.4105 0.2385 0.5053 0.1770 0.0780 0.8788 0.8036 0.0655 0.4780 0.0291 0.1191 0.3208 0.5717 0.6039 0.8138 0.9124 0.1954 0.6289 0.3784 0.4435 0.4654 0.2083 0.9933 0.2300 0.5333 0.9819 0.4551 0.0355 0.4474 0.7420 0.5970 0.9139 0.4975 0.0179 0.6240 0.8461 0.0425 0.3084 0.4425 0.2521 0.8396 0.8497
|
||||||
|
48 48
|
||||||
|
16.3317
|
||||||
|
0.2146 0.9999 0.7198 0.1737 0.1887 0.6949 0.3125 0.6807 0.8886 0.7616 0.8532 0.2614 0.4164 0.4875 0.2715 0.2489 0.7328 0.3873 0.7260 0.9757 0.7097 0.4245 0.7202 0.0446 0.4752 0.5735 0.2830 0.0652 0.2933 0.2940 0.5003 0.6752 0.9207 0.0823 0.7172 0.3626 0.8538 0.5575 0.2136 0.8571 0.7678 0.0660 0.1756 0.8303 0.0336 0.7334 0.7847 0.3049
|
||||||
|
47 47
|
||||||
|
18.3412
|
||||||
|
0.5802 0.1941 0.6840 0.2327 0.1039 0.6280 0.2091 0.3630 0.6637 0.4163 0.3617 0.4065 0.0342 0.8427 0.8745 0.5104 0.8330 0.8990 0.4471 0.2294 0.6156 0.3643 0.7712 0.0957 0.3148 0.2029 0.6345 0.4263 0.0835 0.0172 0.6705 0.1504 0.6086 0.8461 0.4025 0.5864 0.3945 0.5322 0.3516 0.0383 0.9703 0.6811 0.9604 0.6826 0.3893 0.2369 0.0182
|
||||||
|
46 46
|
||||||
|
22.0451
|
||||||
|
0.5592 0.6908 0.7228 0.1673 0.8581 0.5699 0.2533 0.4159 0.4134 0.7487 0.2290 0.2534 0.3533 0.3846 0.6190 0.6146 0.0891 0.7241 0.1561 0.3937 0.0845 0.6791 0.0388 0.0781 0.9280 0.6490 0.7670 0.0137 0.8239 0.5368 0.0043 0.6810 0.9784 0.0087 0.8251 0.6068 0.6703 0.8915 0.7569 0.3375 0.0982 0.3026 0.3216 0.1737 0.0924 0.2874
|
||||||
|
47 47
|
||||||
|
20.6282
|
||||||
|
0.6123 0.9190 0.6805 0.2928 0.0444 0.4684 0.7318 0.9652 0.8914 0.2194 0.6934 0.2179 0.8129 0.4641 0.3254 0.7444 0.9304 0.8038 0.4571 0.8515 0.4740 0.8389 0.7248 0.3537 0.3393 0.1332 0.8143 0.5183 0.3800 0.5519 0.0759 0.3094 0.8861 0.8512 0.2371 0.5829 0.3198 0.3915 0.1679 0.8271 0.5663 0.7447 0.3315 0.4841 0.1328 0.2629 0.7003
|
||||||
|
50 50
|
||||||
|
18.1530
|
||||||
|
0.8991 0.8854 0.0910 0.7641 0.2397 0.9682 0.4796 0.5162 0.8588 0.8281 0.5218 0.9112 0.3157 0.8200 0.4484 0.1535 0.3645 0.0658 0.5312 0.7254 0.5949 0.8758 0.6459 0.8785 0.9402 0.1393 0.8460 0.1344 0.1042 0.6988 0.1712 0.1333 0.5654 0.0420 0.6708 0.5821 0.3243 0.7735 0.4999 0.6724 0.8208 0.7283 0.5014 0.6620 0.3131 0.7180 0.3635 0.0677 0.1678 0.4349
|
||||||
|
47 47
|
||||||
|
15.0774
|
||||||
|
0.6006 0.1221 0.7823 0.2378 0.4926 0.2530 0.4674 0.9538 0.9036 0.8845 0.0044 0.0725 0.0344 0.7686 0.4706 0.2834 0.3416 0.5027 0.7680 0.2283 0.8802 0.8921 0.5691 0.4992 0.3555 0.6920 0.4612 0.6548 0.2584 0.9382 0.7007 0.7646 0.8879 0.6129 0.1216 0.9809 0.8140 0.2714 0.2802 0.4620 0.3040 0.4532 0.5347 0.3160 0.5013 0.0479 0.9849
|
||||||
|
49 49
|
||||||
|
20.6963
|
||||||
|
0.9690 0.3628 0.3904 0.4498 0.1293 0.4322 0.7872 0.8880 0.3186 0.2000 0.3773 0.0514 0.2035 0.4047 0.4480 0.6468 0.0179 0.5530 0.7643 0.5015 0.2888 0.9536 0.1850 0.7345 0.9019 0.4217 0.4186 0.0793 0.7950 0.2240 0.4384 0.7506 0.0183 0.9793 0.5703 0.5306 0.4884 0.4563 0.5383 0.3279 0.8293 0.0557 0.6703 0.4247 0.3821 0.2773 0.4034 0.9972 0.2731
|
||||||
|
50 50
|
||||||
|
21.1207
|
||||||
|
0.2574 0.0715 0.8502 0.1683 0.9960 0.0747 0.4544 0.5828 0.1263 0.5545 0.0577 0.2507 0.7152 0.2059 0.0155 0.7741 0.2912 0.5823 0.4302 0.8729 0.0020 0.1676 0.0141 0.3750 0.0208 0.4166 0.4427 0.4514 0.0055 0.8132 0.8961 0.4250 0.4608 0.4927 0.5633 0.9363 0.0017 0.5577 0.4322 0.4750 0.0248 0.4767 0.9402 0.2903 0.5887 0.9100 0.3512 0.6411 0.0146 0.3336
|
||||||
|
49 49
|
||||||
|
19.0610
|
||||||
|
0.3133 0.9224 0.2562 0.9636 0.6789 0.7571 0.2034 0.8223 0.1039 0.4083 0.0823 0.4477 0.4662 0.9272 0.5612 0.3892 0.6874 0.6610 0.8309 0.0249 0.7053 0.6792 0.8088 0.1051 0.0396 0.4975 0.1188 0.9390 0.2935 0.4659 0.9235 0.6840 0.7986 0.8742 0.8695 0.7358 0.1367 0.9262 0.9860 0.7318 0.7827 0.6832 0.9199 0.9496 0.1229 0.5952 0.9809 0.6889 0.4736
|
||||||
|
46 46
|
||||||
|
15.5774
|
||||||
|
0.9831 0.9473 0.3878 0.8648 0.6370 0.4525 0.9485 0.7595 0.4878 0.6352 0.2521 0.2497 0.1611 0.0645 0.9037 0.5310 0.5514 0.0358 0.0435 0.3919 0.0796 0.7080 0.2278 0.2605 0.2895 0.7292 0.5287 0.7191 0.1481 0.7360 0.6079 0.4315 0.4145 0.3163 0.7245 0.2697 0.8702 0.7462 0.3569 0.2384 0.1957 0.1876 0.7898 0.8523 0.1576 0.7955
|
||||||
|
50 50
|
||||||
|
21.2310
|
||||||
|
0.6257 0.3883 0.5258 0.0480 0.6548 0.9116 0.2613 0.8864 0.0117 0.6265 0.9196 0.9777 0.6302 0.2311 0.2718 0.6977 0.2997 0.6532 0.3766 0.1018 0.6294 0.7807 0.6000 0.8443 0.6714 0.0341 0.2973 0.6021 0.7969 0.2970 0.5071 0.9178 0.7157 0.9583 0.1833 0.6795 0.8865 0.1054 0.2169 0.7684 0.7223 0.5882 0.8332 0.9377 0.6257 0.2359 0.6772 0.1823 0.4860 0.3730
|
||||||
|
45 45
|
||||||
|
20.7897
|
||||||
|
0.9471 0.9386 0.0332 0.6033 0.6992 0.8237 0.7744 0.1092 0.6434 0.1869 0.2837 0.8643 0.1267 0.3337 0.0334 0.7661 0.4250 0.2440 0.0006 0.4294 0.2070 0.1134 0.3732 0.3330 0.6814 0.8431 0.4810 0.6769 0.1972 0.6046 0.3116 0.7856 0.9820 0.5713 0.7969 0.9205 0.9687 0.8924 0.1198 0.1854 0.3364 0.6285 0.0533 0.3744 0.5707
|
||||||
|
2 2
|
||||||
|
0.5000
|
||||||
|
0.5000 0.5000
|
||||||
|
45 45
|
||||||
|
20.8092
|
||||||
|
0.3006 0.0767 0.0039 0.0490 0.8617 0.8395 0.6799 0.8361 0.8923 0.3920 0.4028 0.3137 0.8938 0.7941 0.5859 0.2223 0.2470 0.1801 0.4158 0.7665 0.0041 0.3320 0.4325 0.0788 0.4040 0.0265 0.5676 0.5921 0.5469 0.9187 0.2348 0.0469 0.7240 0.7982 0.9283 0.1440 0.8555 0.2353 0.0240 0.3654 0.8256 0.7283 0.8314 0.2535 0.7620
|
||||||
|
46 46
|
||||||
|
16.5966
|
||||||
|
0.3682 0.8943 0.8713 0.1842 0.0052 0.6742 0.3158 0.2942 0.1885 0.7450 0.6826 0.8285 0.1423 0.0860 0.8433 0.4137 0.1694 0.8093 0.6591 0.5227 0.5013 0.0465 0.8889 0.6709 0.7572 0.4630 0.7646 0.3756 0.1323 0.7564 0.0497 0.8995 0.4089 0.9904 0.9705 0.5239 0.8878 0.1210 0.9977 0.7016 0.6123 0.5997 0.3165 0.7923 0.5447 0.5132
|
||||||
|
2 2
|
||||||
|
0.0000
|
||||||
|
1.0000 1.0000
|
||||||
|
48 48
|
||||||
|
20.5928
|
||||||
|
0.4833 0.6422 0.6040 0.2703 0.2776 0.4758 0.7994 0.7974 0.6842 0.7908 0.5095 0.8841 0.7715 0.0355 0.0716 0.1997 0.7558 0.0394 0.8780 0.2875 0.5139 0.5918 0.7850 0.9965 0.2854 0.1309 0.7482 0.6949 0.5152 0.0157 0.9515 0.9530 0.2787 0.6560 0.3688 0.8615 0.5320 0.8863 0.1629 0.1482 0.8736 0.6392 0.1743 0.4277 0.1681 0.8944 0.6479 0.0164
|
||||||
|
49 49
|
||||||
|
19.1224
|
||||||
|
0.2806 0.1998 0.0912 0.8584 0.3965 0.2329 0.6031 0.9233 0.1111 0.2515 0.4179 0.0329 0.7855 0.1909 0.7984 0.8012 0.0806 0.7525 0.9693 0.0830 0.3490 0.8452 0.9671 0.1956 0.9819 0.1132 0.5794 0.9912 0.6992 0.1701 0.9148 0.9919 0.8701 0.9489 0.2101 0.2659 0.3819 0.4871 0.6499 0.2735 0.4187 0.3539 0.8316 0.4589 0.2171 0.3169 0.6214 0.6342 0.6954
|
||||||
|
48 48
|
||||||
|
21.1151
|
||||||
|
0.1068 0.4741 0.5645 0.3856 0.2484 0.6406 0.1260 0.7285 0.6979 0.9180 0.0227 0.1847 0.5524 0.3379 0.5921 0.3800 0.5412 0.8398 0.8505 0.1508 0.7709 0.2571 0.7310 0.0661 0.1761 0.6513 0.2187 0.0757 0.3932 0.0848 0.3476 0.9341 0.4580 0.9020 0.2856 0.0836 0.0913 0.0669 0.2883 0.5992 0.3129 0.4810 0.6148 0.7437 0.6429 0.2296 0.7362 0.4826
|
||||||
|
49 49
|
||||||
|
2.2603
|
||||||
|
0.4266 0.1762 0.2235 0.4379 0.1679 0.7961 0.6047 0.2062 0.4795 0.4581 0.2368 0.7694 0.5154 0.0852 0.7001 0.4606 0.5509 0.7932 0.7444 0.9229 0.8491 0.1329 0.8561 0.6873 0.7481 0.6125 0.7809 0.5347 0.3106 0.8691 0.5165 0.6857 0.4856 0.0739 0.0706 0.6942 0.5352 0.5337 0.2869 0.5095 0.3850 0.7213 0.2017 0.1160 0.8354 0.3545 0.2831 0.7064 0.8378
|
||||||
|
4 4
|
||||||
|
1.3999
|
||||||
|
0.8000 0.7000 0.6000 0.5000
|
||||||
|
46 46
|
||||||
|
18.4223
|
||||||
|
0.1316 0.4088 0.8607 0.2696 0.9271 0.3667 0.1894 0.4309 0.1383 0.4101 0.3226 0.6112 0.3003 0.4528 0.6129 0.2209 0.5217 0.0408 0.0388 0.2992 0.2072 0.9760 0.1343 0.8383 0.1490 0.0867 0.1356 0.4677 0.8474 0.2360 0.2484 0.2344 0.1275 0.6457 0.8918 0.6177 0.0453 0.0630 0.7283 0.4093 0.0945 0.7445 0.9726 0.3634 0.3647 0.4328
|
||||||
|
48 48
|
||||||
|
20.6491
|
||||||
|
0.5898 0.7233 0.6276 0.5110 0.3093 0.3687 0.5286 0.2954 0.4379 0.6734 0.0498 0.1668 0.7824 0.9310 0.5527 0.8098 0.3007 0.5172 0.5532 0.3216 0.9350 0.3482 0.2506 0.4213 0.6343 0.0318 0.6954 0.7682 0.3350 0.1360 0.3600 0.1173 0.2620 0.5207 0.7189 0.5898 0.2920 0.2776 0.3140 0.4824 0.3529 0.9124 0.8605 0.9627 0.3994 0.0865 0.3827 0.6122
|
||||||
|
48 48
|
||||||
|
20.0215
|
||||||
|
0.6255 0.7666 0.1754 0.8870 0.8884 0.6063 0.1565 0.7796 0.7150 0.3525 0.2502 0.4027 0.9758 0.3248 0.1144 0.1484 0.1000 0.2073 0.8838 0.9706 0.8035 0.2201 0.0132 0.5055 0.3638 0.7873 0.4811 0.9353 0.5453 0.5472 0.1290 0.1204 0.2537 0.0270 0.2772 0.9319 0.6686 0.1886 0.0902 0.1290 0.5698 0.8152 0.4343 0.5319 0.8844 0.2563 0.5491 0.0509
|
||||||
|
49 49
|
||||||
|
19.1246
|
||||||
|
0.8474 0.6142 0.2354 0.2188 0.7425 0.3432 0.0545 0.1490 0.1516 0.3128 0.0104 0.9269 0.4780 0.3192 0.2373 0.8909 0.2015 0.1417 0.5808 0.5325 0.4941 0.3936 0.9425 0.8784 0.4623 0.1874 0.6792 0.0134 0.2221 0.5817 0.8157 0.1302 0.0882 0.8384 0.5491 0.0238 0.1494 0.6079 0.6559 0.7218 0.4645 0.5483 0.5489 0.8303 0.3748 0.1204 0.7296 0.7703 0.5610
|
||||||
|
45 45
|
||||||
|
15.1683
|
||||||
|
0.0763 0.6698 0.5081 0.3167 0.2247 0.6705 0.1031 0.9905 0.0965 0.0680 0.8005 0.4467 0.8509 0.3303 0.3063 0.9890 0.2013 0.7084 0.1920 0.4588 0.2603 0.8275 0.6543 0.3015 0.3846 0.3758 0.9218 0.8536 0.6433 0.8711 0.8302 0.2334 0.7123 0.5285 0.4046 0.6780 0.0545 0.5595 0.5352 0.9127 0.1835 0.1190 0.7433 0.5206 0.1401
|
||||||
|
45 45
|
||||||
|
3.5904
|
||||||
|
0.3448 0.5776 0.9563 0.2414 0.6942 0.3252 0.1847 0.4972 0.4568 0.7248 0.7976 0.2692 0.4244 0.6697 0.3085 0.4520 0.4581 0.3308 0.3892 0.8075 0.5127 0.3324 0.8945 0.3028 0.7715 0.5221 0.1272 0.1036 0.7122 0.7398 0.4031 0.2361 0.1824 0.5679 0.4820 0.1018 0.4654 0.3233 0.8268 0.4465 0.9111 0.1720 0.3880 0.3655 0.8465
|
||||||
|
1 1
|
||||||
|
0.3333
|
||||||
|
0.5000
|
||||||
|
47 47
|
||||||
|
16.0605
|
||||||
|
0.5184 0.7895 0.9569 0.9556 0.3052 0.5678 0.5047 0.2292 0.1362 0.9044 0.1938 0.7545 0.7726 0.2927 0.3930 0.0404 0.4418 0.8196 0.7284 0.1877 0.7247 0.8802 0.9355 0.2127 0.1504 0.9378 0.5277 0.1925 0.6562 0.7603 0.9838 0.1273 0.2008 0.3584 0.7857 0.2470 0.1524 0.3510 0.8886 0.7426 0.8002 0.8382 0.6821 0.2919 0.9149 0.8253 0.9559
|
||||||
|
4 4
|
||||||
|
0.0001
|
||||||
|
0.0000 0.0000 0.0000 0.0000
|
||||||
|
47 47
|
||||||
|
17.9417
|
||||||
|
0.9741 0.3510 0.0825 0.0884 0.3496 0.3211 0.6277 0.2549 0.6867 0.7686 0.3747 0.6293 0.1645 0.5519 0.2776 0.6935 0.3854 0.2028 0.4540 0.4202 0.3429 0.0309 0.6681 0.3080 0.6523 0.8128 0.1705 0.2683 0.7939 0.7787 0.8224 0.3615 0.5468 0.5523 0.3780 0.2514 0.9958 0.6907 0.6231 0.2671 0.5188 0.2060 0.5514 0.5337 0.2788 0.9734 0.2094
|
||||||
|
50 50
|
||||||
|
17.9137
|
||||||
|
0.6277 0.6833 0.1081 0.6670 0.6155 0.2548 0.1515 0.9388 0.6643 0.0170 0.7833 0.4717 0.2236 0.8487 0.7020 0.0766 0.3354 0.2600 0.8148 0.4139 0.8247 0.9158 0.2910 0.2728 0.2104 0.6068 0.4363 0.2936 0.4768 0.6964 0.2833 0.3468 0.4347 0.5590 0.5759 0.5151 0.8075 0.8551 0.0032 0.3795 0.7511 0.0302 0.2926 0.5991 0.6660 0.5272 0.6971 0.5217 0.2444 0.6666
|
||||||
|
50 50
|
||||||
|
19.3171
|
||||||
|
0.9935 0.3629 0.8382 0.6800 0.7177 0.8242 0.3700 0.3559 0.2459 0.0619 0.0117 0.0685 0.8033 0.4253 0.2638 0.8841 0.9047 0.8919 0.6163 0.4404 0.6352 0.0768 0.4095 0.3106 0.3660 0.5541 0.9189 0.8259 0.8210 0.0484 0.4819 0.1000 0.3138 0.3818 0.5157 0.1713 0.2619 0.4603 0.8890 0.2002 0.5584 0.8136 0.9646 0.0874 0.3685 0.4105 0.1980 0.7082 0.0487 0.6281
|
||||||
|
50 50
|
||||||
|
33.3350
|
||||||
|
0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333
|
||||||
|
49 49
|
||||||
|
25.0782
|
||||||
|
0.2673 0.0416 0.5442 0.3392 0.6610 0.4172 0.7910 0.1911 0.3490 0.0873 0.1315 0.3667 0.6108 0.6095 0.5891 0.2900 0.2323 0.4158 0.9656 0.2107 0.7589 0.7651 0.8534 0.1178 0.5238 0.5910 0.4778 0.6336 0.0659 0.2667 0.5578 0.6549 0.0098 0.5546 0.4364 0.6563 0.0420 0.4325 0.0565 0.8756 0.6726 0.3758 0.8981 0.0704 0.1110 0.6502 0.5804 0.1742 0.9812
|
||||||
|
49 49
|
||||||
|
15.9647
|
||||||
|
0.4588 0.7822 0.5782 0.6604 0.1277 0.0259 0.5788 0.7873 0.9343 0.9056 0.0571 0.5171 0.9361 0.8927 0.2975 0.9190 0.2892 0.2609 0.4815 0.2070 0.9478 0.4997 0.0316 0.1246 0.5204 0.4969 0.2716 0.5728 0.2812 0.6885 0.3811 0.4943 0.1949 0.2887 0.9938 0.8394 0.6200 0.0182 0.5631 0.6625 0.6710 0.9356 0.8554 0.4155 0.5285 0.8525 0.9039 0.0253 0.4530
|
||||||
|
47 47
|
||||||
|
2.2784
|
||||||
|
0.4923 0.7939 0.3084 0.1664 0.1370 0.5550 0.7958 0.3364 0.9963 0.9770 0.1902 0.3204 0.1539 0.8278 0.3553 0.9917 0.9056 0.6483 0.6562 0.0239 0.1305 0.1028 0.4354 0.5519 0.1637 0.2346 0.2816 0.6587 0.6641 0.8156 0.1259 0.1277 0.1427 0.4495 0.6506 0.8193 0.7586 0.9042 0.0708 0.9460 0.1005 0.7511 0.8840 0.3635 0.8419 0.6852 0.8489
|
||||||
|
46 46
|
||||||
|
18.7612
|
||||||
|
0.9281 0.1122 0.1862 0.0535 0.6432 0.3810 0.4055 0.4581 0.2734 0.2348 0.5563 0.7949 0.8221 0.8417 0.7190 0.3621 0.8704 0.6103 0.0717 0.3446 0.2062 0.3897 0.1051 0.7924 0.3095 0.7641 0.0393 0.0956 0.2361 0.7495 0.8394 0.5276 0.2792 0.4850 0.1411 0.7470 0.6365 0.2293 0.8517 0.6285 0.3212 0.3948 0.3954 0.7409 0.4930 0.5114
|
||||||
|
50 50
|
||||||
|
0.0000
|
||||||
|
0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765 0.8765
|
||||||
|
47 47
|
||||||
|
0.5837
|
||||||
|
0.0304 0.2637 0.5373 0.4740 0.1291 0.6248 0.2916 0.2976 0.0082 0.5646 0.6131 0.6696 0.5064 0.7167 0.0343 0.6586 0.7335 0.3602 0.5956 0.9918 0.7970 0.8177 0.3793 0.6048 0.3154 0.9137 0.8207 0.8463 0.3682 0.8283 0.7619 0.8867 0.4186 0.4096 0.2756 0.1213 0.3950 0.7012 0.7999 0.4499 0.5026 0.5603 0.8003 0.8738 0.7741 0.9160 0.1457
|
||||||
|
50 50
|
||||||
|
1.0000
|
||||||
|
0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
|
||||||
|
49 49
|
||||||
|
19.6267
|
||||||
|
0.8137 0.7208 0.6351 0.4980 0.2851 0.8874 0.6391 0.1200 0.8772 0.6023 0.5593 0.4466 0.5537 0.7006 0.1113 0.4286 0.3992 0.4044 0.1712 0.9330 0.3293 0.9537 0.4181 0.7734 0.5359 0.9824 0.5557 0.1662 0.9102 0.3282 0.3764 0.3176 0.1290 0.5701 0.8835 0.5641 0.0227 0.0961 0.5182 0.0517 0.5480 0.6851 0.1962 0.5346 0.5882 0.8693 0.3268 0.9098 0.5836
|
||||||
|
47 47
|
||||||
|
18.5509
|
||||||
|
0.3666 0.3079 0.0674 0.7595 0.3511 0.8973 0.4638 0.8489 0.3830 0.3637 0.7219 0.5937 0.6429 0.5784 0.7063 0.4075 0.3303 0.6969 0.7747 0.9553 0.6597 0.3683 0.1169 0.7926 0.7457 0.6888 0.1250 0.7360 0.5874 0.3318 0.8115 0.2533 0.2770 0.6209 0.8764 0.9983 0.2576 0.3831 0.7047 0.8897 0.4550 0.8940 0.5336 0.4780 0.7787 0.9700 0.4644
|
||||||
|
48 48
|
||||||
|
19.7357
|
||||||
|
0.2548 0.1270 0.2663 0.6458 0.3555 0.7392 0.5445 0.6001 0.1720 0.4095 0.6013 0.3266 0.6243 0.1022 0.3731 0.8246 0.2649 0.9462 0.9735 0.1932 0.1174 0.8275 0.2742 0.2401 0.3960 0.0007 0.1625 0.5197 0.3072 0.7489 0.1277 0.8829 0.6095 0.8076 0.1306 0.1533 0.5514 0.5906 0.5088 0.1717 0.3750 0.5812 0.7661 0.5088 0.0016 0.8033 0.4139 0.7720
|
||||||
|
49 49
|
||||||
|
18.8013
|
||||||
|
0.1118 0.7192 0.3957 0.1552 0.6487 0.2637 0.9135 0.3266 0.6248 0.1730 0.4988 0.6470 0.0941 0.3311 0.6826 0.6168 0.4080 0.8744 0.9566 0.4192 0.7286 0.9533 0.2937 0.8098 0.9371 0.0250 0.5695 0.1804 0.1037 0.1230 0.0377 0.4131 0.6162 0.5689 0.9119 0.6314 0.5442 0.6995 0.3353 0.1123 0.5703 0.6841 0.3567 0.8292 0.0050 0.5934 0.4404 0.0397 0.4682
|
||||||
|
50 50
|
||||||
|
0.0000
|
||||||
|
0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
|
||||||
13
puzzles/google_code_jam/2017/1C-C.cpp.test
Normal file
13
puzzles/google_code_jam/2017/1C-C.cpp.test
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
4
|
||||||
|
4 4
|
||||||
|
1.4000
|
||||||
|
0.5000 0.7000 0.8000 0.6000
|
||||||
|
2 2
|
||||||
|
1.0000
|
||||||
|
0.0000 0.0000
|
||||||
|
2 1
|
||||||
|
0.0000
|
||||||
|
0.9000 0.8000
|
||||||
|
2 1
|
||||||
|
0.1000
|
||||||
|
0.4000 0.5000
|
||||||
Reference in New Issue
Block a user