uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
ed214849-05f7-4fc6-9880-fa4b1d83f153 | abhiram138b/LEETCODE | 155-min-stack/155-min-stack.cpp | class MinStack {
public:
stack<long> st;
long mini = INT_MAX;
MinStack() {}
void push(int val) {
st.push((long)val - mini);
mini = min(mini,(long)val);
}
void pop() {
mini = mini - min(st.top(),0L);
st.pop();
}
int top() {
return max... | ALGO | 0.999886 | 5.79624 |
74df72fe-d4fa-4915-be5b-893e977d177b | IMBAchan/CPlusPlusPractic | lab10/Ex3.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main() {
int m = 5;
int n = 7;
int numbers[m][n];
srand(time(NULL));
for (int i = 0; i < m; i++)
for (int j = 0; j < n; j++)
numbers[i][j] = rand() % 11;
for (int i = 0; i < m; i++) {
for (int j ... | ALGO | 0.996819 | 3.594397 |
9a2d3bcf-42f1-4c67-b84a-4f55bfb2fd6b | mahadihasan88/Problem-solving-Codeforces- | calculatinng function.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ll n,sum=0;
cin>>n;
if(n%2==0)
cout<<n/2<<endl;
else
cout<<n/2-n<<endl;
return 0;
}
| ALGO | 0.999805 | 3.205729 |
917a2b14-b3b1-4c8c-b2b7-28621d978d6c | karimoucisse/flutter_chat_ipssi | 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.998784 | 6.761023 |
a1113b95-1d53-4feb-89a6-fb3fda03c932 | FlexibleSUSY/FlexibleSUSY-generated | models/UMSSM/UMSSM_soft_beta_mvR2.cpp | #include "UMSSM_soft_parameters.hpp"
#include "wrappers.hpp"
namespace flexiblesusy {
#define INPUT(parameter) input.parameter
#define TRACE_STRUCT soft_traces
namespace {
template <typename Derived>
typename Eigen::MatrixBase<Derived>::PlainObject operator+(const Eigen::MatrixBase<Derived>& m, double n)
{
retur... | WEB | 0.916292 | 5.01202 |
a524ec62-22aa-4a5b-96ef-c4856a0e3bb3 | dongyuma/mdywork2 | base-mdy/libcxx/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp | // <numeric>
// UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: clang-8
// UNSUPPORTED: gcc-9
// Became constexpr in C++20
// template<class InputIterator, class OutputIterator, class T,
// class BinaryOperation, class UnaryOperation>
// OutputIterator transform_inclusive_scan(InputIterator first, InputIte... | TEST | 0.968041 | 7.06197 |
b041824d-021d-418a-a1e9-81382bd8c033 | AshwinkumarPillai/LeetCode | Problems/0451_Sorts_characters_by_frequency.cpp | class Solution
{
public:
static bool comp(pair<char, int> &p1, pair<char, int> &p2)
{
return p1.second > p2.second;
}
string frequencySort(string s)
{
unordered_map<char, int> m;
for (char x : s)
{
m[x]++;
}
vector<pair<char, int>> v;
... | ALGO | 0.999993 | 6.099727 |
baa41c92-4a71-4c4d-81d2-a0b2b73a6c29 | chriswengqi/kattis | problemclassification/problemclassification.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<char> vc;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<dou... | ALGO | 0.99998 | 3.966771 |
364af518-5a3e-4d95-9498-79e2ea3d9805 | ichwalM/Semester-3-Struktur-Data | 0. Tugas Project/kamusKata-windows.cpp | #include <iostream>
#include <string>
using namespace std;
struct Node{
string key;
string Meaning;
Node *left;
Node *right;
};
Node* root = nullptr, *n = nullptr, *temp = nullptr;
Node* createNode(string key,string meaning){
n=new Node;
n->key=key;
n->Meaning=meaning;
n->left=nullptr;... | TOOL | 0.993137 | 3.745891 |
089e64ed-26ed-450e-9a69-7a24404f81a7 | donnytab/TopLeetcode | Bit/LC405_to-hex.cpp | class Solution {
public:
string toHex(int num) {
if (num == 0) {
return "0";
}
string sb;
for (int i = 7; i >= 0; i --) {
int val = (num >> (4 * i)) & 0xf;
if (sb.length() > 0 || val > 0) {
ch... | ALGO | 0.996689 | 5.518239 |
00dcc1af-896c-46ec-b6bc-41975422b44e | Sajalthehacker/Leetcode-Contests | Biweekly_Contest_144/Zero_Array_Transformation_III.cpp | // https://leetcode.com/problems/zero-array-transformation-iii/description/
/*
You are given an integer array nums of length n and a 2D array queries where queries[i] = [li, ri].
Each queries[i] represents the following action on nums:
Decrement the value at each index in the range [li, ri] in nums by at most 1.
The... | ALGO | 0.999303 | 6.760048 |
0f57da76-c1a1-4183-90c4-7941c9158ed1 | iamdeit/CompetitiveProgramming | uva/11764_jumpingMario.cpp |
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <vector>
#include <map>
#include <algorithm>
#include <set>
#include <string>
#include <cstring>
using namespace std;
int main() {
int cases, currCase = 1, walls, h, l, currWall, readWall;
scanf("%d", &cases);
while(cases--) {
h ... | ALGO | 0.999538 | 3.160877 |
48c2a617-9dc3-43ae-abe4-7a4c4375fd93 | suchita08/CPP | GraphAndTree/Topological Sort(DAG).cpp | #include<bits/stdc++.h>
using namespace std;
vector<int>adj[10001];
vector<int>res;
int in[10001];
//topological sort for the directed acyclic graph
//Acyclic :No cylcle
//Cyclic graph do not have topological sort
void top_sort(int n)
{
queue<int>q;
//push that node that have zero indegree
for(int i=1;i... | ALGO | 0.999991 | 4.44442 |
8ee0ad01-5e74-454c-a22b-b60c229780f1 | techtalent17/C-Plus-Plus-Code | prime number check.cpp | //prime number check
#include <iostream>
#include <cmath>
using namespace std;
bool isPrime(int N) {
if (N == 1) return false;
if (N == 2 || N == 3) return true;
if (N % 2 == 0 || N % 3 == 0) return false;
for (int i = 5; i * i <= N; i += 6) {
if (N % i == 0 || N % (i + 2) == 0)
r... | ALGO | 0.999866 | 4.397605 |
6fa1438e-2ac8-42e6-9dd8-3252d5d7417f | gunapark/codetree-TILs | 240430/절댓값으로 변경/find-the-absolute-value.cpp | #include <iostream>
using namespace std;
int n;
void modify(int *arr){
for(int i=0;i<n;i++){
arr[i] = abs(arr[i]);
}
}
int main() {
// 여기에 코드를 작성해주세요.
cin >> n;
int arr[n];
for(int i=0;i<n;i++){
cin >> arr[i];
}
modify(arr);
for(int i=0;i<n;i++){
cout <<... | ALGO | 0.999931 | 4.704584 |
5cabe282-9109-4a82-905f-f747e349c450 | KimmiGYH/LeetCode_Notes_Public | Solutions_0001-1000/0931_Minimum Falling Path Sum_下降路径最小和/cpp_21_DP_朴素_v2.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class Solution {
public:
int minFallingPathSum(vector<vector<int>>& A) {
int n = A.size(), m = A[0].size();
vector<vector<int>> f(n, vector<int>(m, INT_MAX));
for (int j = 0; j < m; j++)
f[... | ALGO | 0.999986 | 5.981056 |
d8f73f2a-c461-4564-980c-19bc8b387dcc | sinian666/code_86_6 | cpp_副本2/chapter_backtracking/n_queens.cpp | /**
* File: n_queens.cpp
* Created Time: 2023-05-04
* Author: Krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* 回溯算法:N 皇后 */
void backtrack(int row, int n, vector<vector<string>> &state, vector<vector<vector<string>>> &res, vector<bool> &cols,
vector<bool> &diags1, vector<bool> &diags2) {
... | ALGO | 0.999244 | 5.895102 |
10bbd9c3-c9ec-45fc-8139-c620fb971e07 | SajjadHossainSoykot/Codeforces | 1-500/4A.cpp | #include<iostream>
using namespace std;
int main(){
int w;
cin>>w;
if (w>3 && w%2==0)
{
cout<<"YES"<<endl;
}
else cout<<"NO"<<endl;
return 0;
} | ALGO | 0.999232 | 3.226787 |
de1ab7bc-1793-4d68-bfd5-77b4188aa83c | Alexbutno/calculator | sortFunctions.cpp | #include "sortFunctions.h"
using namespace calculator;
bool calculator::ascending(const long double& a, const long double& b) {
return a < b;
}
bool calculator::descending(const long double& a, const long double& b){
return a > b;
}
void calculator::selectionSort(std::vector<int>& array, std::function<bool(in... | ALGO | 0.999844 | 4.421441 |
1e80fb6a-d8e4-49dc-8653-e7171f8ed95d | ishandutta2007/codeforces | generic_placeholder_name/normal/1499/E.cpp | #pragma GCC optimize("Ofast")
#pragma GCC optimization("unroll-loops, no-stack-protector")
#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/trie_policy.hpp>
#include <ext/rope>
using namespace std;
using namespace __gnu_pbds;
using namespace __gn... | ALGO | 0.999983 | 4.667394 |
bc49c9f4-2438-4f44-b910-4fa3c3137a86 | PutinCoinPUT/putincoinsource | boost_1_58_0/libs/geometry/doc/index/src/examples/rtree/polygons_shared_ptr.cpp | //[rtree_polygons_shared_ptr
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point.hpp>
#include <boost/geometry/geometries/box.hpp>
#include <boost/geometry/geometries/polygon.hpp>
#include <boost/geometry/index/rtree.hpp>
#include <cmath>
#include <vector>
#include <iostream>
#include <boost/fore... | ALGO | 0.999419 | 7.361921 |
e792faca-c3ff-4b5f-95e6-a5399927504e | wsmoses/Tapir-compiler-rt | lib/cilksan/old/static_dictionary.cpp | #include "static_dictionary.h"
#include <sys/stat.h>
// Definitions of static members
const value_type00 Dictionary::null_val = value_type00();
int n_threads(void)
{
struct stat task_stat;
if (stat("/proc/self/task", &task_stat))
return -1;
return task_stat.st_nlink - 2;
}
LRU_List::LRU_List() {
head = ... | TOOL | 0.8783 | 5.54917 |
381f5b8a-3d49-4894-a59e-b9af8bc89037 | NastyRunner13/DSA-Solutions | LeetCode/#875 Koko Eating Bananas.cpp | class Solution
{
public:
bool canEat(vector<int> piles, int k, int h)
{
int totalHours = 0;
for (int pile : piles)
{
totalHours += (pile + k - 1) / k;
if (totalHours > h)
{
return false;
}
}
return true;
... | ALGO | 0.999941 | 5.453083 |
8327904f-17e4-4ff5-8b95-fc728f2c231e | GambitBSM/gambit_2.0 | contrib/MassSpectra/flexiblesusy/models/MSSM_mAmu/MSSM_mAmu_weinberg_angle.cpp | // File generated at Thu 10 May 2018 14:33:29
#include "MSSM_mAmu_mass_eigenstates.hpp"
#include "MSSM_mAmu_weinberg_angle.hpp"
#include "MSSM_mAmu_info.hpp"
#include "wrappers.hpp"
#include "logger.hpp"
#include "numerics2.hpp"
#include "config.h"
#include "numerics.h"
#include "error.hpp"
#include "pv.hpp"
#include... | ALGO | 0.994547 | 6.058894 |
7594e5d9-48c0-4a02-9775-f8b3fb03a16f | shirashko/c-cpp-projects | Project 4 - Digit Recognition using Artificial Neural Networks/MlpNetwork.cpp | #include "MlpNetwork.h"
#define LENGTH_ERROR "invalid size of matrix"
// ok to do this in this way? need to check validity of arguments?
MlpNetwork::MlpNetwork(Matrix weights[],Matrix biases[]) : _layer1
(weights[0], biases[0], activation::relu) ,
_layer2 (weights[1], biases[1],activation::relu) ,
_layer3(weights[2],bi... | ALGO | 0.960551 | 3.71886 |
19db2004-6b06-4b24-b96e-4ace0fb9fc9f | WTY2002/security_similarity_query_matrix | include/SSQ.cpp | /**
* @author: WTY
* @date: 2024/8/15
* @description: Definition of constants, operations, and header files
*/
#include "SSQ.h"
// 密文数据集
vector<VectorXd> ciphertext;
// 加密矩阵
MatrixXd encryptMatrix;
// 自定义比较器,仅根据 double 值排序
struct Compare {
bool operator()(const pair<double, VectorXd>& a, const pair<double, Vect... | ALGO | 0.993445 | 3.307713 |
cf757358-7077-4379-a210-c6fea854dda1 | Mugglen/LeeCode | LeeCode/剑指offerNo2_替换空格_20250731.cpp | #include <vector>
using namespace std;
//#define DEBUG
#ifdef DEBUG
class Solution {
public:
void replaceSpace(char* str, int length) {
// ͳƿո
int spaceCount = 0;
int totalLen = length;
for (int i = 0; i < length; ++i) {
if (str[i] == ' ') spaceCount++;
}
... | ALGO | 0.999319 | 4.59529 |
7729fe18-e1a4-429b-bf3b-ca52cfd24336 | Anshtripathi079/Problem-solving | LeetCode/206_Reverse_linked_list.cpp | class Solution {
public:
ListNode* reverseList(ListNode* head) {
if(head==NULL || head->next == NULL){
return head;
}
ListNode* prev = NULL;
ListNode* curr = head;
ListNode* forward = NULL;
while(curr!=NULL){
forward = curr->next;
... | ALGO | 0.999824 | 5.51241 |
8ad63772-b448-47b5-83ac-4b3f969f3002 | jusonalien/Algorithms-Datastructure | poj/2386.cpp | #include<iostream>
#include<cstdio>
#include<queue>
using namespace std;
const int MAX_N = 110;
int N,M;
char field[MAX_N][MAX_N];
void dfs(int x,int y) {
field[x][y] = '*';
for(int dx = -1;dx <= 1;dx++)
for(int dy = -1;dy <= 1;dy++) {
int nx = x + dx;
int ny = y + dy;
if(nx >= 1&&nx... | ALGO | 0.99967 | 3.777277 |
feee34b4-5cde-424d-9930-e5b7c2b0c612 | shresthashim/cpp-topics | cpp lab 1/Q2.cpp | #include <iostream>
using namespace std;
void calculate(int a, int b, int &sum, int &diff, int &mult)
{
sum = a + b;
diff = a - b;
mult = a * b;
}
int main()
{
int a, b;
int sum, diff, mult;
cout << "Enter two numbers: ";
cin >> a >> b;
calculate(a, b, sum, diff, mult);
cout << "Su... | ALGO | 0.997142 | 4.877689 |
12a2300f-0559-42ff-b2b8-4d505148e748 | chinmayG1236/lets-cp | C_Trapmigiano_Reggiano.cpp | #include<bits/stdc++.h>
using namespace std;
using ll=long long;
void solve(){
int n,st,en;cin>>n>>st>>en;
if(n==1){
cout<<"1\n";return;
}
vector<vector<int>>adj(n+1);
vector<int>ind(n+1,0);
for(int i=0;i<n-1;i++){
int x,y; cin>>x>>y;
adj[x].push_back(y);
adj[y].... | ALGO | 0.99997 | 4.017041 |
87f0db6f-0976-4b9a-9cf1-204859b3d90c | serzaxlucifer/Leetcode | Strings/Greedy/1903. Largest Odd.cpp | // Simply traverse in reverse order!
string largestOddNumber(string num) {
int end = num.length() - 1;
for(int i = end; i >= 0; i--)
{
if((num[i]-48)%2)
{
return num.substr(0, i+1);
}
}
return "";
}
| ALGO | 0.994636 | 5.709242 |
a12c7a07-468f-44a7-8206-628cfa869c50 | njrafi/Competitive-Programming-Solutions | CodeForces/711B - Chris and Magic Square - 20259617.cpp | #include <bits/stdc++.h>
#ifndef ONLINE_JUDGE
#define gc getchar
#define pc putchar
#else
#define gc getchar_unlocked
#define pc putchar_unlocked
#endif
using namespace std;
#define vi vector<int>
#define vll vector<i64>
#define si set<int>
#define vs vector<string>
#define pii pair<int, int>
#define vpi vector<pii>
#d... | ALGO | 0.999965 | 3.375212 |
38acba15-98e9-48e0-b94c-f17c0a6f6cd9 | Bungmint/competitiveprogramming | contest/cses/coin_piles.cpp | #pragma GCC optimize("O3")
#pragma GCC target("sse4")
#include <bits/stdc++.h>
using namespace std;
#define all(v) (v).begin(), (v).end()
#define ar array
#define PB push_back
using ll = long long;
const int INF = 1e9;
const ll LINF = 1e15;
const int MOD = 1e9 + 7;
void solve()
{
int a, b;
cin >> a >> b;
... | ALGO | 0.999708 | 5.20419 |
09d30152-24ad-4709-b6ca-29f384e1b9d3 | Sneha-Agarwal23/Leetcode_Problems | Watering_plants.cpp | class Solution {
public:
int wateringPlants(vector<int>& plants, int capacity)
{
int steps = 0;
int c = capacity;
for(int i = 0; i < plants.size(); i++)
{
if(plants[i] <= c)
{
steps++;
}
else
{
... | ALGO | 0.999987 | 6.342519 |
4daf99c8-97b3-4493-828b-6e212fd0bbac | xb446909/zxingcpp | zxingcpp/zxing/src/datamatrix/DMECEncoder.cpp | #include "DMECEncoder.h"
#include "DMSymbolInfo.h"
#include "ByteArray.h"
#include "ZXStrConvWorkaround.h"
#include <stdexcept>
#include <string>
#include <array>
#include <algorithm>
namespace ZXing {
namespace DataMatrix {
/**
* Precomputed polynomial factors for ECC 200.
*/
static std::array<ByteArray, 16> FACTOR... | ALGO | 0.992832 | 6.200085 |
a7a451c3-861b-4671-b7dd-561e1256c901 | Mdananda/Competitive-Programming | Learn Topic/Bainary-search/a.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ll n, low, hg;
while(true)
{
cin>>n;
low = 1;
hg = 2e9;
while((hg-low) > 1)
{
ll mid = (hg+low)/2;
ll midval = (mid*(mid+1))/2;
if(midval <= n)
... | ALGO | 0.99998 | 4.134262 |
789fa808-2d61-44a7-ab72-307dd93bc942 | WilhelmBrehm/co-work-24-challenge-cpp | components/is_feasible.cpp | #ifndef IS_FEASIBLE_CPP
#define IS_FEASIBLE_CPP
#include "vrppd_solution.h"
#include "vrppd_parameters.h"
#include <iostream>
bool is_feasible(const VRPPDParameters& param, const VRPPDSolution& sol) {
bool feasibility = sol.is_feasible_solution;
if (!feasibility) {
std::cout << "NO FEASIBLE SOLUTION ... | ALGO | 0.999265 | 6.871517 |
1e8f1647-1b03-43c8-a370-add6fcd1e87f | dante329/Cpp_develop | Sort/heap_sort.cpp | #include <iostream>
using namespace std;
int n;
const int N = 1e5 + 10;
int a[N];
void down(int parent,int sz)
{
int child = parent * 2;
while(child <=sz)
{
if(child + 1 <= sz && a[child + 1] > a[child]) child++;
if(a[parent] >= a[child]) return;
swap(a[parent],a[child]);
parent = child;
child = ... | ALGO | 0.999969 | 4.139013 |
5add9a7f-2c68-407c-a015-f80ebddc04c1 | chandanSahoo-cs/cp-archive | Codeforces-Round-856-(Div.-2)-C.-Scoring-Subsequences_2025-06-22_04-51PM.cpp | /*It is not the matter of if, it is the matter of when*/
#include "bits/stdc++.h"
using namespace std;
#define velociraptor ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define all(v) v.begin(),v.end()
#define lcd(a,b) a*(b/__gcd(a,b))
#define ll long l... | ALGO | 0.999901 | 4.071153 |
78fe8cfa-bd6c-4b24-af45-0477d5016403 | hrshshukla/C-P-P | 62_Linkedlist/06_Traversal.cpp | // Travesal in Linked list
#include <iostream>
using namespace std;
struct Node
{
int data;
Node* next;
};
void Traversal(Node* ptr){
while (ptr != NULL) // STEP 2 : while( ptr !=null ) == while( ptr->next !=null )
{
cout << "Data : " << ptr->data << endl;
ptr = ptr->next; // STEP 1... | ALGO | 0.999152 | 3.671468 |
0ea48202-8395-4124-bc68-73540546003c | cliarie/grind25 | cses/ferris_wheel.cpp | #include <iostream>
#include <deque>
#include <algorithm>
using namespace std;
int main()
{
// freopen("../input.txt", "r", stdin);
// freopen("../output.txt", "w", stdout);
int n, x;
cin >> n >> x;
deque<int> children(n);
for (int i = 0; i < n; ++i)
cin >> children[i];
sort(child... | ALGO | 0.999971 | 4.237633 |
8a302318-248a-4d22-8585-02fbac7a8645 | traviskahl/programming_work | cpp/learncpp/ch6/sec12a/forEachVector.cpp | #include <iostream>
#include <vector>
int main() {
std::vector<int> fibonacci = { 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89 };
for (const auto &number : fibonacci)
std::cout << number << ' ';
std::cout << '\n';
return 0;
} | ALGO | 0.996999 | 4.337317 |
f0dc2950-09e6-4c98-8afc-c97d327e9b84 | aplqo/exercises | poj/1741-Tree.cpp | #ifdef APTEST
#include "debug_tools/program.h"
#endif
#include <algorithm>
#include <climits>
#include <cstring>
#include <iostream>
using namespace std;
const unsigned int maxn = 1e5;
struct edge {
unsigned int to;
unsigned long long val;
const edge* pre;
} ed[maxn * 2 + 1], *cur = ed;
const edge* head[maxn + 1... | ALGO | 0.999975 | 4.290441 |
4c40a673-b032-4482-bbd7-eac5465764b4 | mehdihosseinimoghadam/MHM-Flutter-UI-UX-Tutorial | Flutter fl_chart - Flutter animated line chart (animated line graph)/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.998208 | 6.785645 |
b09e696f-e4bc-4a8f-8ca5-e72dcf3d53dd | RADAR-base/radar-commons-android | plugins/radar-android-audio/src/main/jni/opensmile-2.3.0/src/functionals/functionalExtremes.cpp | /* openSMILE component:
functionals: extreme values and ranges
*/
#include <functionals/functionalExtremes.hpp>
#define MODULE "cFunctionalExtremes"
#define NORM_TURN 0
#define NORM_SECOND 1
#define NORM_FRAME 2
#define FUNCT_MAX 0
#define FUNCT_MIN 1
#define FUNCT_RANGE 2
#define FUNCT_MAXPOS... | TOOL | 0.902158 | 6.46594 |
9b33971a-927f-4623-b3fe-82892b42d34e | bonawoo/Kwak_Practice | baaarkingdog/11(Greedy)/1700.cpp | #include <bits/stdc++.h>
using namespace std;
int N,K;
int tab[105];
int b[105];
int tot = 0;
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
cin >> N >> K;
for(int i=0; i<K; i++){
cin >> b[i];
}
int tab_size = 0;
for(int i=0; i<K; i++){
if(tab_size == 0){
tab[0... | ALGO | 0.999836 | 3.852059 |
14a559ab-3bc0-41f3-92a5-927396504444 | ishandutta2007/codeforces | peti1234/normal/1283/B.cpp | #include <bits/stdc++.h>
using namespace std;
int w;
long long n, k, ans;
int main()
{
cin >> w;
while (w--) {
cin >> n >> k;
ans=n/k*k;
n-=ans;
cout << ans+min(k/2, n) << "\n";
}
return 0;
} | ALGO | 0.999957 | 3.767433 |
c5fc1299-1220-419e-af9e-3697a0d94b3a | TJWWood/Physics | 1. particle animations/glm/test/core/core_func_integer_bit_count.cpp | // This has the programs for computing the number of 1-bits
// in a word, or byte, etc.
// Max line length is 57, to fit in hacker.book.
#include <stdio.h>
#include <stdlib.h> //To define "exit", req'd by XLC.
#include <ctime>
unsigned rotatel(unsigned x, int n)
{
if ((unsigned)n > 63) {printf("rotatel, n out of ... | ALGO | 0.999382 | 4.576482 |
54c11702-68e7-48aa-9ea3-7a23f8685547 | andreamatt/esercizi | algoz/progetto 3/tarjan.cpp | #include <fstream>
#include <iostream>
#include <unordered_set>
#include <vector>
#define AP_GID 0
using namespace std;
struct Node {
int id = 0;
int level = 0;
int time = 0;
int lowTime = 0;
Node *parent = nullptr;
int groupID = AP_GID;
vector<Node *> vic;
int n_vic = 0;
bool v... | ALGO | 0.999953 | 4.313296 |
b01b639b-da41-4361-8e7d-7297f0b808a4 | AkhilKharey/DSA | BINARY SEARCH/SearchInRotatedSortedArray.cpp | class Solution {
public:
int search(vector<int>& nums, int target) {
int s=0;
int e=nums.size()-1;
int mid=s+(e-s)/2;
while(s<=e)
{
if(nums[mid]==target)
return mid;
else if(nums[s]<=nums[mid])
{
if(target>=nums[... | ALGO | 0.999947 | 6.176893 |
609eed88-9499-4ca6-a1f8-5b4d6ad691ef | connorwang38/CodeForces-Solutions | CodeForces-A/1354A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int t;
cin >> t;
while (t--) {
ll a, b, c, d;
cin >> a >> b >> c >> d;
if (b >= a) {
cout << b << "\n";
} else if (d >= c) {
cout << -1 << "\n";
} else {
... | ALGO | 0.999841 | 3.444212 |
5f3e7577-8aaa-498f-bc95-1fc6a2e2d5b9 | ishandutta2007/codeforces | pigstd/normal/1499/F.cpp | #include<bits/stdc++.h>
#define int long long
#define pb push_back
#define mp make_pair
#define x first
#define y second
#define WT int TT=read();while(TT--)
#define NO puts("NO");
#define YES puts("YES");
using namespace std;
inline int read()
{
char c=getchar();int x=0;bool f=0;
for(;!isdigit(c);c=getchar()... | ALGO | 0.999948 | 4.605968 |
a49fc069-e952-484a-8a4e-9c40117c280b | dingvyoung/keyword | score.cpp |
#include<fstream>
#include<iostream>
#include<cassert>
#include<sstream>
#include<cstdlib>
#include<queue>
#include<stack>
using namespace std;
class myclass {
public:
string word;
double score;
myclass(string w, double s):word(w), score(s) {
};
bool operator <(const myclass & rth) const {
... | ALGO | 0.996552 | 3.775889 |
1916ccee-d30d-4a2d-8f0b-ac9193f488ba | ishandutta2007/codeforces | akulyat/normal/1479/B1.cpp | #include <bits/stdc++.h>
#pragma GCC optimize ("O3", "unroll-all-loops")
#pragma GCC target ("sse4.2")
using namespace std;
#define F first
#define S second
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
ifstream in;
ofstream out;
const long long kk... | ALGO | 0.999985 | 4.232316 |
1dc07c5b-e165-446f-9dd2-f04a24552b73 | securesystemslab/llvm-project | mlir/lib/Conversion/SCFToStandard/SCFToStandard.cpp | #include "mlir/Conversion/SCFToStandard/SCFToStandard.h"
#include "../PassDetail.h"
#include "mlir/Dialect/SCF/SCF.h"
#include "mlir/Dialect/StandardOps/IR/Ops.h"
#include "mlir/IR/BlockAndValueMapping.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/MLIRContext.h"
#include "mlir/IR/Pa... | TOOL | 0.927769 | 7.875858 |
c498ab54-215e-4097-89c0-86c621e102e1 | lindsayhaslam/Portfolio | C++/BookAnalyzerHW/BookAnalyzerHW/BookAnalyzerFunctions.cpp | ///
// BookAnalyzerFunctions.cpp
// BookAnalyzerHW
//
// Created by Lindsay Haslam on 9/1/23.
//
#include "BookAnalyzerFunctions.hpp"
#include <iostream>
#include <string>
#include <cstdlib>
#include <vector>
#include <fstream>
//Find Title of Book
void TitleOfBook (std::vector<std::string> &allWords){
int i =... | TOOL | 0.959389 | 4.038577 |
5b2a651a-6d52-46e8-987c-aa74ac377877 | mussu777/CODE | peak_moutain_search.cpp | #include<iostream>
using namespace std;
int peakmountain(int arr[] , int size)
{
int start = 0;
int end = size - 1;
int mid = start + (end - start)/2;
while (start < end)
{
if (arr[mid] < arr[mid + 1])
{
start = mid + 1;
}
else
{
end = mid;
}
mid = start + (end - start)/2;
}
cout<<"the val... | ALGO | 0.999818 | 3.911828 |
1ddb9bdd-f7ac-4aa8-86b6-a6d57ee8294a | BlueberryPie-kyle/Algorithm-Exercise | Codeforces/1883(Round 905)/1883D.cpp | #include <bits/stdc++.h>
#define endl "\n"
#define ll long long
using namespace std;
void solve() {
multiset<int> l, r;
int cnt, left, right;
cin >> cnt;
while (cnt--) {
char op;
cin >> op;
cin >> left >> right;
if (op == '+') {
l.insert(left);
r.... | ALGO | 0.999888 | 5.451183 |
ceb0629c-389d-4bf3-ba95-f8f712cb1fb7 | GargeeKatariya/SafeSpace | server/tempCodeRunnerFile.cpp | #include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#include <sstream>
class TimeTravelersArchive {
private:
using Entry = std::pair<int, std::string>;
std::map<std::string, std::vector<Entry>> data;
public:
void Store(const std::string& key, const std::string& value, int timestamp) ... | ALGO | 0.921354 | 6.919194 |
21049fc1-7102-4655-a852-a0322dc04a83 | PochecoPachico/Procon | AtCoder/ABC/087/B.cpp | #include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
struct edge { int u, v; ll w; };
ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;
int main() {
int A, B, C, X;
cin >> A >> B >> C ... | ALGO | 0.99975 | 4.115265 |
107884ca-5879-44f2-9897-a9598a9a5166 | JordiLazo/Bachelors_Degree_in_Computer_Engineering | 102000_Introduction_to_Programming_1/Practice_1/Ejercicio_1_y_2/ex1.cpp | #include<stdio.h>
int main(){
int n,roma=n+1,suma=0; // roma es la variable que utilitzo per comparar les lletres introduides per l'usuari i la inicialitzare a n+1.
//Perquè el primer valor que introduirà l'usuari actuará com si fós més petit que l'anterior.
char c;
bool trobat=false;
printf("\nInt... | ALGO | 0.999545 | 4.000364 |
d432a6e2-0399-4421-88b1-11a7e4466c02 | garechav/geombd_crtp | examples/example_FwdDynDiff.cpp | //#define EIGEN_RUNTIME_NO_MALLOC
#define EIGEN_NO_DEBUG
#define EIGEN_MPL2_ONLY
#define EIGEN_UNROLLING_LIMIT 30
#include "geombd/CRTP/DForwardDynamicsCRTP.hpp"
#include <iostream>
#include <chrono>
#include "geombd/io/parser.hpp"
#define __FU_PATH_PREFIX__ "../../data/TROmodels/"
//std::string urdf_dir = __FU_PAT... | TOOL | 0.99292 | 4.687922 |
c5de8e9b-3813-4d73-9769-f43f064cc851 | KhoiBui16/28Tech_Code_Online | Data structure algorithm/Source Code DSA Contest/MangCongDon_HaiConTro_SlidingWindow/SlidingWindow/Bai2_MaximumWindow.cpp | #include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
typedef long long ll;
int main()
{
int n , k ; cin >> n >> k;
int a[n]; for(int i = 0 ; i < n ; i++) cin >> a[i];
multiset<int>se;
for(int i = 0 ; i < k ; i++)
{
se.insert(a[i]);
}
cout << *se.begin() << " " << *... | ALGO | 0.999975 | 3.063481 |
25ee5f1f-1c85-49f4-ada9-112e95d50475 | cxwcfea/uva-code | 253.cpp | /*
* =====================================================================================
*
* Filename: 253.cpp
*
* Description:
*
* Version: 1.0
* Created: 07/13/2014 19:46:15
* Revision: none
* Compiler: g++
*
* Author: cxwcfea(<EMAIL>),
* Organizati... | ALGO | 0.999353 | 3.896049 |
0c85b47e-fe99-4a74-b422-d42736ca18b4 | JJJoonngg/Algorithm | 프로그래머스/소수 만들기.cpp | //
// Created by 김종신 on 2020/06/02.
//
#include <vector>
#define MAXI 3000
using namespace std;
bool arr[MAXI + 1];
int solution(vector<int> nums) {
int answer = 0, siz = nums.size();
arr[1] = true;
for (int i = 2; i * i <= MAXI; i++)
if (!arr[i]) { for (int j = i * i; j <= MAXI; j += i) arr[j] = ... | ALGO | 0.999773 | 5.452858 |
ce94d474-6dec-4251-b251-d73079848cda | xpharry/coding-battle | leetcode/cpp/222.cpp | /**
* Tree
*
* Ref: https://leetcode.com/problems/count-complete-tree-nodes/discuss/62056/68ms-C++-solution-using-binary-search-with-brief-explanation.
*/
class Solution {
public:
int countNodes(TreeNode* root) {
if(!root) return 0;
TreeNode *temp = root;
int height = 0, count = 0, level... | ALGO | 0.999955 | 6.616162 |
444bdbce-63d0-4d34-aec2-c0aa04c4c777 | psk001/Leetcode-Problems | 51-n-queens/51-n-queens.cpp | class Solution {
public:
vector<vector<string>> solveNQueens(int n) {
vector<vector<string>> res;
vector<string> board(n);
string s(n, '.');
for(int i=0; i<n; i++)
board[i]=s;
solve(0, board, res, n);
return res;
}
... | ALGO | 0.999731 | 6.042693 |
56f123bc-a172-4821-879e-f02c1ded8320 | rs-97-cfw/gnash | libcore/asobj/TextField_as.cpp | #include "TextField_as.h"
#include "namedStrings.h"
#include "TextField.h"
#include "log.h"
#include "fn_call.h"
#include "Global_as.h"
#include "AsBroadcaster.h" // for initializing self as a broadcaster
#include "TextFormat_as.h"
#include "MovieClip.h"
#include "NativeFunction.h"
#include "GnashNumeric.h"
#include "... | TOOL | 0.874978 | 7.002498 |
0d1a3669-9e6b-42f2-bff4-4e7b86f9fe94 | raincross7/code-similarity | codes/train_code/problem248/problem248_405.cpp | #include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound, __gcd, count, find, next_permutation
#include <bitset> // bitset
#include <deque> // deque
#include <iomanip> // setprecsion
#include <iostream> // cout, endl, cin
#include <map> // map
#include <queue> // queue, priori... | ALGO | 0.999973 | 4.068607 |
45151029-22a5-4cb5-829c-5b7a130fa5d9 | ebbunnim/Algorithm | leetcode/13_Roman to Integer.cpp | class Solution {
public:
int romanToInt(string s) {
unordered_map<string, int> hashMap;
hashMap["I"] = 1;
hashMap["V"] = 5;
hashMap["X"] = 10;
hashMap["L"] = 50;
hashMap["C"] = 100;
hashMap["D"] = 500;
hashMap["M"] = 1000;
hashMap["IV"] = 4;
... | ALGO | 0.999338 | 6.205355 |
0381fb04-0de0-4e31-844f-df8e2501388c | gauravengine/CPP_Freak | Dynamic_Programming/vipul_and_modulos.cpp | //https://hack.codingblocks.com/app/contests/1209/512/problem
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#define db1(x) cout<<#x<<"="<<x<<'\n'
#define db2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<... | ALGO | 0.99986 | 4.479813 |
2cc72871-7b50-4988-b7e9-66cd02ff5c3e | WLinZhen/cyberdog_sim | src/cyber_guide/common/src/SparseCMPC/SparseCMPC_Math.cpp | #include "SparseCMPC/SparseCMPC.h"
#include <eigen3/Eigen/Dense>
#include <eigen3/unsupported/Eigen/MatrixFunctions>
void SparseCMPC::c2d(u32 trajIdx, u32 bBlockStartIdx, u32 block_count) {
Eigen::Matrix<double, 24, 24> AB, expmm;
AB.setZero();
AB.block(0,0,12,12) = _aMat[trajIdx];
for(u32 i = bBlockStartIdx... | ALGO | 0.994753 | 3.924443 |
f39e485d-3d03-4728-98c5-a0360dfbe505 | Himel-032/testing | inverseMatrix.cpp | #include <bits/stdc++.h>
using namespace std;
// Function to perform Gauss-Jordan elimination for matrix inversion
void gaussJordanInversion(vector<vector<double>> &matrix)
{
int n = matrix.size();
// Perform Gauss-Jordan elimination
for (int i = 0; i < n; i++)
{
// Check if pivot is zero, and... | ALGO | 0.999982 | 6.30293 |
8be34394-e8e9-490c-b1d3-b1e168162650 | mozilla-firefox/firefox | gfx/angle/checkout/src/compiler/translator/tree_util/IntermTraverse.cpp | #include "compiler/translator/tree_util/IntermTraverse.h"
#include "compiler/translator/Compiler.h"
#include "compiler/translator/InfoSink.h"
#include "compiler/translator/SymbolTable.h"
#include "compiler/translator/tree_util/IntermNode_util.h"
#include "compiler/translator/util.h"
namespace sh
{
// Traverse the in... | TOOL | 0.937373 | 7.109775 |
7106f2e1-bddd-48e7-b329-0cdcaa36c9f0 | krishna-raj007/BodhiTree-Annotation | CS101_Spring2020-21 /LAB4_L1/uncategorized/euclidean_distance/Submissions/81_euclidean_distance.cpp | #include<simplecpp>
main_program{
int p,n;
cin>>p;
for(int i=0; i<p; i++)
{
int n1;
cin>>n1;
double sum=0.0;
for(int i=0;i<n;i++)
{
double a,b;
cin>>a>>b;
sum= sum+ (a-b)*(a-b);
}
printf("%.2f\n",sqrt(sum));
}
}
| ALGO | 0.998929 | 3.284391 |
bd29d732-6060-47a8-a5e7-d7efdbf4d922 | Govind-techie/DSA | Extra Problems/07_problem7.cpp | /*
Problem: Buy and Sell Stocks for Maximum Profit (Easy)
You are given a list of prices where each element represents the price of a stock on a particular day.
Your task is to buy the stock on one day and sell it on another future day, and get the maximum profit.
You are allowed to buy and sell only one time.
If i... | ALGO | 0.999883 | 6.477105 |
314ac8d5-6f1f-4e07-8ffa-5d9411006981 | Raheel-10k/45_Raheel_101prorams | 034_sum_of_digits_of_a_number_using_a_do_while_loop.cpp | //Calculate the sum of digits of a number using a do-while loop.
#include <iostream>
using namespace std;
int main(){
int n,sum=0,m;
//taking the input from user
cout<<"Enter a number: ";
cin>>n;
//using do while loop
do{m=n%10;
sum=sum+m;
n=n/10;
}
while(n>0); ... | ALGO | 0.999947 | 5.013422 |
688bd5d6-7ed6-429e-ad78-64b193df8092 | bansal1999/LeetCode_Solutions | reverse-prefix-of-word/reverse-prefix-of-word.cpp | class Solution {
public:
string reversePrefix(string word, char ch) {
for(int i=0; i< word.length(); i++)
{
if(word[i] == ch)
{
reverse(word.begin(), word.begin()+ i+1);
break;
}
}
return word;
}
}; | ALGO | 0.999979 | 6.29952 |
d67ad1d0-8c0f-4e00-a6e9-177d159360c3 | ishandutta2007/codeforces | ffao/normal/1383/A.cpp | #ifdef LOCAL
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
using namespace std;
#define all(x) begin(x), end(x)
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define sz(x) (int)(x).size()
vi val, comp, z, cont;
int Time, ncomps;
t... | ALGO | 0.999902 | 3.840894 |
32683584-06f9-4fe5-a62d-6b101d37b443 | wcysai/triple_dogs | ucup/stage4/C.cpp | #pragma GCC optimize(3)
#include<bits/stdc++.h>
#define MAXN 100005
#define INF 1000000000
#define MOD 1000000007
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int n,k,a[MAXN];
int p[MAXN];
char str[MAXN];
int main()
{
scanf("%s",str+1);
n=strlen(str+1);
... | ALGO | 0.999975 | 3.666636 |
ffccd2f6-d453-4ccc-9c0e-a3fd1aa70e70 | khalilia2000/CarND-Path-Planning-Project | src/helper.cpp | #include "helper.h"
Helper::Helper() {}
Helper::~Helper() {}
double Helper::pi()
{
return M_PI;
}
double Helper::deg2rad(double x)
{
return x * pi() / 180;
}
double Helper::rad2deg(double x)
{
return x * 180 / pi();
}
// Calculate euclidian distance between two points
// x1, y1 are coordinates of the fi... | ALGO | 0.993089 | 4.900027 |
b8940315-46e7-47da-b927-c945cd42fd0b | Zacholme7/Coding-Interview | LeetcodeDaily/January2024/1-11-24.cpp | // link:
// https://leetcode.com/problems/maximum-difference-between-node-and-ancestor/description/
// difficulty: medium
// date solved: january 11, 2024
#include <algorithm>
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : v... | ALGO | 0.999787 | 6.511406 |
039dfdf5-5bc9-4548-94b5-713261eac442 | GunankaD/Data-Structures-Algorithms | Data Structures/Hashmaps/firstUniqueCharacter.cpp | #include<iostream>
#include<unordered_map>
#include<string>
using namespace std;
int firstUniqueCharacter(string s){
unordered_map<char,int> frequency;
for(char i:s) frequency[i]++;
for(int i=0;i<s.size();i++) if(frequency[s[i]]==1) return i;
return -1;
}
int main(){
string s="uunanka";
cout<<... | ALGO | 0.997664 | 4.836513 |
63dc45d2-8f13-4361-b86e-e0661c6e4268 | jqnfxa/PropositionalCalculusSolver | src/math/ast.cpp | #include <algorithm>
#include <vector>
#include <sstream>
#include <unordered_map>
#include <iostream>
#include <stack>
#include <queue>
#include <functional>
#include <string>
#include <numeric>
#include "ast.hpp"
#include "../parser/parser.hpp"
const auto operation_dict = [] () -> std::unordered_map<operation_t, std... | ALGO | 0.990336 | 6.704315 |
a3c65026-9a20-47a0-bbef-33453743a763 | shivangigoel1302/leetcode_solutions | Word_Ladder_II.cpp | class Solution {
public:
vector<vector<string>> findLadders(string beginWord, string endWord, vector<string>& word) {
deque<vector<string>>paths;
unordered_set<string>visited;
int level = 1;
vector<vector<string>>ans;
paths.push_back({beginWord});
unordered_set<string... | ALGO | 0.999969 | 5.772704 |
a156d698-e613-44cd-ab01-845558cdc2d6 | arthur-bouton/PathPlanning3D | third_party/libigl/libigl/tutorial/203_CurvatureDirections/main.cpp | #include <igl/avg_edge_length.h>
#include <igl/cotmatrix.h>
#include <igl/invert_diag.h>
#include <igl/massmatrix.h>
#include <igl/parula.h>
#include <igl/per_corner_normals.h>
#include <igl/per_face_normals.h>
#include <igl/per_vertex_normals.h>
#include <igl/principal_curvature.h>
#include <igl/read_triangle_mesh.h>
... | ALGO | 0.978373 | 5.776041 |
9c0ee1b3-366a-4f92-b95d-1f51538e7eef | RedZeroTheCat/cw_OS | cw/table/src/table_test.cpp | #include "../include/table.h"
#include <memory>
namespace comparison
{
class int_comparer final
{
public:
int operator()(
int const &left,
int const &right) const noexcept
{
return left - right;
}
};
class stdstring_comparer final
{... | TOOL | 0.865193 | 4.997193 |
7acf0528-3889-4625-893e-f775c5d5c6e4 | mgaillard/CS635 | Assignment1/CameraCalibration/Utils.cpp | #include "Utils.h"
#include <iostream>
#include <QtMath>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/calib3d.hpp>
cv::Vec2f projectPoint(const cv::Mat1f& H, const cv::Vec3f& m)
{
assert(H.rows == 3);
assert(H.cols == 3);
cv::Mat1f point(3, 1);
point.at<float>(0) =... | ALGO | 0.976482 | 6.360719 |
5ebbe194-2ba9-4438-a381-c19d98883238 | PICTureRG/UDF2SQL | third_party/cbmc/src/pointer-analysis/value_set_analysis.cpp | /*******************************************************************\
Module: Value Set Propagation
Author: Daniel Kroening, <EMAIL>
\*******************************************************************/
/// \file
/// Value Set Propagation
#include "value_set_analysis.h"
#include <util/cprover_prefix.h>
#include <... | ALGO | 0.875016 | 6.737499 |
6362b36b-5061-473f-b17e-d2c39414edda | ishandutta2007/codeforces | abdude824/normal/1559/A.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long int
int32_t main()
{
int t;cin>>t;
while(t--)
{
int n;cin>>n;
vector<int>a(n);
for(int i=0;i<n;i++)cin>>a[i];
int ans=a[0];
for(int i=0;i<n;i++)ans=ans&a[i];
cout<<ans<<endl;
}
... | ALGO | 0.999956 | 4.733206 |
a50effce-9d94-4934-b24e-fbd084977f26 | alexandraback/datacollection | solutions_1595491_0/C++/LTT/main.cpp | #include <algorithm>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <set>
using namespace std;
typedef ifstream inft;
typedef ofstream outt;
typedef long int li;
typedef vector <li> vi;
typedef unsigned long int ui;
#define fo(i, a, b) for( int i = ... | ALGO | 0.978887 | 3.047461 |
ed5c0d09-aa4a-4a07-a251-08bfa9d7b8eb | hjiang13/LLMs-in-IR | POJ-104/82/803.cpp | #include <iostream>
using namespace std;
int main ()
{
int n,i,max;
int k=0;
int a[N],b[N],c[N];
cin >> "%d",&n);
for(i=0; i<n; i++){
cin >> "%d%d",&a[i],&b[i]);
if(a[i]>=90&&a[i]<=140&&b[i]>=60&&b[i]<=90){
k++;
c[i]=k;
}
else {
c[i]=k=0;
}
}
max=c[0];
for(i=0; i<n; i++){
if(max<c[i]){
max=c[i];
}
}
cout << "%d",max);
... | ALGO | 0.999863 | 3.460423 |
27ad141f-e958-4a38-b6e4-07f3f3457482 | dmironenko/leetcode | 383. Ransom Note/main.cpp | #include <string>
#include <iostream>
#include <vector>
class Solution {
public:
bool canConstruct(std::string ransomnote, std::string magazine) {
std::vector<int> target(26, 0);
for (const auto letter : magazine) {
++target[letter - 'a'];
}
for (const auto letter : ra... | ALGO | 0.999311 | 6.37435 |
ac3eed52-bbb8-4638-be6b-3cc0492a3458 | khushisinha20/Data-Structures-and-Algorithms | Sorting/reverse_pairs.cpp | //leetcode.com/problems/reverse-pairs/
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int merge(vector<int>& nums, int low, int mid, int high) {
vector<int> buffer;
int reversePairs = 0;
int left = low;
int right = mid + 1;
int j = mid + 1;
... | ALGO | 0.999964 | 5.831337 |
1a0b2351-6e3b-4dda-9654-fafebf6e430c | dgonzalezarbelo/AceptaElReto | 608.cpp | #include <iostream>
#include <fstream>
#include <vector>
using namespace std;
#pragma warning (disable: 4996)
bool resuelveCaso() {
int num;
scanf("%d", &num);
if (num == 0) return false;
int digit;
int menor = -1, mayor = -1, total = 0;
for (int i = 0; i < num; i++) {
scanf("%d", &digit);
if (digit > 6) may... | ALGO | 0.999554 | 3.959655 |
3cab8f0f-661c-4f36-adf5-757d382cda03 | ishandutta2007/codeforces | ezoilearner/normal/1416/C.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,bool> pib;
const int T=30;
int n;
#define Maxn 300010
#define V 5000010
#define cout cerr
#define FR first
#define SE second
int a[Maxn];
vector<pib> vec[V];int root,cnt=0;
int son[V][2];
void Insert(int &k,int at,int pos){
if(!k)k=++... | ALGO | 0.999876 | 3.652885 |
e76dbd86-bd0e-431a-a326-88b57200a4fa | ratchanonp/algordsgnanal | LAB8/archives/lab8_recursion.cpp | #include <bits/stdc++.h>
using namespace std;
int cntOdd = 0;
int cntEven = 0;
void PatternOdd(vector<int> &arr, int start, int end)
{
if (start > end)
{
return;
}
arr[start] = cntOdd * 2 + 1;
cntOdd++;
int mid = (start + end) / 2;
PatternOdd(arr, start + 1, mid);
PatternOd... | ALGO | 0.999871 | 4.110585 |
ada669db-0c82-45ce-825e-8f45d80fded9 | Vonewman/introduction_to_algorithm | heap_sort/heap_sort_cpp/program.cpp | #include <algorithm>
#include <iostream>
#include <functional>
#include <iterator>
using namespace std;
void show(int *ia, char const *header);
int main() {
int ia[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14, 15, 16, 17, 18, 19, 20};
make_heap(ia, ia + 20);
show(ia, "The values 1-20 in a max-hea... | ALGO | 0.996227 | 4.550503 |
a46495f2-d5de-4efc-9ab0-75ffa471e663 | acc-cosc-1337-spring-2020-hl/acc-cosc-1337-spring-2020-s1938708 | src/examples/03_module/07_vectors_for_ranged/vec_for_ranged.cpp | #include "for_ranged.h"
#include<iostream>
#include<vector>
using std::vector;
/*
Write code for function loop_vector_w_auto with no parameters.
The function creates an int vector with values 9, 10, 99, 5, 67
and displays the numbers to screen using a for ranged loop with auto as follows: 9 10 99 5 67
*/
/*
Write c... | ALGO | 0.86059 | 4.68638 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.