This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x1=-1.0; x2=+1.0; y1=-1.5; y2=+4.5; | |
nx=7; ny=9; | |
step_x=(x2-x1)/(nx-1); step_y=(y2-y1)/(ny-1); | |
step_min = min(step_x,step_y); | |
[x,y]=meshgrid([x1:step_x:x2], [y1:step_y:y2]); | |
z= x.^3 + 5.*x.^2.*y + x - y.^3; | |
surf(x,y,z), title('PS. Press<enter>'); | |
pause; | |
xx=reshape(x,1,nx*ny); | |
yy=reshape(y,1,nx*ny); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x1=-1.0; x2=+1.0; y1=-1.5; y2=+4.5; z1=-1.0; z2=+1.0; | |
nx=7; ny=9; nz=5; | |
step_x=(x2-x1)/(nx-1); step_y=(y2-y1)/(ny-1); step_z=(z2-z1)/(nz-1); | |
step_min = min([step_x step_y step_z]); | |
[x,y,z]=meshgrid([x1:step_x:x2], [y1:step_y:y2], [z1:step_z:z2]); | |
f= 4.*x+x.^2.*y-z.*y; | |
isosurface(x,y,z,f), title('PS. Press<enter>'); | |
pause; | |
close; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma GCC optimize("Ofast,no-stack-protector,tree-vectorize") | |
#pragma GCC target("avx,sse4,tune=native") | |
#include <iostream> | |
#include <cassert> | |
#include <string> | |
#include <vector> | |
#include <array> | |
#include <numeric> | |
#include <algorithm> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "game.h" | |
#include "geometry.h" | |
#include <queue> | |
#include <array> | |
#include <set> | |
#include <cstdlib> | |
constexpr size_t kNone = std::numeric_limits<size_t>::max(); | |
constexpr double kEps = 1e-5; | |
constexpr size_t kProfitTurnsAfterReset = 10; |