From 54467f78773f3a109cffc71ff37d80ab7ff15ae3 Mon Sep 17 00:00:00 2001 From: vinay Date: Sat, 16 Dec 2017 16:57:03 +0530 Subject: [PATCH 1/3] Checking --- nonogram.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nonogram.cpp b/nonogram.cpp index 4ecc547..e38fdf3 100644 --- a/nonogram.cpp +++ b/nonogram.cpp @@ -2,7 +2,7 @@ using namespace std; - +// some predefined values #define pb push_back #define mp make_pair #define ii insert From 07da553564ce9882ca71336d1ac361e8d6b04853 Mon Sep 17 00:00:00 2001 From: Vinay Aggarwal Date: Sat, 10 Mar 2018 17:05:31 +0530 Subject: [PATCH 2/3] Add files via upload --- finalsover.cpp | 314 +++++++++++++++++++++++++++++++++++++++++++++++ map_function.cpp | 119 ++++++++++++++++++ 2 files changed, 433 insertions(+) create mode 100644 finalsover.cpp create mode 100644 map_function.cpp diff --git a/finalsover.cpp b/finalsover.cpp new file mode 100644 index 0000000..286a079 --- /dev/null +++ b/finalsover.cpp @@ -0,0 +1,314 @@ + +// FINAL-LEFTMOST SOLVER PART-1 !!! + +#include + +using namespace std; +#define ll long long +#define ull unsigned long long +#define ld long double +#define fi first +#define se second +#define pb push_back +#define mp make_pair + +int a[100005]; +int n; +int b[100005]; +vector query; +pair start_end[1000]; +int q,flag=1; + + + +void initial() +{ + for(int i=0;i>a[i]; + } +} + +void simplesol(int l1, int r1, int q1) +{ + vector filled; + vector empty; + + + for(int i=l1;il1){ + if(a[k-1]==4)check=0; // if the element just before the bolck is filled we can't place the block + } + if(check==1){ + //cout<>x; + query.pb(x); + } +} + +vector assign(int l1,int r1) +{ + vector assigned; + for(int i=l1;i=0;i--) + { + if(start_end[i].second=pos){ + + int chk=1; + + // not a valid position if empty cell lies + for(int i=l;i0&&x!=1) + { + y--; + x=firstpart(pos,y,1); + if(x==1) + { + chk=1; + break; + } + } + if(chk) + continue; + else + { + flag=0; + break; + } + + } + } + +} + +void printsimplesol() +{ + for(int i=0;i arr=sipleLeftSolver(); + + cin>>n; + cin>>q; + + inputquery(); // l se r ki zaroorat shayad na ho + initial(); // l se r ki zaroorat shayad na ho + simplesol(l1,r1,q1); // starting from array index l1 upto r1 and q1 denotes the query from which it will start running + vector assign_block; + assign_block = assign(l1,r1); // to get the assigned blocks in the range l1 to r1 + printsimplesol(); + startend(); + checker(); + final_output(); + + return 0; +} \ No newline at end of file diff --git a/map_function.cpp b/map_function.cpp new file mode 100644 index 0000000..a702cce --- /dev/null +++ b/map_function.cpp @@ -0,0 +1,119 @@ +#include +using namespace std; + +// x= horizonal y= going to bottom right z=going to bottom left + +int grid[201][201]; +int n=10; + +void map_func(vector l, int x, int y, int z) +{ + if(x) + { + for(int i=100-x+1;i<=100+x-1;i++) + grid[x][i]=l[i+x-101]; + } + else if(y) + { + int i=101-y, j=y; + int k=0,p=-1; + while(j<=n&&k l; + + l.push_back(1); + l.push_back(1); + l.push_back(1); + l.push_back(1); + l.push_back(1); + l.push_back(1); + l.push_back(1); + + initialize(); + + map_func(l,0,7,0); + + print_grid(); + + return 0; +} From 6f84738978ae2793cdbcf10d1e5f1593b0979de8 Mon Sep 17 00:00:00 2001 From: Vinay Aggarwal Date: Sat, 10 Mar 2018 17:09:46 +0530 Subject: [PATCH 3/3] Add files via upload --- finalsover(1).cpp | 278 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 278 insertions(+) create mode 100644 finalsover(1).cpp diff --git a/finalsover(1).cpp b/finalsover(1).cpp new file mode 100644 index 0000000..5edf2b9 --- /dev/null +++ b/finalsover(1).cpp @@ -0,0 +1,278 @@ + +// FINAL-LEFTMOST SOLVER PART-1 !!! + +#include + +using namespace std; +#define ll long long +#define ull unsigned long long +#define ld long double +#define fi first +#define se second +#define pb push_back +#define mp make_pair + +//vector> v; +//ll b[200005]; +//ll a[300005],b[300005],c[300005]; +//ll a[1001005]; +//pair a[1000005]; +//vector l; +//pairp; +//pair a[500005]; +//vector adj[100005]; +//unordered_set s; + +bool comp(const int a,const int b){ + return a query; +vector assigned; +pair start_end[1000]; +int q; + + +void initial() +{ + for(int i=0;i>a[i]; + } +} + +void simplesol() +{ + vector filled; + vector empty; + + + for(int i=0;i0){ + if(a[k-1]==4)check=0; // if the element just before the bolck is filled we can't place the block + } + if(check==1){ + //cout<>x; + query.pb(x); + } +} + +void assign() +{ + for(int i=0;i=0;i--){ + + + + l=start_end[i].fi; + r=start_end[i].se; + + int tempx=l; + int tempy=r; + //cout<=pos){ + + int chk=1; + + // not a valid position if empty cell lies + for(int i=l;i arr=sipleLeftSolver(); + + cin>>n; + cin>>q; + + inputquery(); + initial(); + simplesol(); + assign(); + printsimplesol(); + startend(); + checker(); + final_output(); + + return 0; +} \ No newline at end of file