uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
b926c5f2-4a1b-4966-836a-dd00b5e3908d | rodrigobmg/3D-Graphics-Engine | src/source/math/Matrix.cpp | /**********************************************************************
* FILENAME : Matrix.cpp
*
* DESCRIPTION :
* Contains a Matrix class, SquareMatrix class and a 4x4 Matrix class.
*
* AUTHOR : Greg Smith START DATE : Jan '13
*
****************************************************************... | ALGO | 0.959448 | 4.729297 |
2f385689-59b7-4fe9-8820-b0b9d72499ba | CramenNoodle/COSC1030 | fix-the-errors-2/main.cpp | //
// Carmen Grajeda
// 1/21/2025
// Fix the Errors #2 Programming Project
// COSC 1030
//
// This program will take a number and divide it by 2.
#include <iostream>
using namespace std;
int main()
{
float number;
int divider;
divider = 2; // Changed the divider variable to 2.
cout << "Hi there" << endl;
cout... | ALGO | 0.928914 | 4.454504 |
00b67c8f-a7d0-4c59-813f-7864edeac805 | sameer-19/Leetcode | Enemy - GFG/enemy.cpp | //{ Driver Code Starts
//Initial Template for C++
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution
{
public:
int largestArea(int n,int m,int k,vector<vector<int>> &enemy)
{
if(k==0) return n*m;
... | ALGO | 0.999888 | 5.467399 |
e7893988-f14e-4128-be5c-eed7d89a55b7 | Juanito98/Competitive-Programming | IOI/Network of Schools.cpp | #include <bits/stdc++.h>
#define MAXN 1000002
using namespace std;
int n;
stack < int > pila;
vector < int > invertido[MAXN];
vector < int > lista[MAXN];
int componentes;
int inDegree[MAXN];
int outDegree[MAXN];
int nodoSupremo[MAXN];
int nAux;
bool visitado[MAXN];
void desmarca() {
for(int i=1; i<=nAux; i++)
... | ALGO | 0.999458 | 3.828484 |
d4f33de3-41b0-40ed-8042-91854666c5f7 | moharamfatema/algorithms-problem-solving | minimum-spanning-tree/Kruskal.cpp | #include <vector>
#include <queue>
#include <cmath>
#define GET_INDEX(I,J,N) I * N + J
#define GET_I(x,N) X / N
#define GET_J(x,N) X % N
class Edge{
public:
std::pair<std::vector<int>,std::vector<int>> points;
int weight;
Edge(
std::pair<std::vector<int>,std::vector<int>> points,
int w... | ALGO | 0.999766 | 4.615151 |
85d5ac0c-8fbb-4ba6-aca6-15e4db2270ff | vfolunin/archives-solutions | LeetCode/692.cpp | class Solution {
public:
vector<string> topKFrequent(vector<string> &words, int k) {
unordered_map<string, int> count;
for (string &word : words)
count[word]++;
vector<pair<string, int>> pairs(count.begin(), count.end());
partial_sort(pairs.begin(), pairs.begin()... | ALGO | 0.999981 | 6.51441 |
878fd150-f739-4cc0-82f4-4db0bff88258 | 3013216006/ACM | 8-19/i.cpp | #include <iostream>
#include <string.h>
#include <algorithm>
#include <stdio.h>
using namespace std;
char s[20];
int a[20],b[20];
int getans(char s){
if(s=='A') return 16;
if(s=='B') return 7;
if(s=='C') return 8;
if(s=='D') return 1;
if(s=='E') return 1;
if(s=='F') return 2;
if(s=='G') return 3;
}
int main(){
... | ALGO | 0.999274 | 4.196117 |
cfb8ff8b-eff1-4c96-9c27-507c76e1f8c9 | ishandutta2007/codeforces | mr_eight/normal/626/G.cpp | //#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <climits>
#include <functional>
#include <cstring>
#include <string>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
... | ALGO | 0.999794 | 3.112453 |
659e054f-4b5f-444b-957c-8633b83fda14 | minstaar/beakjoon | 2024/10423.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct Edge
{
int from;
int to;
int cost;
bool operator < (const Edge& other){
return cost < other.cost;
}
};
int parent[1010];
bool gen[1010];
int Find(int x)
{
if(parent[x] == x) return x;
else{
... | ALGO | 0.999895 | 4.573588 |
ed9d8822-79bc-4b93-adde-787c4e6c6ce3 | MooYongArin/grader-algoritm-design | 01-brutes_force/consecutive_ones/consecutive_ones.cpp | #include <iostream>
#include <vector>
using namespace std;
bool found_consec(string st, int k){
int count = 0;
for (char &ch : st)
{
if (ch == '1') count++;
else count = 0;
if(count == k) return true;
}
return false;
}
void consecutive_ones(int n, int k, string st){
if(s... | ALGO | 0.999936 | 4.391821 |
b0ef7717-87ee-48ed-8427-f7b92f0e5327 | BaBa0525/competitive-programming | qualification/regional_contest.cpp | #include <iostream>
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int year{}, month{}, date{};
char split_ch;
std::cin >> year >> split_ch >> month >> split_ch >> date;
if (year > 2023) {
std::cout << "GOOD\n";
return 0;
}
if (year < 2023) {
std::cout << "TOO LATE... | ALGO | 0.986891 | 5.231369 |
2909fa63-e0e7-47ba-97b2-3bd32658eb03 | Maxorella/Boids-Praktika | src/fieldb.cpp | #include "fieldb.h"
#include "data.h"
#include "coord.h"
#include <cmath>
#include <vector>
#include <iostream>
using namespace std;
void FieldBehaviour::allBehave(){
for(int i=0; i<dat.getPigInMeadowSize(); i++)
{
dat.getPigeon(i)->behave();
}
dat.getCar()->behave();
}
void FieldBehaviour::al... | ALGO | 0.92473 | 3.780135 |
a4b14b93-b31e-41db-8721-df5f7c4f31af | Anujpandey12345/Dsa_c-_Repo | Reverse_the_string.cpp | #include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main(){
string str = "my name is anuj";
int start = 0;
int edd = str.length()-1;
while(start <= edd){
swap(str[start], str[edd]);
start++;
edd--;
}
cout<<str<<" ";
}
| ALGO | 0.999689 | 3.351836 |
b98839ab-d6b6-4a2e-a5c6-f73178893ef7 | lonnewolf120/DS_Algo | MAP/1/g.cpp | #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>
using namespace std;
typedef long long ll;
typedef long double ld;
ll MOD = 998244353;
double eps = 1e-12;
#define forn(i,e) for(ll i = 0; i < e;... | ALGO | 0.999958 | 4.368815 |
3aee19d1-d4dc-4001-afea-b5c381b91c8f | choiwooseok/aoc_sol | 2021/day4/day4.cpp | #include <iostream>
#include <iomanip>
#include <fstream>
#include <sstream>
#include <vector>
#include <queue>
#include <algorithm>
std::vector<std::string> readInputs(const std::string& fileName) {
std::fstream inputs(fileName);
std::vector<std::string> data;
std::string line;
while (!inputs.eof()) {
in... | ALGO | 0.998418 | 6.072095 |
fdf8aa42-23f7-4922-a070-f89a6961c44c | Abhi7026/Leetcode-Solutions | Maximum no of 1's row - GFG/maximum-no-of-1s-row.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
int maxOnes (vector <vector <int>> &Mat, int N, int M)
{
// your code here
int count=0;
int curmax=0;
int max=0;
for(int i=... | ALGO | 0.999897 | 6.287591 |
d201ec07-6b1b-485a-a0ad-1c7531bd827c | raincross7/code-similarity | codes/train_code/problem400/problem400_361.cpp | #include<bits/stdc++.h>
using namespace std;
#define For(i,n) for(int i=0;i<n;i++)
#define fors(i,s) for(int i=0;i<s.size();i++)
#define forn(i,n) for(int i=1;i<=n;i++)
#define nl "\n"
#define test int t;cin>>t;for(int l=0;l<t;l++)
#define End return 0
#define gt greater<int>()
#define... | ALGO | 0.999911 | 3.756559 |
f6fc8266-869f-4900-a626-085fa641f954 | gleraromero/goc | code/src/math/linear_function.cpp | //
// Created by Gonzalo Lera Romero.
// Grupo de Optimizacion Combinatoria (GOC).
// Departamento de Computacion - Universidad de Buenos Aires.
//
#include "goc/math/linear_function.h"
#include <vector>
#include "goc/exception/exception_utils.h"
#include "goc/math/number_utils.h"
#include "goc/string/string_utils.h... | ALGO | 0.975977 | 7.17535 |
485f254f-42fe-49ff-9b1b-cc6c6c792496 | StoyanMalinin/Algorithms | past problems/IATI/2017/sequences_N3_pref.cpp | #include <iostream>
using namespace std;
const int MAXN = 30;
int64_t dpPref[MAXN+5][MAXN+5];
int64_t dp[MAXN+5][MAXN+5];
int main()
{
int n, m, k;
cin >> n >> m >> k;
dp[0][0] = 1;//
dpPref[0][0] = dp[0][0];
for(int x = 1;x<=m;x++) dpPref[0][x] = dpPref[0][x-1] + dp[0][x];
for(int len =... | ALGO | 0.999959 | 3.700378 |
16f5f7ce-4ba3-4311-abb5-641f80ca7fd8 | Mohd-3/Codeforces-Solutions | Normal/377/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define add push_back
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n";
using ll = long long;
const int INF = 0x3f3f3f3f;
int n, m, k, fre, cnt, vis[501][501];
char grid[501][501];
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
bool isV... | ALGO | 0.999987 | 3.996244 |
dc8c0b75-8820-42db-be97-c78c2500e525 | Jitendra-rec/LeetCode | 2406-decode-the-message/decode-the-message.cpp | class Solution {
public:
string decodeMessage(string key, string message) {
unordered_map<char,char>mp;
char ch='a';
for(auto i:key)
{
if(i!=' '&& mp.find(i)==mp.end())
mp[i]=ch++;
}
// for(auto i:mp)
// cout<<i.first<<" "<<i.se... | ALGO | 0.999983 | 5.632716 |
a0f8dd4e-54cd-41b0-8efd-63209275c0f5 | atlas25git/LeetCode | 986IntervalListIntersection.cpp | class Solution {
public:
vector<vector<int>> intervalIntersection(vector<vector<int>>& fL, vector<vector<int>>& sL) {
int s =0,e=1;
int i=0,j=0;
vector<vector<int>> res;
while(i<fL.size() && j<sL.size())
{
if(
(fL[i][s]<=sL[j][e] && fL[i][s]>=sL[j]... | ALGO | 0.999985 | 6.061281 |
3cb3b17c-279f-429d-bd21-4ae528c8f547 | Sushil2002/Data-Structure-and-Algorithm | DSA_Assignment_08.cpp | // Topological Sort=>Acylic and directed Graph Is Required!
/*PROBLEM STTATEMENT=>Write a C++/Java program to implement topological sorting on graph using object
oriented programming features Design necessary class. .( Use of graph)
*/
#include <bits/stdc++.h>
#include <iostream>
#define MAX 50
typedef long long ll;
us... | ALGO | 0.999956 | 5.615225 |
bce82ae9-c424-448a-af00-0120334a3c77 | skumailraza/Tess4OCR | tess-two/jni/com_googlecode_tesseract_android/src/ccutil/indexmapbidi.cpp | #include "indexmapbidi.h"
namespace tesseract {
// SparseToCompact takes a sparse index to an index in the compact space.
// Uses a binary search to find the result. For faster speed use
// IndexMapBiDi, but that takes more memory.
int IndexMap::SparseToCompact(int sparse_index) const {
int result = compact_map_.bi... | ALGO | 0.860833 | 7.79805 |
dd79c724-41f6-4117-bb54-800a62b03056 | xuda25/C-study | leetcode/143.重排链表.cpp | /*
* @lc app=leetcode.cn id=143 lang=cpp
*
* [143] 重排链表
*/
// @lc code=start
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : ... | ALGO | 0.999983 | 5.911563 |
e2c54958-890e-443f-af93-058c3dfd3613 | usc-clmc/qp_oases | interfaces/octave/qpOASES_sequence.cpp | /**
* \file interfaces/matlab/qpOASES_sequence.cpp
* \author Hans Joachim Ferreau, Aude Perrin
* \version 3.0beta
* \date 2007-2012
*
* Interface for Matlab(R) that enables to call qpOASES as a MEX function
* (variant for QPs with fixed matrices).
*
*/
#include <qpOASES/SQProblem.hpp>
using namespace qpOASE... | ALGO | 0.898943 | 5.822712 |
2aa54055-226b-40d9-b2dd-910c528a4e7f | ahmadesh/Udacity-CarND-Term2-Model-predictive-Control | src/Eigen-3.3/bench/sparse_randomsetter.cpp |
#define NOGMM
#define NOMTL
#include <map>
#include <ext/hash_map>
#include <google/dense_hash_map>
#include <google/sparse_hash_map>
#ifndef SIZE
#define SIZE 10000
#endif
#ifndef DENSITY
#define DENSITY 0.01
#endif
#ifndef REPEAT
#define REPEAT 1
#endif
#include "BenchSparseUtil.h"
#ifndef MINDENSITY
#define M... | TOOL | 0.870387 | 4.515939 |
14a5b853-1fb3-42f6-9ee7-b62e55049c10 | MustafaAhsanKhan/FAST-NUCES | Fall 2023/Programming Fundamentals/Assignments/Assignment 3/23i-0549_Q4.cpp | #include <iostream>
#include <string>
#include <unistd.h>
using namespace std;
// Mustafa Ahsan Khan 23I-0549 Assignment 3
int main()
{
string str, find_word, replace_word, word, extra;
char x;
word = "";
str = "x";
while(str != "")
{
string words_array[500];
cout << "Enter your... | TOOL | 0.994099 | 3.539311 |
090a9870-812d-4330-900c-0cd178e7022f | Biank23/Competitive-Programming | Codeforces/Beta Round 2/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(x) begin(x), end(x)
#define fst first
#define snd second
const int INF = 1e9;
const int MAX_N = 1001;
int n;
int grid[MAX_N][MAX_N];
int dp[MAX_N][MAX_N];
pair<int, string> solve(auto val) {
for (int i = 0; i <= n; i++) {
dp[0][i] = dp[i][0] = I... | ALGO | 0.999983 | 4.941584 |
44f805bb-8ec9-4679-9966-18058859f8af | the-t3ch-wizard/Dsa-Practice | LeetCode/921. Minimum Add to Make Parentheses Valid.cpp | class Solution {
public:
int minAddToMakeValid(string s) {
stack<char> stk;
for (auto i: s){
if (i=='(') stk.push(i);
else {
if (stk.empty()) stk.push(i);
else if (stk.top()=='(') stk.pop();
else stk.push(i);
... | ALGO | 0.999617 | 6.147647 |
da4d9ec7-d677-4500-9ff2-31076b4191b9 | gidlbn/dlbn_02 | src/libs/3rdparty/botan/src/engine/gnump/gmp_nr.cpp | #include <botan/eng_gmp.h>
#include <botan/gmp_wrap.h>
#include <gmp.h>
namespace Botan {
#if defined(BOTAN_HAS_NYBERG_RUEPPEL)
namespace {
/*
* GMP NR Operation
*/
class GMP_NR_Op : public NR_Operation
{
public:
SecureVector<byte> verify(const byte[], u32bit) const;
SecureVector<byte> sign(const ... | TOOL | 0.870472 | 7.415147 |
7dc5e29d-74ab-4687-9007-ada0544abeff | Esheta10/LeetCode-Solutions | 2645-pass-the-pillow/2645-pass-the-pillow.cpp | class Solution {
public:
int passThePillow(int n, int time) {
//Approach-1(Simulations)
//T.C. = O(time)
//S.C. = O(1)
/*
int idx = 1;
int dir = 1;
while(time > 0)
{
if(idx+dir >= 1 && idx+dir <= n)
{
idx += dir;... | ALGO | 0.999993 | 6.306459 |
da0726b8-494f-4b72-a6ef-609272d8a3e0 | ishandutta2007/codeforces | maspy/normal/1615/F.cpp | #line 2 "/home/maspy/library/my_template.hpp"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ll8 = __int128;
using ld = long double;
using pi = pair<ll, ll>;
using vi = vector<ll>;
template <class T> using vc = vector<T>;
template <class T> using vvc = vector<vc<T>>;
template <class T> usin... | ALGO | 0.999977 | 4.965423 |
31e6aa9e-b313-40d6-b80e-229a6e08d87e | papagiannakis/CPP-PP-Edu | Resources/Code/Programming-code/Chapter08/chapter.8.5.3.cpp |
//
// This is example code from Chapter 8.5.3 "Call by value" of
// "Programming -- Principles and Practice Using C++" by Bjarne Stroustrup
//
#include "std_lib_facilities.h"
//------------------------------------------------------------------------------
// call-by-value (give the function a copy of the value pass... | ALGO | 0.981631 | 6.367766 |
6344fbfc-e536-4bff-b22d-1d81262f9641 | meat124/BAEKJOON_My_Solution | Silver_3/백준_1213_팰린드롬만들기.cpp | #include<iostream>
#include<string>
#include<deque>
using namespace std;
string name;
int char_cnt[30]; // 알파벳 나온 횟수
deque<char> palindrome;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
cin >> name;
for (int i = 0;i < name.length();i++)
char_cnt[name[i] - 'A']++;
int odd_cnt ... | ALGO | 0.999982 | 3.174856 |
c679562c-bd33-40ec-b685-8c559a02a954 | PrajaktaKeer/Programming | A2OJ/Codeforces Div 2 A/devu_the_singer_and_chiru_the_joker.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
int n, d, x, sum = 0, temp;
cin>>n>>d;
for(int i = 0; i < n; i++) {
cin>>x;
sum += x;
}
temp = sum;
sum = sum + ((n - 1) * 10);
//cout<<sum<<" "<<d<<" ";
if(sum > d)
cout<<-1;
else
cout<<(d - temp) / 5;
return 0;
} | ALGO | 0.999465 | 3.215115 |
c8a086dd-2844-44e5-bb4d-6822cc2c89f2 | Harsh-Upadhayay/DSA | Hores_Partition.cpp | #include <iostream>
using namespace std;
typedef int Data_type;
Data_type partition(Data_type *arr, Data_type l, Data_type r){
Data_type pivot = arr[l], i = l-1, j = r+1;
while(1){
do
i++;
while (arr[i] < pivot);
do
j--;
while (arr[j] > pivot);
... | ALGO | 0.999964 | 4.507247 |
aca1808c-e343-4414-bb99-a33470394c30 | ishandutta2007/codeforces | maspy/normal/1551/E.cpp | #line 1 "main.cpp"
#include <bits/stdc++.h>
#line 3 "/home/maspy/library/my_template.hpp"
using namespace std;
using ll = long long;
using ld = long double;
#define int ll
using pi = pair<int, int>;
using vi = vector<int>;
#define FOR(i, n) for (int i = 0; (i) < (int)(n); ++(i))
#define FOR3(i, m, n) for (int i = (m... | ALGO | 0.999857 | 5.241917 |
67df6d06-6660-405b-8af5-8191424c7851 | raincross7/code-similarity | codes/train_code/problem042/problem042_138.cpp | #include "bits/stdc++.h"
#define rep(i,n) for (int i=0; i<(n); ++i)
using namespace std;
using ll =long long;
using P =pair<int,int>;
int main(){
int n;
int m;
cin >> n >> m;
int ans=0;
vector <vector <int>> h(n);
int a,b;
rep(i,m){
cin >> a >> b;
--a;
--b;
h... | ALGO | 0.999861 | 3.71287 |
3e5c017f-7b42-48eb-aeb2-0a3eca8fffbf | akhil2510/competitive-programming | CodeForce/B 230.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
long long n,a,b,j;
cin>>n;
for(int i=0;i<n;i++)
{
cin>>a;
b= sqrt(a);
for( j=2;j*j<b;j++)
if(a%j==0)break;
if(j*j>b && b*b==a && a>1)cout<<"YES"<<endl;
else cout<<"NO"<<... | ALGO | 0.999787 | 4.064253 |
ddfdb366-d9b7-49d9-bb37-062c06a0e5f3 | 1m188/algorithm | 牛客网/HJ8 合并表记录.cpp | /*
描述
数据表记录包含表索引index和数值value(int范围的正整数),请对表索引相同的记录进行合并,即将相同索引的数值进行求和运算,输出按照index值升序进行输出。
提示:
0 <= index <= 11111111
1 <= value <= 100000
输入描述:
先输入键值对的个数n(1 <= n <= 500)
接下来n行每行输入成对的index和value值,以空格隔开
输出描述:
输出合并后的键值对(多行)
示例1
输入:
4
0 1
0 2
1 2
3 4
复制
输出:
0 3
1 2
3 4
复制
示例2
输入:
3
0 1
0 2
8 9
复制
输出:
0 3
8 9
*/
#inclu... | ALGO | 0.99982 | 5.777905 |
5a834e1b-e252-437f-91f1-539a44fc7bbf | ArminSmajlagic/Data-Structures-And-Algorithms | project/algorithms/Sorting Algorithms/merge_sort/code/code.cpp | //MERGE SORT
#include<iostream>
using namespace std;
void mergesort(int a[], int start, int mid, int end)
{
int i = start, j = mid + 1, k = 0, b[50];
while (i <= mid && j <= end)
{
if (a[i] < a[j])
b[k++] = a[i++];
else
b[k++] = a[j++];
}
while (i <= mid)
b[k++] = a[i++];
while (j <= end)
b[k++] =... | ALGO | 0.999903 | 3.810844 |
6d92a5b9-694d-4724-aa7f-8cdc5c8955f7 | mongodb/mongo | src/mongo/db/query/compiler/rewrites/boolean_simplification/quine_mccluskey_bm.cpp | #include "mongo/db/query/compiler/rewrites/boolean_simplification/quine_mccluskey.h"
#include "mongo/db/query/compiler/rewrites/boolean_simplification/bitset_algebra.h"
#include "mongo/db/query/compiler/rewrites/boolean_simplification/petrick.h"
#include <cstddef>
#include <memory>
#include <vector>
#include <benchm... | ALGO | 0.999114 | 6.382174 |
6a0b677d-8c0c-4885-8268-82fb778f3cc4 | immrit/mrit_managment | 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.998859 | 6.785645 |
0ecaeae6-3230-4d2f-b580-ceef1ec774f5 | pedrobiqua/Estudos_CPlusPlus | HashTable/HashTable.cpp | // HashTable.cpp : Este arquivo contém a função 'main'. A execução do programa começa e termina ali.
//
#include <iostream>
#include "Hash.h"
int main()
{
const int TAM = 31;
int opcao, valor, retorno, tabela[TAM];
Hash::inicializarTabela(tabela, TAM);
do
{
std::cout << "\n\t0 -Sair\n\t1 ... | ALGO | 0.987718 | 4.591456 |
cddeb23c-d312-4a57-9250-743f816c688e | NiHe99/opencv | modules/calib3d/src/polynom_solver.cpp | #include "precomp.hpp"
#include "polynom_solver.h"
#include <math.h>
#include <iostream>
int solve_deg2(double a, double b, double c, double & x1, double & x2)
{
double delta = b * b - 4 * a * c;
if (delta < 0) return 0;
double inv_2a = 0.5 / a;
if (delta == 0) {
x1 = -b * inv_2a;
x2 = x1;
retu... | ALGO | 0.999807 | 5.055465 |
d4b351a7-7ca6-4943-bca5-fc27e1316adf | Leefir/MyCodes | Codeforces/CF231E.cpp | #include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#define rep(i,a,b) for(int i=a,i##_END_=b;i<i##_END_;++i)
typedef std::vector<int> vi;
typedef std::pair<int,int> pii;
typedef std::vector<pii> vpii;
#define sz(x) ((int)(x).size())
#define pb push_back
#define fi first
#define se second
const... | ALGO | 0.99993 | 4.087642 |
baa3e185-1b8d-4771-9216-d2a4ee93c9fa | MaSteve/UVA-problems | UVA00343.cpp | #include <iostream>
using namespace std;
int value(char c) {
int val = c - 'A';
if (val < 0) return c - '0';
return val + 10;
}
long long eval(string & s, int base) {
long long ret = 0, pot = 1;
for (int i = s.length()-1; i >= 0; i--) {
ret += value(s[i]) * pot;
pot *= base;
}
... | ALGO | 0.999468 | 4.51761 |
8284a379-ccd6-4ed3-b06d-e90bcf8e971f | ishandutta2007/codeforces | enem/normal/1483/B.cpp | #include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define M1 1000000007
#define M2 998244353
#define ll long long
#define ld long double
#define pll pair<ll,ll>
#define REP(i,a,b) for(ll i=a;i<b;i++)
#define REPI(i,a,b... | ALGO | 0.999931 | 3.531517 |
b1f60c00-dc0e-40c3-b80a-71d79fc0c6cb | yarncha/algorithm-solutions | baekjoon/6064.cpp | /*
모든 경우의 수를 다 해보기에는 시간이너무 오래 걸림
x값을 고정하고, y값에 대해서만 해 보면 O(n)의 시간이 걸림
*/
#include <iostream>
using namespace std;
void Solution6064() {
ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
int num_testcase;
cin >> num_testcase;
for (int i = 0; i < num_testcase; i++)
{
int result = 0;
int M, N, x, y; // ... | ALGO | 0.999884 | 3.772785 |
effc3265-6c12-4acc-bbc8-4c297a1fe52f | Git4pranay/Pranay-s_LeetCode | 0012-integer-to-roman/0012-integer-to-roman.cpp | class Solution {
public:
string intToRoman(int num) {
string ones[] = {"","I","II","III","IV","V","VI","VII","VIII","IX"};
string tens[] = {"","X","XX","XXX","XL","L","LX","LXX","LXXX","XC"};
string hrns[] = {"","C","CC","CCC","CD","D","DC","DCC","DCCC","CM"};
string ths[]={"","M","M... | ALGO | 0.99748 | 6.308283 |
93a40dc9-5804-4d86-8bb4-199c1abcc257 | SivaReddy989/OT | toonz/sources/tnztools/toonzrasterbrushtool.cpp |
#include "toonzrasterbrushtool.h"
// TnzTools includes
#include "tools/toolhandle.h"
#include "tools/toolutils.h"
#include "tools/tooloptions.h"
#include "tools/replicator.h"
// TnzQt includes
#include "toonzqt/dvdialog.h"
#include "toonzqt/imageutils.h"
// TnzLib includes
#include "toonz/tobjecthandle.h"
#include... | TOOL | 0.918478 | 5.280818 |
329ed492-b5a7-4afd-b247-18dcbb123e83 | Shrehan1234/TcsNqqt | Numbers/KdaneAlgo.cpp | #include <iostream>
#include <sstream>
#include <vector>
#include <climits> // INT_MIN ke liye
using namespace std;
int MaxSubarray(vector<int>& arr) {
int maxSum = INT_MIN;
int currSum = 0;
for (int i = 0; i < arr.size(); i++) {
currSum += arr[i];
maxSum = max(currSum, maxSum);
... | ALGO | 0.999611 | 5.508569 |
0fb27a82-3813-4636-a385-bd00a878d81a | kenjinote/SortOrderGraph | Source.cpp | #pragma comment(linker,"\"/manifestdependency:type='win32' name='Microsoft.Windows.Common-Controls' version='<IP_ADDRESS>' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#pragma comment(lib, "gdiplus")
#include <windows.h>
#include <gdiplus.h>
#include <array>
#include <random>
#define M... | ALGO | 0.998098 | 4.734506 |
f8a75e2e-5167-48af-bb1f-d15c57580e13 | dhnesh12/codechef-solutions | 04-CodeChef-Hard/210--Maximum Distance.cpp | #include <bits/stdc++.h>
#define ll long long
#define ff first
#define ss second
#define pb push_back
using namespace std;
typedef pair<ll,ll> pii;
mt19937 gen(time(NULL));
ll inf=1e18;
double eps=0.000000001;
double pi=3.1415926;
const int maxn=2e5+10;
const int bsize=300;
int n,br,blp[maxn/bsize+10],brp[maxn/bsize+1... | ALGO | 0.999936 | 3.241389 |
bfe88c57-3cde-4c79-8cf4-d5f881ab0f7a | BhaveshPatil12/CPP-OOPS | Inheritance74.cpp | #include<iostream>
using namespace std;
class T4Tutorials_first
{
protected :
int i;
};
class T4Tutorials_second
{
protected :
int j;
};
class T4Tutorials_third : public T4Tutorials_first,public T4Tutorials_second
{
protected :
int n,r;
public :
int pat()
{
cout<<"Enter no of rows : ";
cin>>n;
for(... | ALGO | 0.950037 | 3.836124 |
9578656a-a75c-4177-b2da-e17185348305 | ans2568/codingtest | backjoon/10988.cpp | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
string str, reverse_str;
int main() {
cin >> str;
reverse_str = str;
reverse(reverse_str.begin(), reverse_str.end());
if (str == reverse_str)
cout << 1 << endl;
else
cout << 0 << endl;
return 0;
} | ALGO | 0.999989 | 4.74504 |
194e902c-b317-4e03-9140-e7bf246f182b | CesarinGood/OMICH | OMICH-2022/Stack/Artista/100.cpp | #include <bits/stdc++.h>
using namespace std;
#define fore(i, l, r) for (auto i = (l); i < (r); i++)
#ifdef LOCAL
#include "debug.h"
#else
#define debug(...)
#endif
struct Papel {
stack<int> pila;
int color() {
// Cual es el color que se ve desde arriba
return pila.size() ? pila.top() : -1;
}
void ... | ALGO | 0.9989 | 4.717574 |
4f26b73c-0f70-4252-b568-9d44dda94450 | ShivamSharma19Ai/Coding-Questions | tcs/coutnbinarysubstrings.cpp | class Solution {
public:
int countBinarySubstrings(string s) {
int ans=0;
int prevequals=0;
int currequals=1;
for(int i=0;i+1<s.length();i++){
if(s[i]==s[i+1]){
currequals++;
}
else{
ans+=min(prevequals,currequals);
... | ALGO | 0.999984 | 6.320483 |
4909fd0c-4d52-48aa-a8de-a6a5aaae890b | axelu/leetcode | cpp/00000-00499/loggerratelimiter.cpp |
// 359. Logger Rate Limiter
// https://leetcode.com/problems/logger-rate-limiter/
class Logger {
private:
unordered_map<string,int> um;
public:
/** Initialize your data structure here. */
Logger() {
}
/** Returns true if the message should be printed in the given timestamp, otherwise returns fal... | ALGO | 0.970864 | 6.908327 |
9538e53b-9b6a-4739-bb73-6fe1d882d9cf | Hush-Engine/hush-llvm | libc/src/math/nvptx/remquo.cpp | #include "src/math/remquo.h"
#include "src/__support/common.h"
#include "declarations.h"
#include "src/__support/macros/config.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(double, remquo, (double x, double y, int *quo)) {
return __nv_remquo(x, y, quo);
}
} // namespace LIBC_NAMESPACE_DECL
| TOOL | 0.96365 | 6.196097 |
977b3856-c0db-45a6-ae7a-cdd735a378aa | ssb001111/PS | Baekjoon/DP1/1890.cpp | #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;
vector< vector<long long> > res;
vector< vector<int> > arr;
vector<long long> v;
vector<int> a;
int main() {
cin.tie(NULL);
ios_base::sync_with_stdio(false);
int n;
cin >> n;
for (int i = 0; i < ... | ALGO | 0.999976 | 3.604097 |
4fdb5824-07e3-4b0a-8f7e-693cbe660587 | PabloTabilo/MathProblems-daily | CF/TLE_Eliminators/TLE_Level1/M5-MathForCpBeginner/1984B.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int,int>;
void printDouble(double d){
// fix precision, the fixed is for evit rounding
// rounding can be different for each compiler
cout << fixed << setprecision(11) << d << '\n';
}
int main(){
... | ALGO | 0.999679 | 4.994102 |
5dceec30-d1a9-4ef4-baaa-0441cc3575f2 | Omar-Sharif/Competitive-Programming | ALGORITHM_CODE/Strongly Connected Component/wising_snake try_Valo.cpp | #include<bits/stdc++.h>
using namespace std;
#define mx 1010
vector<int>edges[mx],Redges[mx],components[mx],finaledges[mx],num;
stack<int>st;
bool vis[mx],finalvis[mx],unused[mx];
map<int,int>my;
int dfs1(int x)
{
vis[x]=1;
int a=edges[x].size();
for(int i=0;i<a;i++){
int v=edges[x][i];
i... | ALGO | 0.99996 | 4.297407 |
5926d00c-0083-4595-bb31-7a2c3e1cbf9e | PunnyOz2/POSN-Programming | POSN 2_1/Day 5/LR_Tree.cpp | /*
TASK:
LANG: CPP
AUTHOR: PeaTT~
SCHOOL: CRU
*/
#include<bits/stdc++.h>
using namespace std;
long long dp[140][140];
long long play(int i,int j){
int ii,jj;
if(i==0 && j==0) return dp[i][j]=1;
if(dp[i][j]!=0)return dp[i][j];
if(i>0){
dp[i][j]+=play(i-1,j);
dp[i][j]%=9999... | ALGO | 0.999822 | 4.905256 |
3d73eacb-7863-4816-b82b-1d44cc3d75df | muskan300600/DSA | Queue/9.reverse_first_k.cpp | #include<iostream>
#include<algorithm>
#include<queue>
#include<stack>
using namespace std;
int main(){
queue<int> q;
q.push(1);
q.push(2);
q.push(1);
q.push(2);
q.push(3);
q.push(4);
q.push(5);
q.push(1);
int k;
cin>>k;
queue<int> q1;
stack<int> s;
for(int i=0;i... | ALGO | 0.99996 | 3.183201 |
052ca611-4acf-4fa0-a77f-32f693fbf832 | thecsapprentice/SBSS_Public | src/lib/EngineFrontend/CLElib_Single_Point_Constraints.cpp | //#####################################################################
// Function Add_Single_Point_Constraint
//#####################################################################
int CLElib::
Add_Single_Point_Constraint(const int triangle_id, const std::array<float,3>& uv){
#ifndef ENABLE_LOG_MESSAGES
LOG::SCO... | ALGO | 0.971872 | 3.667056 |
f27d162f-cabd-4186-9904-240efb31510a | TIAN-2001/leetcode | 103. Binary Tree Zigzag Level Order Traversal.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.999993 | 6.09603 |
be09d939-aff9-4d1e-b876-a19481bc5125 | NlNJ4/CEDT-Comprog | 06/partylist.cpp | #include "bits/stdc++.h"
using namespace std;
int main(){
vector<pair<string,float>> vote;
string str;
float vt,party=0,percentage;
int sum = 0;
while(cin >> str){
if(str=="END") break;
cin >> vt;
vote.push_back({str,vt});
sum+=vt;
}
vector<pair<double,pair<... | ALGO | 0.998679 | 4.061145 |
05b9a421-7492-4e0e-9eb7-99a65c817216 | amrutakadam174/Design-Analysis-and-Algorithms | A2.cpp | /*Implement a problem of move all zeroes to end of array.
Statement: Given an array of random numbers, Push all the zero’s
of a given array to the end of the array. For example, if the given
arrays is {1, 9, 8, 4, 0, 0, 2, 7, 0, 6, 0}, it should be changed to {1,
9, 8, 4, 2, 7, 6, 0, 0, 0, 0}. The order of all other... | ALGO | 0.999867 | 3.930453 |
d057188c-1c80-4e32-9f0c-b31d95b2f4c8 | Nayem73/Problem_Solving | CodeForces/cutRibbon.cpp | //BISMILLAHIR-RAHMANIR-RAHIM//
#include <bits/stdc++.h>
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > rje & operator <<
#define eni(x) sim > typename \
enable_if<sizeof dud<c>(0) x 1, rje&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j)... | ALGO | 0.999872 | 3.783065 |
0c681419-7e38-4b5e-ad37-e0486d74267d | InFluX-M/Solving-Problem | Kattis/GrassSeedInc.cpp | #include <bits/stdc++.h>
using namespace std;
typedef string str;
typedef long long ll;
typedef double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
const ll mod = 1e9 + 7;
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("a... | ALGO | 0.999864 | 4.357138 |
3d1453b7-a5bc-45ad-9eee-865d83f0832b | praveenchiliveri6/Advent-Of-Code-2024 | Day6/part2.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
ll n,m,i,j,row,col;
vector<vector<ll>> dir{{-1,0},{0,1},{1,0},{0,-1}};
vector<string> matrix;
string input;
vector<vector<bool>> visitedCells;
string convertToString(vector<ll> arr){
string result;
for(auto num:arr)
result+=to_string(n... | ALGO | 0.9999 | 5.151235 |
59ae3855-c9b3-4410-8dd7-69982be158be | aridspace10/data-structures | C++/hash-table.cpp | #include <iostream>
#include "dynamic-array.cpp"
template <typename T>
class HashTable {
private:
int size;
DynamicArray<T> arr;
public:
int getSize() {
return size;
}
int insert() {
;
}
};
int main() {
return 0;
} | ALGO | 0.874572 | 3.688725 |
d0d51f7d-ab85-4931-b8a0-5ce095e0f824 | facebook/watchman | watchman/cppclient/WatchmanClient.cpp | #include "WatchmanClient.h"
#include <fmt/core.h>
#include <glog/logging.h>
#include <utility>
namespace watchman {
using namespace folly;
WatchmanClient::~WatchmanClient() {
// We need to explicitly close the connection so in the case that it outlives
// us it doesn't accidentally call our callback.
conn_->... | TOOL | 0.87764 | 7.886678 |
7a1d22b1-655a-4b9e-8809-82d8b01f2c22 | Xenawn/Algorithm | BOJ_Cpp/2193.cpp | #include <bits/stdc++.h>
using namespace std;
long long d[92];
int main() {
int n;
cin >> n;
d[1] = 1;
d[2] = 1;
for (int i = 3; i <= n; i++) {
d[i] = d[i - 1] + d[i-2];
}
cout << d[n];
} | ALGO | 0.999967 | 4.170569 |
1c94377e-887f-4a14-ba4c-a7eab8458508 | prat-glitch/CP | B_Normal_Problem.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
string a;
cin >> a;
string b = a;
reverse(b.begin(), b.end());
for (char &ch : b)
{
if (ch == 'q')
ch = 'p';
else if (ch == ... | ALGO | 0.999882 | 4.497345 |
6ac8a064-3bc0-4652-8c5e-dce2642b9cb2 | ishandutta2007/codeforces | dragoon/normal/46/B.cpp | #pragma warning(disable:4786)
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<functional>
#include<string>
#include<cstring>
#include<cstdlib>
#include<queue>
#include<utility>
#include<fstream>
#include<sstream>
#include<math.h>
#include<stack>
using namesp... | ALGO | 0.999815 | 3.107571 |
4d47c429-5a07-44e4-8c6e-026bf2fc2598 | Jakub-Piotrowski/CPlusPlusRecursion | Lab Assignment #7/RecursionClass.cpp |
#include <iostream>
#include <string>
#include <algorithm>
int RecursionClass::binToDec(std::string bin, int i)
{
int n = bin.length();
if (i == n - 1)
return bin[i] - '0';
else
return ((bin[i] - '0') << (n - i - 1)) + binToDec(bin, i + 1);
}
int RecursionClass::decToBin(int dec)
{
i... | ALGO | 0.995685 | 3.163395 |
5e77065f-0d79-45fd-82c1-40a488b33d62 | rmoncada21/Software_codeHub | Cpp_merge/Ejercicios/Clases/6_triangle.cpp | #include <iostream>
using namespace std;
class Triangle{
private:
int lado1;
int lado2;
int lado3;
public:
// Constructores
Triangle() { cout<<" Se creó la clase triangulo" << endl;};
Triangle(int lado1, int lado2, int lado3)
: lado1(lado1), la... | ALGO | 0.896055 | 4.919946 |
5b225258-8dd1-4b2c-ba0d-11fe6ed4f203 | fizioterapia/WDP_CPP_2021 | Lesson2/z1.cpp | /*
Napisać program pobierający od użytkownika boki prostopadłościanu (liczby całkowite) i zwracający jego pole podstawy, objętość, pole powierzchni bocznej i pole powierzchni całkowitej.
Program ma wykonywać możliwie mało obliczeń (jeśli to możliwe, to należy do obliczenia kolejnej wartości wykorzystać wartość ... | ALGO | 0.958594 | 3.97237 |
423b91ec-8754-4fa4-b7f0-290507704f80 | ishandutta2007/codeforces | pajaraja/normal/733/B.cpp | #include <iostream>
#include <stdio.h>
#include <math.h>
int l[100007],r[100007];
int main(int argc, char** argv)
{
int n,ind=0,lu=0,ru=0;
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
scanf("%d%d",&l[i],&r[i]);
lu+=l[i];
ru+=r[i];
}
int max=fabs(lu-ru);
for(int i=1;i<=n;i++)
{
lu=lu-l[i]+r[i];
r... | ALGO | 0.999985 | 3.622993 |
4489656f-fb3e-4a6b-9145-2c8e5ff1a13d | Miltonbhowmick/Interview-Questions | samsung r&d/number of palidrome path.cpp | #include<iostream>
#define MAX 10000
using namespace std;
int t,r,c,grid[MAX][MAX];
bool vis[MAX][MAX];
void NumPalin(int x,int y,int &cnt){
if(x==n-1&&y==n-1){
cnt++;
}
if(vis[x][y]==true)
return;
NumPalin(x+1,y,cnt);
NumPalin(x,y+1,cnt);
NumPalin(x-1,y,cnt);
NumPalin(x+1,... | ALGO | 0.999362 | 3.075514 |
acf7c5a2-ffe0-49ab-be33-93b6a0dc8c92 | KartikeyJadli/LEETCODE | 1502-can-make-arithmetic-progression-from-sequence/1502-can-make-arithmetic-progression-from-sequence.cpp | class Solution {
public:
bool canMakeArithmeticProgression(vector<int>& arr) {
sort(arr.begin(),arr.end());
int diff = arr[1] - arr[0];
for(int i=0;i<arr.size()-1;i++){
if(arr[i+1] - arr[i] != diff){
cout << arr[i+1] - arr[i] << " ";
return false;... | ALGO | 0.999731 | 5.241559 |
22917701-b2f4-444c-9e9c-da448e90e58f | abhiXsliet/Solved-DSA-Problems | Leetcode Daily Challenge/019-January-2025/003-number-of-ways-to-split-array.cpp | // https://leetcode.com/problems/number-of-ways-to-split-array/
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
// TC : O(N)
// SC : O(1)
int waysToSplitArray(vector<int>& nums) {
int n = nums.size();
long total = accumulate(begin(nums), end(nums), 0LL);
int ... | ALGO | 0.999937 | 5.733218 |
fd6b8e80-d66c-4364-9763-16e667c4c72b | makio93/competitive-othersites | LeetCode/Problems/DCC/2022/Jun/W3/D18/main0.cpp | // 自力AC
#include <bits/stdc++.h>
using namespace std;
class WordFilter {
unordered_map<string, int> dict;
public:
WordFilter(vector<string>& words) {
int n = words.size();
for (int i=0; i<n; ++i) {
int len = words[i].length();
for (int l=0; l<len; ++l) for (int r=len-1;... | ALGO | 0.999026 | 5.356036 |
8591d1b1-d9ad-4440-9603-41dcff20e3ff | StoicGang/Problem_Solving | 8/arithmatic_progression.cpp | #include <iostream>
using namespace std;
int AriP(int start, int n, int d)
{
int term = 0;
// formula ==> a + (n-1)d
term = start + ((n - 1) * d);
return term;
}
int main()
{
int start{0};
int n{0};
int d{0};
cout << "Enter the start value: ";
cin >> start;
cout << "Enter the v... | ALGO | 0.998426 | 3.734246 |
e4e6c289-a167-4079-a9a2-613d61eb40ff | alanzhou/MPDec | MPDec/MPDec.cpp | // MPDec.cpp : Demo of message passing algorithm
//
// Note
// rxLLR: ln(p(rx|0) / p(rx|1))
//
// Author: Alan Bao Jian ZHOU
// Email: <EMAIL>
// Created: 20140722
// Last-modified: 20140727
#include "stdafx.h"
#include "MPDecoder.h"
int _tmain(int argc, _TCHAR* argv[])
{
// Start
printf("----Message Passing Decod... | ALGO | 0.99941 | 3.783744 |
832bafcb-56a2-4614-a193-3f0cad1e8feb | metux/thunderbird-2 | media/webrtc/signaling/gtest/mediaconduit_unittests.cpp | #include <iostream>
#include <string>
#include <fstream>
#include <vector>
#include <math.h>
using namespace std;
#include <MediaConduitInterface.h>
#include <VideoConduit.h>
#include "mozilla/UniquePtr.h"
#include "mozilla/Unused.h"
#include "mtransport_test_utils.h"
#include "nss.h"
#include "runnable_utils.h"
#inc... | TEST | 0.853662 | 4.361666 |
85154478-a884-4dd2-b585-f94b43541062 | httpvieve/coding-dump | cpp/sum.cpp | #include <iostream>
#include <string>
using namespace std;
int main(){
int num, total = 0;
do {
cin >> num;
total += num;
} while (num > 0);
cout << "sum: " << total;
// casting -> (data_type)variable >> i.e : int points, div = (double)points / 2; ... | ALGO | 0.984663 | 3.0925 |
35599bfc-612c-4e45-b7aa-3ce30a1228c5 | robotronik/Sauron | source/mapping.cpp | /*
Fichier source contenant les fonctions de mapping 3D (SLAM) de l'application à l'aide de la librairie OpenCV et de la librairie SFM de OpenCV contrib.
Tout cela en utilisant des tags ArUco pour la détection et la triangulation des points.
*/
#include "mapping.hpp"
#include <string>
#include <iostream>
#include... | TOOL | 0.993093 | 4.088777 |
77397e86-db2b-4155-9875-5dd826dfad9f | ShengfaZhu/algorithm | reOrderArray.cpp | #include <iostream>
#include <stack>
#include <vector>
#include <queue>
using namespace std;
// reorder array to make all odd numbers is before even numbers
// and the order of odd numbers and even number doesn't chager.
// erase the even number and push back it into array
void reOrderArray(vector<int> &array){
vect... | ALGO | 0.999746 | 4.759811 |
4e214afc-fe43-4804-8043-4324de833604 | Lydxn/Competitive-Programming | Codeforces/1553/C.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> plli;
typedef pair<int, ll> pill;
typedef pair<pa... | ALGO | 0.999938 | 4.823702 |
88fcf166-1297-443a-be1e-e644b8f15359 | Robertyaya/LeetCode | 88.merge-sorted-array.cpp | /*
* @lc app=leetcode id=88 lang=cpp
*
* [88] Merge Sorted Array
*/
// @lc code=start
class Solution
{
/**
* Time: O(N+M), Space: O(1)
* 解題流程: 從後面過來
*/
public:
void merge(vector<int> &nums1, int m, vector<int> &nums2, int n)
{
// 故意在前面塞一個INT_MIN, 這樣在two pointer比較時才不會越界
nu... | ALGO | 0.999936 | 6.082601 |
1ecd2a10-1613-4287-b8e8-0fa63c68c2f3 | catoraa/pipioj-exercise | 1036.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
stack<int> s;
int a[100010]={0};
char b[100010]={0};
int len;
while(scanf("%s",b)!=EOF){
len=strlen(b);
for(int i=0;i<len;i++){
if(s.empty()){
s.push(i);
continue;
}
if(b[s.top()]=='('&&b[i]==')'){
a[s.top()]=i;
s.pop();
}
... | ALGO | 0.996341 | 3.064877 |
d21de617-19ae-42af-b39f-81cf11c21fd1 | purple-jwl/atcoder | src/ABC/131/E.cpp | #include <bits/stdc++.h>
#define REP(i, x, n) for (int i = x; i < (int)(n); i++)
#define rep(i, n) REP (i, 0, n)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x.size())
#define popcount(x) __builtin_popcount(x)
#define popcountll(x) __builtin_popcountll(x)
#define u... | ALGO | 0.999444 | 4.5628 |
c6b3ed1c-abe5-4321-9b4f-f39396380a8f | TheNurshed37/DATA_STRUCTURE_LAB | LT2(HW)(22-46702-1)/LT2A.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int a[10] = {1,2,3,5,6,3,2,3,1,10};
int n,coun=0;
cout<<"Enter A Number"<<"\n";
cin>>n;
for(int i = 0; i<10; i++){
if(n == a[i])
coun++;
}
cout<<coun;
} | ALGO | 0.999603 | 3.645266 |
b66fcff4-3b64-48b3-81a5-6b8b299e15ad | gecakou/hello-algo | codes/cpp/chapter_heap/heap.cpp | /**
* File: heap.cpp
* Created Time: 2023-01-19
* Author: LoneRanger(<EMAIL>)
*/
#include "../utils/common.hpp"
void testPush(priority_queue<int> &heap, int val) {
heap.push(val); // 元素入堆
cout << "\n元素 " << val << " 入堆后" << endl;
printHeap(heap);
}
void testPop(priority_queue<int> &heap) {
int va... | ALGO | 0.991251 | 4.766076 |
acc31a5f-a132-4e40-bc7a-cc93a94e51b2 | barak/opencv | modules/stitching/exposure_compensate.cpp | #include "exposure_compensate.hpp"
#include "util.hpp"
using namespace std;
using namespace cv;
using namespace cv::gpu;
Ptr<ExposureCompensator> ExposureCompensator::createDefault(int type)
{
if (type == NO)
return new NoExposureCompensator();
if (type == GAIN)
return new GainCompensator();
... | ALGO | 0.957367 | 4.741639 |
af3f25ee-499d-49e3-8358-0b3184020006 | jaredramey/AutomationTest_Playground | Engine/Source/ThirdParty/CryptoPP/5.6.2/include/vmac.cpp | // vmac.cpp - written and placed in the public domain by Wei Dai
// based on Ted Krovetz's public domain vmac.c and draft-krovetz-vmac-01.txt
#include "pch.h"
#include "vmac.h"
#include "argnames.h"
#include "cpu.h"
NAMESPACE_BEGIN(CryptoPP)
#if defined(_MSC_VER) && !CRYPTOPP_BOOL_SLOW_WORD64
#include <intrin.h>
#en... | ALGO | 0.964999 | 6.08424 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.