uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
d38ca3fb-cd2b-40c9-a3f0-e98486a34851 | zbqq/neus2 | dependencies/eigen/unsupported/doc/examples/MatrixPower.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
const double pi = std::acos(-1.0);
Matrix3d A;
A << cos(1), -sin(1), 0,
sin(1), cos(1), 0,
0 , 0 , 1;
std::cout << "The matrix A is:\n" << A << "\n\n"
"The matrix power A^(pi/4) is:\n"... | ALGO | 0.999841 | 3.790203 |
36a10f54-89a7-434b-b72c-b92c6a601157 | ANANDMOHIT209/Leetcode | 1547-minimum-cost-to-cut-a-stick/1547-minimum-cost-to-cut-a-stick.cpp | class Solution {
public:
int f(int i,int j,vector<int>& cuts,vector<vector<int>>&dp){
if(i>j) return 0;
int mini=INT_MAX;
if(dp[i][j]!=-1) return dp[i][j];
for(int ind=i;ind<=j;ind++){
int cost=cuts[j+1]-cuts[i-1] + f(i,ind-1,cuts,dp)+f(ind+1,j,cuts,dp);
mini ... | ALGO | 0.999869 | 5.097373 |
f521c030-5881-4dae-8b01-2fa3a615b4a2 | AbbaszadeAbbas/Cpp_learning | C++ Lessons/Group_D/November(2022)/Number Theory(Advanced)/Greatest divisor.cpp | #include <bits/stdc++.h>
#define MAXIMUM 1000000
using namespace std;
int main() {
long long a;
cin>>a;
long long ans = a;
for(long long i = 2;i<MAXIMUM;i++){
if(a%i == 0){
ans = i;
break;
}
}
cout<<a/ans;
} | ALGO | 0.999703 | 3.110675 |
3037cf88-45bd-4e28-a1f5-015acf5ab11f | 04megumi/leetCode | 25_reverseKGroup.cpp | /**
* 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) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* reverseKGro... | ALGO | 0.999988 | 6.14048 |
0173a70f-b607-40e7-981c-fc110a416769 | kunal951990/cpp | TimeClassWithPlusOperatorOverload.cpp | #include<iostream>
using namespace std;
class Time
{
private:
int HR,MIN,SEC;
public:
void setTime(int,int,int);
void showTime();
void normalize();
Time operator +(Time t)
{
Time k;
k.HR=HR+t.HR;k.MIN=MIN+t.MIN;k.SEC=SEC+t.SEC;
return k;
}
};
void Time::setTime(int ... | TOOL | 0.972432 | 3.979816 |
cfb3907a-1ca7-4a72-9e56-8282c90c6e2e | Ahmad-Farhan/Parallel-and-Distributed-Computing | K-Shortest Paths/serial.cpp | #include <iostream>
#include <sstream>
#include <fstream>
#include <vector>
#include <queue>
#include <algorithm>
#include <stdlib.h>
#include <time.h>
#include <chrono>
using namespace std;
#define testfile "new-who-grf.txt"
#define inf 1e6
typedef vector<vector<pair<int, int>>> _graph; // Graph Structure
typedef ... | ALGO | 0.992735 | 4.464151 |
39fee45a-22d3-4fba-abf6-aafb67aedcbb | sakthi3119/assessment | 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.998733 | 6.76775 |
cddf1afa-99d6-4a87-bdfd-9a48da9885db | uniqss/leetcodecpp | 0136/136_SingleNumber1.cpp | #include "../inc.h"
class Solution {
public:
int singleNumber(vector<int>& nums) {
const int offset = 3 * 10000;
vector<int> dict(6 * 10000 + 1, 0);
for (size_t i = 0; i < nums.size(); i++) {
++dict[nums[i] + offset];
}
for (size_t i = 0; i < dict.size(); i++)... | ALGO | 0.999408 | 5.703606 |
e33ad247-efb5-44ab-8d99-81adc4c31fd9 | rabelhmd/LeetCode | 1041-robot-bounded-in-circle/1041-robot-bounded-in-circle.cpp | class Solution {
public:
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
int getMod(int d) {
d %= 4;
d += 4;
return d % 4;
}
string circle(string str) {
return str + str + str + str;
}
bool isRobotBounded(string ins) {
ins = c... | ALGO | 0.999926 | 5.704783 |
94ff49c1-b1f3-4199-9041-3cf61d198333 | phuong-dinhmai/Cpp | codeforce/416E.cpp | #include <bits/stdc++.h>
#define maxN 505
#define inf (int) (1e9+7)
using namespace std;
int n, m;
int matrix[maxN][maxN];
int c[maxN][maxN];
int f[maxN][maxN];
main(){
//freopen("in.inp","r",stdin);
cin >> n >> m;
for (int i = 1; i <= n; i++)
for (int j = 1; j <= n; j++)
{
matrix[i][j] = inf;
c[i][j] =... | ALGO | 0.999906 | 3.357684 |
78eecca0-7f3c-4e68-a467-2f2beca14a2d | NAgrawal1798/Competitive-coding | 3351-maximize-happiness-of-selected-children/maximize-happiness-of-selected-children.cpp | class Solution {
public:
long long maximumHappinessSum(vector<int>& h, int k) {
// every time i have to find the biggest element - this thought is keep
// pushing me towards to use the priority queue
// and i have to reduce the values again and again
// by 1
// as this is ... | ALGO | 0.999993 | 5.277542 |
87c9709a-57e5-4b4a-ad0d-b10955b9a459 | anipatil72/My_Competitive_Programming | 400.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
// function to check prime
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 ... | ALGO | 0.999785 | 4.191763 |
488bc563-cfff-49ea-87d8-a3af27212fc3 | 2NNS-V/Algorithm | 프로그래머스/1/67256. [카카오 인턴] 키패드 누르기/[카카오 인턴] 키패드 누르기.cpp | #include <string>
#include <vector>
#include <cstring>
#include <cmath>
#include <iostream>
using namespace std;
// 1, 4, 7 : L
// 3, 6, 9 : R
// 2, 5, 8, 0 : 가까운 쪽
string solution(vector<int> numbers, string hand) {
string answer = "";
vector<vector<int> > keypad;
keypad = {{3, 1}, {0, 0}, {0, 1}, ... | ALGO | 0.999923 | 5.395443 |
2d0ead19-0070-4f9f-a949-d8066ca64670 | avinash799/100days-codeforces-challenge | Duff and Meat.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<pair<int, int>> days(n);
for (int i = 0; i < n; i++) {
cin >> days[i].first >> days[i].second;
}
int totalCost = 0;
int minPrice = days[0].second;
for (int i = 0; i < n; i++) {
min... | ALGO | 0.999878 | 5.074816 |
4287eec8-f0a2-4092-8b1e-671b50e3ce3d | LeeChanHyuk/Algorithm | C++/0x0C_BackTracking/15651.cpp | #include <iostream>
#include <vector>
#include <list>
#include <stack>
#include <string>
#include <queue>
#include <string.h>
#include <algorithm>
using namespace std;
int arr[10];
int isused[10];
int n, m;
int cnt = 0;
void backtracking(int num)
{
if (num == m + 1 && cnt > 0)
{
for (int i = 1; i <= m; i++)
c... | ALGO | 0.999894 | 3.629868 |
37e1e21c-578e-4acd-a43c-ef1046898809 | Splasher1804/Godot_engine_3.4.4_for_ARM64_Windows | thirdparty/bullet/LinearMath/TaskScheduler/btThreadSupportWin32.cpp | #if defined(_WIN32) && BT_THREADSAFE
#include "LinearMath/btScalar.h"
#include "LinearMath/btMinMax.h"
#include "LinearMath/btAlignedObjectArray.h"
#include "LinearMath/btThreads.h"
#include "btThreadSupportInterface.h"
#include <windows.h>
#include <stdio.h>
struct btProcessorInfo
{
int numLogicalProcessors;
int n... | TOOL | 0.865933 | 5.867874 |
a50381f2-4342-421e-8964-902e505af6ed | gopaljha16/100Days-of-Dsa-Learning | Day 21/Array_With_Func.cpp | #include <iostream>
using namespace std;
void doubleNum(int *ptr)
{
for (int i = 0; i < 5; i++)
{
// p[i] == *(p+i) like this it will do their execution..
ptr[i] = 2 * ptr[i];
}
}
int main()
{
int arr[5] = {1, 2, 3, 4, 5};
doubleNum(arr); // we know that arr will assingn the addre... | ALGO | 0.999371 | 4.85261 |
314df63a-d3e0-47c7-96c2-3292a889a049 | threalwinky/cp_library | luyencode/gacho.cpp |
#include<iostream>
using namespace std;
int main(){
int sg, sc, tsc, tsch;
cin>>tsc>>tsch;
if (tsch & 1) cout<<-1;
else {
sg = (4*tsc - tsch)/2;
sc = tsc - sg;
if (sg < 0 || sc < 0) cout<<-1;
else
cout<<sg<<" "<<sc;
}
} | ALGO | 0.99977 | 3.954095 |
a8d75130-8001-455c-8b85-489f28214077 | ishandutta2007/codeforces | skywalkert/normal/235/D.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = (int)3e3 + 1;
int n, m, seq[maxn], idx[maxn], dep[maxn];
vector<int> e[maxn];
bool vis[maxn], ban[maxn];
bool pfs(int u) {
vis[u] = 1;
seq[m++] = u;
for(auto &v : e[u])
if(vis[v]) {
if(m > 1 && v == seq[m - 2])
continue;
for(int i = m - 3; i ... | ALGO | 0.998846 | 4.353911 |
5eac386b-8832-461d-80cf-81c53bf5c298 | gf234/baekjoon-code | 2156번 포도주 시식.cpp | #include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
int n;
int amount[10001];
// pos : ġ
// cnt :
int cache[10001][4];
int solve(int pos, int cnt) {
if (pos == n)
return 0;
int& ret = cache[pos][cnt];
if (ret != -1)
return ret;
// 2 Ű
if (cnt == 2)
ret = solve(pos +... | ALGO | 0.999878 | 3.81306 |
e951de60-2d39-4d81-ad90-b451b0c69b86 | mohsenzouari/Ingeniorat_PFE | sumo-main/src/dfrouter/dfrouter_main.cpp | /****************************************************************************/
/****************************************************************************/
/// @file dfrouter_main.cpp
/// @author Daniel Krajzewicz
/// @author Eric Nicolay
/// @author Jakob Erdmann
/// @author Sascha Krieg
/// @author Michael ... | TOOL | 0.898022 | 5.158689 |
2cd38e7e-d849-4ccf-bd1a-423d06a26fbc | acnokego/LeetCode | 530_Minimum_Absolute_Difference_in_BST/inorder.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
/*
* Complexity: O(n)
* Space: O(lg(n))
*/
class Solution {
public:
void dfs_inorder(TreeNode* root, int& prev, int& ... | ALGO | 0.999996 | 6.591836 |
dbbf202e-19f3-42d2-beae-264ba959a96e | ishandutta2007/codeforces | ddytxdy/normal/1327/E.cpp | #include<bits/stdc++.h>
using namespace std;
const int N=2e5+50,mod=998244353;
int n,pw[N];
int main(){
scanf("%d",&n);pw[0]=1;
for(int i=1;i<=n;i++)pw[i]=10ll*pw[i-1]%mod;
for(int i=1;i<=n;i++){
int x=max(n-i-1,0)*810ll%mod*pw[max(n-i-2,0)]%mod;
if(i!=n)x=(x+180ll*pw[n-i-1])%mod;
el... | ALGO | 0.999926 | 3.966784 |
4a58b33e-4e13-4426-ae14-de60017b795a | sb-baifeng-sb/boost | libs/math/src/tr1/assoc_legendref.cpp | extern "C" float BOOST_MATH_TR1_DECL boost_assoc_legendref BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned l, unsigned m, float x) BOOST_MATH_C99_THROW_SPEC
{
return (m&1 ? -1 : 1) * c_policies::legendre_p BOOST_PREVENT_MACRO_SUBSTITUTION(l, m, x);
}
| TOOL | 0.952202 | 4.12418 |
5be8fa5d-02f8-431b-80a6-6a0e2ce4dcd1 | Buttiyeeppp/Code | Codeforces/CF1879D.cpp | #include <bits/stdc++.h>
using namespace std;
#define clo 1000.*clock()/CLOCKS_PER_SEC
#ifndef xxzx
#define endl '\n'
#endif
using ll=long long;
using PII=pair<int,int>;
const int N=3e5+10;
const ll Mod=998244353;
bool mem1;
int n,a[N];
ll ans;
void calc(int x) {
// vector<int> p;
// for(int i=1;i<=n;i++) if(a[... | ALGO | 0.999977 | 4.431463 |
8bfb76bc-a0b2-49ce-8d00-10e34c0ac66f | Waterforces/Competitive-programming | POSN/SU_66_67/Camp2/ConsecSubseq.cpp | #include<bits/stdc++.h>
using namespace std;
int n,col,cou,old,_max,ans;
set<int> s;
map<int,int> mp;
int main() {
while(cin >> n) s.insert(n);
for(auto& i:s) {
if(old+1!=i) {
if(_max<cou) {
_max=cou;
ans=col;
}
cou=0;
col+... | ALGO | 0.999962 | 3.641206 |
be77ec61-19f8-4c76-95ed-1052dc4ccc2e | AmeyaWagh/CarND_MPC | src/Eigen-3.3/lapack/cholesky.cpp | #include "lapack_common.h"
#include <Eigen/Cholesky>
// POTRF computes the Cholesky factorization of a real symmetric positive definite matrix A.
EIGEN_LAPACK_FUNC(potrf,(char* uplo, int *n, RealScalar *pa, int *lda, int *info))
{
*info = 0;
if(UPLO(*uplo)==INVALID) *info = -1;
else if(*n<0) ... | ALGO | 0.998036 | 6.004565 |
944d743a-28b0-42ca-a0b9-7bd1e1e395b3 | greenfox-zerda-sparta/nmate91 | week_08/12-15/08/08/08.cpp | #include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;
string remove_x(string word, int digit) {
if (digit >= word.length()) {
return word;
}
if (word[digit] == 'x') {
word.erase(word.begin() + digit);
return remove_x(word, digit);
}
digit++;
return remove_x(word, digit... | ALGO | 0.995449 | 5.196115 |
2eb3b91d-383c-493a-9ac3-11a108b4219f | Tianyi-Tang/Poj_Algorithm_Practice | Mixed/solution/2301.cpp | #include <cstdlib>
#include <cstring>
#include <iostream>
using namespace std;
int main()
{
long long sum,different,a,b,n;
cin >> n;
for(int i =0;i < n;i++){
cin >> sum >> different;
if(sum < different || (sum + different)%2 != 0){
cout << "impossible" << endl;
continue;
}
a = (sum + different) /2... | ALGO | 0.999805 | 3.231956 |
fe86e3fb-3daa-4d19-8e82-b8fff9d112a5 | kkduncan/gpu_performance_eval | dependencies/libcudacxx/libcxx/test/std/containers/sequences/vector/vector.special/swap.pass.cpp | // <vector>
// template <class T, class Alloc>
// void swap(vector<T,Alloc>& x, vector<T,Alloc>& y);
#include <vector>
#include <iterator>
#include <cassert>
#include "test_macros.h"
#include "test_allocator.h"
#include "min_allocator.h"
#include "asan_testing.h"
int main(int, char**)
{
{
int a1[] = {1... | TEST | 0.85753 | 5.274514 |
4c8e23e1-c56d-4522-bd86-ea8fba1096ad | adeen08/cs112l_2021051 | lab 10/task1.cpp | #include<iostream>
using namespace std;
int main(){
int first,second,third;
char fourth,fifth;
cout<<"Enter the value for first variable: ";
cin>>first;
cout<<"Enter the value for third variable: ";
cin>>third;
cout<<"Enter the value for fourth variable: ";
cin>>fourth;
cout<<"E... | ALGO | 0.909172 | 3.061753 |
12c482a7-6f5c-43f8-86bc-ed20e84cec27 | apieum/netgen | libsrc/occ/occgenmesh.cpp | #ifdef OCCGEOMETRY
#include <mystdlib.h>
#include <occgeom.hpp>
#include <meshing.hpp>
namespace netgen
{
#include "occmeshsurf.hpp"
#define TCL_OK 0
#define TCL_ERROR 1
#define DIVIDEEDGESECTIONS 1000
#define IGNORECURVELENGTH 1e-4
#define VSMALL 1e-10
bool merge_solids = 1;
// can you please explain what ... | ALGO | 0.982302 | 4.170737 |
e135bef6-d7c8-4786-831d-3fd4013819c8 | coutinhoneto16/Introducao-a-Programacao | questoes&desafios/questoesVetores/2.cpp | /*Exercício 02
Faça um programa que leia N números inteiros e armazene-os em um vetor. Em seguida,
mostre na tela:
- Todos os números pares
- A quantidade de números pares*/
#include <iostream>
#include <cstdio>
using namespace std;
int main(){
int qtd, numero, qtdpares=0;
cin >> qtd;
int vetor[qtd];
... | ALGO | 0.998865 | 5.125967 |
8162cb2a-d7e3-4bd7-858f-89aeeb26ed6f | Wuuo0/SDU-data-structure-lab2021 | 大二数据结构实验/lab3.1.cpp | #include<iostream>
#include<sstream>
#include<string>
using std::cin;
using std::cout;
using std::string;
using std::endl;
//Result类也是线性表 用于储存结果
class Result
{
private:
int *data_;
int capacity_;
int size_;
public:
Result(int inicapa = 20) // 默认构造函数
{
capacity_ = inicapa;
data_... | ALGO | 0.990806 | 4.008648 |
479c094e-95e8-41af-8660-25a5965bed05 | aiaimimi0920/godot-tts | thirdparty/SummerTTS/eigen-3.4.0/unsupported/doc/examples/MatrixSquareRoot.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
const double pi = std::acos(-1.0);
MatrixXd A(2,2);
A << cos(pi/3), -sin(pi/3),
sin(pi/3), cos(pi/3);
std::cout << "The matrix A is:\n" << A << "\n\n";
std::cout << "The matrix square root of A is:... | ALGO | 0.999497 | 3.930508 |
e2fb7496-1cc0-4e27-b7bc-81db84366b52 | Channingss/paddle2lite | mobile/src/operators/kernel/arm/sum_kernel.cpp | #ifdef SUM_OP
#include "operators/kernel/sum_kernel.h"
#include "operators/kernel/central-arm-func/sum_arm_func.h"
namespace paddle_mobile {
namespace operators {
template <>
bool SumKernel<CPU, float>::Init(SumParam<CPU> *param) {
return true;
}
template <>
void SumKernel<CPU, float>::Compute(const SumParam<CPU>... | TOOL | 0.988244 | 7.101502 |
4caadc7b-04e3-418a-b012-e055305551dd | hit7sh/CodeForces | Round 702 div 3/D.cpp | int d = 0;
void fx(vi& A, int l, int r, int i) {
auto mx = max_element(l+A.begin(), r+A.begin());
int mxp = mx-A.begin();
if (*mx == A[i])
return;
d++;
if (mxp > i)
fx(A, l, mxp, i);
else
fx(A, mxp+1, r, i);
}
void solve() {
int n;
cin >> n;
vi A(n);
cin >> A;
int i;
f0(i, n){
d = 0;
fx(A, 0, n, ... | ALGO | 0.999876 | 4.25189 |
11969ab1-e649-415d-8cc0-1c722ac74e54 | NOSME/android_frameworks_av | media/codecs/amrwb/dec/src/pvamrwbdecoder.cpp | /*
------------------------------------------------------------------------------
Filename: pvamrwbdecoder.cpp
Date: 05/08/2004
------------------------------------------------------------------------------
REVISION HISTORY
Description:
----------------------------------------------------------------------... | ALGO | 0.998706 | 4.180786 |
1b195b4f-5005-495f-b0e2-c580a8036728 | sarvex/cpp-leetcode | 1910.Remove All Occurrences of a Substring.cpp | class Solution {
public:
string removeOccurrences(string s, string part) {
int m = part.size();
while (s.find(part) != -1) {
s = s.erase(s.find(part), m);
}
return s;
}
}; | ALGO | 0.997825 | 6.249959 |
ed8252bc-5658-45f8-8d85-0da4e6402b54 | M-Awwab-Khan/Competitive-Programming | G_1_Into_Blocks_easy_version.cpp | #include "bits/stdc++.h"
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/pb_ds/tree_policy.hpp"
#ifndef ONLINE_JUDGE
#include "debugging.cpp"
#else
#define debug(...)
#define debugArr(...)
#endif
using namespace std;
using namespace __gnu_pbds;
#define ff first
#define ss second
#define ll long long
#define l... | ALGO | 0.999739 | 3.796254 |
8d38a1b0-c624-41d0-9445-b58955442300 | naveengitboi/cp | codes/dp/arithmeticSequences.cpp | #include <bits/stdc++.h>
#include <climits>
#include <cmath>
#include <string>
#include <sys/types.h>
#include <unordered_map>
using namespace std;
/* clang-format off */
/* TYPES */
#define ll long long
#define pii pair<int, int>
#define pll pair<long long, long long>
#define vi vector<int>
#define vvi vector<vecto... | ALGO | 0.999545 | 5.131304 |
6eee8865-c127-475c-bf47-9d12293ba18f | nhattanho/LeetcodePractices | stringArray/58_LengthofLast.cpp | /*version 1*/
class Solution {
public:
int lengthOfLastWord(string s) {
int l = s.size();
int count = 0, flag = 0, end = 0;
for(int i = l-1; i >= 0; i--){
if(s[i] != ' '){
if(flag == 0) flag =1, end = i;
if( i == 0) return end+1;
}
... | ALGO | 0.995389 | 5.264416 |
0bd91f5f-8195-46ba-94dd-cbb5860218ad | ObedRav/Tic_Tac_Toe | 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 |
aafa4037-d080-434f-87fb-5a2ae3075f0d | ShrinathRaje/Competitive-programming | string/EVENTUAL.cpp | //july cook off - Eventual-Reduction
//problem: https://www.codechef.com/COOK120B/problems/EVENTUAL
#include<bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while(t--) {
int n;
cin >> n;
string s;
cin >> s;
// if(n % 2)
// cout << "NO\n";
// else {
// int a[26] = {0};
// ... | ALGO | 0.999868 | 4.954424 |
a8b1f75b-b3a8-49d0-8be7-ccf51a03e54a | ishandutta2007/codeforces | forza_ferrari/normal/1701/D.cpp | #include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<set>
using namespace std;
int t,n,ans[500001];
vector<pair<int,int> > v[500001];
set<pair<int,int> > s;
int main()
{
cin>>t;
while(t--)
{
cin>>n;
s.clear();
for(int i=1;i<=n;++i)
v[i].clear(... | ALGO | 0.999975 | 3.168701 |
849a15c0-69e1-4f6b-9132-5ef41c0c5e07 | anonymous-maestro/maestro | klee/tools/call-paths-to-bdd/bdd/call-paths-groups.cpp | #include "call-paths-groups.h"
namespace BDD {
void CallPathsGroup::group_call_paths() {
assert(call_paths.size());
for (const auto &cp : call_paths.cp) {
on_true.clear();
on_false.clear();
if (cp->calls.size() == 0) {
continue;
}
call_t call = cp->calls[0];
for (unsigned int icp ... | ALGO | 0.939125 | 4.875168 |
74a92361-7deb-4ca6-9fc8-05111a6a7695 | vbonnici/grafe-sim | analysis/data/p03170/s302623796.cpp | #include <bits/stdc++.h>
using namespace std;
#define inf INT_MAX
#define mod 1000000007
#define int long long
void solve() {
int n,k;
cin>>n>>k;
vector<int> a(n);
int i;
for(i=0;i<n;i++)cin>>a[i];
int j;
vector<int> dp(k+1);
dp[0] = 0;
for(i=1;i<=k;i++){
int t = 0;
for(j=0;j<n;j++){
if(i-a[j] >= 0)if... | ALGO | 0.999988 | 4.469917 |
3c22bd78-a5f7-44e2-98e1-9209aba19516 | wwenjie/leetcode | 25_reverse-nodes-in-k-group/link_list2.cpp | #include <iostream>
#include <sstream>
#include <stdio.h>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <cmath> // 包含 pow
#include <functional>
#include <algorithm>// 包含 std::sort
#include <limits.h> // 包含 INT_MAX
#inclu... | ALGO | 0.999988 | 5.107413 |
d4651d86-e481-4bbf-b4e2-b122a12ed319 | Shantanu993/GFG_DailyPractice | Difficulty: Medium/Jump Game/jump-game.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:
// Function to check if we can reach the last index from 0th index.
bool solveCanReach(vector<int> &arr, int index){
... | ALGO | 0.994227 | 5.934858 |
2176fd53-0d10-49b3-92d4-6fa0a2a0eb1b | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/09/0920/personal_submission/cf615b_yui.cpp | #define int i64
void solve() {
int n, m;
cin >> n >> m;
vec<int> in(n);
vec2<int> g(n);
for (int i = 0; i < m; i++) {
int u, v;
cin >> u >> v;
u--, v--;
g[u].push_back(v);
g[v].push_back(u);
in[v]++;
in[u]++;
}
vec<int> dp(n, 1);
... | ALGO | 0.999651 | 4.887679 |
2b771c50-e5ac-4ae3-8c38-bbb7781fb3e5 | S4ltF1sh/SPOJ | BCDAISY.cpp | //BCDAISY - Chú bò hư hỏng(20/100)
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
using namespace std;
int main()
{
int n, k, tmp1, tmp2, Check = 0;
cin >> n >> k;
vector<int> DanhDau(n + 1, 0);
for (int i = 1; i <= k; i++)
{
... | ALGO | 0.99988 | 3.248596 |
fa89aa70-90f9-4e01-9f67-9a083a8b0197 | jeniagt/Labs-OAIP-2-semestr-13-variant | lab4.cpp | /* .
.
(. 4.1).
13. a/(b+cd*e) a = 7.6 b = 4.8 c = 3.5 d = 9.1 e = 0.2 = 1.173
*/
#include <iostream>
#include <string>
#include <iomanip>
using std::cout;
using std::cin;
using std::endl;
struct Stack {
char info;
Stack* next;
};
int Prior(char a);
Stack* Push(Stack* p, char in);
Stac... | ALGO | 0.9998 | 3.864195 |
85e772e0-5913-4c1b-b744-ff2961931a2c | cuspaceflight/spalax | shared/src/calibration/ms5611_calibration.cpp | #include "ms5611_calibration.h"
#include <math.h>
/* Constants from the US Standard Atmosphere 1976 */
const float Rs = 8.31432f;
const float g0 = 9.80665f;
const float M = 0.0289644f;
const float Lb[7] = { -0.0065f, 0.0f, 0.001f, 0.0028f, 0.0f, -0.0028f, -0.002f };
const float Pb[7] = { 101325.0f, 22632.10f, 5474.89f... | ALGO | 0.989732 | 6.22598 |
f759813a-0891-46bf-99f8-0cca067f8f5d | Marawan-Mohamed/Problem-Solving-training | level-1/Atcoder/Phase 1-2/B_81.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define frni(i, a, n) for(int i = a; i < n; ++i)
#define SHORT_MAX ((short)0x7FFF)
#define SHORt_MIN ((short)0x8000)
#define USHORT_MAX ((unsigned short)0xFFFF)
#define LL_MAX ((long long)0x7FFFFFFFFFFFFFF... | ALGO | 0.998902 | 4.85705 |
d3ddbe7c-37e4-4050-a3cb-7c1dfd6a168f | VipulChauhan89/Leetcode-solutions | Dynamic Programming/0377-Combination_Sum_IV.cpp | class Solution {
public:
int combinationSum4(vector<int> &nums,int target) {
vector<unsigned int> dp(target+1,0);
dp[0]=1;
for(int i=1;i<=target;i++)
{
for(int num:nums)
{
if(i-num>=0)
{
dp[i]+=dp[i-num];
... | ALGO | 0.999942 | 6.208037 |
0d6aee33-90ac-4db3-a4d5-1e4eecef878f | pnnv/hyprland-dotfiles | VSCodium/User/History/-51e851cc/MILQ.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int32_t main() {
ios::sync_with_stdio(false); cin.tie(0);
int n; cin >> n;
vector <vector <int>> t(n);
for (int i = 0; i < n - 1; i++) {
int a, b; cin >> a >> b;
t[--a].push_back(--b);
t[b].push_back(a);
}
set <pair <int, int>> st;
func... | ALGO | 0.999922 | 4.135004 |
18504e2d-c1a2-428e-976f-e3eb7c5b3eb8 | mihaimoga/XMLSitemap | boost/libs/contract/test/cmake_test/main.cpp | //[mitchell02_stack
#include <boost/contract.hpp>
#include <boost/optional.hpp>
#include <vector>
#include <cassert>
template<typename T>
class stack {
friend class boost::contract::access;
void invariant() const {
BOOST_CONTRACT_ASSERT(count() >= 0); // Non-negative count.
}
public:
/* Creat... | TOOL | 0.946562 | 6.890442 |
50d774ca-aad5-4b11-9292-1245437a7455 | chakitg/cp_solutions | gfg-potd/Roman Number to Integer.cpp | Given a string in roman no format (s) your task is to convert it to an integer . Various symbols and their values are given below.
I 1
V 5
X 10
L 50
C 100
D 500
M 1000
Example 1:
Input:
s = V
Output: 5
Example 2:
Input:
s = III
Output: 3
Your Task:
Complete the function romanToDecimal() which takes a string as inp... | ALGO | 0.9998 | 6.193166 |
ad7d8ad4-db53-4759-8002-ee14e6f93535 | gupenghu/LeetCode | 93. Restore IP Addresses.cpp | // Given a string containing only digits, restore it by returning all possible valid IP address combinations.
// For example:
// Given "25525511135",
// return ["<IP_ADDRESS>", "<IP_ADDRESS>"]. (Order does not matter)
class Solution {
public:
vector<string> restoreIpAddresses(string s) {
int match_lev... | ALGO | 0.999547 | 5.471035 |
910fa7c6-0ace-480b-a265-c7a06eaa8102 | Kamrul101/cpp_practice | contest/998 div 3/1.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define endl "\n"
#define MOD 1000000007
#define mem(a,b) memset(a, b, sizeof(a) )
// const int mx =2e5+123;
// int a[mx];
int main() {
optimize();
... | ALGO | 0.999188 | 4.354156 |
52c4d5ef-13c8-4d07-bb7e-53c67a3a35e4 | Andrewliera/vigilant-octo-adventure | vigilant-octo-i/nextLargestPermutation.cpp | //Compute the next permutation has a really good case analysis explenation by 'Back To Back SWE' on YT
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
vector<int> nextLargestPermutation(vector<int>& input){
int length = input.size();
int pivot, temp;
vector<int> result... | ALGO | 0.99998 | 4.888988 |
710859c4-618b-41b5-ba12-93d9c8188299 | raincross7/code-similarity | codes/train_code/problem081/problem081_228.cpp | #include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstring>
#include <numeric>
#include <ctime>
#include <complex>
#include <bitset>
#include <ra... | ALGO | 0.999964 | 4.441025 |
d81c6096-a43c-4e14-b877-5068390897f5 | dhruvsaini25/GFG-solutions | Difficulty: Easy/Second Largest/second-largest.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function template for C++
class Solution {
public:
// Function returns the second
// largest elements
int getSecondLargest(vector<int> &arr) {
int n = arr.size();
int largest = INT_MIN;
... | ALGO | 0.99933 | 5.888068 |
2f057ed7-43d2-464a-960e-31937c9643f9 | meriken/merikens-tripcode-engine | SourceFiles/Verification10.cpp | ///////////////////////////////////////////////////////////////////////////////
// INCLUDE FILE(S) //
///////////////////////////////////////////////////////////////////////////////
#include "MerikensTripcodeEngine.h"
//////////////////////////////////////////... | ALGO | 0.962748 | 4.461135 |
840d5fa5-b554-47c6-967b-c7162afe5c1b | cloudv2077/At_Offer | 006.cpp | #include <iostream>
#include <vector>
#include <deque>
using namespace std;
class Solution {
public:
int minNumberInRotateArray(vector<int> rotateArray) {
int r_min = 0;
for (int i = 0; i < rotateArray.size(); ++i) {
if(r_min==-1){r_min = rotateArray[i];}
else{
... | ALGO | 0.999931 | 5.505875 |
9dd0be07-56fc-45b3-a5d2-56fa26a981ef | tinhngovnptho/Code | CP/Code THPT/DTQG 25/Contest/3-12/city.cpp | /**
* author: tinhnopro (tinh nop)
* created: 2024-12-03
**/
#ifdef LOCAL
#include "debug.h"
#else
#define debug(...) 0
#endif // LOCAL
#include <bits/stdc++.h>
#define TASK ""
using namespace std;
template <typename T> int isize(const T& a) { return a.size(); }
bool maximize(int& a, int b) {
return a < b ? a =... | ALGO | 0.999646 | 4.007679 |
ca1bcb85-3a29-48df-8d7f-d58dd6b6a5a2 | DuowngK06/CTDL_GT_SS8 | CNTT3_IT204_SS8_Bai2.cpp | #include <stdio.h>
#include <stdlib.h>
// Ham tim kiem nhi phan
int binarySearch(int arr[], int left, int right, int target) {
while (left <= right) {
int mid = (left + right) / 2;
if (arr[mid] == target)
return mid; // Tra ve vi tri tim thay
if (arr[mid] < target)
... | ALGO | 0.999417 | 4.465456 |
f77260fe-cb7c-4d13-b619-3a62aa6e9df1 | ayushrai6249/Cpp-Programming-Codes | 7-1D Array/10-arrayToFunction.cpp | #include <iostream>
using namespace std;
void display(long longa[], long longsize) // long longa[] is treates as long long*a
{
for (long longi = 0; i < size; i++)
{
cout << a[i] << " ";
}
return;
}
void change(long longb[], long longsize) // long longb[] is treates as long long*b
{
b[0] = 1... | ALGO | 0.993071 | 3.282833 |
9cecae5f-13d0-47b3-b967-c028ac71c8b6 | anisharma07/LAB-IV | DSA LAB/.DSA_js/LinkedList/ekekrkeSinglyLinkedList/p.cpp | // Verified
#include <iostream>
using namespace std;
typedef struct Node
{
int data;
Node *next;
} anode;
void linked_list_traversal(anode *head)
{
cout << "Elements: ";
while (head->next != NULL)
{
cout << head->data << " ";
head = head->next;
}
cout << head->data << endl;... | ALGO | 0.999677 | 4.35277 |
60255efd-d363-4786-b6e7-ef1e0e4998bc | Jameel-Ahmed-2003/OOPS-IN-CPP | 37_template_functions.cpp | #include <iostream>
using namespace std;
template <class T>
T add(T a, T b)
{
return a + b;
}
int main()
{
cout << add<int>(12, 34)<<endl;
cout << add<double>(12.4, 98.3)<<endl;
cout << add<string>("Jameel ", "Ahmed")<<endl;
return 0;
} | ALGO | 0.940084 | 4.513877 |
8c2c73bc-d6c0-4e6f-a383-6f98caa6c07c | kmather73/hackerRank | Algorithms/Graph-Theory/ Breadth First Search: Shortest Reach.cpp | #include <cmath>
#include <set>
#include <unordered_map>
#include <queue>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
void BFS(vector<set<int>> G, int S){
int delta = 6;
vector<int> distance(G.size(), -1);
unordered_map<int, bool> used;
qu... | ALGO | 0.999961 | 4.271301 |
7d064a8d-f7bb-4197-a069-890151475284 | ishandutta2007/codeforces | hydro-bot1/normal/1307/G.cpp | // Hydro submission #6332f7995741ce0221192e65@1664284569168
#include <bits/stdc++.h>
using namespace std;
#define MP make_pair
#define MT make_tuple
namespace io {
#define SIZE (1 << 20)
char ibuf[SIZE], *iS, *iT, obuf[SIZE], *oS = obuf, *oT = oS + SIZE - 1, c, qu[55];
int f, qr;
inline void flush(void) { return fwri... | ALGO | 0.999936 | 3.930546 |
31783105-633a-4aff-88bb-97f481212161 | ishandutta2007/codeforces | tfg/normal/1088/E.cpp | #include <iostream>
#include <vector>
#include <chrono>
#include <random>
std::mt19937 rng((int) std::chrono::steady_clock::now().time_since_epoch().count());
const int ms = 300200;
long long w[ms];
long long a[ms];
std::vector<int> edges[ms];
std::vector<int> lul[ms];
int par[ms];
int getPar(int x) { return x == ... | ALGO | 0.999748 | 4.226575 |
3ddab97b-7dba-4aed-9c93-d8eecf5f1dc5 | BurningS0ul/QT-Projects | insertionsort/main.cpp | #include <iostream>
using namespace std;
int main()
{
const int max = 10;
int n = 0, zahl;
int A[max] = {0};
cout << "This is insertion sort!\n" << endl;
//Eingabe
do {
cout << "Input your integers (0 to end inputs): ";
cin >> zahl;
A[n] = zahl;
if (zahl != 0)... | ALGO | 0.999813 | 4.239622 |
d2e397d2-8894-4f97-9009-6242c2a5f779 | rdstihz/Learning-and-Coding | src/contest/EOJ/20210509/D.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 200000 + 100;
int a[maxn];
int main() {
int n, m;
while (cin >> n >> m) {
for (int i = 0; i < n; i++) {
cin >> a[i];
}
int cur = 0;
int k;
while (m--) {
cin >> k;
cur =... | ALGO | 0.999933 | 3.284174 |
3d34e7cf-54ff-40b3-b168-43da9bc654b2 | Minipoloalex/comp_prog | codeforces/problems/161/D/D.cpp | #include <bits/stdc++.h>
using namespace std;
void solve() {
int n, k;
cin >> n >> k;
vector<vector<int>> g(n);
for (int i = 0; i < n - 1; i++) {
int a, b;
cin >> a >> b;
a--;b--;
g[a].push_back(b);
g[b].push_back(a);
}
vector<int> par(n);
function<v... | ALGO | 0.999858 | 4.895342 |
92152c65-1093-4c5a-969c-3adf5a5721dc | mwasuji/DSA | 225-implement-stack-using-queues/implement-stack-using-queues.cpp | class MyStack {
public:
queue<int> que;
MyStack() {
}
void push(int x) {
que.push(x);
int n = que.size();
for (int i =0; i<n-1; i++){
que.push(que.front());
que.pop();
}
}
int pop() {
int x = que.front();
qu... | ALGO | 0.998478 | 5.817431 |
613db9e0-eccd-4688-8b51-de3c07accd66 | ia2407/112-1-junior-college-C-plus-plus-program | 1111134036/π/ConsoleApplication1/ConsoleApplication1/ConsoleApplication1.cpp | // ConsoleApplication1.cpp : 此檔案包含 'main' 函式。程式會於該處開始執行及結束執行。
//
#include <iostream>
#include<stdint.h>
int main()
{
int value ,i;
double result = 4.0;
printf("please input the number of terms:");
scanf_s("%d", &value);
for (i=2; i <= value;i++)
{
printf("%lf\n", result);
if (!(i % 2))
result -= 4.0 / (i ... | ALGO | 0.999734 | 3.821543 |
29376d9a-de3c-410e-99a1-d6d0076569d2 | LostSunset/nextfoam-cfd-202407 | NextFOAM-2407/applications/utilities/preProcessing/setAlphaSurface/alphaSurfaceFunctions/libigl/include/igl/embree/reorient_facets_raycast.cpp | template <
typename DerivedV,
typename DerivedF,
typename DerivedI,
typename DerivedC>
IGL_INLINE void igl::embree::reorient_facets_raycast(
const Eigen::PlainObjectBase<DerivedV> & V,
const Eigen::PlainObjectBase<DerivedF> & F,
int rays_total,
int rays_minimum,
bool facet_wise,
bool use_parity,
b... | ALGO | 0.99896 | 7.070845 |
5033f148-ba9e-43e0-84cb-8b1d5421190f | Eclipse-Community/eMail-aura-test | gfx/skia/skia/src/core/SkQuadClipper.cpp | #include "SkQuadClipper.h"
#include "SkGeometry.h"
SkQuadClipper::SkQuadClipper() {
fClip.setEmpty();
}
void SkQuadClipper::setClip(const SkIRect& clip) {
// conver to scalars, since that's where we'll see the points
fClip.set(clip);
}
/////////////////////////////////////////////////////////////////////... | ALGO | 0.994954 | 6.753691 |
ded36692-6af2-47b1-8946-72d0ecf27282 | saks-hamjain/Leetcode_solutions | 2274-maximum-consecutive-floors-without-special-floors/2274-maximum-consecutive-floors-without-special-floors.cpp | class Solution {
public:
int maxConsecutive(int bottom, int top, vector<int>& special) {
int maxi =0,n = special.size();
sort(special.begin(),special.end());
for(int i=1;i<n;i++)
{
maxi = max(maxi,special[i] - special[i-1]-1);
}
maxi = max(maxi, to... | ALGO | 0.999888 | 5.59684 |
985f45e8-a2b6-45db-b961-d8a804915d72 | ranzhaocgu/C-programming-coursera | Week 5/Dates/Dates/Dates.cpp | // Dates.cpp : Defines the entry point for the console application.
//
//#include "stdafx.h"
#include<iostream>
using namespace std;
int main() {
int a;
cin >> a;
if (a == 1 || a == 3 || a == 5)
cout << "NO" << endl;
else
cout << "YES" << endl;
return 0;
}
//这道题比较简单啦,和A+B是一个级别的,看懂应... | ALGO | 0.999922 | 3.50897 |
842c3d14-2e10-4971-803a-06b5fbff9136 | virgile-crtl/Arcade | games/pacman/src/Enemy.cpp | /*
** EPITECH PROJECT, 2022
** EPITECH
** File description:
** Enemy
*/
#include "Enemy.hpp"
Enemy::Enemy(): refPos(13, 9), animTime(0, 0), clockStart(0, 0), alive(false), target(false), start(false), chance(0), before(' '), onPlayer(false)
{
}
Enemy::~Enemy()
{
}
bool canEnemyMove(std::pair<int, int> newPos, std::... | TOOL | 0.909422 | 3.698196 |
744935d1-f1a5-48c7-8d9e-4922e57d399d | Coach-Academy/Fall-1-2024 | Level 1/CPU - Standard - L1 - C107/Practice G2/Week 02/ProblemJ.cpp | #include <iostream>
using namespace std;
int main(){
int a,b,c;
cin>>a>>b>>c;
int x = a-b;
if(x>0) cout<<"Takahashi"; //a>b
else if(x<0) cout<<"Aoki"; //a<b
else {
if(c==0) cout<<"Aoki";
else cout<<"Takahashi";
}
// if(c==0){
// if(a>b) cout<<"Takahashi";
... | ALGO | 0.999445 | 4.175723 |
83bc2aa7-0e7f-4a02-892b-58967b92bf5b | shubhangi44-coder/CPP-Exercise | pattern41.cpp | /*
*
**
* *
* *
*****
*/
#include <iostream>
#include <conio.h>
using namespace std;
class Pattern
{
public:
int lines = 5;
int starcount = 1;
void display()
{
for (int i= 1; i <= lines; i++)
{
for ( int j=1; j <= i; j++)
{
if (j == 1 || j ==... | ALGO | 0.998027 | 3.326955 |
fd805492-ccf4-45a8-85fb-cf1e3aa2b15c | jasveen18/CP-krle-placement-lag-jayegi | 450 DSA Questions/14 Dynamic Programming/4LongestIncreasingSubsequenceSum.cpp | // Extending on the 2nd approach of LIS
int longestSubsequenceSum(int n, int a[]) {
// Initialize the dp
vector<int> dp(n + 1, 0);
for (int i = 0; i < n; i++)
dp[i] = a[i];
for (int i = 0; i < n; i++) {
for (int j = 0; j < i; j++) {
if (a[i] > a[j] and dp[i] < dp[j] + a[i])
dp[i] = dp[j] + a[i];
}
}... | ALGO | 0.999859 | 4.812162 |
ae245904-46c9-46df-91fd-c19038df13ee | amitkparida/ProgrammingBasics | DataStructures/Graph/2 AdjacencyList.cpp |
// Adjacency List representation of graph:
// 1. An adjacency list represents a graph as an array of linked lists.
// 2. Each index of the array represents a vertex and each element in its linked list represents
// the other vertices that are connected to the vertex by an edge.
// 3. The size of the array is equa... | ALGO | 0.999934 | 5.892847 |
603ed6f8-e1e8-4aed-9b72-fd9a788bec29 | thorstendikmann/fomss2024aud | src/chapter/03_sort/radixsortstringarray/radixsortstringarray_test.cpp | #include <iostream>
#include <string>
#include "radixsortstringarray.h"
int main()
{
std::cout << "#---- Radixsort on strings." << std::endl;
{
fom::AuD::RadixSortStringArray array;
array.fromVector(
{
"hello",
"world",
"test",
... | ALGO | 0.995267 | 5.374101 |
2989863e-e95a-4339-ada5-fcd6f6644504 | matthewdschulman/DroneOptics | OpenCV/opencv-3.0.0/samples/gpu/houghlines.cpp | #include <cmath>
#include <iostream>
#include "opencv2/core.hpp"
#include <opencv2/core/utility.hpp>
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/cudaimgproc.hpp"
using namespace std;
using namespace cv;
using namespace cv::cuda;
static void help()
{
cout << "This program demon... | ALGO | 0.952717 | 5.343914 |
f6924f8e-c514-429c-a1b9-1fa64e5ac318 | C-2024-1-3/240203dingchenyang | 3&4 problem7.cpp | #include<iostream>
#include<vector>
using namespace std;
void bubbleSort(vector<int>&a)
{
for(int i=0;i<a.size();i++)
{
for(int j=0;j<a.size()-1-i;j++)
{
if(a[j]>a[j+1])
{
int temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
... | ALGO | 0.999834 | 3.87492 |
53c8d521-9d77-47da-9d60-efb46d6d0053 | Junghs-cloud/Baekjoon | Silver/5/_14916.cpp | #include <iostream>
using namespace std;
int main()
{
cin.tie(NULL);
ios::sync_with_stdio(false);
int N;
cin >> N;
int answer = -1;
for (int i = N/5; i >=0; i --)
{
int last = N - i * 5;
if (last % 2 == 0)
{
answer = last / 2 + i;
break;
}
}
cout << answer << "\n";
return 0;
} | ALGO | 0.99991 | 3.822439 |
148a58ba-9dfb-4390-9195-de9a594e4cee | raditya1710/competitive-programming | USACO/3/3.3/camelot.cpp | /*
ID: raditya1
TASK: camelot
LANG: C++11
*/
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
const int R = 30, C = 26, INF = 1e9;
int r, c;
pii king;
vector<pii> knights;
void input(){
cin >> r >> ... | ALGO | 0.999095 | 3.767262 |
cceb714c-b246-429f-9570-7ddecc067d4f | Function-Coin/FUNC | src/libzerocoin/Accumulator.cpp | /**
* @file Accumulator.cpp
*
* @brief Accumulator class for the Zerocoin library.
*
* @author Ian Miers, Christina Garman and Matthew Green
* @date June 2013
*
* @copyright Copyright 2013 Ian Miers, Christina Garman and Matthew Green
* @license This project is released under the MIT l... | ALGO | 0.917911 | 6.530212 |
9c2cdf4a-5cee-4576-8c56-878f39ed504c | chenxiex/focalors | main.cpp | #include "crypt.h"
#include <cstring>
#include <fstream>
#include <getopt.h>
#include <iostream>
#include <sstream>
#include <stdexcept>
#include <string>
#include <unordered_map>
#include <variant>
using crypt::bitset;
using std::cout;
using std::endl;
using std::function;
using std::string;
using std::variant;
std::u... | TOOL | 0.915914 | 5.599733 |
6187fd61-2ec3-4242-8a8f-381ebacf40bd | mitupatil18/GeeksForGeeks-Solutions | Difficulty: Easy/Coverage of all Zeros in a Binary Matrix/coverage-of-all-zeros-in-a-binary-matrix.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int FindCoverage(vector<vector<int>>&mat){
int ans = 0 , n = mat.size(), m = mat[0].size();
int x[] = {-1,0,1,0};
int y[] = {0,-1,0,1};
for(int i = 0 ; i<mat.size();i... | ALGO | 0.999874 | 6.372215 |
9c6f13e1-b301-429f-882f-5ecb456e16eb | ishandutta2007/codeforces | kirill22/normal/1701/D.cpp | #include<bits/stdc++.h>
using namespace std;
signed main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
vector<int> b(n), a(n);
for (int i = 0; i < n; i++) {
cin >> b[i];
}
v... | ALGO | 0.99998 | 3.388278 |
0067af6e-5278-4f93-b9d9-25cc58f61f9c | clip968/algorithm | previous/그대로_출력하기.cpp | #include<bits/stdc++.h>
using namespace std;
int num = 100;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
string s;
vector<string> v;
while(num--) {
getline(cin, s);
if(s.empty()) break;
v.push_back(s);
}
for(auto k : v) {
cout ... | TOOL | 0.992661 | 3.962945 |
747626cb-92ad-4819-8b56-742897706c4d | hhh07/multi_nat | ctcdecode/third_party/boost_1_67_0/libs/sort/benchmark/single/benchmark_numbers.cpp | //----------------------------------------------------------------------------
/// @file benchmark_numbers.cpp
/// @brief Benchmark of several sort methods with integer objects
///
/// @author Copyright (c) 2017 Francisco José Tapia (<EMAIL> )\n
/// Distributed under the Boost Software License, Version 1.0.\n
/... | TEST | 0.994488 | 6.106568 |
53454f42-04f6-458f-a81e-3400510c5d4b | aamir-ops/Competitive-Programming | SPOJ/QTREE.cpp | #include<bits/stdc++.h>
/* Library to perform heavy-light decomposition on general trees */
// To use this library, set the macro MAX_N >= n + 1 and LOG_N >= LOG(n+1)
// Remember to set the segment tree size accordingly
// Call resetHLD() to initialize the HLD data structures
// Then call addHLDEdges to add edges to ... | ALGO | 0.999767 | 4.665975 |
13ed30de-6590-4baa-bbc1-ff2dd623e34d | michaeltrannhan/sem203 | dsastudents/graphdemo.cpp | #include "graph/DGraphModel.h"
#include "graph/TopoSorter.h"
#include "graph/IGraph.h"
#include <iostream>
#include <string>
#include <iomanip>
#include <fstream>
using namespace std;
bool charComparator(char& lhs, char& rhs){
return lhs==rhs;
}
string vertex2str(char& v){
stringstream os;
os << v;
retu... | ALGO | 0.995577 | 4.657878 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.