Comments (1)
It cannot solve complex problems of Algo and Graphs.
Example. Input : Implementing the Knapsack algorithm to solve the 0/1 Knapsack problem: Description: Write a program to implement the Knapsack algorithm to solve the 0/1 Knapsack problem. Input: int values[] = {60, 100, 120}; int weights[] = {10, 20, 30}; int W = 50; Write program in C++ 17 and without explanations.
Output :
int main() { int values[] = {60, 100, 120}; int weights[] = {10, 20, 30}; int W = 50; int n = sizeof(values) / sizeof(values[0]); int m = sizeof(weights) / sizeof(weights[0]); int max_value = values[0]; int max_weight = weights[0]; int max_weight_value = 0; int max_value_weight = 0; int sum = 0; int result = 0; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { sum = sum + values[i] * weights[j]; if (sum > max_value) { max_value = values[i]; } if (sum > max_weight) { max_weight = weights[j]; } if (sum > max_weight_value) { max_weight_value = sum; } if (sum > max_value_weight) { max_value_weight = sum; } } } if (max_value_weight > W) { result = max_value_weight; } else { result = max_value; } cout << result << endl; return 0; }Output : 16800 Expected Output : 220
how about using Python instead of C++?
from codealpaca.
Related Issues (19)
- Please publish weights? HOT 1
- Instructions for training 13b model
- How can i run this model locally using cpu on Windows 11?
- Open LLaMA project
- AssertionError: Check batch related parameters. train_batch_size is not equal to micro_batch_per_gpu * gradient_acc_step * world_size 256 != 8 * 1 * 8 HOT 1
- Just want to say thank you.
- Difference between new_codealpaca.json, rosetta_alpaca.json and codealpaca-20k.json?
- Llama2 model with code instruction-tuning on a single RTX 3090 is available now
- Please elaborate the process of coding data generation.
- A new code editing dataset
- More training data HOT 2
- Is it commercially usable? HOT 1
- How long did it take? HOT 7
- Hosting your dataset on the Hugging Face Hub HOT 2
- Private data HOT 1
- 65b model possible? HOT 1
- bug: get empty state dict HOT 1
- How big is the finished model?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from codealpaca.