generated from TNFSH-Programming-Contest/tps-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
littlecube
committed
Sep 11, 2023
1 parent
ac24a4f
commit 8324a14
Showing
91 changed files
with
26,468 additions
and
346 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
["B", "C"] | ||
["A", "B", "C", "D", "E", "F"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,14 @@ | ||
nothing: | ||
|
||
import-pA: | ||
cmsImportTask ./pA/ -u $(if $(s), , --no-statement) | ||
import-pB: | ||
cmsImportTask ./pB/ -u $(if $(s), , --no-statement) | ||
import-pC: | ||
cmsImportTask ./pC/ -u $(if $(s), , --no-statement) | ||
import-pD: | ||
cmsImportTask ./pD/ -u $(if $(s), , --no-statement) | ||
import-pE: | ||
cmsImportTask ./pE/ -u $(if $(s), , --no-statement) | ||
import-pF: | ||
cmsImportTask ./pF/ -u $(if $(s), , --no-statement) |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,43 @@ | ||
@subtask samples | ||
manual example.in | ||
manual example-01.in | ||
manual example-02.in | ||
|
||
@subtask one | ||
gen-one 1 | ||
gen-one 23 | ||
gen-one 51238 | ||
gen-one 100000 | ||
@subtask n4 | ||
manual 1x1.in | ||
gen 100 100 2 1 | ||
gen 100 100 2 2 | ||
gen 100 100 2 3 | ||
gen 100 100 2 4 | ||
gen 100 100 2 5 | ||
gen 100 100 50 6 | ||
gen 100 100 50 7 | ||
gen 100 100 50 8 | ||
gen 100 100 50 9 | ||
gen 100 100 50 10 | ||
|
||
@subtask six | ||
gen-six 1 | ||
gen-six 23 | ||
gen-six 51238 | ||
gen-six 100000 | ||
@subtask n3 | ||
@include n4 | ||
gen 500 500 2 11 | ||
gen 500 500 2 12 | ||
gen 500 500 2 13 | ||
gen 500 500 2 14 | ||
gen 500 500 2 15 | ||
gen 500 500 100 16 | ||
gen 500 500 100 17 | ||
gen 500 500 100 18 | ||
gen 500 500 100 19 | ||
gen 500 500 100 20 | ||
|
||
@subtask full | ||
@include n3 | ||
gen 2000 2000 0 21 | ||
gen 2000 2000 2 22 | ||
gen 2000 2000 5 23 | ||
gen 2000 2000 10 24 | ||
gen 2000 2000 100 25 | ||
gen 2000 2000 100 26 | ||
gen 2000 2000 500 27 | ||
gen 2000 2000 1000 28 | ||
gen 2000 2000 2000 29 | ||
gen 2000 2000 40000000 30 | ||
|
||
@subtask all | ||
@include one | ||
@include six | ||
gen 5 | ||
gen 6 | ||
gen 100000 a | ||
gen 100000 b | ||
gen 100000 c | ||
gen 100000 d | ||
gen 100000 e | ||
gen 100000 f | ||
gen-equal 100000 a | ||
gen-equal 100000 b |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
#include <bits/stdc++.h> | ||
#include "testlib.h" | ||
using namespace std; | ||
|
||
const int C = 1'000'000'000; | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
ios::sync_with_stdio(0); | ||
cin.tie(0); | ||
registerGen(argc, argv, 1); | ||
#include <bits/stdc++.h> | ||
|
||
int N = atoi(argv[1]); | ||
using namespace std; | ||
|
||
cout << N << '\n'; | ||
for (int i = 1; i <= N; i++) | ||
cout << rnd.next(1, C) << " \n"[i == N]; | ||
int main(int argc, char* argv[]) { | ||
registerGen(argc, argv, 1); | ||
int n=atoi(argv[1]),m=atoi(argv[2]),c=atoi(argv[3]); | ||
cout<<n<<" "<<m<<"\n"; | ||
for (int i=1;i<=n;i++){ | ||
for (int j=1;j<=m;j++){ | ||
int r=rnd.next(0,c); | ||
if (r==0) cout<<1; | ||
else cout<<0; | ||
} | ||
cout<<'\n'; | ||
} | ||
return 0; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
1 1 | ||
0 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
5 5 | ||
00010 | ||
00000 | ||
00111 | ||
10000 | ||
01010 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
3 4 | ||
1000 | ||
0001 | ||
1000 |
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
//#pragma GCC optimize("Ofast,unroll-loops,O3") | ||
//#pragma GCC target("avx,avx2,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,fma,tune=native") | ||
#include<bits/stdc++.h> | ||
//#include<bits/extc++.h> | ||
//#pragma pack(1) | ||
#define int long long | ||
#define pii pair<int,int> | ||
#define x first | ||
#define y second | ||
#define N 3015 | ||
using namespace std; | ||
//using namespace __gnu_pbds; | ||
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); | ||
//typedef tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update> order_multiset; | ||
//typedef tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> order_set; | ||
int n,m,arr[N][N],s[N][N]; | ||
int count(int x1,int y1,int x2,int y2){ | ||
return s[x2][y2]+s[x1-1][y1-1]-s[x1-1][y2]-s[x2][y1-1]; | ||
} | ||
signed main(){ | ||
ios::sync_with_stdio(0); | ||
cin.tie(0); | ||
cin>>n>>m; | ||
for (int i=1;i<=n;i++){ | ||
for (int j=1;j<=m;j++){ | ||
char c; cin>>c; | ||
arr[i][j]=c-'0'; | ||
s[i][j]=s[i][j-1]+arr[i][j]; | ||
} | ||
} | ||
for (int i=1;i<=n;i++){ | ||
for (int j=1;j<=m;j++) | ||
s[i][j]+=s[i-1][j]; | ||
} | ||
int ans=0; | ||
for (int i=1;i<=n;i++){ | ||
for (int j=1;j<=m;j++){ | ||
for (int ii=i;ii<=n;ii++){ | ||
for (int jj=j;jj<=m;jj++){ | ||
if (count(i,j,ii,jj)<=1) | ||
ans=max(ans,(ii-i+1)*(jj-j+1)); | ||
} | ||
} | ||
} | ||
} | ||
cout<<ans<<'\n'; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
//#pragma GCC optimize("Ofast,unroll-loops,O3") | ||
//#pragma GCC target("avx,avx2,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,fma,tune=native") | ||
#include<bits/stdc++.h> | ||
//#include<bits/extc++.h> | ||
//#pragma pack(1) | ||
#define pii pair<int,int> | ||
#define x first | ||
#define y second | ||
#define N 3015 | ||
using namespace std; | ||
//using namespace __gnu_pbds; | ||
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); | ||
//typedef tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update> order_multiset; | ||
//typedef tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> order_set; | ||
int arr[N][N],n,m,ans; | ||
int s[N][N],nxt0[N][N],nxt1[N][N]; | ||
void solve(int l,int r){ | ||
int mid=(l+r)>>1,tans=0; | ||
for (int i=1;i<=n;i++){ | ||
for (int j=mid;j>=l;j--){ | ||
if (j==mid) s[i][j]=arr[i][j]; | ||
else s[i][j]=s[i][j+1]+arr[i][j]; | ||
} | ||
for (int j=mid+1;j<=r;j++){ | ||
if (j==mid+1) s[i][j]=arr[i][j]; | ||
else s[i][j]=s[i][j-1]+arr[i][j]; | ||
} | ||
} | ||
for (int i=1;i<=n;i++){ | ||
for (int j=l;j<=r;j++){ | ||
s[i][j]+=s[i-1][j]; | ||
} | ||
} | ||
for (int j=l;j<=r;j++){ | ||
int p0=1,p1=1; | ||
for (int i=1;i<=n;i++){ | ||
while (p0<=n&&s[i-1][j]==s[p0][j]) | ||
p0++; | ||
while (p1<=n&&s[i-1][j]+1>=s[p1][j]) | ||
p1++; | ||
nxt0[i][j]=p0-1; | ||
nxt1[i][j]=p1-1; | ||
} | ||
} | ||
for (int i=1;i<=n;i++){ | ||
int p0=mid+1,p1=mid+1; | ||
for (int j=mid;j>=l;j--){ | ||
int now=0; | ||
while (p0<=r&&nxt1[i][p0]>=nxt0[i][j]) | ||
p0++; | ||
now=max(now,(p0-j)*(nxt0[i][j]-i+1)); | ||
while (p1<=r&&nxt0[i][p1]>=nxt1[i][j]) | ||
p1++; | ||
now=max(now,(p1-j)*(nxt1[i][j]-i+1)); | ||
tans=max(tans,now); | ||
} | ||
p0=mid; p1=mid; | ||
for (int j=mid+1;j<=r;j++){ | ||
int now=0; | ||
while (p0>=l&&nxt1[i][p0]>=nxt0[i][j]) | ||
p0--; | ||
now=max(now,(j-p0)*(nxt0[i][j]-i+1)); | ||
while (p1>=l&&nxt0[i][p1]>=nxt1[i][j]) | ||
p1--; | ||
now=max(now,(j-p1)*(nxt1[i][j]-i+1)); | ||
tans=max(tans,now); | ||
} | ||
} | ||
ans=max({ans,tans}); | ||
} | ||
void Merge(int l,int r){ | ||
if (l==r){ | ||
solve(l,l); | ||
return; | ||
} | ||
int mid=(l+r)>>1; | ||
Merge(l,mid); Merge(mid+1,r); | ||
solve(l,r); | ||
} | ||
signed main(){ | ||
ios::sync_with_stdio(0); | ||
cin.tie(0); | ||
cin>>n>>m; | ||
for (int i=1;i<=n;i++){ | ||
for (int j=1;j<=m;j++){ | ||
char c; cin>>c; | ||
arr[i][j]=c-'0'; | ||
} | ||
} | ||
Merge(1,m); | ||
cout<<ans<<'\n'; | ||
} |
Oops, something went wrong.