Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a4f3315

Browse files
committedMar 4, 2021
Add workflow test
1 parent 32ddcce commit a4f3315

File tree

5 files changed

+28
-22
lines changed

5 files changed

+28
-22
lines changed
 

‎.github/workflows/icpc-reference-tester.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,16 @@ on: [pull_request]
33
jobs:
44
check-tests:
55
runs-on: ubuntu-latest
6-
defaults:
7-
run:
8-
shell: bash
9-
working-directory: icpc-reference-tester
106
steps:
117
- uses: actions/checkout@v2
8+
- run: git clone https://github.com/samuraiexx/icpc-reference-tester
129
- uses: nanasess/setup-chromedriver@master
1310
- uses: actions-rs/toolchain@v1
1411
with:
1512
toolchain: stable
16-
- uses: actions-rs/cargo@v1
17-
with:
18-
command: build
19-
args: --release
20-
- uses: actions-rs/cargo@v1
21-
with:
22-
command: run
23-
args: --release test/test_folder
13+
- run: cargo build --release
14+
working-directory: icpc-reference-tester
15+
- run: icpc-reference-tester/target/release/icpc-reference-tester tests
16+
env:
17+
CF_USER: ${{ secrets.CF_USER }}
18+
CF_PASSWORD: ${{ secrets.CF_PASSWORD }}

‎dynamic-programming/lis.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
// dp(i) = max j<i { dp(j) | a[j] < a[i] } + 1
44
//
55

6-
int dp[N], v[N], n, lis;
6+
// int dp[N], v[N], n, lis;
77

88
memset(dp, 63, sizeof dp);
9-
for (int i=0; i<n; ++i) {
9+
for (int i = 0; i < n; ++i) {
1010
// increasing: lower_bound
1111
// non-decreasing: upper_bound
12-
int j = lower_bound(dp, dp+lis, v[i]) - dp;
12+
int j = lower_bound(dp, dp + lis, v[i]) - dp;
1313
dp[j] = min(dp[j], v[i]);
14-
lis = max(lis, j+1);
14+
lis = max(lis, j + 1);
1515
}

‎icpc-reference-tester

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎test/src/main.rs

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// @problem_url: https://codeforces.com/problemset/problem/340/D
2+
#include<bits/stdc++.h>
3+
using namespace std;
4+
5+
const int N = 2e5;
6+
7+
int main() {
8+
int dp[N], v[N], n, lis;
9+
10+
cin >> n;
11+
for (int i = 0; i < n; i++)
12+
cin >> v[i];
13+
14+
// @include: dynamic-programming/lis.cpp
15+
16+
cout << lis << endl;
17+
}

0 commit comments

Comments
 (0)
Please sign in to comment.