uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
2069e9ba-544e-4341-a45b-c30c3546192c | HossainJoy0012/Programming | Tree/Binary Search Tree/02._Insert_in_BST.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int val;
Node *left;
Node *right;
Node(int val)
{
this->val = val;
this->left = NULL;
this->right = NULL;
}
};
Node *input_tree()
{
int val;
while (true)
{
cin >> val;
if (v... | ALGO | 0.999955 | 4.804787 |
4a423da0-012f-47f9-877a-9d97082f7576 | Tjintokk93/P5_Control | project/pid_controller/eigen-3.3.7/bench/vdw_new.cpp | #include <iostream>
#include <Eigen/Core>
using namespace Eigen;
#ifndef SCALAR
#define SCALAR float
#endif
#ifndef SIZE
#define SIZE 10000
#endif
#ifndef REPEAT
#define REPEAT 10000
#endif
typedef Matrix<SCALAR, Eigen::Dynamic, 1> Vec;
using namespace std;
SCALAR E_VDW(const Vec &interactions1, const Vec &inter... | ALGO | 0.999822 | 3.519938 |
678f288f-7942-4ffe-a25b-63b169147478 | pius338/BOJ | 20230324/_9663.cpp | #include <iostream>
#include <vector>
using namespace std;
int n, cnt;
vector<int> brd;
int ft_check(int low, int col)
{
for (int i = 0; i < col; i++)
if(brd[i] == low || abs(brd[i] - low) == col - i)
return 0;
return 1;
}
void mkboard(int low, int col)
{
if(col == n)
{
cn... | ALGO | 0.999916 | 4.050045 |
f32bf05c-0f55-4e3a-b8eb-87799340249a | duttaANI/AL_Lab | Leetcode/785_IsGraphBipartite?.cpp | // My
class Solution {
public:
static const int mxN = 100;
int vis[mxN];
int col[mxN];
int ans = 1;
int n;
void dfs(int x,vector<vector<int>>& graph, int c=0){
// cout << x << " node \n";
vis[x] = 1;
col[x] = c;
for(int v : graph[x] ){
if(!v... | ALGO | 0.999941 | 5.790668 |
30411e08-8668-4b26-9ed2-f7b13822de0b | alpha74/iLC | F/FizzBuzz.cpp | // Fizz Buzz
// https://leetcode.com/problems/fizz-buzz/
// Aman Kumar
vector<string> fizzBuzz(int n)
{
vector<string> ret ;
for( int i = 1 ; i <= n ; i++ )
{
if( i % 3 == 0 && i % 5 == 0 )
ret.push_back( "FizzBuzz" ) ;
else if( i % 3 == 0 )
ret.push_back( "Fizz" ... | ALGO | 0.998559 | 6.356922 |
2d14dc32-1043-447c-b175-1fce666cc5c0 | hyunstory/CodingTestPractice | Baekjoon/CPP/2146.cpp | #include <iostream>
#include <queue>
#include <algorithm>
#include <cstring>
using namespace std;
enum{
MAX = 101,
dir = 4
};
int naming = -1;
int dx[] = { -1, 0, 1, 0 };
int dy[] = { 0, 1, 0, -1 };
int N;
int island[MAX][MAX];
int result = 100000000;
int count_path[MAX][MAX];
bool check[MAX][MAX];
void input()... | ALGO | 0.999556 | 4.604431 |
8102acd3-89a0-4bb9-afcf-442fa6411816 | knixk/DSA-Journey-Kanishk | problem solving/coding minutes/dsa-essentials-course-master/06 Pointers/reference.cpp | #include<iostream>
using namespace std;
int main(){
int x = 10;
int &y = x;
y++;
x++;
cout << x <<endl;
cout << y <<endl;
return 0;
} | TOOL | 0.881288 | 3.441764 |
258f954c-81f0-4a95-9ee0-26cb4db76cdc | sp4ghet/comp | abc168/d.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vint = vector<int>;
using vvint = vector<vint>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vchar = vector<char>;
using vvchar = vector<vchar>;
using vp = vector<P>;
using vpp = vector<pair<P, P>>;
using vvp ... | ALGO | 0.999999 | 4.201759 |
a15214eb-c50e-453f-9b54-74b126030d20 | Zzzode/myLeetCode | 242.有效的字母异位词.cpp | /*
* @lc app=leetcode.cn id=242 lang=cpp
*
* [242] 有效的字母异位词
*
* https://leetcode-cn.com/problems/valid-anagram/description/
*
* algorithms
* Easy (61.94%)
* Likes: 288
* Dislikes: 0
* Total Accepted: 164.2K
* Total Submissions: 262.4K
* Testcase Example: '"anagram"\n"nagaram"'
*
* 给定两个字符串 s 和 t ,编... | ALGO | 0.999891 | 6.680301 |
c72e6056-4942-43c4-b286-321a2d6bf508 | bfmoon/algorithmbasic | class11/Code07_PaperFolding.cpp | /*
折纸问题
请把一段纸条竖着放在桌子上,然后从纸条的下边向上方对折1次,压出折痕后展开
此时折痕是凹下去的,即折痕突起的方向指向纸条的背面
如果从纸条的下边向上方连续对折2次,压出折痕后展开
此时有三条折痕,从上到下依次是下折痕、下折痕和上折痕。
给定一个输入参数N,代表纸条都从下边向上方连续对折N次
请从上到下打印所有折痕的方向。
N=1时,打印: down
N=2时,打印: down down up
*/
#include<iostream>
using namespace std;
//多几次,找规律,可得是二叉树的中序遍历
//1.头节点是凹,2.所有左子树的头节点是凹,3.所有右子树的节点是凸
//所以规定凹... | ALGO | 0.999834 | 4.099356 |
b8e7ad95-000b-462c-bd7d-ff80b15f78f3 | Firoz587/XPSC-4 | Week-17/Day-1/Rating Increase.cpp | /******** Name :- Md Firoz Islam ***********
University :- Northern University Bangladesh
********** Dhaka,Bangladesh ***************/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define yes cout<<"YES"<<endl;
#define no cout<<"NO"<<endl;
#define faster ios::sync_with_stdio(false),cin.tie(NULL);
... | ALGO | 0.999036 | 3.983731 |
c1fa14d9-8ace-49a2-bfdb-fb78373e7418 | ishandutta2007/codeforces | alexandr_ts/normal/526/B.cpp | #include <bits/stdc++.h>
#define fr(i, n) for (ll i = 0; i < n; i++)
#define frab(i, a, b) for (ll i = a; i < b; i++)
#define pb push_back
#define mp make_pair
using namespace std;
typedef pair <long long, long long> pr;
typedef long long ll;
typedef long double ld;
const ll MOD = 1e9 + 7;
const ll INF = 2e9;
const ... | ALGO | 0.99986 | 3.744917 |
c5769f79-17b2-4662-962f-35df119d6348 | ssahoo11742/CompetetiveProgramming | CODEFORCES/1300/1711B.cpp |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
void solve(){
ll n,m;
cin>>n>>m;
vector<ll> a(n);
vector<ll> frnds[n];
for(ll i=0;i<n;i++){
cin>>a[i];
}
ll ans=1e18;
for(ll i=0;i<m;i++){
ll x,y;
cin>>x>>y;
x--;y--;
frnds[x].... | ALGO | 0.999925 | 4.515038 |
ceae61bd-c527-415c-816c-fca13663da16 | sarvex/leetcode-ada | solution/2500-2599/2599.Make the Prefix Sum Non-negative/Solution.cpp | class Solution {
public:
int makePrefSumNonNegative(vector<int>& nums) {
priority_queue<int, vector<int>, greater<int>> pq;
int ans = 0;
long long s = 0;
for (int& x : nums) {
s += x;
if (x < 0) {
pq.push(x);
}
while (s ... | ALGO | 0.99999 | 5.656071 |
c78aff7e-6048-4244-abd1-c8bb18f8bd6d | thekodidala/LeetCode-CF | 0048-rotate-image/0048-rotate-image.cpp | class Solution {
public:
void rotate(vector<vector<int>>& matrix) {
//optimal solution
int n=matrix.size();
for(int i=0;i<n;i++){
for(int j=0;j<i;j++){
swap(matrix[i][j],matrix[j][i]);
}
}
for(int i=0;i<n;i++){
reverse(matri... | ALGO | 0.999986 | 6.380673 |
1d25c2c0-6fe6-4438-8038-5a85bf702d00 | ishandutta2007/codeforces | e869120/normal/743/E.cpp | #include<iostream>
#include<algorithm>
using namespace std;
int n, a[1005], d[9][1005][1005], dp[1005][256];
int solve(int pos, int mask, int ko) {
if (pos > n)return -99999999;
if (pos == n && mask != 255)return -99999999;
if (mask == 255)return 0;
if (dp[pos][mask] >= 0)return dp[pos][mask];
int maxn = -9999999... | ALGO | 0.999699 | 3.309643 |
67055d8f-3820-48b6-bf40-0fdf554489b0 | raincross7/code-similarity | codes/train_code/problem384/problem384_453.cpp | #include<iostream>
using namespace std;
#include<vector>
#include<map>
#define int long long int
int32_t main()
{
int n,k;
cin>>n>>k;
string str;
cin>>str;
int answer=0;
vector<int> v;
map<int,int> mp1,mp2;
int count=0;
int j;
for(j=0;j<n;j++)
{
if(str[j]=='0')
{
mp1[j... | ALGO | 0.99991 | 3.851189 |
53bc15c3-e5a6-43d2-9cba-320b16b7f076 | andreiarnautu/Algorithmic-Problems | joc8.cpp | #include <cstdio>
using namespace std;
FILE *fin=freopen("joc8.in","r",stdin);
FILE *fout=freopen("joc8.out","w",stdout);
int main()
{
int op, st, dr, m, ok = 0;
scanf("%d%d", &st, &dr);
while( !ok && st <= dr )
{
scanf("%d", &op);
m = (st + dr) / 2;
if(op)
ok = 1;
... | ALGO | 0.999952 | 3.285174 |
930db84c-ecf4-4f86-9357-44db86821364 | VasiliBaranov/PorousMediaAnalysis | Externals/FreeImage/Source/OpenEXR/IlmImf/ImfHuf.cpp | //-----------------------------------------------------------------------------
//
// 16-bit Huffman compression and decompression.
//
// The source code in this file is derived from the 8-bit
// Huffman compression and decompression routines written
// by Christian Rouet for his PIZ image file format.
//
//-----------... | ALGO | 0.994916 | 6.579604 |
0c60be12-861b-46ca-8d03-375d30a9fdd1 | Abhay-140/DSA-solution-in-cpp | Array/findKthLargestNum.cpp | /*
Q : Kth Largest element in an array
link : https://leetcode.com/problems/kth-largest-element-in-an-array/
*/
// brute force
int findKthLargest(vector<int> &nums, int k)
{
sort(nums.begin(), nums.end());
int ans;
for (int i = nums.size() - 1; i >= 0; i--)
{
if (k == 1)
... | ALGO | 0.99989 | 5.260686 |
a92cc427-599e-48e9-912c-fa06072de8c0 | nodchip/icfpc2021 | libs/boost_1_76_0/libs/numeric/ublas/doc/samples/matrix_range.cpp | #include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/matrix_proxy.hpp>
#include <boost/numeric/ublas/io.hpp>
int main () {
using namespace boost::numeric::ublas;
matrix<double> m (3, 3);
matrix_range<matrix<double> > mr (m, range (0, 3), range (0, 3));
for (unsigned i = 0; i < mr.siz... | ALGO | 0.930556 | 3.213937 |
d7bff79e-4c77-45bc-8c71-7237ca1c8fa7 | Roman-n/Stalker_OXR_BTTR | Externals/cryptopp/tea.cpp | // tea.cpp - modified by Wei Dai from code in the original paper
#include "pch.h"
#include "tea.h"
#include "misc.h"
NAMESPACE_BEGIN(CryptoPP)
static const word32 DELTA = 0x9e3779b9;
typedef BlockGetAndPut<word32, BigEndian> Block;
void TEA::Base::UncheckedSetKey(const byte *userKey, unsigned int length, const Name... | ALGO | 0.997865 | 7.755398 |
8b8dc5c2-ff65-4735-9bdf-e6d5a83525bb | Fss7/dataset | AtCoder dataset/abc037/D/2482698.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <map>
#include <deque>
using namespace std;
#define REP(i,n) for(int i = 0; i < n; i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
typedef pair<int,int> pi;
typedef pair<ll,ll> pll;
type... | ALGO | 0.999913 | 4.126125 |
cc4113da-a96f-4e81-8afa-ca808b02b68a | xndtmfdl/codetree-TILs | 241122/홀수만 출력/output-only-odd.cpp | #include <iostream>
using namespace std;
int main() {
// 여기에 코드를 작성해주세요.
int a, b;
cin >> a >> b;
for(int i=a; i<=b; i++) {
if(i%2!=0)
cout << i << " ";
}
return 0;
} | ALGO | 0.999497 | 3.491829 |
2183c96b-df77-4921-89de-0a8c76490ced | PixelBlaster-CAF/frameworks_av | media/codecs/amrnb/dec/src/d_plsf_5.cpp | /*
------------------------------------------------------------------------------
Pathname: ./audio/gsm-amr/c/src/d_plsf_5.c
Date: 04/24/2000
------------------------------------------------------------------------------
REVISION HISTORY
Description: Made changes based on review meeting.
Description: Sync... | ALGO | 0.998234 | 6.451288 |
5cf960a4-9fc0-49f4-b953-15af5493cb8f | TrumanJeppson/Lab-Hashmaps | HashMapHelp-master/hash.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
int hashme(string param, int tablesize) {
unsigned char *ptr = (unsigned char *)param.c_str();
int sum = 0;
for(int i = 0; i < param.size(); i++) {
sum += ptr[i];
}
int hashval = sum%tablesize;
cout << "Size = ... | ALGO | 0.998696 | 4.949777 |
aa40735f-5ddf-401c-91d2-964ceb99b4d4 | ArtemioVibora/Cleto_DatastructuresAndAlgorithms_Practice | pointer2.cpp | #include <bits/stdc++.h>
using namespace std;
//Taken From GeeksForGeeks
int main()
{
int a = 10;
int b = 99;
int *ptr = &a;
cout << "Memory Address: " << ptr << endl;
cout << "Value: " << *ptr << endl;
cout << "Swapped" << endl;
ptr = &b;
cout << "Memory Address: " << ptr << endl;
... | ALGO | 0.999372 | 4.014844 |
89bb7c7a-c9cc-4cbd-915d-297880e01895 | Alok-Khansali/Lets-LeetCode | Easy/Diameter_of_Binary_Tree.cpp | class Solution // Approach 1
{ // i guess, its just about getting the max of left depth and right depth about any node and getting the max of all P.S. I was right
public:
int mx = 0;
int chc(TreeNode *r)
{
if (r == NULL)
return 0;
int lt = 1 + chc(r->left), rt = 1 + chc(r->right)... | ALGO | 0.999961 | 6.445335 |
34e17438-7ee5-48b4-b5ef-facd3c23462b | 18-RAJAT/ONLINE-JUDGE | C_Manipulating_History.cpp | #include<bits/stdc++.h>
#define Rajat_Joshi main;
#define CSE ios_base::sync_with_stdio(false);
#define Joshi cin.tie(NULL);
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <ite... | ALGO | 0.999902 | 4.217942 |
19203e5c-610e-4720-9bbd-4689becffeac | zxyDEDIRE/ACM_CODE | 日常/ANO/1203/C.cpp | /*
嵌套变量重复
特殊样例 0 1 2 n
数组越界
开long long
*/
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
using ull=unsigned long long;
using ll=long long;
using pii=pair<int,int>;
const int dx[]={0,0,1,-1,1,-1,1,-1};
const int dy[]={1,-1,0,0,1,-1,-1,1};
const int mod=998244353;
const int inf=0x3f3f3f3f;
const int I... | ALGO | 0.999965 | 3.693331 |
42bab1b6-0907-4989-a447-e9cb1f018e99 | Mitali-Potdar/LeetCode | 0045-jump-game-ii/0045-jump-game-ii.cpp | class Solution {
public:
int jump(vector<int>& nums) {
int n = nums.size();
for(int i = 1; i < n; i++){
nums[i] = max(nums[i] + i, nums[i-1]);
}
int ind = 0;
int ans = 0;
while(ind < nums.size() - 1){
ans++;
ind = nums[ind];
... | ALGO | 0.999986 | 6.058422 |
a56d0667-7a89-4bf8-a1f4-65b749543fba | mjrodriguez/dg-mood-limiting | 1d/src/Equations.cpp | #include <cmath>
#include "Equations.h"
#include "Array.h"
#include "ArrayUtils.h"
Euler::Euler(double gamma) {
mGamma = gamma;
}
double Euler::Gamma() const {
return mGamma;
}
double Euler::Pressure(DArray &state){
double rhou_sqrd = state[momx]*state[momx];
double P = (mGamma - 1)*( state[ener] - 0.5*(rhou_sq... | ALGO | 0.995736 | 4.532188 |
a6aaec8a-c99a-479d-b345-bef125deefc7 | sarvex/leetcode-tcsh | solution/2200-2299/2216.Minimum Deletions to Make Array Beautiful/Solution.cpp | class Solution {
public:
int minDeletion(vector<int>& nums) {
int n = nums.size();
int ans = 0;
for (int i = 0; i < n - 1; ++i) {
if (nums[i] == nums[i + 1]) {
++ans;
} else {
++i;
}
}
if ((n - ans) % 2) ++an... | ALGO | 0.999985 | 5.997639 |
8abf4039-e618-4536-84e1-1299981d79af | xiaohaoxiang/inpaint | main.cpp | #include <algorithm>
#include <ctime>
#include <filesystem>
#include <fstream>
#include <iostream>
#include <sstream>
#include <string>
#include <opencv2/opencv.hpp>
#include "bilinear.h"
#include "evaluate.h"
#include "fast_marching.h"
#include "generate.h"
#include "nearest_neighbor.h"
#include "utils.h"
#include "RB... | DATA | 0.941154 | 4.176381 |
3af73d6a-bb7d-43c4-bedb-b4a78907f63d | Allergy27/Allergy-to-not-study | cpp/StarryCoding/smart/p241.cpp | /* @author Allergy
* @email <EMAIL>
* @workspace cpp\StarryCoding\smart\p241.cpp
* @date 2024/12/03 17:15:50
*/
#include <bits/stdc++.h>
#define lowbit(x) ((x) & (-(x)))
#define ln '\n'
#define int int64_t
using namespace std; // NOLINT
using ll = int64_t;
int inf = 0x3f3f3f3f;
ll ll_inf = 0x3f3f3f3f3... | ALGO | 0.99967 | 5.097354 |
613e94ab-1dfc-454b-872f-197fe41c6285 | Baselyosry/DataStructures | DataStructures/GraphAdjacencyMatrix.cpp | #include <iostream>
using namespace std;
class Graph {
private:
int NumVertices; // Number of vertices in the graph
int** AdjacencyMatrix; // Adjacency matrix to represent connections between vertices
public:
// Constructor to initialize the graph with the given number of vertices
Graph(int vertices)... | ALGO | 0.998662 | 6.82761 |
ff62829b-eea0-4ae9-b844-544ed5d3cc73 | AndrewBartholomew62/Andrew-Bartholomew-draw | src/edge_distribution.cpp | /**********************************************************************************
Edge distribution placement
January 2019
This approach seeks to expand regions of a diagram interconnected by short edges of the
trinagulation after circle packing by cont... | ALGO | 0.999932 | 5.229743 |
188d2e25-6b79-4c19-b1b8-394c266a8287 | ishandutta2007/codeforces | mateocv/normal/1169/C.cpp | #include <bits/stdc++.h>
#define pb push_back
#define fst first
#define snd second
#define fore(i,a,b) for(int i=a,ThxDem=b;i<ThxDem;++i)
#define SZ(x) ((int)x.size())
#define ALL(x) x.begin(),x.end()
#define mset(a,v) memset((a),(v),sizeof(a))
#define FIN ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace ... | ALGO | 0.999995 | 3.987261 |
f1bc8774-1668-4078-9193-98698beba12f | maxnelso/algorithms_competitions | codeforces/problem_set/158B.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cst... | ALGO | 0.999857 | 4.187841 |
96feae48-20d5-4d63-b944-9c3cf15c19ad | Gupta-Nikhil85/striverSDESheetChallenge | day 9/onlineStockSpan.cpp | #include <bits/stdc++.h>
vector<int> findSpans(vector<int> &price) {
// Write your code here.
stack<int> st;
vector<int> ans;
ans.push_back(1);
st.push(0);
for(int i=1; i<price.size(); i++){
while(!st.empty() && price[st.top()]<=price[i]){
st.pop();
}
if(st.em... | ALGO | 0.999835 | 5.287397 |
186489b7-f408-4d95-b42a-e2659788e832 | karthikeyan2ai/hpc_course | MPI_assignments/LU_Solve_ass3/LU_decompose_solve_ass3.cpp | #include <iostream>
#include <vector>
#include <mpi.h>
// Function to perform LU decomposition
void luDecomposition(std::vector<std::vector<double>>& A, int n) {
for (int k = 0; k < n; k++) {
for (int i = k + 1; i < n; i++) {
A[i][k] /= A[k][k];
for (int j = k + 1; j < n; j++) {
... | ALGO | 0.999981 | 5.380578 |
833af006-f040-4c25-a2e7-e8189a07ff32 | MalachiTimothyPhillips/olcf-crusher-slow-mpi-bw | src/bench/axHelm/main.cpp | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "omp.h"
#include <unistd.h>
#include "mpi.h"
#include "nrssys.hpp"
#include "setupAide.hpp"
#include "platform.hpp"
#include "configReader.hpp"
#include "benchmarkAx.hpp"
int main(int argc, char** argv)
{
int rank = 0, size = 1... | ALGO | 0.967387 | 4.183173 |
d9c3acc8-8622-4398-9a13-89bcc4789dad | Nikhil-251/Code | 216-combination-sum-iii/216-combination-sum-iii.cpp | class Solution {
public:
vector<vector<int>>ans;
void fun(int i, int n, int sum, vector<int>temp){
if(sum==0){
if(n==0) ans.push_back(temp);
return;
}
if(i>9) return;
fun(i+1,n,sum,temp);
temp.push_back(i);
fun(i+1,... | ALGO | 0.999961 | 6.688911 |
c817f692-a713-448e-93af-43ca73e40be8 | DebugDynamo21/CPP_Programs | Array/maxSubarray3.cpp | //Write a program to find the maximum subarray sum.
//KADANE'S ALGORITHM
#include <iostream>
using namespace std;
int maxSum_subarray(int arr[], int size) {
int currSum = 0, maxSum = INT_MIN;
for (int i = 0; i < size; i++) {
currSum += arr[i]; // Add current element to current sum
maxSum = ma... | ALGO | 0.999992 | 6.607797 |
587cd946-8047-4655-b607-b35e542d3786 | OddEssA/BambuStudio-SoftFever | src/libslic3r/Line.cpp | #include "Geometry.hpp"
#include "Line.hpp"
#include "Polyline.hpp"
#include <algorithm>
#include <cmath>
#include <sstream>
namespace Slic3r {
Linef3 transform(const Linef3& line, const Transform3d& t)
{
typedef Eigen::Matrix<double, 3, 2> LineInMatrixForm;
LineInMatrixForm world_line;
::memcpy((void*)w... | ALGO | 0.977113 | 5.599967 |
b4b561dc-6180-452a-9740-ef58c0dece51 | ORBIT-UIN-SMDD/sima-orbit-mobile | 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 |
2005489e-eeed-4f5c-b54d-33b67eea1b5f | Rishi-09/cpp_code_bot | snippets/single_num.cpp | #include <iostream>
#include <vector>
using namespace std;
int SingleNum(vector <int> &num)
{
int ans = 0;
for(int i:num)
{
ans ^=i;
}
return ans;
}
int main()
{
vector <int> arr;
int n;
cout << "enter number of elements :";
cin >> n;
for ( int i =0 ; i< n ;i++)
{ cout... | ALGO | 0.999791 | 5.148984 |
b5b0e764-90d1-40f0-9e98-4e0b57bf209a | lowayforest/luogu | 96.歌唱比赛.cpp | #include <bits/stdc++.h>
using namespace std;
vector<double> score;
double avg(vector<double> a,int m) {
sort(a.begin(),a.end());
double sum=0;
for(int i=1;i<m-1;i++) {
sum+=a[i];
}
return sum/((m-2)*1.0);
}
int main() {
int n,m;
cin>>n>>m;
for(int i=0;i<n;i++) {
vector... | ALGO | 0.999667 | 3.630993 |
f73b16ea-3f26-46ac-af38-90d759ee0d01 | sungmen/Solve_Algorithms | LeetCode/459_Repeated_Substring_Pattern.cpp | class Solution
{
public:
bool repeatedSubstringPattern(string s)
{
if (s.size() == 1) return false;
string r = "";
for (int i = 0; i < s.size() / 2; i++)
{
r += s[i];
if (r + s == s + r)
{
return true;
}
}
... | ALGO | 0.999755 | 5.763062 |
98fc618b-c71c-4774-9f5c-6b332c12cb63 | tishat-ahasan/computer-graphics-lab | Circle/test3.cpp | #include <GL/glut.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#define WIDTH 640
#define HEIGHT 480
#define RAD 40
int flag=0,flag2=0;
int p=0;
int x00=0,x11=0,y00=0,y11=0;
int ax0[1000],ax1[1000],ay0[1000],ay1[1000];
int k=0;
int type;
bool isCollide(){
in... | ALGO | 0.998551 | 3.875243 |
47cc3c50-441f-4671-bc4b-b54a723c64db | HanYouyang/Computer | 数据结构与算法/PATCode/乙级/basic/1005. 继续(3n+1)猜想 (25).cpp | #include<iostream>
#include<vector>
#include<algorithm>
#include <functional>
int main()
{
int size;
int s = 0;
std::vector<int> num;
std::vector<int> comp;
std::vector<int> answer;
std::cin >> size;
for (int i = 0; i < size; ++i)
{
int t = 0;
std::cin >> t;
num.push_back(t);
int n = num[i];
while (n... | ALGO | 0.99999 | 5.075209 |
5c5a1737-cb38-4fdb-afba-305d74a01f08 | leehi0110/Algorithm | ProgrammersAlgorithm/Cpp/Level_2/더맵게.cpp | // ProblemNumber || ProblemName : 더 맵게
// 문제
// 모든 음식의 스코빌 지수를 K이상으로 만들기 위한 최소횟수를 구하라
#include <string>
#include <vector>
#include <set>
#include <iostream>
using namespace std;
int solution(vector<int> scoville, int K) {
int answer = 0;
multiset<int> temp(scoville.begin(),scoville.end());
while(1) {
... | ALGO | 0.999778 | 5.185418 |
d4b267c0-3f6c-43f9-ba09-9380860f2b20 | ishandutta2007/codeforces | zlt1117/normal/1516/E.cpp | //#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#define FOR(i,a,b) for(int i=a;i<=b;++i)
#define PII pair<int,int>
#define ll long long
#define pb push_back
#define sz(x) (int)(x.size())
#define rd (rand()<<16^rand())
#define db double
#define gc getchar()
#define mk make_pair
#define iter set<int>::iterator
//... | ALGO | 0.999938 | 3.333813 |
cc993a22-667d-4f01-87dc-3332c2d4307b | buptb421/OJ | BasicProgramming/experiment/exp10/exp10_E.cpp | #include<stdio.h>
void nextr(int *r, int *w, int *border);
void nextrw(int *r, int *w, int *border);
void outputArray(int a[], int n);
int main()
{
int a[200], addmap[200];
int n;
scanf("%d", &n);
for(int i = 0; i < n; i++)
addmap[i] = i;
int w = 0, r = 0, border = n;
for(... | ALGO | 0.999973 | 3.389991 |
994c6618-27e0-4ee4-b276-61cffdd91be2 | ishandutta2007/codeforces | matthew99/normal/763/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define REP(i, a, b) for (int i = (a), i##_end_ = (b); i < i##_end_; ++i)
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define mp make_pair
#define x first
#define y second
#define pb push_back
#define SZ(x) (int((x).size()))
#define ALL(x) (x).begin(), (x).end()
temp... | ALGO | 0.999801 | 4.001938 |
b32f35fe-b09d-4404-b434-1a16c38f5b6a | yjaiswal05/Face-recognition- | opencv/OpenCV 4.5.2.tar/opencv-opencv-39d2578/3rdparty/carotene/src/morph.cpp | #include "common.hpp"
#include <algorithm>
#include <limits>
#include <vector>
#include <cstring>
namespace CAROTENE_NS {
bool isMorph3x3Supported(const Size2D &size, BORDER_MODE border)
{
return isSupportedConfiguration() && size.width >= 16 &&
(border == BORDER_MODE_CONSTANT ||
border == BO... | ALGO | 0.996026 | 6.977763 |
ef068797-2e98-47b2-9c11-9b55f78d2163 | yokoleia/AmadeusCPP | Amit_Assignments/strings/a2.cpp | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main()
{
string inputString;
string holdString = "";
cin >> inputString;
for (int i = 0; i<inputString.size(); i++) {
if (inputString.at(i) != 'x') {
cout << inputString.at(i);
}
els... | ALGO | 0.998891 | 3.393749 |
c20a25cf-b8d2-491b-8720-fe6898f71f04 | AbhJ/some-cp-files-1 | codeforces1451C.cpp | //Coded by Abhijay Mitra
#include <iostream>
#include <stdlib.h>
#include <algorithm>
#include <cstdio>
#include <numeric>
#include <cstring>
#include <numeric>
#include <vector>
#include <iterator>
#include <map>
#include <set>
#include <climits>
#include <queue>
#include <cmath>
#include <stack>
#include <cctype>
#i... | ALGO | 0.999985 | 3.941788 |
c63bf418-137b-4b03-9faa-a86786495d6d | imawadh/Code_Chef | Codechef_Less_than_500_Problems-main/profit_increment.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int t,x,y;
cin>>t;
for (int i = 0; i<t ; i++)
{
cin>>x>>y;
cout<<(0.1*x)+y<<'\n';
}
}
| ALGO | 0.999175 | 3.619481 |
ac7bff2b-d98a-4ce9-9286-f34179b2a140 | BricenFord/CS-2413 | project4/project4.cpp | /*
Project Description:
This project's objective is to implement a Multiway Search Tree (M-Tree) using efficient insertion, deletion, and search operations by splitting a sorted
array recursively and using the split values for tree navigation.
*/
#include <iostream>
#include <vector>
using namespace std;
class NotFou... | ALGO | 0.999997 | 6.035452 |
bf087552-5213-447c-b009-310dd863285e | Keneral/ae1 | libcxx/test/std/containers/sequences/vector.bool/resize_size.pass.cpp | // <vector>
// vector<bool>
// void resize(size_type sz);
#include <vector>
#include <cassert>
#include "min_allocator.h"
int main()
{
{
std::vector<bool> v(100);
v.resize(50);
assert(v.size() == 50);
assert(v.capacity() >= 100);
v.resize(200);
assert(v.size() == ... | TEST | 0.925021 | 4.894603 |
eed5c857-45b6-4eaa-af3e-a0506013c869 | ishandutta2007/codeforces | hongzy/normal/708/C.cpp | #include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <queue>
#include <cmath>
#include <map>
#include <set>
#define rep(i, j, k) for(int i = j; i <= k; ++ i)
#define per(i, j, k) for(int i = j; i >= k; -- i)
using namespace std;
#define fs first
#d... | ALGO | 0.999895 | 4.417464 |
2b7b0aee-27c1-4dc6-b164-05ba09dc9af6 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_3384_5.cpp | #include <bits/stdc++.h>
using namespace std;
const int NMAX = 500005;
bool sir[NMAX];
vector<pair<bool, int> > v;
vector<pair<int, int> > v_dir;
vector<int> poss;
int main() {
ios_base ::sync_with_stdio(false);
int n = 0;
cin >> n;
for (int i = 1; i <= n; ++i) cin >> sir[i];
v.push_back(make_pair(sir[1], 1))... | ALGO | 0.999999 | 3.02228 |
135255c3-faa1-41ff-b0c8-dc90d167c6e7 | redcpp/Competitive-Programming | codeforces/598A.cpp | #include <bits/stdc++.h>
using namespace std;
#define PB push_back
typedef long long ll;
typedef long double ld;
const ll INF = ll(1e18);
ll T, N;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(nullptr);
cin >> T;
while (T--) {
cin >> N;
ll res = N*(N+1)/2;
res -= 2 * (pow(... | ALGO | 0.999726 | 5.491881 |
f8402571-78a8-4d3e-8c07-08b077161453 | dave98/cpp_2018_2 | paralelos_pthread_2/main.cpp | #include <iostream>
#include <vector>
#include <thread>
#include "function.h"
using namespace std;
void process(vector<int>, vector<int>, int, vector<int>&);
int main(){
int n = 20000;
int m = 20000;
//cin>>n;
//cin>>m;
vector< vector<int> > matrix_;
vector< int > vec_;
vector< int > res_ = vector<int>(n, 0... | ALGO | 0.999761 | 3.196687 |
2d2363f5-00e6-4251-aa2b-8334eda283e4 | Rafy43/CF-Practices | A_Way_Too_Long_Words.cpp | //08.04.2025
//rafy
//frequency string
#include<bits/stdc++.h>
using namespace std;
int main(){
int t;cin>>t;
while(t--){
string s;
cin>>s;
if(s.length()>10){
cout<<s[0]<<s.length()-2<<s.back()<<endl;
}
else{
cout<<s<<endl;
}
}
} | ALGO | 0.999398 | 4.291237 |
c86e0e6c-dee0-4cea-a091-f00d8ae30ead | sslab-gatech/caver | llvm/lib/Option/OptTable.cpp | #include "llvm/Option/OptTable.h"
#include "llvm/Option/Arg.h"
#include "llvm/Option/ArgList.h"
#include "llvm/Option/Option.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cctype>
#include <map>
using namespace llvm;
using namespace llvm::opt;
namespace... | TOOL | 0.93496 | 7.891369 |
1b2dc926-ff1e-41a9-9092-0a3bee58947b | goldi1027/GT-EHL | boost_1_64_0/tools/inspect/link_check.cpp | // link_check implementation -----------------------------------------------//
#include "link_check.hpp"
#include "boost/regex.hpp"
#include "boost/filesystem/operations.hpp"
#include <boost/algorithm/string/case_conv.hpp>
#include <cstdlib>
#include <set>
// #include <iostream>
namespace fs = boost::filesystem;
... | TOOL | 0.893983 | 7.750386 |
3028cac1-c0d0-4331-8773-ca3c69180732 | manikanta2901/ubuntu | .history/codingChallenges/cpp/Codechef/longChallenges/August/smallestKmp_20200809140039.cpp | #include<bits/stdc++.h>
#include<vector>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<iterator>
#include<string>
#include<map>
#define vv vector
#define F first
#define S second
#define MP make_pair
#define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define printM... | ALGO | 0.999977 | 4.043058 |
196e934e-3954-43a7-b145-81942d0c106e | aklef/aklefB1Marlin | Marlin/src/libs/crc16.cpp | #include "crc16.h"
void crc16(uint16_t *crc, const void * const data, uint16_t cnt) {
uint8_t *ptr = (uint8_t *)data;
while (cnt--) {
*crc = (uint16_t)(*crc ^ (uint16_t)(((uint16_t)*ptr++) << 8));
for (uint8_t i = 0; i < 8; i++)
*crc = (uint16_t)((*crc & 0x8000) ? ((uint16_t)(*crc << 1) ^ 0x1021) : (... | ALGO | 0.997264 | 4.764662 |
b0aa0e56-fd59-4630-9757-0edcf451a209 | alexandraback/datacollection | solutions_1674486_1/C++/sunnn/AutoProject.cpp | #include <vector>
#include <string>
#include <queue>
#include <list>
#include <set>
#include <map>
#include <utility>
#include <functional>
#include <algorithm>
#include <numeric>
#include <sstream>
#include <fstream>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <cassert>
using namespace std;
#def... | ALGO | 0.999474 | 4.871107 |
43469f1a-944d-40bd-99d1-1ca0231a20e7 | ishandutta2007/codeforces | qpedop_muxaujlobu4/normal/1561/B.cpp | #pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,abm,mmx,tune=native")
#include<vector>
#include<iostream>
#include<stack>
#include<cmath>
#include<algorithm>
#include<set>
#include<map>
#include<string>
#include<tuple>
#include<bitset>
#include<queue>
#include<... | ALGO | 0.999917 | 4.071177 |
8807ce44-97e2-495d-8dfa-d4e5dca3ac35 | roshan3010/Roshan_NITM | Learnbay Practice/Strings/rabin-karp.cpp | /*
Rabin-Karp Algorithm for Pattern Searching
Given a text txt[0..n-1] and a pattern pat[0..m-1], write a function search(char pat[], char txt[])
that prints all occurrences of pat[] in txt[]. You may assume that n > m
*/
#include<bits/stdc++.h>
using namespace std;
void rabin_karp(char* txt, char* pat)... | ALGO | 0.999747 | 4.694269 |
155795e8-cece-439e-9bfb-0871b88c9eb9 | Pavaneswar630/cryptography-csa5166-pavaneshwar-192211363 | crypto lab programs 17 -40/(20).cpp | #include <stdio.h>
#include <string.h>
void encryptBlock(char *plaintext, char *ciphertext) {
strcpy(ciphertext, plaintext);
}
void decryptBlock(char *ciphertext, char *plaintext) {
strcpy(plaintext, ciphertext);
}
void simulateTransmittedCiphertextError(char *ciphertext, int blockIndex) {
ciphertext[b... | ALGO | 0.986082 | 4.073563 |
0a679211-85c4-4baa-8726-8ab1edd9d157 | goldragoon/cuda-cpp-bilateral-filter | src/main.cpp | #include <opencv2/opencv.hpp>
#include <opencv2/core/cuda.hpp>
#include <opencv2/cudaimgproc.hpp>
#include <cxxopts.hpp>
#include <iostream>
using namespace std;
using namespace cv;
void bilateralFilter(const Mat & input, Mat & output, int r,double sI, double sS);
int main(int argc, char** argv) {
cxxopts::Options... | TOOL | 0.889543 | 5.91619 |
9ce1a424-785a-4697-86e6-c92076daa8b9 | AbhinavKoul/Coding_Questions_Solutions | Level - Tough QUESTIONS/DP/Burst Baloon/Solution.cpp | #include<iostream>
#include<vector>
#include<queue>
#include<stack>
using namespace std;
#define v vector
//https://www.youtube.com/watch?v=Yz4LlDSlkns&ab_channel=takeUforward
#define v vector
int mod = 1e9 + 7;
#define v vector
//recursive code
class Solution {
public:
int recHelper(int l, int r, v<int>& nums)
... | ALGO | 0.999995 | 4.923821 |
c21136a7-a548-4ba3-b9ee-71827b6e2829 | zach5456/zs2311972 | Hmwk/Assignment1/Gaddis_7thEd_Chap2_Prob1/main.cpp | /*
* File: main.cpp
* Author: Stewart, Zach
* Class: 46024
*
* Created on June 26, 2014, 11:22 PM
*/
#include <iostream>
using namespace std;
int main() {
float apple = 62, orange = 99, total;
total = apple + orange;
cout << "The total fruit eaten was " << total << "." << endl;
... | ALGO | 0.942534 | 3.276857 |
803469da-15ff-4722-b482-a2f36c430b9a | JackieLee-cn/src | microsim/MSRightOfWayJunction.cpp | /****************************************************************************/
/****************************************************************************/
/// @file MSRightOfWayJunction.cpp
/// @author Christian Roessel
/// @author Daniel Krajzewicz
/// @author Michael Behrisch
/// @author Jakob Erdmann
/// @... | TOOL | 0.978323 | 4.714827 |
432fa1af-4616-4f68-9a7c-e0fd364f5fd3 | ishandutta2007/codeforces | radal/normal/1154/A.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main(){
string aa;
long long int a=0,b=0,c=0,d=0;
for (int i=0; i<4; i++){
int s;
cin>>s;
if (s>a){
d=c;
c=b;
b=a;
a=s;
}
else{
if (s>b){
d=c;
c=b;
b=s;
}
else{
if (s>c){
d=c;
c=s;
}
els... | ALGO | 0.999869 | 3.098137 |
9f709891-6e7e-4f72-a432-80baac1cb227 | toufunn/fun | FACEBOOK/334_Increasing_Triplet _Subsequence.cpp | /*filling from Smallest to second small, till we are about to fill the third one return true*/
class Solution {
public:
bool increasingTriplet(vector<int>& nums) {
int len = nums.size();
int smallest = INT_MAX;
int second = INT_MAX;
for (int i = 0; i <len; i++) {
if (nums... | ALGO | 0.999979 | 5.636934 |
0745b59c-7565-403d-afd6-e0eb3cb8960e | bbbjihan/ObjectOrientedProgramming | assignment1-1-2/assignment1-2/assignment1-2.cpp | #include <iostream>
using namespace std;
long long addition(long long a, long long b);
int main() {
long long a,b;
cout << "Enter Two Numbers :";
cin >> a >> b;
cout << addition(a, b);
return 0;
}
long long addition(long long a, long long b) {
return a + b;
} | TOOL | 0.94908 | 3.694411 |
58475da3-99e4-443e-b9ec-91f0933f497f | Mahdiehmirzayi/homeworks | HM7 - Q5.cpp | #include<iostream>
#include<math.h>
using namespace std;
int main(){
int n;
cin>> n;
for (int i=2; i<n; i++)
for (int j=2; j*j<=i; j++)
{
if (i % j == 0)
break;
else if (j+1 > sqrt(i)) {
cout << i << " ";
}
}
} | ALGO | 0.999895 | 4.375032 |
32bfb767-8e7c-4b10-8f0d-89c0604a5599 | Sookmyung-Algos/2021algos | algos_assignment/3rd_grade/송혜민_songfox00/week5/2491.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main() {
vector<int>v;
int n;
cin >> n;
for (int i = 0; i < n; i++) {
int a;
cin >> a;
v.push_back(a);
}
int cnt = 1, maxcnt = 1;
for (int i = 1; i < n; i++) {
if (v[i] >= v[i - 1])
cnt++;
else {
cnt = 1;
}
... | ALGO | 0.99999 | 4.520853 |
12c06146-f94a-4ff6-ace0-bb104f817f59 | mingjiaojiaozhu/Euler | project_euler/Problem040/Problem040.cpp | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
class Problem040 {
public:
void solution() {
int target = 1000000;
vector<int> borders(0);
int index = 0;
while (true) {
int value = ((int) pow(10, index) * (9 * index - 1) + 1) / 9;
... | ALGO | 0.99989 | 5.994738 |
3b6edaca-63a6-4110-9a6b-858d40fa868e | Hammad-Ikhlaq/Computer-Programming | Practice Material/All_Recursion/Single2DSum.cpp | //#include <iostream>
//using namespace std;
//
//int sum_F(int A[][2], int sum, int row, int col, int counter1, int counter2)
//{
// if (counter1 == row)
// {
// return sum;
// }
// else
// {
// sum = ((A[counter1][counter2] + A[counter1][counter2]) - A[counter1][counter2]) + sum;
// counter2++;
// if (counter2 ==... | ALGO | 0.9995 | 3.966218 |
0fdd9302-ed09-4447-aa30-bef907a154ab | PeizhongQiu/leetcode | 02/0209/873.cpp | /*
* @lc app=leetcode.cn id=873 lang=cpp
*
* [873] 最长的斐波那契子序列的长度
*
* https://leetcode-cn.com/problems/length-of-longest-fibonacci-subsequence/description/
*
* algorithms
* Medium (52.35%)
* Likes: 212
* Dislikes: 0
* Total Accepted: 18.3K
* Total Submissions: 34.8K
* Testcase Example: '[1,2,3,4,5,6,... | ALGO | 0.99992 | 5.586717 |
65b4e25b-87f9-4d0b-9b00-4cdd5cdc787d | elephantrobotics/agv_pro_ros2 | navigation2/nav2_costmap_2d/plugins/inflation_layer.cpp | #include "nav2_costmap_2d/inflation_layer.hpp"
#include <limits>
#include <map>
#include <vector>
#include <algorithm>
#include <utility>
#include "nav2_costmap_2d/costmap_math.hpp"
#include "nav2_costmap_2d/footprint.hpp"
#include "pluginlib/class_list_macros.hpp"
#include "rclcpp/parameter_events_filter.hpp"
PLUGI... | TOOL | 0.912171 | 7.626105 |
b5769fde-5522-4f4e-b5be-af084d4428ca | cful-chn/-2- | 封装 园周长/源.cpp | #include<iostream>
#include<string>
using namespace std;
const double PI = 3.14;
class yuan
{
public:
int r;//뾶
double zhouchang()
{
return 2 * PI * r;
}
};
class xuesheng {
public:
string name;
int xuehao;
void xianshi() {
cout << name << xuehao << endl;
}
};
int main() {
yuan cc;
cc.r = 5;
cout <... | TOOL | 0.853182 | 3.797143 |
9cf855cf-5c9f-4f5a-90d8-5711dd5fa806 | dev010799/C-Folder | Project16/main.cpp | #include <iostream>
using namespace std;
int main(){
// a += 1; /* i.e. a = a + 1 */
// a /= 5; /* i.e. a = a * (b + c)*/
// a *= b + c; /* i.e. a = a * (b + c)*/
// cost += items * tax; /* cost = cost + (items * tax); */
const int dollar_value{100};
const int quarter_value{25};
const int di... | ALGO | 0.971179 | 3.500229 |
287d947c-ab93-4ac1-8b99-e7e8374b6f87 | ameybh/competitive-programming | codeforces/688/B.cpp | // Author: Amey Bhavsar - ameybhavsar24@(github & twitter)
// IDE: Geany on Ubuntu 20.04
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(auto i=a;i<b;i++)
#define repD(i,a,b) for(auto i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#d... | ALGO | 0.999697 | 4.014466 |
5edae970-02df-4b10-b7f8-318e38027b4d | NguyenCongHau25/UIT-CS-SUBJECTS | IT002 - Object-oriented programming/Bai tap ly thuyet/WEEK_03/CPOINT.cpp | #include <iostream>
using namespace std;
class point {
/*khai báo các thành phần dữ liệu riêng*/
private:
int x,y;
/*khai báo các hàm thành phần công cộng*/
public:
point(){x = 0; y = 0;}
point(int ox, int oy){x = ox; y = oy;}
//ham khoi tao mac dinh
void init(int ox, int oy);
void move(int dx, int dy);
voi... | TOOL | 0.982227 | 4.561864 |
252ba282-8423-42bc-ba1f-b42ecbd2dfa3 | sjm150/ps | baekjoon/6310/solution.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0); ios_base::sync_with_stdio(0);
for (int h = 1; ; h++) {
int n; cin >> n;
if (!n) break;
cout << "Heap " << h << '\n';
vector<array<int, 4>> sld(n);
for (auto &s: sld) cin >> s[0] >> s[1] >> s[2] >> s[... | ALGO | 0.999799 | 4.589078 |
b656d384-3306-4691-8abb-e875c0350320 | ppraval/Codez | cplusplus/pathcrossing.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
string s = "NES";
int x = 0, y = 0;
set<vector<int>> mp;
mp.insert({0, 0});
for(auto i : s)
{
if(i == 'N')
{
y++;
}
else if(i == 'S')
{
y--;
}
else if(i == '... | ALGO | 0.999985 | 4.059891 |
9706b0ee-c493-4a92-b477-ab2dc0ceb189 | Shivam-Prajapati-59/Shivam-C-codes | All-Stack-Codes/Next-SMaller-Elemnt.cpp | #include<stack>
vector<int> nextSmallerElement(vector<int> &arr, int n)
{
// Write your code here.
stack<int> s;
s.push(-1);
vector<int> ans(n);
for(int i=n-1; i>=0 ; i--) {
int curr = arr[i];
while(s.top() >= curr)
{
s.pop();
}
//ans is stack ka... | ALGO | 0.99999 | 5.472609 |
2885d7b0-8994-4db0-901e-09d8d0a62fae | joaby-oliveira/TPA | Jogo da Velha/jogo_da_velha.cpp | #include <stdio.h>
#include <windows.h>
#include <locale.h>
int main(){
char resp, casas[3][3], O[30], X[30], bol = 'O', xis = 'X';
int cont_jogadas, l, c, vez=0, i, j, s, placarX = 0, placarO = 0;
setlocale(LC_ALL, "portuguese");
printf("Digite o nome do jogador X: ");
gets(O);
fflush(stdin);
printf("Digite o... | ALGO | 0.977712 | 3.551151 |
75e6b793-bd26-4596-b241-e38a3d99a71b | breno550/Competitive-Programming | Problem Solutions/etc/bradiostation.cpp | #include <bits/stdc++.h>
using namespace std;
map<string, string> ma;
int main(){
int n, m;
cin >> n >> m;
for(int i = 0; i < n; i++){
string ip, name;
cin >> name >> ip;
ma[ip]=name;
}
for(int i = 0; i < m; i++){
string command, ip;
cin >> command >> ip;
//map<string, string>::iterator it = ... | ALGO | 0.999111 | 4.272978 |
717f2607-2ffc-440c-b8c5-5e3e3fbf082b | ishandutta2007/codeforces | linkct/normal/644/C.cpp | #include <iostream>
#include <set>
#include <map>
#include <string>
#include <vector>
#define fi first
#define se second
using namespace std;
typedef unsigned long long int ULL;
const ULL SEED = 233ULL;
int n, cnt;
map <string, set <string> > dict;
map <ULL, vector <string> > ans;
inline int idx(char x){
if(x >= 'a'... | ALGO | 0.997525 | 3.716699 |
f7d6609c-0c95-416d-b838-762437bb0f8e | za233/Polaris-Obfuscator | src/libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/ranges_generate_n.pass.cpp | // UNSUPPORTED: c++03, c++11, c++14, c++17
// <algorithm>
// template<input_or_output_iterator O, copy_constructible F>
// requires invocable<F&> && indirectly_writable<O, invoke_result_t<F&>>
// constexpr O generate_n(O first, iter_difference_t<O> n, F gen); // Since C++20
#includ... | TEST | 0.88968 | 7.499273 |
306792f1-743d-4cb2-a144-c4a887c86d6a | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_7869_16.cpp | #include <bits/stdc++.h>
using namespace std;
using llint = long long;
const int N = 510, B = 1e9 + 7;
int n, m, q;
int e[N][2 * N];
int x[N];
int ps[N];
char s[N][N];
char bs[N];
int inv[] = {0, 1, 3, 2, 4};
int pw[N] = {1};
int rk;
llint mypw(int a, int b, int m) {
llint ret = 1;
while (b) {
if (b & 1) ret = ... | ALGO | 0.999961 | 4.896987 |
8dc185e1-93eb-4aee-851d-1ec1dd40bff4 | Tomoki-Kikuta/atcoder | abc130/abc130-4.cpp | #include<iostream>
#include<algorithm>
#define MAX 100004
using namespace std;
int main(void){
int n;
long int count = 0,K,A[MAX];
cin >> n >> K;
for(int i=0;i<n;i++){
int a;
cin >> a;
if(i!=0){
A[i] = A[i-1] + a;
}else{
A[i] = a;
}
}
... | ALGO | 0.999893 | 3.576304 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.