CARVIEW |
Select Language
HTTP/2 200
date: Sat, 11 Oct 2025 21:16:04 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=ef6fef8bfb66a93c345bdfc83546bba821b4b0e14c1013368228b9cf339544c4a%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22VRtazeQr0WlMS9TpkPU4VkLxu0Y5_wjI%22%3B%7D; HttpOnly; Path=/
cf-ray: 98d1605cdab375e9-BLR
Sequencia A - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Paulo Miranda
- */
- #include <iostream>
- #include <algorithm>
- #include <string.h>
- using namespace std;
- int vetor[40];
- int memo[40][40][1010];
- int existe(int i, int f, int valor){
- if(valor < 0)
- return 0;
- if(valor == 0)
- return 1;
- if(i == f)
- return 0;
- if(memo[i][f][valor] != -1)
- return memo[i][f][valor];
- int sem = existe(i+1, f, valor);
- int com = existe(i+1, f, valor - vetor[i]);
- if(sem == 1 || com == 1)
- return memo[i][f][valor] = 1;
- return memo[i][f][valor] = 0;
- }
- int main(){
- int n, caso = 1;
- while(cin >> n){
- bool result = true;
- memset(memo, -1, sizeof(memo));
- for(int i=0; i<n; i++){
- cin >> vetor[i];
- }
- if(vetor[0] < 1)
- result = false;
- for(int i=1; result && i<n; i++)
- if(vetor[i] - vetor[i-1] <=0 )
- result = false;
- for(int i=1; result && i<n; i++)
- if(existe(0, i, vetor[i]))
- result = false;
- cout << "Case #"<< caso<<":";
- for(int i=0; i < n; i++)
- cout << " " << vetor[i];
- cout << endl;
- if(result)
- cout << "This is an A-sequence." << endl;
- else
- cout << "This is not an A-sequence." << endl;
- caso++;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
-
⭐✅ Swapzone Glitch ✅ Working ⭐⭐ 0
JavaScript | 2 sec ago | 0.25 KB
-
✅⭐ Make huge profits on trading ⭐⭐ 5
JavaScript | 8 sec ago | 0.25 KB
-
⭐⭐⭐Exchange Exploit T I⭐⭐
Java | 8 sec ago | 0.10 KB
-
✅ Make $2500 in 20 minutes⭐⭐⭐ 4
JavaScript | 12 sec ago | 0.25 KB
-
📌 Instant BTC Profit Method ✅ Working
JavaScript | 15 sec ago | 0.24 KB
-
⭐✅ Marketplace Glitch ✅ Working ✅ NEVER SEEN...
JavaScript | 17 sec ago | 0.25 KB
-
⭐⭐⭐ChangeNOW Exploit⭐⭐
Java | 21 sec ago | 0.10 KB
-
📌 Swapzone +37% glitch ⭐ V
JavaScript | 21 sec ago | 0.25 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand