uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
c2b6f25e-5878-4fb4-be86-42280e8740c1 | azmuth13/Leetcode | 1223-dice-roll-simulation/1223-dice-roll-simulation.cpp | class Solution {
public:
int mod = 1e9 + 7;
int memo[5001][7][16];
int helper(int n, int last, int lastFreq, vector<int>& rollMax)
{
if(n == 0)
return 1;
if(memo[n][last][lastFreq] != -1) return memo[n][last][lastFreq];
int ans = 0;
for(int i = 1; i <= 6; i++)... | ALGO | 0.999981 | 5.649844 |
b675dd07-9363-43a9-aaec-b2685474308c | Corycle/XCPC-Codes | test/Codeforces Round 819 (Div. 1 + Div. 2) and Grimoire of Code Annual Contest 2022/C. Jatayu's Balanced Bracket Sequence.cpp | /*====Corycle====*/
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int inf=0x3f3f3f3f;
const int N=2e5+5;
int read(){
int s=0,f=1;char c=getchar();
while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
while(c>='0'&&c<='9'){s=s*10+c-'0';c=getchar();}
return s*f;
}
char s[N];
int n,m,fa[N],pos[N]... | ALGO | 0.999427 | 3.543484 |
2f627506-f495-4fb7-8424-99b56d95b533 | Kretinum/AOC2020 | Day8.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <cstring>
std::ifstream fin("C:\\Users\\mihai\\CLionProjects\\AOCDay8\\input.txt");
typedef struct instruction{
int type;
int value;
};
int task_1(int postion,instruction ins_list[],bool visited_array[],int cr_acc,int size)
{
if (visited_arra... | ALGO | 0.999895 | 4.040785 |
31af825d-0009-4502-9deb-99d5966ac5d8 | wchch1010/caffe-cvmlp-polsar | src/caffe/layers/argmax_layer.cpp | #include <algorithm>
#include <functional>
#include <utility>
#include <vector>
#include "caffe/layers/argmax_layer.hpp"
namespace caffe {
template <typename Dtype>
void ArgMaxLayer<Dtype>::LayerSetUp(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top) {
const ArgMaxParameter& argmax_param = th... | DATA | 0.901759 | 6.595083 |
03c1f69d-eb8a-4514-bbf5-3e7e61e6cba2 | pavel-ryzhov/global_vars | runs/005272.cpp | /*
* File: main.cpp
* Author: valerij
*
* Created on April 30, 2011, 8:26 PM
*/
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
using namespace std;
/*
*
*/
vector<vector<string> > templatesL(10,vector<string>(4,""));
vector<vector<string> > templatesR(10,vecto... | ALGO | 0.985147 | 3.15907 |
081c06bd-94e5-414b-b42f-5f40184b5dec | PhuocVinhLee/online_system_exam_quiz_programming | online_exam_system_backend/temp/0d4ptyc4.cpp | #include<stdio.h>
int add(int x, int y)
{
return(x+s9);
}
int main() {
printf("%d", add(-5, 1));
return 0;
}
| TOOL | 0.969295 | 3.448655 |
e653a267-fbe8-4302-89eb-83c9fb1fde92 | MukeshSahaniCS/rr | firstLastPosi.cpp |
#include <iostream>
using namespace std;
int firstOcc(int arr[], int n, int k){
int s=0;
int e=n-1;
int mid=s+(e-s)/2;
int ans=-1;
while(s<=e){
if(arr[mid]==k){
ans=mid;
e=mid-1;
}
else if(k>arr[mid]){
s=mid+1;
}
else{
... | ALGO | 0.999904 | 5.039715 |
24decc17-1c22-4f66-ae82-45412a47a8ba | Geetansh01/oops-cwh-codes | tut15_functions_funct_prototyping.cpp | #include<iostream>
using namespace std;
//*****************************Functions***************************
// int sum(int a, int b){
// int sum = a+b;
// return sum;
// }
// int main(){
// int num1, num2;
// cout<<"Enter first number:"<<endl;
// cin>>num1;
// cout<<"Enter second number:"<<e... | ALGO | 0.993399 | 3.733818 |
19158061-ad90-46fc-a196-861841707381 | mirzaazwad/Competitive-Programming | SolvedProblems/Codeforces/A_Destroyer.cpp | #include <bits/stdc++.h>
#define fastio \
ios_base::sync_with_stdio(false); \
cin.tie(NULL)
#define endl "\n"
#define ll long long
using namespace std;
void solve(){
map<ll,ll>mp;
int n;
cin>>n;
vector<int>v(n);
int lim=INT_MIN;
for(int i=0;i<n;i++){
cin>>v[i];
mp[v... | ALGO | 0.999654 | 4.588642 |
e808efa0-10c9-45da-afb9-27fd2fc061f1 | Pragna235/Coding-Ninjas-Problems | Longest Subarray With Sum K Positives.cpp | int longestSubarrayWithSumK(vector<int> a, long long k) {
// Write your code here
int left=0,right=0;
long long sum = a[0];
int n = a.size();
int maxLen=0;
while(right<n){
while(left<=right && sum>k){
sum-=a[left];
left++;
}
if(sum==k){
... | ALGO | 0.999933 | 4.985692 |
b595bab6-d8ff-47cc-8a86-f2d2807af82b | virtualsecureplatform/llvm-rv16k | llvm/lib/Support/SpecialCaseList.cpp | #include "llvm/Support/SpecialCaseList.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Regex.h"
#include <string>
#include <system_error>
#include <utility>
#include <stdio.h>
namespace llvm {
bool SpecialCaseList::Matcher::insert(s... | TOOL | 0.937838 | 7.382716 |
4c3eae13-3f74-4b62-8c25-4c93532df789 | MarcoVitoC/compnest | CSES/Introductory/GrayCode.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<string> grayCode;
grayCode.push_back("");
for (int i=0; i<n; i++){
int size = grayCode.size();
for (int j=size-1; j>=0; j--){ // add the previous list in reverse order
grayCode.push_... | ALGO | 0.999989 | 4.555217 |
1b546f1c-e0f7-4976-8bd6-93150230ea14 | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/Phi/top0-100/maximize-the-number-of-partitions-after-operations-Solution.maxPartitionsAfterOperations/177839_+Info.cpp | _PUBLIC_ codepoint_t next_codepoint_handle_ext(
struct smb_iconv_handle *ic,
const char *str, size_t len,
charset_t src_charset,
size_t *bytes_consumed)
{
/* it cannot occupy more than 4 bytes in UTF16 format */
uint8_t buf[4];
smb_iconv_t descriptor;
size_t ilen_orig;
size_t ilen;
size_t olen;... | ALGO | 0.975987 | 5.138347 |
3eb54c2f-f70d-42d9-8f5e-4b044c18b641 | Raagsss/DSA | LeetCode/209-minimum-size-subarray-sum/minimum-size-subarray-sum.cpp | class Solution {
public:
int minSubArrayLen(int target, vector<int>& nums) {
int n=nums.size();
int j=0;
int minLen=INT_MAX;
int sum=0;
for(int i=0;i<n;i++) {
sum+=nums[i];
while(sum>=target) {
minLen=min(minLen,i-j+1);
... | ALGO | 0.999996 | 6.436159 |
94f17de1-29e8-49c7-9fd9-a8b65bcc8523 | utsavibhakhar/C- | PDF-6/6-p5.cpp | #include <iostream>
using namespace std;
int main() {
int side1 = 6;
int side2 = 13;
int hypotenuseSquared = side1 * side1 + side2 * side2; //205
int hypotenuse = 0;
for (float i = 1; i * i <= hypotenuseSquared; i += 0.001)
{
hypotenuse = i;
}
cout<<"Length of the third side(... | ALGO | 0.997927 | 3.360824 |
9b1af5b0-cd0d-46f6-8197-7f396f9653ea | kirijuana/OOP_LAB_1 | OOP_LAB_1/boost_1_75_0/libs/graph/example/degree_centrality.cpp | //[degree_centrality_example
#include <iostream>
#include <iomanip>
#include <boost/graph/undirected_graph.hpp>
#include <boost/graph/exterior_property.hpp>
#include <boost/graph/degree_centrality.hpp>
#include "helper.hpp"
using namespace std;
using namespace boost;
// The Actor type stores the name of each vertex... | ALGO | 0.999201 | 7.280549 |
966c2141-bf39-4c59-a38d-67285a84ce3f | harshit4v/Daily-DSA-GFG-Practice | Arrays/Sort 0s, 1s and 2s.cpp | void sort012(vector<int>& arr) {
// code here
int n=arr.size();
int low=0,mid=0,high=n-1;
while(mid<=high){
if(arr[mid]==0){
swap(arr[mid],arr[low]);
mid++;
low++;
}
else if(arr[mid]==1){
mid++;
}
else{
swap(ar... | ALGO | 0.999962 | 5.242564 |
ca6af78b-5ae6-493c-b906-591ffb753d2d | AngilaPalungwaLimbu/Shopping-App-UI | 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.998689 | 6.787361 |
53a25f3e-ff45-4c43-a47c-71608240bd36 | dinox0r/comp-prog | project-euler/p27.cpp | #include <iostream>
#include <cstring>
#include <bitset>
#include <list>
#include <vector>
#include <cmath>
#include <cstdio>
#include <ctime>
#include <map>
using namespace std;
typedef unsigned int uint;
typedef list< pair<uint, uint> > listOfPair;
template<int N> void sieveOfAtkin(bitset<N>& primes) {
primes.r... | ALGO | 0.999805 | 4.0751 |
1bfb8156-f2c9-446a-b803-735b826a1d62 | adityaazad79/CP | Maximum_AND.cpp | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
#define endl '\n'
const int N = 1e7 + 10;
const int M = 1e9 + 7;
bool compare(pair<ll, ll> &A, pair<ll, ll> &B)
{
if (A.first != A.second)
return A.first > B.first;
return A.seco... | ALGO | 0.9999 | 4.198871 |
6f9a2a7d-c2d8-4d0d-a483-9d57be5ef03e | Saikrishna1504/DSA0151-OOPS | UNIT-III/Medium/5.decimal_to_binary.cpp | #include <iostream>
using namespace std;
class DecimalToBinary {
public:
DecimalToBinary(int decimal);
void displayBinary();
private:
int binary;
};
DecimalToBinary::DecimalToBinary(int decimal) {
int remainder, factor = 1;
binary = 0;
while (decimal != 0) {
remainder = decimal % 2... | ALGO | 0.985392 | 6.572885 |
d282a8d6-1d4f-4e55-b247-446d53583ada | mkcse2012/ardupilot_240430 | libraries/AP_Proximity/AP_Proximity_RangeFinder.cpp | #include "AP_Proximity_config.h"
#if AP_PROXIMITY_RANGEFINDER_ENABLED
#include "AP_Proximity_RangeFinder.h"
#include <AP_HAL/AP_HAL.h>
#include <ctype.h>
#include <stdio.h>
#include <AP_RangeFinder/AP_RangeFinder.h>
#include <AP_RangeFinder/AP_RangeFinder_Backend.h>
// update the state of the sensor
void AP_Proximi... | TOOL | 0.962017 | 6.412265 |
e620711a-e7f4-449a-92d2-619694c6da98 | jhpark555/dsa_cpp | ArrayVector.cpp | #include <iostream>
using namespace std;
typedef int Elem;
class ArrayVector{
public:
ArrayVector();
int size() const;
bool empty() const;
Elem& operator[](int i);
Elem& at(int i);
void erase(int i);
void insert(int i,const Elem& e);
void reserve(int... | ALGO | 0.966392 | 4.182047 |
d2d1dbc8-5937-43f0-a562-c432f144c21a | QianQNanami/JSOI-WC25 | TG/judger/source/WC25-543/tree.cpp | #include<bits/stdc++.h>
#define int long long
using namespace std;
int n,root,num,ans;
int hd[100005],tot;
struct node{
int v,nxt;
}edge[100005];
void link(int u,int v){
tot++;
edge[tot].v=v;
edge[tot].nxt=hd[u];
hd[u]=tot;
}
int x[100005],y;
int d[100005];
void dfs(int u,int f){
d[u]=x[u];
for(int i=hd[u];i;i=e... | ALGO | 0.999908 | 3.680253 |
d8da9af4-800f-4dcf-ad87-4c7892fcfec4 | aragle/online-judge-solutions | URI Online Judge/1070 - Six Odd Numbers/1070 - Six Odd Numbers.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int inputAnInteger;
cin >> inputAnInteger;
if(inputAnInteger%2==0){
inputAnInteger +=1;
}
for (int i = inputAnInteger; i < inputAnInteger+12; i+=2){
cout << i << endl;
}
}
| ALGO | 0.998559 | 3.017658 |
212bf3a4-f88b-46e6-b762-007a8d150e2d | Fobertree/CSES_Practice | Archived/Introductory Problems/Two_Knights.cpp | #include <iostream>
#include <vector>
#include <utility>
// two knights
using namespace std;
typedef long long ll;
vector<pair<int,int>> dirs = {{2,1},{2,-1},{1,2},{1,-2},{-1,2},{-1,-2},{-2,1},{-2,-1}};
ll z {0};
int main() {
int n; ll res{0}, cannot{0}, x,y, sq;
cin >> n;
// can condense to n^2
f... | ALGO | 0.999743 | 3.670976 |
ae6c2b81-9ac1-4715-949c-a86d1c4f53b3 | NaVIn69/AlgoZenith_DSA | week1/increasing_array.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
void solve(){
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++){
cin>>a[i];
}
int cnt=0;
for(int i=0;i<n;i++){
if(i==n-1){
continue;
}
if(a[i]<=a[i+1]){
continue;
}e... | ALGO | 0.999624 | 4.460559 |
88a4d96e-f690-4fc2-8711-eb8ff90bb28e | aryashsaxena/leetcode_problems | Surround the 1's - GFG/surround-the-1s.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int get(int i,int j,vector<vector<int>>&grid){
int dx[8]={-1,-1,-1,1,1,1,0,0};
int dy[8]={-1,0,1,-1,0,1,-1,1};
int count=0;
for(int k=0;k<8;k++){
... | ALGO | 0.999859 | 6.789931 |
4eccb344-44f7-46ea-bcfa-cae55c5acb04 | setuhb/FLUTTER-PROJECT | 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.998809 | 6.763549 |
32ca8397-d1e7-4303-b4c9-21f2e4ec8ad8 | Azraf-Faheem/C-Practices | EvenOdd.cpp | #include<iostream>
using namespace std;
int main()
{
int a;
cout<<"Enter a number: ";
cin>>a;
if(a%2==0)
{
cout<<a <<" is a Even Number";
}
else {
cout<< a <<" is an ODD Number";
}
return 0;
}
| ALGO | 0.952402 | 3.226545 |
4c4be19e-5c94-4b13-990e-25455f40de23 | mdakram28/synclibcpp | src/diff.cpp |
#include "diff.hpp"
#include <math.h>
#include <cstdio>
#include <iterator>
#include <sstream>
#include <string>
#include <vector>
#define MERGE_THRES 6
#define DEBUG(var) std::cout << #var << " = " << var << std::endl;
#define RET_ERROR(_err_msg) \
err_msg = _err_msg; \
return false;
#define RET_JSON(... | TOOL | 0.949398 | 6.065365 |
c2d9bb97-0efc-475f-9c68-d6943965a02b | iSuneast/uva-codes-for-acm-icpc | UVa 100 - 9999/412 - Pi_0226_number theory.cpp | /*
412 - Pi
...
ҪͷԼ...
Ҫӵķȥ...
*/
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int gcd(int a,int b)
{
return b==0?a:gcd(b,a%b);
}
int main()
{
// freopen("in.txt","r",stdin);
int n,num[55];
while(cin>>n && n)
{
int i,j,cnt=0;
long double pi;
for(i=0;i<n;i++)
cin>>num[i];... | ALGO | 0.999774 | 3.431221 |
060be1ba-fd17-43a6-adf3-9d26f4b930da | amiralikaboli/Codeforces | 169B.cpp | #include <bits/stdc++.h>
using namespace std;
bool cmp(char a,char b){
return a>b;
}
int main(){
string s,digit;
cin >> s >> digit;
sort(digit.begin(),digit.end(),cmp);
int ind=0;
for (int i=0;i<s.size();++i)
if (ind<digit.size() && s[i]<digit[ind])
s[i]=digit[ind++];
cout << s;
} | ALGO | 0.999742 | 3.896458 |
929405aa-98a9-4a86-b48b-dc655c3a505c | milmillin/comp-prog | IPST/Archive/12Mar/rss.cpp | #include <cstdio>
#include <string>
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int dp[20][100100];
struct ei{
int id,rnk1,rnk2;
};
bool cmp (const ei &a, const ei &b) {
if (a.rnk1!=b.rnk1) return a.rnk1<b.rnk1;
return a.rnk2<b.rnk2;
}
string x;
int get(int i,int j) {
if (... | ALGO | 0.999933 | 4.042336 |
5b510287-a145-4684-8eaa-35d8bab44c98 | ishandutta2007/codeforces | ekzhang/normal/997/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const double PI = 4 * atan(1);
int N;
LL X, Y;
string S;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
// freopen("input.txt", "r", stdin);
cin >> N >> X >> Y >> S;
bool blk = false;
int num = 0;
for (int i = 0; i < N; i++) {
... | ALGO | 0.999633 | 3.667685 |
83f9b8bb-6b26-493f-b1b1-3997510ba10d | cbrownaz24/Momentum-Trading-Bot | eigen-3.4.0/bench/perf_monitoring/trmv_up.cpp | #include "gemv_common.h"
EIGEN_DONT_INLINE
void trmv(const Mat &A, const Vec &B, Vec &C)
{
C.noalias() += A.triangularView<Upper>() * B;
}
int main(int argc, char **argv)
{
return main_gemv(argc, argv, trmv);
}
| ALGO | 0.97463 | 4.868302 |
4f9dd14f-d51d-439b-b5e1-2163b7403a7c | utkhagni13/Programming | hackerrank/problem solving/chocolate feast.cpp | #include <bits/stdc++.h>
using namespace std;
vector<string> split_string(string);
// Complete the chocolateFeast function below.
int chocolateFeast(int n, int c, int m)
{
int i,chc,wrap;
chc = wrap = n/c;//chc=5
if(wrap < m)//but m=2
wrap = 0;
while(wrap>=m)
{
chc = chc + wrap/m;//2/... | ALGO | 0.999885 | 5.599373 |
6c36bde9-b432-4813-a767-f4d52f07ae53 | makodaa/happy-habit-at | 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 |
2dfe799f-9ccd-4593-978d-167f0cb99516 | raincross7/code-similarity | codes/train_code/problem183/problem183_155.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,ll>pa;
const int N=2e5+100;
const int mod=1e9+7;
const int inf=0x3f3f3f3f;
ll qpow(ll x,ll n)
{
if(x==0&&n==0) return 1;
ll sum=1;
while(n){
if(n&1) {
sum=sum*x%mod;
}
x=x*x%mod;
... | ALGO | 0.99999 | 4.62816 |
a4ceece4-2a0e-41a1-b290-a2cc02bad894 | Preven-K/ALTRUISTY-CHALLENGE | Q5/Q5.cpp | # include <bits/stdc++.h>
using namespace std;
int main()
{
int arr[9];
for(int& ox : arr){
cin >> ox ;
if((ox<1 || ox>100)){
cout << "INVALID INPUT";
return 0;
}
}
int sum[3] = {0, 0, 0};
for(int i=0;i<9;i++){
sum[i%3] += arr[i];
}
int... | ALGO | 0.998401 | 4.151921 |
30953ae3-2507-458c-96f9-ea0b4043b3f6 | locus-x64/DSA | recursionPracs2/t6.cpp | /*
Write a recursive function GCD(n,m) that returns the
greatest common divisor of two integers n and
m according to the following definition:
*/
#include<iostream>
#include <string>
using namespace std;
int GCD(int n, int m){
if(n>=m and n%m == 0) return m;
else if(m>n) return GCD(m,n);
else return GCD(m,n%m);
... | ALGO | 0.999817 | 6.028712 |
d46a77d2-9ab3-480a-b5f4-f069ee4f6a33 | LEETESH42/Leetcode | 0816-design-hashset/0816-design-hashset.cpp | class MyHashSet {
public:
vector<int> v;
MyHashSet() {
v.resize(1e6+1,0);
}
void add(int key) {
v[key]=1;
}
void remove(int key) {
v[key]=0;
}
bool contains(int key) {
return v[key];
}
};
/**
* Your MyHashSet object will be instantiate... | ALGO | 0.998724 | 5.4802 |
ea82f478-247d-42b5-acc1-bd7fc60ec33d | netanel0909/Cses | 1617.cpp | #include<string>
#include<iostream>
#include<vector>
#include<algorithm>
#define MAX 10000000007
using namespace std;
int main()
{
long long int n = 1;
long long int k;
cin >> k;
while (k--)
{
n <<= 1;
n %= MAX;
}
cout << n << endl;
return 0;
} | ALGO | 0.999843 | 3.71444 |
ee7026e9-e457-4356-b2b6-dd3ac1693a3a | Easoncer/swordoffer | sword_c++/连续子数组的最大和.cpp | //
// Created by 李先生 on 2018/8/30.
//
#include <iostream>
#include <iostream>
#include <string>
#include <stack>
#include <vector>
#include <queue>
#include <map>
using namespace std;
class Solution {
public:
int FindGreatestSumOfSubArray(vector<int> array) {
int res = array[0], temp = array[0];
... | ALGO | 0.999815 | 4.784639 |
4289f602-755a-4544-8e23-ed12a6beebb7 | hiden52/C-Practice | 연습/거듭제곱For문.cpp | #include <iostream>
using namespace std;
int main()
{
//for문의 연습
// 임의의 정수를 입력받아 그 수 만큼 1~10의 수를 각각 거듭제곱한 결과를 출력하는 프로그램
int iHowM =0; //입력 받을 수 == 거듭제곱의 횟수
cout << "1~10 의 수를 몇 번 제곱할까? : " << endl;
cin >> iHowM ;
for(int i=1; i<=10; ++i) //i는 1부터 10까지의 수를 뽑아내기 위함
{
int i... | ALGO | 0.988871 | 3.55172 |
b7ed998b-ea91-4c58-a61d-b82958c7a471 | quadratech188/baekjoon | solutions/10775-noinclude.cpp | #include <array>
#include <cassert>
#include <cstdio>
#include <iostream>
#include <istream>
#include <type_traits>
#include <unistd.h>
#include <utility>
#include <vector>
#ifndef FASTISTREAM_BUFFER_SIZE
#define FASTISTREAM_BUFFER_SIZE 1 << 20
#endif
#ifndef FASTOSTREAM_BUFFER_SIZE
#define FASTOSTREAM_BUFFER_SIZE 1 ... | ALGO | 0.999866 | 3.932382 |
0a2dfff7-2479-46e6-95db-977a7ab7517a | crimsonme/UE4.25 | UnrealEngine-release/Engine/Source/Developer/TraceInsights/Private/Insights/ViewModels/TimerGroupingAndSorting.cpp | #include "TimerGroupingAndSorting.h"
#include "Insights/Table/ViewModels/TableColumn.h"
#include "Insights/ViewModels/TimerNodeHelper.h"
#define LOCTEXT_NAMESPACE "TimerNode"
// Sort by name (ascending).
#define INSIGHTS_DEFAULT_SORTING_NODES(A, B) return A->GetName().LexicalLess(B->GetName());
////////////////////... | TOOL | 0.939596 | 7.037147 |
b035c1b4-1c15-4755-8e33-afb9a4dba685 | thinkdifferentor/datastructure | Data_Structure/Data_Structure/1.17.cpp | #include<stdio.h>
#include<stdlib.h>
#define MAX_INDEX 1000
int fibonacci(int k, int m);
int main() {
int i = fibonacci(2, 5);
printf("%d\n", i);
system("pause");
return 0;
}
int fibonacci(int k, int m) {
int result = 0;
int a[MAX_INDEX];
if (m < 0 || k < 2) {
printf("飡");
return -1;
}
if (m < k - ... | ALGO | 0.99955 | 3.359871 |
13b146ee-63f7-4688-9d91-8332dc785a67 | inf-eth/i02-0491-courses | 1301 - Programming for Engineers II - Spring 2013/Course Progression/PII-Spr2013-30-Linked_List_Display_Search_and_Delete-12-04-2013/PII-Spr2013-30-Linked_List_Display_Search_and_Delete-12-04-2013.cpp | #include <iostream>
using namespace std;
class Node
{
public:
int Data;
Node* Next;
};
class LinkedList
{
private:
Node* First;
public:
LinkedList(): First(NULL)
{
}
// Adds a node at the end of linked list.
void AddNode(int pData)
{
// If creating first node we need to change first pointer.
if (First ==... | ALGO | 0.999922 | 5.714327 |
b80c5259-a19f-42ac-85e5-9b2d943b47f0 | abdul1mannan/LeetCode | 0138-copy-list-with-random-pointer/0138-copy-list-with-random-pointer.cpp | /*
// Definition for a Node.
class Node {
public:
int val;
Node* next;
Node* random;
Node(int _val) {
val = _val;
next = NULL;
random = NULL;
}
};
*/
class Solution {
public:
void insertnode(Node *head){
Node *temp=head;
while(temp!=NULL){
... | ALGO | 0.999167 | 5.365347 |
a64872a3-fde0-4e90-a401-84b767b6674a | heeba-khan/Leetcode-Solutions | 0965-univalued-binary-tree/0965-univalued-binary-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999895 | 6.384986 |
beb970ff-1e4f-46fd-aa32-36f0a2ed7892 | Arjun11221/DsaPractice | Matrix1/storetranspose.cpp | #include<iostream>
using namespace std;
int main(){
int m;
cout<<"Enter Rows : ";
cin>>m;
int n;
cout<<"Enter Columns : ";
cin>>n;
int arr[m][n];
cout<<"Enter Array's Elements : ";
for(int i = 0; i<m; i++){
for(int j = 0; j<n; j++){
cin>>arr[i][j];
}... | ALGO | 0.998576 | 3.175374 |
487f1ba8-ada8-4e17-9b74-d007564a43ca | aryacliche/StorageDump-Public- | CS101/Final CS Project/starter_code/main_but_with_obstacles.cpp | #include <simplecpp>
#include "shooter.h"
#include "bubble.h"
#include "obstacles.h"
/* Simulation Vars */
const double STEP_TIME = 0.02;
/* Game Vars */
const int PLAY_Y_HEIGHT = 450;
const int LEFT_MARGIN = 70;
const int RIGHT_MARGIN=500-70;
const int TOP_MARGIN = 20;
const int BOTTOM_MARGIN = (PLAY_Y_HEIGHT+TOP_MA... | ALGO | 0.964151 | 3.493783 |
a060895c-8f5b-4106-bd1d-8149d6a1b1ad | sarafanshul/Codes | OJs/1651.cpp | // https://cses.fi/problemset/task/1651
#ifndef CUST_DEBUG
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("unroll-loops")
#endif
#include <bits/stdc++.h>
#define ALL(x) x.begin(),x.end()
#define PB push_back
#define F first
#define S se... | ALGO | 0.99982 | 4.751565 |
a8a06760-d2c1-4c2b-9aff-ac24e8431d09 | prclibo/relative-pose-estimation | eigen/bench/benchmarkX.cpp | // g++ -fopenmp -I .. -O3 -DNDEBUG -finline-limit=1000 benchmarkX.cpp -o b && time ./b
#include <iostream>
#include <Eigen/Core>
using namespace std;
using namespace Eigen;
#ifndef MATTYPE
#define MATTYPE MatrixXLd
#endif
#ifndef MATSIZE
#define MATSIZE 400
#endif
#ifndef REPEAT
#define REPEAT 100
#endif
int mai... | ALGO | 0.932722 | 3.376298 |
dc238040-0148-4206-aded-e5ea5d171ad6 | aanu2021/Leetcode-Solutions | 102-binary-tree-level-order-traversal/102-binary-tree-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.999794 | 6.096005 |
a7e97b83-b499-4875-b740-870da261125a | aruaru0/cpp-myatcoder | ABC/373/a.cpp | #include <iostream>
using namespace std;
int main()
{
int cnt = 0;
for (int i = 1; i <= 12; i++)
{
string s;
cin >> s;
if (s.size() == i)
{
cnt++;
}
}
cout << cnt << endl;
} | ALGO | 0.99326 | 3.777658 |
a58dfd62-2f1f-4b62-8f50-b03280b35427 | asadullahkhalid147/XPSC | week-4/day-10/practice.cpp | #include<bits/stdc++.h>
using namespace std;
void solve()
{
int n;
cin >> n;
vector<int>a(n);
for(auto &i : a) cin >> i;
int ans = 0;
for(int i = n - 2; i >= 0; i--)
{
while(a[i] >= a[i + 1] && a[i] > 0)
{
a[i] /= 2;
ans++;
}
if(a[i] ==... | ALGO | 0.999682 | 4.341885 |
db81ecee-6ae1-470d-b45e-46f66415038c | bira37/problem-solving | Codeforces/Official Rounds/403/Div2A.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
bool vis[100001];
for(int i=0; i<100001; i++){
vis[i] = false;
}
int n;
cin >> n;
int ans = 0;
int current = 0;
for(int i =0; i< 2*n; i++){
int x;
cin >> x;
if(vis[x]){
vis[x] = false;
current--;
}
else{
vis[x] = true;
curre... | ALGO | 0.999708 | 3.950311 |
2ef366e8-2632-4232-9041-94dbcfb12dbb | ManasviGaur/Competitive-Programming-Solutions | codeforces/1618/C.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <climits>
#include <iomanip>
#include <tuple>
#include <list>
#include <bitset>
#include <queue>
#include <deque>
#include <string>
#include <cstring>
#include <cmath>
#inc... | ALGO | 0.999928 | 4.613143 |
713c5c01-bcd2-46b7-96af-b9fbfbd442d0 | Shrutichawla786/HeapQuestions | Is Binary Tree Heap.cpp | link-->https://www.geeksforgeeks.org/problems/is-binary-tree-heap/1
Q.Is Binary Tree Heap
code-->
bool CBT(struct Node * root ,int i ,int nodeCount){
if(root==NULL){
return true;
}
if(i>=nodeCount){
return false;
}
... | ALGO | 0.999964 | 5.818311 |
9f3cc472-05d8-48ea-b9ca-f9dce04e2a94 | BanMing/BanMingLeetCode | LeetCode/C++/Array/RemoveElement.cpp | /******************************************************************
** 文件名: RemoveElement.cpp
** 创建人: BanMing
** 日 期: 8/23/2020, 4:42:05 PM
** 描 述:
**************************** 修改记录 ******************************
** 修改人:
** 日 期:
** 描 述:
*******************************************************************/
#include... | ALGO | 0.998713 | 6.083287 |
b3124192-6449-4f07-b8eb-b265a058f163 | koga3/OpenCv-Plus-Unity | source/opencv-4.7.0/modules/ml/src/svmsgd.cpp | #include "precomp.hpp"
#include "limits"
#include <iostream>
using std::cout;
using std::endl;
/****************************************************************************************\
* Stochastic Gradient Descent SVM Classifier *
\***************************************... | DATA | 0.95188 | 7.319946 |
9910a468-7640-48d4-a1d2-10cd01da5da9 | Darkknight1299/C-plus-plus | Graphs/Dijkstra's_Algo.cpp | #include<bits/stdc++.h>
using namespace std;
template <typename T>
class Graph{
unordered_map<T,list<pair<T,int>>> m;
public:
void addEdge(T u,T v,int dist,bool bidir=true){
m[u].push_back(make_pair(v,dist));
if(bidir){
m[v].push_back(make_pair(u,dist));
}
}
void printAdj(){
for(auto ... | ALGO | 0.999947 | 4.176128 |
06408852-fdcd-4b82-81d7-c1d56551ed6d | ishandutta2007/codeforces | everule/normal/1362/A.cpp | //https://codeforces.com/contest/1362/problem/0
#include <iostream>
#include <bits/stdc++.h>
#define ll long long int
#define mp make_pair
#define pb push_back
using namespace std;
template<typename T>
ostream& operator+(ostream& out, const vector<T> &vec){
for(const auto &x : vec){
out<<x<<" ";
}
o... | ALGO | 0.999973 | 4.506683 |
87db466b-e028-4765-a85b-f753db807203 | Zol-piE/Solved-Problems | Problems Solved/Problem Generator.cpp | #include<iostream>
using namespace std;
int main()
{
int t;cin>>t;
while(t--)
{
int n,m;
cin>>n>>m;
char ch;
int arr[] ={0,0,0,0,0,0,0};
for(int i=0;i<n;i++)
{
cin>>ch;
if(ch=='A') arr[0]++;
else if(ch=='B') arr[1]++;
... | ALGO | 0.999218 | 3.619552 |
fa2c62cd-67ce-47f0-82ce-3eac2a7ff36f | lorissigno/ProgettoRipetizioniIUM-Unito | 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.998693 | 6.797273 |
aa018cbc-866b-4531-80c5-ff8502f14f9a | BingluCS/CBB-SC25 | Application/warpx_directory/WarpX/Source/Diagnostics/ComputeDiagFunctors/BackTransformFunctor.cpp | #include "BackTransformFunctor.H"
#include "Diagnostics/ComputeDiagFunctors/ComputeDiagFunctor.H"
#include "Utils/WarpXConst.H"
#include "WarpX.H"
#include <ablastr/utils/Communication.H>
#include <AMReX_Array4.H>
#include <AMReX_BoxArray.H>
#include <AMReX_Config.H>
#include <AMReX_FArrayBox.H>
#include <AMReX_FabA... | TOOL | 0.951969 | 7.788532 |
81f299ba-e14d-4cb9-82ed-0b073881e6b0 | shuest/leetcode | 491.cpp | #include<iostream>
#include<cstdio>
#include<cmath>
#include<string>
#include<cstring>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<stack>
#include<queue>
using namespace std;
//ִС2
class Solution {
public:
vector<vector<int>> findSubsequences(vector<int>& nums) {
vector<vector... | ALGO | 0.999876 | 4.27603 |
295bc081-9e25-4074-84e6-74ab13ad89a2 | bkfish/Assembly-code | 第一次作业/2-40.cpp | // ConsoleApplication1.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#include "pch.h"
#include <iostream>
using namespace std;
int main()
{
int a[14] = { 1,2,3,4,5,6,7,8,9,10,11,12,13,0};
int obssub = 0;
int jishu = 0, oushu = 0;
_asm {
LEA ECX ,a
XOR EAX,EAX
XOR EBX,EBX
LOOOP1:
CMP [ECX],0
JE LOOOPJiOver
... | ALGO | 0.999144 | 3.133888 |
861b11f9-1ff2-45ab-8540-5c669f44553c | gosujuna/cf | rating 1156/C_Thermostat.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using str = string; // ben qi python
#define endl '\n'
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(), (v).end()
template <typename T> T pow(T a, long long b) {
assert(b >= 0);
T r = 1;
while (b) {
if (b & 1)
r *= a;
b >>= 1;
a... | ALGO | 0.99969 | 4.107906 |
abe64607-2076-439c-add9-9b772f8b2694 | BinomialSheep/CompetitiveC-- | AtcoderContest/ABC329/G.cpp | #pragma region header
#include <bits/stdc++.h>
// デバッグ用マクロ:https://naskya.net/post/0002/
#ifdef LOCAL
#include <debug_print.hpp>
#define debug(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) (static_cast<void>(0))
#endif
using namespace std;
using ll = long long;
using vi = vector<int>... | ALGO | 0.999953 | 5.068213 |
f49562c6-be36-4b27-9685-47d99c1acb91 | OpenXRay/xray-soc-history | net.ssa/xr_3da/xrCDB/OPC_OBB.cpp | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
* Contains OBB-related code.
* \file IceOBB.cpp
* \author Pierre Terdiman
* \date January, 29, 2000
*/
/////... | ALGO | 0.957903 | 7.781594 |
eadaedae-bcad-4ade-a287-f65f2e755523 | ParulYaduvanshi/Strivers-A2Z-DSA-Course-Sheet | Step 1: Learn the Basics/Learn Basic Recursion/print_name_N_times_using_recursion.cpp | #include<iostream>
using namespace std;
void func(int i,int n){
// base condition
if (i>n) return;
cout<<"Parul"<<endl;
func(i+1,n);
}
int main(){
int i=1,n=4;
func(i,n);
return 0;
} | ALGO | 0.999762 | 3.661527 |
26682717-0a98-4435-b195-6a1f798a9b0a | priyavrat-misra/dsa-dump | problems/arrays/problem_15.cpp | // Problem:
/*
* Given an array of integers containing n + 1 integers
* where each integer is in the range [1, n] inclusive.
* There is only one repeated number, return this repeated number.
*
* source: https://leetcode.com/problems/find-the-duplicate-number/
*/
// Solution:
/*
* approach: sum of all elements
... | ALGO | 0.988244 | 6.322478 |
e9455eae-3b6e-49af-ba1a-ae4519d61d2f | rwx-tarun/Repeat-repo | P_C.cpp |
#include<bits/stdc++.h>
using namespace std;
int main ()
{
int i,n;
cin>>n;
int arr[n];
for(int i=0;i<n;i++)
{
cin>>arr[i];
}
i=n-2;
while(i>=0 && arr[i+1]<=arr[i]) i--;
if (i>=0)
{
int j=n-1;
while(arr[j]<=arr[i]) j--;
int temp... | ALGO | 0.999983 | 3.742861 |
5efe69c4-be24-4e46-a337-554fbe446999 | anantsingh404/Leetcode | 1370-count-number-of-nice-subarrays/count-number-of-nice-subarrays.cpp | class Solution {
public:
int numberOfSubarrays(vector<int>& nums, int k) {
unordered_map<int,int> mp;
int count=0;
int sum=0;
mp[0]=1;
for(int i=0;i<nums.size();i++)
{
if(nums[i]%2)
{
++sum;
count+=mp[sum-k];
mp[sum]++;
}
... | ALGO | 0.999995 | 5.656649 |
4b654351-91cf-4354-8ef7-f3e58b81d234 | bheem2510/Cracking_The_Coding_Interview | Ch 8. Recursion-and-Dynamic-Programming/8-8-Permutation-with-dups.cpp | #include <iostream>
#include <vector>
#include <map>
#include <string>
using namespace std;
void findPermutations(string curr, map<char,int> m, vector<string>& res, int n){
int curr_length = curr.length();
if (n==curr_length){
res.push_back(curr);
return;
}
for (map<char,int>::iterator i = m.begin(); i!=m.en... | ALGO | 0.999975 | 4.749546 |
ddca5fc2-ee5b-4324-a721-c8f87c149c93 | xidianlina/cppplus | chapter_11_randwalk.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
#include <fstream>
#include "chapter_11_vector.h"
int main()
{
using namespace std;
using VECTOR::Vector;
srand(time(0));
double direction;
Vector step;
Vector result(0.0, 0.0);
unsigned long steps = 0;
double target;
double dstep;
ofstream fout;
fout.... | TOOL | 0.975048 | 3.31628 |
f54189e1-029b-4ad7-a9c0-a52fcfe7956f | retroBro3/CP_codings | DSA && CP Topics/DSA/Semester 2/Week 03 - Shortest Path Algorithm/Module 10 - Problem Solving Graph/Labyrinth_2_not_done.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
const int N = 1e3 + 10;
vector<string> graph;
int level[N][N];
bool visited[N][N];
vector<pii> direc = {{0, -1}, {0, 1}, {-1, 0}, {1, 0}};
pii parentCoords[N][N];
int n, m;
vector<pii> path;
bool isSafe(int i, int j)
{
return (i >= 0 && i <... | ALGO | 0.999987 | 4.113129 |
76da30d7-6d85-493c-a101-9ab851094904 | Eg-Nickname/cpp_uni | cw3/c_array_cpp_array.cpp | // Zadanie tablice:
// Napisz program, w którym utworzysz tablicę o zadanej liczbie elementów. Niech
// program poprosi o wprowadzenie liczb, które następnie będą przechowywane w
// tej tablicy. Wypisz liczby przechowywane w tablicy. Oblicz sumę oraz średnią
// liczb, wypisz je na ekran.
// Zmodyfikuj program tak, ab... | ALGO | 0.932082 | 5.198416 |
f1c8b53f-f12e-4be1-a9ad-3fb571416b4c | tactcomplabs/sst-dbg | src/console/sst-dbg.cpp | #include <fstream>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <thread>
#include <chrono>
#include <cstring>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <time.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <... | TOOL | 0.872784 | 4.666193 |
1132f941-7100-41aa-bf41-d633882765cc | Andrezzz9/StackOverMemes | 3rdparty/opencv_contrib/modules/ximgproc/samples/graphsegmentation_demo.cpp | #include "opencv2/ximgproc/segmentation.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/core.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
using namespace cv;
using namespace cv::ximgproc::segmentation;
Scalar hsv_to_rgb(Scalar);
Scalar color_mapping(int);
static void help() {
std::cout << std::e... | ALGO | 0.996687 | 5.968699 |
aeac4853-0970-4730-a09c-16d2ea410822 | ArtemDyrdin/ASD | 3rd semester/lab_5/main.cpp | #include <iostream>
#include <vector>
// функция - Сортировка Вставками
void insertionSort(std::vector<int>& numbers) {
// выбираем элемент и меняем его с предыдущими, пока он меньше их
for (int i = 1; i < numbers.size(); i++)
for (int j = i; j > 0; j--)
if (numbers[j-1] > numbers[j])
... | ALGO | 0.999967 | 4.714309 |
8b6b0da3-6fdd-4b09-a4ff-f1a93e59e3f0 | the-fall-of-icarus/dsacpp | graphs/dfs.cpp | #include <iostream>
#include <vector>
using namespace std;
/*
Perform DFS traversal on an undirected graph.
The graph is represented using an adjacency list.
*/
void dfsTraversal(int node, vector<vector<int>>& adjList, vector<bool>& visited) {
visited[node] = true; // Mark current node as visit... | ALGO | 0.999994 | 6.939371 |
21adcf2f-8e69-4dd8-a784-ef0c38886ea6 | ZJWang9928/PAT-Solutions | Basic/1070.cpp | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
using namespace std;
int n, rope[10002] = {0};
int main() {
ios::sync_with_stdio(false);
cin >> n;
int i;
int posi;
for (i = 0; i < n; i++) {
cin >> posi;
rope[p... | ALGO | 0.999253 | 3.939482 |
dc291b86-3bfb-47db-bcf6-2285001e03d2 | Imraan002/My-c-programs | prims_algo_optimized.cpp | #include <bits/stdc++.h>
using namespace std;
const int N=100;
int parent[N];
int dist[N];
bool mst[N];
vector<pair<int,int>> vec[N];
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
int n,m;
cin>>n>>m;
for(int i=0;i<m;i++)
{
int u,v,wt;
cin>>u>>v>>wt;
... | ALGO | 0.999995 | 4.882019 |
3d18379a-2fbb-4ca3-b6fc-f8e7532cc529 | christindbose/ECE666project | src/systemc/tests/systemc/misc/unit/data/datawidth_unsigned/bits_to_bits/datawidth.cpp | /*****************************************************************************
datawidth.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/**************************************************************************... | ALGO | 0.967581 | 5.331775 |
83189b03-0b14-4e52-a3f6-d237fa61b7f7 | ozu-201/graph-puzzle-game-mericokcu | src/Array/Heap/MinHeap.cpp | //
// Created by Olcay Taner YILDIZ on 18.05.2023.
//
#include "MinHeap.h"
void MinHeap::percolateDown(int no) {
int left, right;
left = 2 * no + 1;
right = 2 * no + 2;
while ((left < count && array[no].getData() > array[left].getData()) ||
(right < count && array[no].getData() > array[righ... | ALGO | 0.99726 | 4.979185 |
cafee35d-984a-48fe-b15c-f28f6644edf1 | loannt401/DSA_PTIT | DO THI/chuyentudsksangdsc.cpp | #include<bits/stdc++.h>
using namespace std;
main(){
int n; cin >> n;
cin.ignore();
vector<int> List[n+1];
for(int i=1;i<=n;i++){
string s; getline(cin,s);
istringstream s_cin(s);
int j;
while(s_cin>>j) List[i].push_back(j);
}
int d[100][100];
memset(d,0,sizeof(d));
for(int i=1;i<=n;i++){
for(int j=0... | ALGO | 0.999439 | 3.449909 |
870cddd3-4ee3-459d-bef2-dc934de4f4ec | stwuhan/leetcode | solution/0700-0799/0747.Largest Number At Least Twice of Others/Solution.cpp | class Solution {
public:
int dominantIndex(vector<int>& nums) {
int mx = 0, mid = 0;
int ans = 0;
for (int i = 0; i < nums.size(); ++i) {
if (nums[i] > mx) {
mid = mx;
mx = nums[i];
ans = i;
} else if (nums[i] > mid)
... | ALGO | 0.999991 | 6.037005 |
4ce1ae78-8b1b-491b-9026-1ff3e56c9089 | Jps91/BikeApp | lib/eigen-3.4.0/doc/examples/TutorialLinAlgExComputeSolveError.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
MatrixXd A = MatrixXd::Random(100,100);
MatrixXd b = MatrixXd::Random(100,50);
MatrixXd x = A.fullPivLu().solve(b);
double relative_error = (A*x - b).norm() / b.norm(); // norm() is L2 norm
cout << "The ... | ALGO | 0.999392 | 3.626518 |
65693ab9-d966-478b-b321-126b087dd7f9 | raincross7/code-similarity | codes/train_code/problem212/problem212_102.cpp | #include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cassert>
#include <iostream>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <sstream>
#include <bitset>
#define repr... | ALGO | 0.999942 | 4.149434 |
c58d5c79-dfc2-468a-ac80-0c7fa10fa57c | sgsma/Parcial2024-2-2 | Bloque 1/Ejercicio1.cpp | /*1. Escribe un programa que lea de la entrada estándar dos números y muestre
en la salida estándar su suma, resta, multiplicación y división.*/
#include <iostream>
using namespace std;
int main() {
// Declaración de variables
double num1, num2;
// Lectura de los dos números
cout << "Ingresa el prim... | ALGO | 0.868032 | 4.368577 |
1d11126a-7bab-4e3f-84c2-802a90c8ce18 | srak-uf/lammps_intermol_heatflux | src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp | #include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "pair_lj_cut_coul_cut_kokkos.h"
#include "kokkos.h"
#include "atom_kokkos.h"
#include "comm.h"
#include "force.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "neigh_request.h"
#include "update.h"
#include "integrate.h"
#inc... | ALGO | 0.996216 | 6.34844 |
09d7f045-75c7-4ec0-8175-6756c8a9ff48 | NachoMC/UE_U_SteeringBehaviors | SteeringsMOAI/moai/3rdparty/box2d-2.2.1/Box2D/Common/b2Math.cpp | #include <Box2D/Common/b2Math.h>
const b2Vec2 b2Vec2_zero(0.0f, 0.0f);
/// Solve A * x = b, where b is a column vector. This is more efficient
/// than computing the inverse in one-shot cases.
b2Vec3 b2Mat33::Solve33(const b2Vec3& b) const
{
float32 det = b2Dot(ex, b2Cross(ey, ez));
if (det != 0.0f)
{
det = 1.0f... | ALGO | 0.999089 | 6.960704 |
cbfe7d38-60a7-480a-8f83-4dd9fe03db64 | GersonCavalheiro/OpenMPSnapshot | May2023/RepCPP/250192223/OpenQR.cpp |
#include "OpenQR.h"
OpenQR::OpenQR()
{
threadNum = GetCoresSize();
}
void OpenQR::SetThreadNum(int intputThreadNum)
{
threadNum = intputThreadNum;
}
int OpenQR::GetCoresSize()
{
PSYSTEM_LOGICAL_PROCESSOR_INFORMATION pProcessorInformations = NULL;
DWORD length = 0;
BOOL result = GetLogicalProcessorInformation(pPro... | ALGO | 0.982687 | 3.85719 |
f824f632-be82-42cb-bc3c-aa20957f20b4 | faisals345/ProblemSolvingShorts | HackerEarth Algo/Searching/hexadicimalNumber.cpp | #include <bits/stdc++.h>
using namespace std;
int gcd__(int a,int b){
if(b==0){
return a;
}
return gcd__(b,a%b);
}
int funcX(char strg[],int n){
int ans;
for(int i=0;i<n ;i++){
if(strg[i]>=48 && strg[i]<58){
ans+=(strg[i]-48);
}
else{
ans+=(... | ALGO | 0.999908 | 4.396722 |
ee1aa29e-914d-46e4-bd0a-426406755c96 | AnkushMishraCS/ARRAYS | 16.cpp | #include <iostream>
using namespace std;
int main() {
int arr[] = {10, 20, 30};
int (*ptr)[3] = &arr; // Pointer to an array
cout << "First element using (*ptr)[0]: " << (*ptr)[0] << endl;
cout << "Second element using (*ptr)[1]: " << (*ptr)[1] << endl;
return 0;
}
| ALGO | 0.912166 | 4.450334 |
63841ed7-8204-4992-a07c-180c2b036c9f | Rishi-11-2/CP | A_Water_Station.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(v) (v).begin(), (v).end()
void solve();
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
solve();
}
void solve()
{
int n;
cin >> n;
int x = n / 10;
x = x * 10;
int y = x + 5;
if (abs(n - x) > a... | ALGO | 0.999611 | 3.77702 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.