This file contains hidden or 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 <bits/stdc++.h> | |
| using namespace std; | |
| const int N = 1010; | |
| char tab[2][N]; | |
| int prev[2][N], dp[N][N][2][2]; | |
| int main(){ | |
| #ifndef ONLINE_JUDGE |
This file contains hidden or 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 <bits/stdc++.h> | |
| using namespace std; | |
| const int NM = 1e3 + 10; | |
| char s[2][NM]; | |
| int dp[NM][NM]; | |
| int main(){ | |
| int n, m; |
This file contains hidden or 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 <bits/stdc++.h> | |
| using namespace std; | |
| const int N = 1e3 + 10; | |
| int a[N], dp[N]; | |
| int main(){ | |
| int n; | |
| scanf("%d", &n); |
This file contains hidden or 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 <bits/stdc++.h> | |
| using namespace std; | |
| const int N = 1e4 + 10, L = 110; | |
| int v[N], p[N], dp[N][L]; | |
| int main(){ | |
| int n, l; | |
| scanf("%d %d", &n, &l); |
This file contains hidden or 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 <bits/stdc++.h> | |
| using namespace std; | |
| int main(){ | |
| int n; | |
| scanf("%d", &n); | |
| int best = INT_MIN, ans = INT_MIN; | |
| for(int i = 1, v; i <= n; i++){ | |
| scanf("%d", &v); | |
| best = max(best + v, v); |
This file contains hidden or 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 <bits/stdc++.h> | |
| using namespace std; | |
| const int N = 1e5 + 10; | |
| int bit[N]; | |
| void add(int pos, int val){ | |
| for(int i = pos; i < N; i += (i & -i)){ | |
| bit[i] += val; |
This file contains hidden or 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 <bits/stdc++.h> | |
| using namespace std; | |
| const int N = 1e5 + 10; | |
| int node[4*N], lazy[4*N]; | |
| void upd(int seg, int l, int r){ | |
| node[seg] += (r - l + 1)*lazy[seg]; | |
| if(l != r){ |
This file contains hidden or 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 <bits/stdc++.h> | |
| using namespace std; | |
| const int N = 1e5 + 10; | |
| int node[4*N]; | |
| void modify(int seg, int l, int r, int p, int val){ | |
| if(l == r){ | |
| node[seg] += val; |
This file contains hidden or 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 <bits/stdc++.h> | |
| using namespace std; | |
| int main(){ | |
| int n; | |
| scanf("%d", &n); | |
| int sqn = sqrt(n); | |
| printf("fatores(%d) =", n); | |
| for(int i = 2; i <= sqn && n > 1; i++){ | |
| while(n%i == 0){ |
This file contains hidden or 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 <bits/stdc++.h> | |
| using namespace std; | |
| const int N = 1e5 + 10; | |
| bool notprime[N]; | |
| void crivo(int n){ | |
| int sqn = sqrt(n); | |
| notprime[1] = true; |
NewerOlder