uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
6ffa264d-3201-41b3-bffb-83f940ce2db0 | Haribala-09/hyprdots | User/History/-896f157/C82R.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
using int2=pair<int,int>;
using int3=array<int,3>;
using int4=array<int,4>;
int m,n,k;
int minoperation(vector<vector<int>>& mat)
{
vector<int2> moves={{1,0},{0,1},{-1,0},{0,-1}};
queue<int4> q;
q.emplace({0,0,k})
}
int main()
{
int t... | ALGO | 0.999961 | 4.805338 |
d3994bd2-28be-4663-aa9a-400318b6c027 | chjs/mmio-tracer | source/tools/ToolUnitTests/ea_verifier_addr16.cpp | /*
* This file contains a tool for testing 16bit addressing including
IARG_MEMORY(READ/WRITE)_EA of those addresses on PIN Windows
*/
#include <stdio.h>
#include <iostream>
#include "pin.H"
#include <map>
#ifdef TARGET_WINDOWS
namespace WIND
{
#include <windows.h>
}
inline ADDRINT InitializeThreadData()
{
... | TEST | 0.9608 | 4.547606 |
e87f2fbb-17c2-4544-90b0-03127d42f583 | geemcoin/geem | tests/Difficulty/Difficulty.cpp | #include <cstddef>
#include <cstdint>
#include <fstream>
#include <iostream>
#include <vector>
#include <algorithm>
#include "CryptoNoteConfig.h"
#include "CryptoNoteCore/Difficulty.h"
#include "CryptoNoteCore/Currency.h"
#include "Logging/ConsoleLogger.h"
using namespace std;
int main(int argc, char *argv[]) {
... | TOOL | 0.882499 | 5.204565 |
fec3c38d-0fd8-403c-8390-f27cac18bb5e | ZcRaaTch/Leetcode-solutions | 1518-water-bottles/1518-water-bottles.cpp | class Solution {
public:
int numWaterBottles(int numBottles, int numExchange) {
int ans=numBottles;
while(numBottles>=numExchange){
int temp=numBottles/numExchange;
ans+=temp;
numBottles=temp+(numBottles%numExchange);
}
return ans;
}
}; | ALGO | 0.999861 | 5.375971 |
ead82aab-a9ee-4230-a2ac-a4559943c70e | philmantatsky/half-gammon-undone | halfGammonBoard.cpp | #include "HalfGammonBoard.h"
#include <iostream>
#include <iomanip>
using namespace std;
// Constructor: sets xTurn to true, and then initializes the x and o boards
HalfGammonBoard::HalfGammonBoard() {
xTurn = true;
for (int i = 0; i < ARRAY_SIZE; i++) {
xBoard[i] = 0;
oBoard[i] = 0;
}
int spacingOfSecondCh... | ALGO | 0.973598 | 6.403029 |
22e34785-9561-4fbb-b32a-cf4ef1a953c5 | khatrijiraj/Leetcode-DSA-CPP | 226-invert-binary-tree/invert-binary-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999975 | 5.96688 |
8cf78098-8c74-45aa-a495-b12efb81b8ee | rkorsakov/23202-Korsakov-OOP-CPP | task-1/BitArray.cpp | #include "BitArray.h"
#include <cstring>
#include <stdexcept>
#include <string>
/***************************************************************************
* Method : BitArray (default constructor)
* Description: Default constructor. Initializes an empty BitArray with 0 bits.
* Parameters : None
* Returne... | TOOL | 0.925953 | 6.642959 |
ace6c180-6a90-4a44-8b6d-817fce7c251f | alexandraback/datacollection | solutions_2751486_1/C++/liymouse/A.cpp | #include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <numeric>
#include <cstring>
typedef long long i64d;
using namespace std;
int isV(char x)
{
... | ALGO | 0.999857 | 4.276902 |
03f26573-1620-4e38-9cdf-57b254d1e1e0 | alexandraback/datacollection | solutions_5644738749267968_0/C++/SuprDewd/d_2.cpp | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <strin... | ALGO | 0.999856 | 4.162973 |
d5cfabc6-183b-4e5a-b79a-e035e3026f48 | mason20240920/BatmanInfer | source/layer/detail/concat.cpp | //
// Created by Mason on 2024/11/21.
//
#include <layer/detail/concat.hpp>
#include <layer/abstract/layer_factory.hpp>
#include <data/tensor_util.hpp>
namespace BatmanInfer {
ConcatLayer::ConcatLayer(int axis) : NonParamLayer("Concat"), axis_(axis) {
}
InferStatus ConcatLayer::Forward(const std::vector<... | ALGO | 0.858698 | 6.004797 |
91cbeded-8cd3-4b2a-bf76-2bdd12115e46 | mohitdtumce/Competitive-Coding | DataStructure&Algorithm/interview/codingNinja/Practice/Binary Tree/NK 22. Sum of all elements in Binary Tree.cpp | #include<iostream>
#include<stack>
#include<queue>
using namespace std;
template <typename T>
class BTNode{
public:
T data;
BTNode* left;
BTNode* right;
};
BTNode<int>* CreateTree(){
int data;
cout<<"Enter root data\n";
cin>>data;
if(data==-1){
return NULL;
}else{
BTNode<int>* newnode=new BTNode<int>... | ALGO | 0.999917 | 4.253085 |
b3481b63-e79f-4268-8381-68136475b87e | robustrobotics/gtsam_condemned | gtsam/nonlinear/NonlinearOptimizer.cpp | /**
* @file NonlinearOptimizer.cpp
* @brief Convergence functions not dependent on graph types
* @author Frank Dellaert
* @date Jul 17, 2010
*/
#include <gtsam/nonlinear/NonlinearOptimizer.h>
#include <gtsam/linear/GaussianEliminationTree.h>
#include <gtsam/linear/VectorValues.h>
#include <gtsam/linear/SubgraphS... | ALGO | 0.999468 | 7.503521 |
8dcf04cd-7edc-47aa-9dbd-c68bc52f5d98 | SMHMS-01/VsCode | CPP_STORAGE/cppPrimer/Container.cpp/CustomOperation.cpp | #include <iostream>
#include <windows.h>
#include <algorithm>
#include <vector>
#include <deque>
#include <array>
#include <numeric>
#include <iterator>
#include <functional>
using namespace std;
bool sizeStandrad(const string &str)
{
return str.size() < 6;
}
void test()
{
vector<string> v{"Abandon", "breach",... | TOOL | 0.941836 | 4.446017 |
64c1a440-2f3e-4315-a3e4-d67b070c4400 | Chan531/BaekJoon_Online_Judge | 래환이의여자친구사귀기대작전.cpp | #include <iostream>
using namespace std;
int n, m, ans = -1, arr[101010];
void input()
{
cin >> n >> m;
for (int i = 1; i <= n; i++) cin >> arr[i];
}
void solution()
{
for (int i = n; i; i--)
{
m -= arr[i];
if (m <= 0)
{
ans = i;
break;
}
}
cout << ans;
}
void solve()
{
input();
solution(... | ALGO | 0.999973 | 4.349286 |
c51b6e4f-dcea-4898-bca7-2e45f0f1d117 | MahmoudHamdy00/competitiveProgramming | Newcomers/Material (tips & tricks)/3-Arrays/#10.cpp | /*
* ICPC Assuit Community - Newcomers (Array)
* Source: https://cutt.ly/tff3SCd
* Problem Statement :You have an array and your task is to calculate the summation of the maximum value in each prefix of the array and the summation of the minimum value in each prefix of the array.
*/
#include<iostream>
using namespa... | ALGO | 0.99849 | 4.017837 |
1df0b291-7d10-485e-b3f3-2d11493f96d5 | chelik010/algoritm-5130203-40001 | 16.09_3.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int main()
{
int randomNumb = rand() % 200 + 1;
int num_user;
char play;
do
{
cout << "Введите предполагаемое число: "<< endl;
cin >> num_user;
while(randomNumb != num_user)
{
i... | ALGO | 0.964658 | 3.008682 |
24aeee60-af48-4e9d-be46-dad2fbd31bcc | xdtianyu/android-4.3 | frameworks/av/media/libstagefright/codecs/amrnb/enc/src/l_negate.cpp | /*
------------------------------------------------------------------------------
INPUT AND OUTPUT DEFINITIONS
Inputs:
L_var1 = 32 bit long signed integer (Word32) whose value falls
in the range : 0x8000 0000 <= L_var1 <= 0x7fff ffff.
Local Stores/Buffers/Pointers Needed:
None
Global Stores/... | TOOL | 0.992698 | 5.632393 |
eaf2b03a-9fb2-4874-b736-e8ba82a9fea0 | abrhamkg/point2mesh | Manifold/Manifold/3rd/igl/copyleft/marching_cubes.cpp | #include "marching_cubes.h"
#include "marching_cubes_tables.h"
#include <unordered_map>
extern const int edgeTable[256];
extern const int triTable[256][2][17];
extern const int polyTable[8][16];
struct EdgeKey
{
EdgeKey(unsigned i0, unsigned i1) : i0_(i0), i1_(i1) {}
bool operator==(const EdgeKey& _rhs) const
... | ALGO | 0.998388 | 6.888132 |
7cbcd558-33e7-466e-ac76-bcdc090d3241 | wanimaru47/AOJ | volume12/aoj1280.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef vector<int> vec;
typedef vector<vec> mat;
const int INF = 1 << 28;
int N, M;
void solve() {
vector<vector<P> > v(N);
for (int i = 0; i < M; i++) {
int x, y, z;
cin >> x >> y >> z;
x--;
y--;
... | ALGO | 0.99985 | 4.266708 |
44f28294-fe29-4294-a10a-01eb018d375a | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_10691_4.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
int n, f[maxn];
double A, B, x[maxn], y[maxn];
double calc(double x, double y) { return x * x + y * y; }
int main() {
scanf("%d", &n);
for (int i = 1; i <= n; i++) {
scanf("%lf %lf", &x[i], &y[i]);
}
for (int i = n; i >= 1; i--) {
if... | ALGO | 0.999979 | 3.591535 |
a6aa1603-6756-41d3-9b95-110684eb5379 | kaloi-noggins/competicao_programativa | uri/cpp/1060.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int count = 0;
for (size_t i = 0; i < 6; i++)
{
double tmp;
cin >> tmp;
if (tmp > 0)
count++;
}
cout << count << " valores positivos"<< endl;
return 0;
} | ALGO | 0.998251 | 3.5657 |
ab05a810-5c23-40a3-b4fd-fb4aafca77ae | rafaelcalcada/tmap | src/main.cpp | #include <iostream>
#include "../include/AndInverterGraph.h"
#include "../include/CutEngine.h"
#include "../include/TechMapper.h"
int
main (int argc, char *argv[])
try
{
// Basic parameter processing
int k = 6;
int c = 0;
std::string inputFile = "";
MappingGoal mg = MappingGoal::MinimizeArea;
... | ALGO | 0.941623 | 5.389238 |
0f09eb4a-4c95-445b-9c71-d8fb0a0b8d0b | svn2github/AngelscriptMirror | tags/2.21.2/sdk/tests/test_feature/source/scriptstring_utils.cpp | #include <assert.h>
#include "scriptstring.h"
#include "../../../add_on/scriptarray/scriptarray.h"
#include <string.h> // strstr
BEGIN_AS_NAMESPACE
// This function returns a string containing the substring of the input string
// determined by the starting index and count of characters.
//
// AngelScript signature:
/... | TOOL | 0.901893 | 5.538452 |
38c1b8bc-26b7-4481-bdcd-022761b51f2b | iwakiriK/AOJ | ALDS1/1_B.cpp | #include <bits/stdc++.h>
using namespace std;
int x, y;
int gcd(int x, int y) {
if (x < y) swap(x, y);
while (y > 0) {
int r = x % y;
x = y;
y = r;
}
return x;
}
int main() {
cin >> x >> y;
cout << gcd(x, y) << endl;
return 0;
}
| ALGO | 0.999937 | 5.263451 |
b654378c-568c-45b0-8901-922104b807ad | krzysiekbienias/clicker-plus-plus | src/strings/is_permutation.cpp | #include <string>
#include <algorithm>
#include <unordered_map>
#include<iostream>
// Implement your is_permutation logic here.
bool isPermutation(std::string& s1, std::string& s2){
if (s1.length()!=s2.length()) return false;
std::sort(s1.begin(),s1.end());
std::sort(s2.begin(),s2.end());
return s... | ALGO | 0.99982 | 6.00413 |
55ad5f60-bcc5-4970-bb9c-262e539501db | tomgarcia/micromouse2016 | libs/Solver.cpp | #include "Solver.h"
#include <cmath>
#include <stack>
#include <iostream>
Solver::Solver (uint8_t max_X, uint8_t max_Y) : size_X(max_X), size_Y(max_Y)
{
// Allocate memory for grid.
numCells = max_X*max_Y;
cells = new Cell[numCells];
size_X = max_X;
size_Y = max_Y;
lowerLeft.x = upperRight.x = max_X/2;
lower... | ALGO | 0.999461 | 5.087506 |
adb55055-267b-4d3f-bd23-901360d3e260 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_3929_10.cpp | #include <bits/stdc++.h>
using namespace std;
int max(int a, int b) { return a > b ? a : b; }
int min(int a, int b) { return a > b ? b : a; }
long int max(long int a, long int b) { return a > b ? a : b; }
long int min(long int a, long int b) { return a > b ? b : a; }
bool ckmax(int &a, int b) {
int c = a;
a = max(a... | ALGO | 0.999904 | 4.153298 |
ca60cc79-87fa-4884-890f-66519667a0eb | Kailash0529/DSA-Practice | main/LL/sort_zeros_ones_twos.cpp | #include<iostream>
using namespace std;
class node{
public:
int data;
node* next;
node()
{
this->data=0;
this->next=NULL;
}
node(int data)
{
this->data=data;
this->next=NULL;
}
};
void sortthelist(node* &head)
{
if(head==NULL)
{
return;... | ALGO | 0.999984 | 4.178343 |
d1a10f6d-e60d-41dd-bfc1-73529bdf0b51 | MrFrenik/gs_core | third_party/include/recast/RecastDemo/Source/Sample.cpp | #define _USE_MATH_DEFINES
#include <math.h>
#include <stdio.h>
#include "Sample.h"
#include "InputGeom.h"
#include "Recast.h"
#include "RecastDebugDraw.h"
#include "DetourDebugDraw.h"
#include "DetourNavMesh.h"
#include "DetourNavMeshQuery.h"
#include "DetourCrowd.h"
#include "imgui.h"
#include "SDL.h"
#include "SDL_op... | TOOL | 0.866123 | 4.11315 |
40f39f78-21b5-4a7c-98b3-aa2e088d6a63 | k9h7u8/DSA | Pattern/1-22-333-4444.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
for (int i = 1; i <= n; i++)
{
int space = n - i;
while (space)
{
cout << " "
<< " ";
space--;
}
for (int j = 1; j <= i; j++)
{
co... | ALGO | 0.999925 | 4.059003 |
503d3e72-5f69-4abc-ace4-e66138f75712 | vivek1833/Notes-DSA | DSA/7. Dynamic Programming/q_KOrdered_LCS.cpp | #include <bits/stdc++.h>
using namespace std;
#define MAX 10
// TC -> O(N*M*K)
int lcs(int dp[MAX][MAX][MAX], int arr1[], int n, int arr2[], int m, int k)
{
if (k < 0)
return -1e7;
if (n < 0 || m < 0)
return 0;
int &ans = dp[n][m][k];
if (ans != -1)
return ans;
ans = ma... | ALGO | 0.99999 | 4.831822 |
4d0a5a3a-c984-4ba9-8950-394852d5c70c | Alash-electronics/AlashKeypadMatrix | AlashKeypadMatrix.cpp | // Написан для Alash Education
#include <AlashKeypadMatrix.h>
// <<constructor>> Позволяет использовать пользовательскую карту клавиш, конфурацию пинов и размеры клавиатуры.
AlashKeypadMatrix::AlashKeypadMatrix(char *userKeymap, byte *row, byte *col, byte numRows, byte numCols) {
// Инициализация переменных класс... | TOOL | 0.853581 | 4.401501 |
5abeb342-5461-43a8-a08d-60f0173dcc37 | JosephNalkara/data-structure | practice/Lab Cycle:2/LabCycle2-9.cpp | #include "LabCycle2-9.h"
#include <stack>
#include <cctype>
bool isOperator(char c) {
return c == '+' || c == '-' || c == '*' || c == '/';
}
int performOperation(char op, int operand1, int operand2) {
switch (op) {
case '+':
return operand1 + operand2;
case '-':
return ... | ALGO | 0.999453 | 4.929932 |
5faf449e-01a2-41fa-917f-652ad6f561e9 | vishal2005025/cp | B_Blank_Space.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
signed main()
{
int t;
cin>>t;
while(t--){
int n,sum=0,flag=0;
cin>>n;
int a[n];
for(int i=0;i<n;i++){
cin>>a[i];
if(a[i]==0){
flag+=1;
}
else {
sum=max(su... | ALGO | 0.999519 | 4.515355 |
01711c89-13a9-4a7c-a868-b57f46cb7765 | vlad09032/itog7 | itog7/Source.cpp | // array - , .
// target - .
// min - , .
// max - , .
// binarySearch() , . , -1
#include<iostream>
int binarySearch(int* array, int target, int min, int max)
{
while (min <= max)
{
int sr = min + ((max - min) / 2);
if (array[sr] == target)
return sr;
if (array[sr] > target)... | ALGO | 0.999814 | 5.785228 |
db657baf-30d9-4bda-9179-28f8d3f7a0f9 | Shuv25/DSA | 1Bit Manupulation/tempCodeRunnerFile.cpp |
int res = 0;
for (int i = 0; i < n; i++)
{
res ^= arr[i];
}
int rmsb = res & (-res);
cout << rmsb << endl;
int x = 0;
int y = 0;
for (int i = 0; i < n; i++)
{ | ALGO | 0.99992 | 3.918698 |
7af4afeb-358f-4fba-9773-5b2f7c328cda | ZwFink/hpacml | lldb/source/Host/common/HostInfoBase.cpp | #include "lldb/Host/Config.h"
#include "lldb/Host/FileSystem.h"
#include "lldb/Host/Host.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Host/HostInfoBase.h"
#include "lldb/Utility/ArchSpec.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/StreamString.h"
#include "llvm/ADT/S... | TOOL | 0.920013 | 7.137581 |
beb7013a-f385-4fa0-8b48-81c464db7cab | francois141/nori-ray-tracer | ext/nanogui/ext/eigen/doc/examples/Tutorial_ArrayClass_cwise_other.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
ArrayXf a = ArrayXf::Random(5);
a *= 2;
cout << "a =" << endl
<< a << endl;
cout << "a.abs() =" << endl
<< a.abs() << endl;
cout << "a.abs().sqrt() =" << endl
<< a.abs().sqrt() << endl... | ALGO | 0.965292 | 3.130341 |
c059cc8f-c353-4bab-986b-0ca0113cb2bc | wysoviet/acmprogram | hust/2011校赛/d.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cst... | ALGO | 0.999752 | 3.885615 |
c257f062-44c5-4702-bd94-dd028818201c | EmiliaFili/inery-node | inery/src/boost_1_71_0/libs/graph/example/incremental-components-eg.cpp | #include <iostream>
#include <vector>
#include <boost/foreach.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/incremental_components.hpp>
#include <boost/pending/disjoint_sets.hpp>
using namespace boost;
int main(int argc, char* argv[])
{
typedef adjacency_list <vecS, vecS, undirectedS> Graph... | ALGO | 0.997295 | 6.196046 |
04e794b6-9db9-45df-8cc4-bd46da8aebc3 | jmsman3/Doubly-Linked-list-DSA- | week-3 (Doubly Linked List )/Module 12-(Mid_Term_Exam)/Remember_Previous_Queries.cpp | #include <bits/stdc++.h>
using namespace std;
void Print_Normal(list<int> myList)
{
for (int val : myList)
{
cout << val << " ";
}
cout << endl;
}
int main()
{
int Q;
cin >> Q;
list<int> myList;
while (Q--)
{
int x, v;
cin >> x >> v;
if (x == 0)
... | ALGO | 0.999825 | 3.875983 |
6369e631-30c8-4ac2-8ee9-34ac3d05a516 | wisniewskij/CP-Solutions | CSES.FI/Graph Algorithms/1666 - Building Roads.cpp | // github.com/wisniewskij/Code
// cses.fi/problemset/task/1666
// Building Roads
#include <bits/stdc++.h>
#define ndl '\n'
#define ll long long
#define INF 1000000007
#define st first
#define nd second
#define debug(x) cout << #x << ": " << x << ndl
#define all(x) (x).begin(), (x).end()
using namespace std;
vector<v... | ALGO | 0.999933 | 4.141767 |
fd5688fa-8643-4ccf-9bea-5d1fd3404869 | chessbot108/tc_edi | cookedfish/easy/junk/gen.cpp | //gyrating cat enthusiast
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <string>
#include <utility>
#include <cassert>
#include <algorithm>
#include <vector>
#include <random>
#include <chrono>
#include <queue>
#include <set>
#define ll long long
#define lb long double
#define pi... | ALGO | 0.99383 | 3.362942 |
666b002e-eae2-403b-b41c-ab3807e1745c | VishardMehta/DAA | DAA code/kahntopo.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
void kahn_topo(int V, vector<vector<int>>& adj) {
vector<int> indeg(V, 0);
for (int u = 0; u < V; u++) {
for (int v : adj[u]) {
indeg[v]++;
}
}
queue<int> q;
for (int i = 0; i < V; i++)
... | ALGO | 0.999992 | 6.268882 |
22202b44-8166-4090-a4c9-1f2687b23c3a | Kashish2130/Learning_DSA | 3_Array Problems/Easy/13_14_Longest_subArray_sumK.cpp | // brute force
// tc : o(n^2)
// sc : o(1)
int lenOfLongestSubarr(vector<int> &arr, int k)
{
int len = 0;
int n = arr.size();
for (int i = 0; i < n; i++)
{
int sum = 0;
for (int j = i; j < n; j++)
{
sum += arr[j];
if (sum == k)
{
... | ALGO | 0.999787 | 5.375393 |
0b2fdc04-fa7d-4929-af9e-4bea81c02d14 | tung23102000/contests-CTDLGT | contest 5 CTDL>/Bai26_Xem_Phim.cpp | #include<bits/stdc++.h>
using namespace std;
int t;
long long f[101][25001];
//goi f[i][j] la khoi luong lon nhat khi chon den con bo thu i va khoi luong toi da la j
int main(){
t=1;
while(t--){
int w,n;
cin>>w>>n;
int a[n+5];
for(int i=1;i<=n;i++)
cin>>a[i];
memset(f,0,sizeof(f));
for(int i=1;i<=n;i+... | ALGO | 0.999993 | 3.848353 |
acea8fa0-3855-45f5-9c3a-f61638856a3b | its-edmund/competitive-programming | codeforces/gym/utpc_2025_01_29/c_dragon_dance.cpp | #include <bits/stdc++.h>
using namespace std;
#define ar array
#define ll long long
#define ld long double
#define sza(x) ((int)x.size())
#define all(a) (a).begin(), (a).end()
const int MAX_N = 1e5 + 5;
const ll MOD = 1e9 + 7;
const ll INF = 1e9;
const ld EPS = 1e-9;
void solve() {
}
int main() {
ios_base... | ALGO | 0.999975 | 4.603237 |
42c2db21-30c0-49eb-95c4-b2d0ec9e31c6 | nmson2504/Flutter | hive_flutter_2a/windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.997984 | 6.76775 |
c481de37-2f56-433e-9aa7-93289420092b | kaloyankoyuv/codeforces-solutions | problems/Police Recruits/solution.cpp | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int a[n];
for (int i=0; i<n; ++i) {
cin >> a[i];
}
int ans=0;
int r=0;
for (int i=0; i<n; ++i) {
if (a[i] > 0) {
r+=a[i];
} else if (a[i] == -1) {
if (r>=1) {
r--;
} else if (r<=0) {
ans++;
}... | ALGO | 0.999984 | 4.223671 |
bb43721d-b085-48a7-88cd-c464de5515fd | ishandutta2007/codeforces | archuser84/normal/512/C.cpp | ///
/// Hashire sori yo
/// Kaze no you ni
/// Tsukimihara wo
/// PADORU PADORU
///
#include <bits/stdc++.h>
#define Loop(x,l,r) for(ll x = ll(l); x < ll(r); ++x)
#define LoopR(x,l,r) for(ll x = ll(r)-1; x >= ll(l); --x)
#define Kill(x) exit((cout << (x) << '\n', 0))
typedef long long ll;
typedef s... | ALGO | 0.999972 | 3.636931 |
9ce436f2-7a1d-43e5-8e0e-8f158cd7fa3f | kaushikroychowdhury/LeetCode | 30 Days of C++/Day4_Hashing/Subarry_with_XOR.cpp | // Count Subarrays with XOR as K | GFG
/* Brute-force Approach :
1. Find all the Subarray
2. Calculate XOR of all the Subarray :
if XOR is K, then Count += 1
3. Return Count
Time Complexity : O(n^3) -> O(n^2) after Optimization*/
/* Optimal Approach : [Hashing]
Time Complexity : O(n)
Space Complexity : O(n) {H... | ALGO | 0.999983 | 5.999834 |
13b021c4-4dbc-485b-908b-7f4347148c45 | xq114/MajhongBot | utils/runner/runner.cpp | /* From https://github.com/PisonJay/botzone-local-runner/blob/master/runner.cpp
*/
#include <algorithm>
#include <csignal>
#include <cstdio>
#include <cstdlib>
#include <json/json.h>
#include <sstream>
#include <string>
#include <unistd.h>
using namespace std;
#define err_sys(...) fprintf(stderr, __VA_ARGS__), exit(... | TOOL | 0.889616 | 4.360988 |
994f1331-9194-45ba-86fa-4af098e6d915 | Neaj-Morshad-101/CP-Code-Templates-and-Resources | Notes and Resources/HellBent/Zahin Bhai's Library/Extended Euclid.cpp | #include <bits/stdtr1c++.h>
#define clr(ar) memset(ar, 0, sizeof(ar))
#define read() freopen("lol.txt", "r", stdin)
#define dbg(x) cout << #x << " = " << x << endl
#define ran(a, b) ((((rand() << 15) ^ rand()) % ((b) - (a) + 1)) + (a))
using namespace std;
/// Bezout's identity, ax + by = gcd(a,b)
int extended_gcd(... | ALGO | 0.999417 | 3.186075 |
f4ccf604-4982-492f-a9c6-e760492aba8e | Robert-9/JZoffer | Tree/JZ26/JZ26_answer.cpp | #include <iostream>
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
};
class Solution_1 {
/*
用两个递归实现的类
*/
public:
bool HasSubtree(TreeNode* pRoot1, TreeNode* pRoot2) {
// 基础条件检查,空树不是任何树的子结构
if (... | ALGO | 0.999956 | 6.292068 |
3c1f9e72-d0f9-443e-9c60-fdaf0281e66a | BzhangURU/LeetCode-cpp | T466_Count_The_Repetitions.cpp | /*Define S = [s,n] as the string S which consists of n connected strings s. For example, ["abc", 3] ="abcabcabc".
On the other hand, we define that string s1 can be obtained from string s2 if we can remove some characters
from s2 such that it becomes s1. For example, “abc” can be obtained from “abdbec” based on our d... | ALGO | 0.999874 | 5.508842 |
7ee409d1-8b2e-4c55-8ac6-f0a1f7da83de | warycat/uva | 11402/11402tle.cpp | #include <stdio.h>
#include <string.h>
#define check(x) if (x >= size) throw 0
const int fbit = 1048576;
const int size = 2097152;
int a[2097152];
int s[2097152];
int l[2097152];
int r[2097152];
int v[1024000];
char f[60];
int p[60];
int n;
void apply(int x, int f, int count)
{
check(x);
if (f & 1) a[x] = 0, s[x] ... | ALGO | 0.999704 | 3.599385 |
181aa3f5-e34f-49f9-89eb-083babfa4f74 | hari9608/LeetCode | Medium/211. Design Add and Search Words Data Structure.cpp | /*
211. Design Add and Search Words Data Structure
Medium
6.8K
384
company
Google
company
Amazon
company
Apple
Design a data structure that supports adding new words and finding if a string matches any previously added string.
Implement the WordDictionary class:
WordDictionary() Initializes the object.
void ... | ALGO | 0.99946 | 7.388932 |
b5b0eee5-7d0c-432d-a73e-46a8df15c5f3 | LCC-CIT/CS161CPP-CourseMaterials | Examples/MultiplicationTable.cpp | #include <iostream>
#include <iomanip>
using namespace std;
// This is a C++ solution to the problem in slide #29 of
// Lecture Notes: Repetition Program Design (PDF document on moodle)
/*
Requirements for this problem
Assume that youve been asked to write a program that displays
a multiplication chart like the one g... | ALGO | 0.99897 | 4.892295 |
0319c53b-04ed-4b4f-8b32-7c1b49766057 | vidhi2002/Striver-sSheet | 983-minimum-cost-for-tickets/983-minimum-cost-for-tickets.cpp | class Solution {
public:
bool willtravel(int day,vector<int> days)
{
for(int i=0;i<days.size();i++)
{
if(days[i]==day)
return true;
if(days[i]>day)
return false;
}
return false;
}
int find(int day,vector<int>& days,v... | ALGO | 0.999653 | 5.447239 |
c30b6743-9cbe-486d-b9b8-57bb506bcdf6 | corretto/corretto-25 | src/hotspot/os/bsd/os_perf_bsd.cpp | #include "memory/allocation.inline.hpp"
#include "memory/resourceArea.hpp"
#include "runtime/os.hpp"
#include "runtime/os_perf.hpp"
#include "runtime/vm_version.hpp"
#include "utilities/globalDefinitions.hpp"
#ifdef __APPLE__
#import <libproc.h>
#include <sys/time.h>
#include <sys/sysctl.h>
#include <mach/mach... | TOOL | 0.85461 | 6.801853 |
04e708a3-0861-44de-9a28-dc324dc1abd7 | Soumya6Tiwari/LeetCode | 0215-kth-largest-element-in-an-array/0215-kth-largest-element-in-an-array.cpp | class Solution {
public:
int findKthLargest(vector<int>& nums, int k)
{
int i,j,max=0,max1=0;
sort(nums.begin(),nums.end());
reverse(nums.begin(),nums.end());
int len=nums.size();
return nums[k-1];
}
}; | ALGO | 0.99991 | 4.783333 |
956d694b-7796-4598-86a7-08f67fd4b6e5 | imzatt/imzatt.github.io | level1/C++_class/timeconvert.cpp | #include <iostream>
using namespace std;
int main(){
int mySeconds ;
cout << "Enter seconds to calculate: ";
cin >> mySeconds;
int hours = mySeconds/3600;
int seconds = mySeconds%3600;
int minutes = seconds/60;
seconds %= 60;
cout <<mySeconds << " Seconds = " << hours << " Hours : "<<... | ALGO | 0.874976 | 3.483794 |
2a00f0ba-599d-474c-b9f9-29e2effee406 | jldinh/vplants | stat_tool/src/cpp/chain.cpp | #include <iomanip>
#include "tool/rw_tokenizer.h"
#include "tool/rw_cstring.h"
#include "tool/rw_locale.h"
#include "tool/config.h"
#include "stat_tools.h"
#include "markovian.h"
#include "stat_label.h"
using namespace std;
extern int column_width(int nb_value , const double *value , double scale = 1.);
extern void... | TOOL | 0.970217 | 4.934691 |
7747937f-c570-4688-8d5b-c27430df27d3 | MikaelVallenet/R-Type | libs/boost/libs/numeric/ublas/doc/samples/coordinate_matrix.cpp | #include <boost/numeric/ublas/matrix_sparse.hpp>
#include <boost/numeric/ublas/io.hpp>
int main () {
using namespace boost::numeric::ublas;
coordinate_matrix<double> m (3, 3, 3 * 3);
for (unsigned i = 0; i < m.size1 (); ++ i)
for (unsigned j = 0; j < m.size2 (); ++ j)
m (i, j) = 3 * i +... | TOOL | 0.906159 | 3.236453 |
675957fe-6a3b-49da-b0da-ad6318d3777d | Tamiim-Iqbal/Computer-Graphics-and-Multimedia | 26. Triangle Rotation, Animation, Color Chnage/include/glm/glm/test/perf/perf_matrix_div.cpp | #define GLM_FORCE_INLINE
#include <glm/ext/matrix_float4x4.hpp>
#include <glm/ext/matrix_double4x4.hpp>
#include <glm/ext/matrix_transform.hpp>
#include <glm/ext/matrix_relational.hpp>
#include <glm/ext/vector_float4.hpp>
#if GLM_CONFIG_SIMD == GLM_ENABLE
#include <glm/gtc/type_aligned.hpp>
#include <vector>
#include <... | TEST | 0.930541 | 6.64033 |
403e8b59-8d72-4f2c-a505-239a0aa87a33 | ishandutta2007/codeforces | sohsoh/normal/1452/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
#define all(x) (x).begin(),(x).end()
#define X first
#define Y second
#define sep ' '
#define endl ... | ALGO | 0.999971 | 5.226029 |
873c3848-7086-4a50-928f-10332c6ace91 | rlaminseok0824/algorithm-problem | 알고리즘 기초(2)/AlgoSpot.cpp | ////https://www.acmicpc.net/problem/1261
//
//#include<iostream>
//#include<queue>
//#include<utility>
//using namespace std;
//
//#define MAXSIZE 101
//
//int N, M;
//char maze[MAXSIZE][MAXSIZE];
//int visited[MAXSIZE][MAXSIZE];
//int directionRow[4] = { 1,0,-1,0 };
//int directionCol[4] = { 0,1,0,-1 };
//
//
//void b... | ALGO | 0.99996 | 4.835765 |
2806ceac-d405-4c86-b897-7196c17c0bbd | chowon986/Study | 백준 알고리즘/배열 돌리기 3/배열 돌리기 3.cpp | //// 배열 돌리기 3 : https://www.acmicpc.net/problem/16935
// 이전 풀이
//#include <iostream>
//#include <vector>
//using namespace std;
//
//int n, m, r;
//
//void MovePos(vector<vector<int>>& b, string direction)
//{
// vector<vector<int>> newBoard(n);
// for (int i = 0; i < n; i++)
// {
// newBoard[i].resize(m);
// }
//
/... | ALGO | 0.999977 | 4.96049 |
3b9ea580-3da4-4a0f-8d5f-ca8aa982f9f5 | arpande97/CF-CSES-SPOJ-USACO | src/CF/A1458.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, m;
cin >> n >> m;
vector<ll> a(n), b(m);
for (auto &it : a) {
cin >> it;
}
for (auto &it : b) {
cin >> it;
}
ll G = 0;
for (int... | ALGO | 0.999977 | 3.063813 |
7c2dfaa8-65aa-41c6-a02f-6d63d81f5796 | MatteoBartoli03/CPP | esercizi_CPP/Lezione_lettura_scrittura/main.cpp | #include <stdio.h>
#include <assert.h>
int main() {
int N, sum, i;
freopen("input/input1.txt", "r", stdin);
freopen("output/output1.txt", "w", stdout);
assert( 1 == scanf("%d", &N) );
int lista[N];
for( i = 0; i < N; i++) {
assert( 1 == scanf("%d", &lista[i]) );
sum += lista[i];
}
printf("%d", sum);... | ALGO | 0.999061 | 3.082359 |
9b8a1feb-f261-474a-b53d-28abfd8a233e | RashmivernekarN/C-Program2 | SV51.CPP | //* prg to find biggest of 3 nums using functions*/
#include<iostream.h>
#include<conio.h>
int big(int,int,int);
void main()
{
int a,b,c,lar;
clrscr();
cout<<"\n enter any 3 num";
cin>>a>>b>>c;
lar=big(a,b,c);
cout<<"\n biggest of 3 nums="<<lar;
getch();
}
int big(int x,int y,int z)
{
if(x>y)
if(x>z)
return(x);
else
re... | ALGO | 0.999899 | 4.322235 |
399c64a0-fbad-4405-90f2-a38bbe35cb98 | NafisFuad002/Codeforces-Problem-Solutions | Binary Decimal.cpp | #include<bits/stdc++.h>
using namespace std;
#define nl cout<<"\n";
#define pf cout<<
#define sf cin>>
#define ll long long
void fun()
{
string s;
sf s;
int sum=0,temp=0;
for(int i=0; i<s.length(); i++)
{
if(s[i]>'1' && i==0)
{
sum+=s[i]-48;
}
else if(s[... | ALGO | 0.999558 | 3.770465 |
5a342bd3-95e3-46d0-a524-eed97660fa48 | mohamedGamalAbuGalala/Practice | Train/El_Sageer/El_Sageer_Pupil/22 - 24 - [Math]/22 - 23 - [Math] Adhoc Problems/23 - [Math] Adhoc Problems/onTopic/2.UVa [107].cpp | #include <bits/stdc++.h>
using namespace std;
// input handle
#define iln() scanf("\n") //scan new line
#define in(n) scanf("%d",&n) //scan int
#define ins(n) scanf("%s",n) //scan char[]
#define inc(n) scanf("%c ",&n) //scan char
#define inf(n) scanf("%lf",&n) //scan double/float
#define inl(n) scanf("%lld",&n) //scan... | ALGO | 0.99988 | 3.539095 |
fc53d857-2945-42f1-ad51-6391b4adac78 | siddharth12s/LeetCode- | 367-valid-perfect-square/367-valid-perfect-square.cpp | class Solution {
public:
bool isPerfectSquare(int num) {
unsigned long long l =1;
unsigned long long r = num;
while(l<=r){
unsigned long long m = l + (r-l)/2;
if(m*m>num)
r=m-1;
else if(m*m<num)
l=m+1;
... | ALGO | 0.999895 | 5.688262 |
b68e11db-16d4-49bc-938f-2b8dfb029a5e | alexandraback/datacollection | solutions_1483488_1/C++/Spunky/File1.cpp | // ---------------------------------------------------------------------------
#pragma hdrstop
#include <tchar.h>
// ---------------------------------------------------------------------------
#include <iostream>
#include <fstream>
#include <string>
#include <stdlib>
#include <vector>
using namespace std;
#pragma ar... | ALGO | 0.998664 | 4.507235 |
5b4ba5e6-c12a-4048-939d-37d71a94f523 | yunior1250/blockchain_movile | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.9988 | 6.76073 |
83c74514-035d-4731-9620-fb9b0b08e901 | khushisinha20/Data-Structures-and-Algorithms | Queue/design_circular_queue.cpp | //leetcode.com/problems/design-circular-queue/
#include <bits/stdc++.h>
using namespace std;
struct Node {
int val;
Node* next;
Node(int val) {
this -> val = val;
next = NULL;
}
};
class MyCircularQueue {
public:
int capacity = 0;
int size = 0;
Node* head = NULL;
Node*... | ALGO | 0.998484 | 5.82159 |
3f0a5589-17d1-46dd-a02f-2294fecfa322 | AnhDuc-IT/ToanRoiRac2-CodePTIT | TRR1005 - 1.5 Đồ thị.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair <int, int>;
#define MOD 1e9 + 7;
vector <int> ke[10005];
vector <pair <int, int>> edge;
int degree[10005];
int dem = 0;
int n, m, t;
void nhap(){
cin >> n >> m;
for(int i = 1; i <= m; i++){
int x, y; cin >> x >> y;
... | ALGO | 0.999874 | 4.58755 |
d25da8ef-71eb-4d5c-832d-b58f1a5d48d0 | priyamsinghh/Leetcode-cpp-daily-practice | 704-binary-search/704-binary-search.cpp | class Solution {
public:
int search(vector<int>& nums, int target) {
int low=0,high=nums.size()-1;
while(low<=high)
{
int mid=(low+high)/2;
if(nums[mid]==target)
return mid;
else if(nums[mid]<target)
low=mid+1;
e... | ALGO | 0.999924 | 6.165609 |
a6dd111b-119c-4d23-828d-fda69f07c258 | goel-aadhaar/Competitive-Coding | Forked.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(arr) arr.begin(), arr.end()
#define vi vector<int>
#define vvi vector<vi>
#define YES cout << "YES" << endl;
#define NO cout << "NO" << endl;
#define p(x) cout << (x) << endl;
#define sp(x) cout << (x) << " ";
#define endl '\n'
#define vlli vector<long long int>... | ALGO | 0.999854 | 4.662235 |
a85f89f2-7790-4168-b168-2aee0fc97d9f | sunny0425/coursera_c | course1/week10/exec2_6.cpp | #include <iostream>
using namespace std;
int main(){
int n, m;
int a[20];
int last;
cin >> n >> m;
for(int i = 0; i < n; i++){
cin >> a[i];
}
int k = 1;
for(k = 1; k <= m; k++){
last = a[n-1];
for(int i = n - 1; i >= 0; i--){
a[i] = a[i-1];
}
a[0] = last;
}
for(int i = 0... | ALGO | 0.999986 | 3.358065 |
5305ec6d-7587-4526-843c-18a003c1a5db | elenazaharieva/fifthgrade | 191218Zad08/zad8.cpp | /*
* zad8.cpp
*
* Created on: Dec 18, 2019
* Author: eli
*/
#include <iostream>
using namespace std;
int main() {
int m;
cin >> m;
int n;
cin >> n;
for (int i = m; i <= n; i++) {
int divider = (i / 100) * 10 + i % 10;
if (i % divider == 0) {
cout << i << endl;
}
}
return 0;
}
| ALGO | 0.999438 | 3.651919 |
1940ab05-0222-4e58-8b74-0bad5257c3de | YichengZhong/Top-Interview-Questions | 1642.可以到达的最远建筑/furthestBuilding_菜鸡回溯.cpp | class Solution {
public:
int maxLen;
int furthestBuilding(vector<int>& heights, int bricks, int ladders) {
maxLen=0;
helpDFS(heights,bricks,ladders,0);
return maxLen;
}
void helpDFS(vector<int>& heights, int bricks, int ladders,int index)
{
if(index>=heights.size()... | ALGO | 0.999957 | 6.229066 |
0d19620d-5cfc-4abf-bd2d-1050f00d495b | Praneet2003/Cpp-DSA | Day4/RH inverted star pattern.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cout<<"Enter the value of n: ";
cin>>n;
int row=1;
while(row<=n){
int space = row-1;
while(space){
cout<<" ";
space=space-1;
}
int col=1;
int Star=n-row+1;
while(Star){
... | ALGO | 0.999808 | 4.367382 |
7591d2bd-4a0c-4117-a092-0fec0495d9db | dev-area/C-CPP | OPERATOR/ENGLPLUS.CPP | // englplus.cpp
// overloaded '+' operator adds two Distances
#include <iostream.h>
class Distance // English Distance class
{
private:
int feet;
float inches;
public:
Distance() // constructor (no args)
{ feet = 0; inches = 0.0; }
Distance(int ft,... | TOOL | 0.877443 | 5.164084 |
3975160c-3706-48b4-a0bb-bc35d244c96b | MoKee/android_frameworks_av | drm/libmediadrm/Drm.cpp | //#define LOG_NDEBUG 0
#define LOG_TAG "Drm"
#include <utils/Log.h>
#include <dirent.h>
#include <dlfcn.h>
#include <media/DrmPluginPath.h>
#include <media/DrmSessionClientInterface.h>
#include <media/DrmSessionManager.h>
#include <media/Drm.h>
#include <media/drm/DrmAPI.h>
#include <media/stagefright/foundation/ADeb... | TOOL | 0.88577 | 6.897449 |
ff3e0ff3-77b3-481a-9195-fe3ab6a249c7 | AmrARaouf/algorithm-detection | graph-source-code/263-D/6605898.cpp | //Language: GNU C++
/*
* D. Cycle in Graph.cpp
*
* Created on: May 12, 2014
* Author: abdelkarim
*/
#include <bits/stdc++.h>
using namespace std;
vector < vector<int> > adj(100005);
vector<int> path;
bool vis[100005];
int k;
void dfs(int cur) {
path.push_back(cur);
vis[cur] = 1;
int len = pat... | ALGO | 0.999994 | 3.836537 |
9c469a18-a048-4c14-8d7b-a8b9815a9d5f | raincross7/code-similarity | codes/train_code/problem147/problem147_379.cpp | #include <iostream>
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#inc... | ALGO | 0.99977 | 4.119361 |
3e41a38b-8a7d-428a-a0a7-10c382497437 | upesacm/21DaysOfCode-2022 | sarthakrathore23_Sarthak/Reverse Nodes/Solution.cpp | class Solution {
public:
ListNode* reverseKGroup(ListNode* head, int k) {
if (!head || k == 1)
return head;
const int l = getl(head);
ListNode dummy(0, head);
ListNode* prev = &dummy;
ListNode* curr = head;
for (int i = 0; i < l / k; ++i) {
for (int j = 0; j < k - 1; ++j) {
... | ALGO | 0.999992 | 6.309234 |
8611a01d-e362-4fb4-a519-474006ceb002 | sheyua/LAMMPS-QTB | src/PERI/fix_peri_neigh.cpp | /* ----------------------------------------------------------------------
Contributing authors: Mike Parks (SNL), Ezwanur Rahman, J.T. Foster (UTSA)
------------------------------------------------------------------------- */
#include "math.h"
#include "fix_peri_neigh.h"
#include "pair_peri_pmb.h"
#include "pair_pe... | ALGO | 0.998145 | 5.747884 |
5983620b-5f48-491c-9345-e69cd539c810 | GrihsaIvanenko/code228 | Tinkoff_2019_2020/7#Структры Данных 3/Гоша и праздники/code.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 262144, MAXD = 20;
vector<pair<int, long long>> g[MAXN];
int sz[MAXN], r[MAXN];
int C[MAXN][MAXD];
long long D[MAXN][MAXD];
void dfs_sz(int v, int ranc, int p = -1) {
sz[v] = 1;
for (auto x : g[v])
if (x.first != p && r[x.first] > ran... | ALGO | 0.999365 | 4.512066 |
d4b97eb0-d24c-4e28-b5cb-3a3f2e7938f5 | Rajeshnds/Competitive-Programming | friends/neeraj/Flight_Routes_Check.cpp | #include<bits/stdc++.h>
using namespace std;
# define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
# define ll long long
const int N=2e5+5,mod=1e9+7;
int _T;
int n,m,x,y,k,a[N];
string s,t;
vector<vector<int>>v1,v2;
set<int>st;
map<int,int>mp;
pair<int,int>p[N];
void dfs1(int i){
if(a[i])return;
a[i... | ALGO | 0.999967 | 3.725919 |
c2248521-7d4f-4a91-853c-acde33cc2191 | salarshekari/SHMsim | design/design_test.cpp | #include <iostream>
#include <cmath>
#define in2m 0.0254
#define pi 3.1415926535897932
#define rads2rpm 9.5492968
#define rpm2rads 0.1047198
int main()
{
double W = 4.227;
double T = W;
double rho = 1.225; // Air dencity Kg/m^3
double R = 15 * in2m; // Blade Radius in (m)
double A =... | ALGO | 0.998841 | 4.533395 |
03ff4c46-f69c-416c-8cd9-0aa48b8bcaec | Hossain-Sabrina/CSE1230-Computer-Programming-Course | Practices/m.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n,i,temp,a[10005];
cin>>n;
for(i=0; i<n; i++)
{
cin>>a[i];
}
int max=a[0],min=a[0],x=0,y=0;
for(i=0; i<n; i++)
{
if(a[i]>max)
{
max=a[i];
x=i;
}
if(a[i]<min)
... | ALGO | 0.999989 | 3.331429 |
ee7c6750-f425-4a72-b5bb-6ef3b972a43f | Monstry/gem5-cxl | src/systemc/tests/systemc/misc/cae_test/general/arith/divide/divide/divide.cpp | /*****************************************************************************
divide.cpp --
Original Author: Rocco Jonack, Synopsys, Inc., 1999-05-13
*****************************************************************************/
/*****************************************************************************
... | ALGO | 0.997257 | 4.026895 |
abe670d2-9dd8-47f5-948e-98281dc4f152 | tgkhang/BruteForce-For-Fun | Practice/2 backtracking/4_hamiltonCircuit.cpp | #include <iostream>
#include <vector>
using namespace std;
int n, k;
vector<vector<int>> a;
vector<int> res;
// Renamed to 'promising' and fixed logic
bool promising(int i, int j)
{
// Check if the last node connects to the start to form a cycle
if (i == n - 1 && a[j][res[0]] == 0)
return false;
/... | ALGO | 0.999998 | 4.575364 |
e01c708c-d5c2-462e-98d2-464bed7e6162 | ishandutta2007/codeforces | triple__a/normal/1010/B.cpp | #include<bits/stdc++.h>
#define ULL unsigned long long
#define F first
#define S second
#define pb push_back
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define rep1(i,n) for(int i=1;i<=(int)(n);++i)
#define range(a) a.begin(), a.end()
#define PI pair<int,int>
#define VI vector<int>
using namespace std;
typedef lo... | ALGO | 0.999755 | 3.095965 |
5eaeb76c-10c9-493b-81d6-eef0b6cf5d19 | LordPsyan/WoWSource434_V10 | src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp | /* ScriptData
SDName: Boss_Gatewatcher_Ironhand
SD%Complete: 75
SDComment:
SDCategory: Tempest Keep, The Mechanar
EndScriptData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "mechanar.h"
enum Says
{
SAY_AGGRO = 0,
SAY_HAMMER = 1,
SAY_SLAY ... | TOOL | 0.858314 | 7.461918 |
a7fbdc65-ab26-4e13-b76b-4163ac02b8e0 | ankur766/Coding_question | 0121-best-time-to-buy-and-sell-stock/0121-best-time-to-buy-and-sell-stock.cpp | class Solution {
public:
int maxProfit(vector<int>& prices) {
int max=0;
int buy=prices[0];
for(int i=1;i<prices.size();i++)
{if(buy>prices[i])
{
buy=prices[i];
}
else if(prices[i] - buy > max)
{
max=prices[i] - buy;
... | ALGO | 0.999386 | 5.970141 |
78f6166c-0e91-45cc-8a26-34185e3f5fd9 | ayushKhandelwal07/Data-Structure-and-Algorithms | Tuf/Arrays/Logic_building/move_zeros.cpp | #include<bits/stdc++.h>
using namespace std;
// Input: nums = [0, 1, 4, 0, 5, 2]
// Output: [1, 4, 5, 2, 0, 0]
void moveZeroes(vector<int>& nums) {
int n = nums.size();
int ptr = 0;
for(int i = 0;i < n;i++){
if(nums[i] != 0){
swap(nums[i],nums[ptr++]);
}
... | ALGO | 0.999961 | 6.119423 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.