uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
db4e64c0-6c1a-4247-a90d-3f4c18d8c544 | mooleetzi/ICPC | contest/cf576/A.cpp | #include <bits/stdc++.h>
#define lson rt << 1, l, mid
#define rson rt << 1 | 1, mid + 1, r
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pa = pair<int, int>;
using ld = long double;
int n, m, k;
const int maxn = 1e6 + 10;
template <class T>
inline T read(T &ret)
{
int f = 1;
r... | ALGO | 0.999976 | 3.523126 |
00ebbad9-1434-4f0b-adcd-fdddb0265028 | tram-tr/dsa-problems | array-and-string/CF-673A.cpp | // https://codeforces.com/problemset/problem/673/A
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
using namespace std;
int main(int argc, char *argv[]) {
int n, t;
cin >> n;
int time[91] = {0};
while (cin >> t)
time[t] = 1;
int count = 0;
int i;
for (i = 1; i <= 90; i+... | ALGO | 0.999224 | 3.696679 |
81f14ee0-f3d5-4488-8316-e49c5c0d6904 | swoyam2609/CodeChef-Solution | START46/GroupAssignment2.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main()
{
int t;
std::cin >> t;
while (t--)
{
int n;
std::cin >> n;
vector<int> a;
;
for (int i = 0; i < n; i++)
{
std::cin >> a[i];
}
bool ans ... | ALGO | 0.999728 | 4.19057 |
3399263b-9b63-425d-9e3e-d493c2da1d72 | daiwb/Algorithm | TopCoder/SRM/363/HandsShaking.cpp | #include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
using namespace std;
// BEGIN CUT HERE
vector<string> split( const string& s, const string& delim =" " )... | ALGO | 0.99994 | 4.774854 |
2a3e1bc8-ad82-4499-8c2a-5e6460b1fa8c | liumy2010/LiteEFG | LiteEFG/src/Environment/Infoset.cpp | #include "Environment/Infoset.h"
#include "Basic/BasicFunction.h"
#include "Computation/Static.h"
#include <algorithm>
#include <string>
#include <stdexcept>
Node::Node(const int& player_, const int& infoset_, const int& player_num_) : player(player_), infoset(infoset_), player_num{player_num_} {
for(int i=0; i<... | TOOL | 0.99365 | 5.0931 |
861380ad-832d-410f-a06b-a7444f86eda1 | pseudo-usama/my-undergrad-coding | 1 Semesters/1/Programming fundamentals/1Non Graphical/2Mohtalif Ideas Waly Programs/Graph Auto Scale int.cpp | // Graph Auto Scale int.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "iostream"
using namespace std;
int main()
{
int x, y;
cout << "Enter the x-intercept = ";
cin >> x;
cout << "Enter the y-intercept = ";
cin >> y;
for (int a = y / 10 * 10 + 10... | ALGO | 0.899399 | 4.14413 |
7e70c602-8a79-4004-bbf4-f88c404a22ea | shrutigoel11/Data-Structures-and-Algorithms | Standard Template Library/Vector/vector_pop_back.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
vector <int> v={1,2,3,4,5};
vector<int>::iterator it;
cout<<"Before pop_back():\n";
for(it=v.begin();it<v.end();it++)
{
cout<<*it<<" ";
}
v.pop_back();
cout<<"\nAfter pop_back():"<<endl;
for(it=v.begin();it<v.end();it++)
{
cout<<*it<<" ... | TOOL | 0.930879 | 4.485022 |
09bb28fa-95c8-418f-9fbe-45de7035c518 | ACDCBoostCourse/Heewon-Lee | ACDCBoostCourse/ACDCBoostCourse/Section 2_Memory/Week 3/26강.cpp | // 26. 迭 Ű
/* 1 */
#include <stdio.h>
int main() {
// arr[i] == *(arr + i) == *(ptr + i) == *(i + ptr) == i[ptr]
// a[b] -> *(a + b)
int arr[3] = { 1,2,3 };
int* ptr = arr;
for (int i = 0; i < 3; i++) {
printf("%d", *(ptr + i));
}
printf("\n");
for (int i = 0; i < 3; i++) {
printf("%d", ptr[i]);
}
pri... | ALGO | 0.98967 | 3.137574 |
68281cd1-5140-44ed-a960-922692306d95 | chhzh123/Entropy-directed-scheduling | main.cpp | // This is the implementation of Entropy-directed scheduling (EDS) algorithm for FPGA high-level synthesis.
// This file is the main function of EDS.
#include <iostream>
#include <fstream>
#include <string>
#include <cstdlib>
#include <chrono> // timing
using Clock = std::chrono::high_resolution_clock;
#include "gr... | ALGO | 0.992 | 3.534245 |
aaf45f1c-3b25-4e32-b402-8a923068c625 | BuzzCoin/growth | growthcoin-master/growthcoin-master/src/kernel.cpp | #include <boost/assign/list_of.hpp>
#include "kernel.h"
#include "db.h"
using namespace std;
extern int nStakeMaxAge;
extern int nStakeTargetSpacing;
// Modifier interval: time to elapse before new modifier is computed
// Set to 6-hour for production network and 20-minute for test network
unsigned int nModifierInt... | ALGO | 0.991588 | 5.618556 |
5ed54df4-68e4-4aa7-924c-d0a835b80613 | henrywarhurst/matrix | libs/boost_1_72_0/libs/yap/example/autodiff_library/UaryOPNode.cpp | /*
* UaryOPNode.cpp
*
* Created on: 6 Nov 2013
* Author: s0965328
*/
#include "UaryOPNode.h"
#include "BinaryOPNode.h"
#include "PNode.h"
#include "Stack.h"
#include "Tape.h"
#include "Edge.h"
#include "EdgeSet.h"
#include "auto_diff_types.h"
#include <list>
using namespace std;
namespace AutoDiff {
Uar... | ALGO | 0.880889 | 4.839767 |
0f61eb41-f588-4d1a-ab97-17eb656309d7 | codeMYNK/DSA-CPP | Trees/Heaps/KthLargestSumInSubArray.cpp | #include <iostream>
#include <queue>
using namespace std;
class Solution
{
public:
int kthLargest(vector<int> &arr, int k)
{
// code here
priority_queue<int, vector<int>, greater<int>> pq;
for (int i = 0; i < arr.size(); i++)
{
int sum = 0;
for (int j = ... | ALGO | 0.999966 | 4.693411 |
7dffbf14-abff-40c2-912e-64e63fce814a | PaimountLtd/open-source-vision-library | 3rdparty/carotene/src/min_max.cpp | #include <algorithm>
#include "common.hpp"
#include "vtransform.hpp"
namespace CAROTENE_NS {
#ifdef CAROTENE_NEON
namespace {
template <typename T>
struct Min
{
typedef T type;
void operator() (const typename internal::VecTraits<T>::vec128 & v_src0,
const typename internal::VecTraits<... | ALGO | 0.996131 | 6.647814 |
46c025a4-e82d-4031-adb9-5317fe012bfb | ankitmohapatra966/GFG_POTD_Solution | Minimum element in BST.cpp | class Solution {
public:
int minValue(Node* root) {
if(!root){
return 1e9;
}
return min( root->data,min( minValue(root->left), minValue(root->right) ) ) ;
}
};
| ALGO | 0.999975 | 6.09486 |
6abfa144-62bb-428f-96fc-578275f080b9 | ishandutta2007/codeforces | wifiiii/normal/1216/B.cpp | #include<bits/stdc++.h>
typedef long long ll;
using namespace std;
#define ii for(int i=1;i<=n;++i)
#define ji for(int j=1;j<=n;++j)
#define jj for(int j=1;j<=m;++j)
#define ij for(int i=1;i<=m;++i )
#define sz(x) ((int) x.size())
#define all(x) x.begin(),x.end()
#define asd cout<<"ok"<<endl;
#define endl '\n'
struct... | ALGO | 0.999949 | 3.313445 |
11ff51ec-dce8-4aa4-a073-d847e823a2a7 | ericchianpan/LeetCode | deepest-leaves-sum.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
vector<int> sum;
int deepestLeavesSum(TreeNode* root) {
traverse(root, 0);
... | ALGO | 0.999905 | 6.426373 |
ce4af1da-c7eb-41cb-9a5f-381babf20e3a | Sidharth70754/Data_Structure_Algorithm | 0238-product-of-array-except-self/0238-product-of-array-except-self.cpp | class Solution {
public:
vector<int> productExceptSelf(vector<int>& nums) {
int n = nums.size();
vector<int> ans(n,1);
for(int i = 1; i < n ; i++){
ans[i] = ans[i-1] * nums[i-1];
}
int suffix = 1;
for(int i = n-2; i >= 0; i--){
suf... | ALGO | 0.999969 | 5.900779 |
dec24d8c-37c6-4c22-8c60-5f552d56ed99 | amazon-oss/android_bootable_recovery | installcommand.cpp | #include <stdlib.h>
#include <string>
#include <vector>
#ifdef AB_OTA_UPDATER
#include <map>
#include <android-base/parseint.h>
#include <android-base/stringprintf.h>
#include <android-base/strings.h>
#endif
#include <cutils/properties.h>
#include "common.h"
#include "installcommand.h"
#include "minzip/SysUtil.h"
#in... | TOOL | 0.944106 | 7.257098 |
9f4284f1-d158-47a7-8789-4baf5bb6d357 | ArdxWe/leetcode | medium/1405-Longest-Happy-String.cpp | /*
* A string s is called happy if it satisfies the following conditions:
* s only contains the letters 'a', 'b', and 'c'.
* s does not contain any of "aaa", "bbb", or "ccc" as a substring.
* s contains at most a occurrences of the letter 'a'.
* s contains at most b occurrences of the letter 'b'.
* s contains at ... | ALGO | 0.999531 | 6.230989 |
3a89b7cc-af04-45bf-8142-ff67da916560 | AsifShawon/C-Plus-Plus | CPP-CP/W_Dates.cpp | #include<bits/stdc++.h>
using namespace std;
int leapOrNot(int y){
if(y%400==0 || (y%4==0 && y%100!=0))
return 1;
else return 0;
}
int main()
{
int tc;
cin>>tc;
int c = 0;
while(tc--){
int yy=0,t=1,y,dd,d,k;
string date,mm,m;
cin>>date;
cin>>k;
f... | ALGO | 0.999598 | 4.111553 |
b5c49cf7-ad82-48ac-829f-c965194eab08 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_4870_1.cpp | #include <iostream>
#include <algorithm>
#include <iomanip>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <bitset>... | ALGO | 0.999866 | 4.54053 |
a4497aeb-ac49-4c47-aba4-36dc9da68ad8 | mohsystem/llm-generated-code-c-cpp | tests/gemini/Task6_Test.cpp | #include <iostream>
#include <vector>
#include <cassert>
#include <iostream>
#include <string>
#include <algorithm>
#include <cctype>
#include <cassert>
#include <iostream>
#include <vector>
#include <cassert>
//#include "../../source/output/claude/cpp/Task6_CLAUDE_claude-3-5-sonnet-20240620.cpp" // Include the heade... | ALGO | 0.964282 | 6.239429 |
37f63632-97ed-46e8-a90b-d1213f5d3863 | dmarce1/hpx_fft | src/fft_server.cpp | #include <fft/fft.hpp>
fft_server::fft_server(int N_, const std::array<int, NDIM>& pos_) :
Nglobal(N_), lb(pos_) {
}
std::vector<std::complex<double>> fft_server::read(const std::array<int, NDIM>& xlb, const std::array<int, NDIM>& xub) {
std::array<int, NDIM> dx;
int sz = 1;
for (int dim = 0; dim < NDIM; dim++) ... | ALGO | 0.999053 | 6.01908 |
d5b0cfe3-a868-421e-856e-707d8c88db5c | chanyoung990704/Baekjoon_Practice | 프로그래머스/3/60063. 블록 이동하기/블록 이동하기.cpp | #include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <queue>
#include <tuple>
using namespace std;
int dy[4] = {0, 0, 1, -1};
int dx[4] = {1, -1, 0, 0};
bool is_possible(int y, int x, vector<vector<int>>& board){
return (y >= 0 && y < board.size() && x >= 0 && x < board[0].size()) &&
... | ALGO | 0.999935 | 5.667857 |
dbd2ed65-a8fe-4d53-8ca3-ac92c7607987 | raincross7/code-similarity | codes/train_code/problem416/problem416_369.cpp | #include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
using namespace std;
// 894510
#define N 100000
#define MAX 1000000000
int main() {
int cnt = 0;
long long q = 1;
while(cnt++ < 10) {
string ans;
stringstream ss;
ss << "? " << q... | ALGO | 0.999815 | 3.230025 |
ad7f7de5-54d5-4e5b-a26f-88c35ea5b520 | rflin/PAT-Advanced-Level | 1134. Vertex Cover (25).cpp | #include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <functional>
using namespace std;
struct edge
{
int u,w;
edge(int x,int y):u(x),w(y){}
};
vector<edge> v;
int main()
{
int n,m;
cin>>n>>m;
for(int i=0;i<m;++i)
{
int u,w;
cin>>u>>w;
v.push_back(edge(u,w));
}
int k;
cin>>k;... | ALGO | 0.999937 | 4.259624 |
9c2b9b24-61d1-4b73-9eda-3fd21d06b688 | raincross7/code-similarity | codes/train_code/problem275/problem275_26.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
ll W,H,n;
ll area;
cin>>W>>H>>n;
area=W*H;
ll x,y,a;
ll mx[4];
for(int i=0;i<4;i++){
mx[i]=-1;
}
for(int i=0;i<n;i++){
cin>>x>>y>>a;
if(a==1){
if(x>mx[a-1]||mx[a-1]==-1){
mx[a-1]=x;
}
... | ALGO | 0.99878 | 3.693729 |
4916d1cc-1702-49af-b920-9267ff532599 | qhb1001/For-that-dream | Kuangbin/Kuangbin专题七 线段树/qhb_数组型线段树/failed_I.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <stack>
using namespace std;
const int MAX = 5e4 + 5;
struct Node {
int l, r, ok;
}t[MAX<<2];
void build(int i, int l, int r) {
t[i].l = l; t[i].r = r; t[i].ok = 1;
if (l == r) return ;
int mid = l + r >> 1;
build(i<<1, l, mid);
b... | ALGO | 0.99961 | 3.924046 |
497d19e5-a420-445b-b4d6-0205468f763d | lhf12278/DCPNet | UDL/mmcv/mmcv/ops/csrc/parrots/bbox_overlaps.cpp | void bbox_overlaps_impl(const Tensor bboxes1, const Tensor bboxes2, Tensor ious,
const int mode, const bool aligned, const int offset) {
DISPATCH_DEVICE_IMPL(bbox_overlaps_impl, bboxes1, bboxes2, ious, mode,
aligned, offset);
}
void bbox_overlaps(const Tensor bboxes1, c... | ALGO | 0.920586 | 4.203155 |
83aa908b-2def-41f2-9cfb-fb8ddf34204d | SakshamSahgal/Competitive-Programming | Codeforces + Codechef/A. Pretty Permutations.cpp | #include<iostream>
#include<algorithm>
#include<vector>
#define usi unsigned short int
#define ui unsigned int
#define ulli unsigned long long int
#define lli long long int
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int t;
cin>>t;
while(t)
{
... | ALGO | 0.999865 | 4.032509 |
c3136ea1-f85e-4a62-b8e7-990daea36ce7 | KhaledHegazy222/Problem-Solving | CodeForces/148D/main.cpp | #include <bits/stdc++.h>
#define endl '\n'
#define all(a) a.begin(),a.end()
#define fast cin.tie(0),ios::sync_with_stdio(0),cout.tie(0)
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
const int N = 1e3 + 5;
double dp[N][N][2];
double solve(int b,int w,int p){
if(!w || b < 0)
r... | ALGO | 0.998436 | 3.896205 |
6d2098a0-fd06-4d0c-8cc4-f70ab873c0e3 | zealscott/ClassProject | DataStructure/template/Sort/Radix_Sort.cpp | //#include "Radix_Sort.h"
#include <iostream>
#include <queue>
#include <string>
//using namespace std;
//const int max_chars = 28;
//
//int alphabetic_order(char c)
//{
// if (c == ' ') return 0;
// if (c >= 'a' && c <= 'z') return c-'a'+1;
// if (c >= 'A' && c <= 'Z') return c-'A'+1;
// return 27;
//}
//
... | ALGO | 0.995259 | 3.196759 |
59688ee2-fa72-4001-9746-f29ad609172e | snewptl/stationaryTraveller | cf-round/Global25Div1plusDiv2/C.cpp | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <set>
#include <queue>
#include <vector>
#define all(x) x.begin(), x.end()
typedef long long ll;
typedef std::pair<int, int> pii;
typedef std::pair<ll, int> pli;
typedef std::pair<ll, ll> pll;
typedef double db;
typedef long double ldb;
... | ALGO | 0.999914 | 4.000412 |
49eb620c-7d05-4ca3-a2ca-3bb670315ab1 | majharul-web/Basic-Data-Structures | linked-list/doubly-linked-list/doubly-linked-list-reversed.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int val;
Node *next;
Node *prev;
Node(int val)
{
this->val = val;
this->prev = NULL;
this->next = NULL;
}
};
void print_forword(Node *head)
{
Node *temp = head;
while (temp != NULL)
{
... | ALGO | 0.999916 | 5.024891 |
3dfac5ab-4041-4ae8-899c-28c05542f7aa | OliverWayne007/CPP_Codes | olliePS-63.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
ll n;
cin>>n;
bool rated = false , unrated = false;
ll maxi = INT_MIN , mini = INT_MAX;
vector<ll>v;
for(ll i = 1 ; i<=n ; i++)
{
ll x , y;
cin>>x>>y;
if((x-y) != 0)
{
r... | ALGO | 0.999901 | 4.941832 |
a9b4fa69-bdd8-460f-8488-84730c24f61e | hsshimde/justExperiments | MultiThreading/PrimeNumberWithoutMultiThreading.cpp | //#include <iostream>
//#include <vector>
//#include <chrono>
//#include <thread>
//#include <memory>
//#include <mutex>
//
//const size_t MAX_COUNT = 1500000;
//const size_t THREAD_COUNT = 4;
//
//bool IsPrimeNumber(size_t number, const std::vector<size_t>& primes)
//{
// if (number == 1)
// {
// return false;
// }
... | ALGO | 0.992208 | 5.383784 |
66186f30-7183-47d0-90b6-f92c42c6eb2c | hjiang13/LLMs-in-IR | POJ-104/89/721.cpp | #include <iostream>
using namespace std;
int main(){
int know[10000];
int known[10000];
int i,j,n,k=0;
int a,b,time;
cin >> "%d",&n);
time=n*(n-1);
for(i=0; i<n; i++){
know[i]=0;
known[i]=0;
}
for(i=0; i<time; i++){
cin >> "%d %d",&a,&b);
if(a==0&&b==0){
break;
}
else{
know[a]++;
known[b]++;
}
}
for(i=0; i<n; i++){
if(... | ALGO | 0.999902 | 3.260345 |
8bd12bec-d85e-4662-ac74-3d5088d07093 | taoye20/code_thinking | coding_thinking/1020飞地的数量.cpp | #include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
int dir[4][2] = { 0,1,1,0,-1,0,0,-1 };
bool dfs(vector<vector<int>>& grid, vector<vector<bool>>& visited, int x, int y, int& count) {
bool isIsland = true;
for (int i = 0; i < 4; i++) {
int nextx = x +... | ALGO | 0.999906 | 6.181204 |
63f28be7-8a59-4fbc-b5f1-1a0b3f0a3e56 | revolucas/CoC-Xray | src/utils/xrAI/compiler_cover.cpp | #include "stdafx.h"
#include "compiler.h"
#include "cl_intersect.h"
#include "xrThread.h"
#include <mmsystem.h>
#include "quadtree.h"
#include "cover_point.h"
#include "object_broker.h"
Shader_xrLC_LIB* g_shaders_xrlc ;
xr_vector<b_material> g_materials ;
xr_vector<b_shader> g_shader_render ;
xr_vector<b_sha... | ALGO | 0.994619 | 4.491064 |
9fae100c-426a-4ebb-9b86-8f3e288479c1 | surajelijah/Data_Structures | DP/1. FrogJump_DP.cpp | //URL - https://www.geeksforgeeks.org/problems/geek-jump/1
//{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
int minEnergyRec(vector<int>& height, int ind){
if(ind<=0){
return 0;
}
if(ind==1)
... | ALGO | 0.999958 | 6.035553 |
59a9c9c4-ad38-404a-b588-8d853520d102 | Erthraus/Cankaya-CENG | CENG241 Labs/Lab2/lab2q3.cpp | #include <iostream>
#include <string>
using namespace std;
int main(void)
{
string line;
int vowels = 0, consonants = 0, digits = 0, white_spaces = 0;
cout << "Enter a line of string: ";
getline(cin, line);
for(int i = 0; i < line.length(); i++)
{
if(line[i] == 'A' || line[i] == 'E' || line[i] == 'I' || ... | ALGO | 0.992413 | 4.473915 |
6eb4afb2-914f-4dbc-a083-be37622e0297 | dihelium/cpp-competitive | Practice Questions on CodeForces/SUBGIVENSUM.cpp | #include<iostream>
#include<vector>
#include<string>
#include<cmath>
#include<algorithm>
#include<string.h>
#include<cstdio>
#include<map>
#include<cassert>
using namespace std;
#define FOR(i,a,b) for(int i = a; i < b; ++i)
#define pb push_back
const int MOD = 1000000007;
int main()
{
int t;
cin>>t;
while(t--){
... | ALGO | 0.999546 | 3.459466 |
64574fc5-307c-4d59-a65c-2d80caaf7862 | Krythz43/CP-Archieve | codeforces/1187a.cpp | #include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define lli long long int
#define rep(i,n,z) for(int i=z;i<n;i++)
#define rrep(i,z) for(int i=z;i>=0;i--)
#define nl cout<<endl
#define vi vector<int>
#define vlli vector<long long int>
#define umap u... | ALGO | 0.99927 | 3.777613 |
d9f01fdb-c2af-44e7-80c0-33742ebb579c | SergeySinyavskiy/ECC | Elliptic curves/boost_1_70_0/libs/sort/benchmark/parallel/benchmark_objects.cpp | //----------------------------------------------------------------------------
/// @file benchmark_objects.cpp
/// @brief Benchmark of several sort methods with different objects
///
/// @author Copyright (c) 2016 Francisco José Tapia (<EMAIL> )\n
/// Distributed under the Boost Software License, Version 1.0.\n... | TEST | 0.934865 | 6.158231 |
06348acb-e8d9-4080-8a34-167309c39341 | mattjr/structured | vcgapps/OGF/math/numeric/super_lu.cpp | #include <OGF/math/numeric/super_lu.h>
#include <OGF/math/linear_algebra/sparse_matrix.h>
#include <OGF/basic/debug/assert.h>
#include <numeric_stuff/SUPERLU/dsp_defs.h>
#include <numeric_stuff/SUPERLU/util.h>
// TODO: SuperLU seems to convert everything in compressed column storage,
// update solver so that constr... | ALGO | 0.997496 | 4.718947 |
37bf69ce-0bc0-49ce-8211-83bbabd50762 | joniesp/C- | 04_estructuras_de_control/menu.cpp | #include <stdio.h>
#include <stdlib.h>
#define SUMA 1
#define REST 2
#define MULT 3
#define DIVI 4
int main (){
int op1,
op2,
opcion;
system("clear");
system("toilet -fpagga --gay MATEMATICAS");
printf("\n");
printf("introduce el operando 1: ");
scanf(" %i", &op1);
printf("introduce... | ALGO | 0.979398 | 3.329957 |
27f195a7-eb52-4a48-90f0-6d020e4758ac | shashank2801/Programming-Codeforces | 80A.cpp | #include<iostream>
#include<cmath>
using namespace std;
int main(){
int n,m,flag = 0,x,count = 0;
cin >> n >> m;
for(int i=2;i<=sqrt(m);i++)
{
if(m % i != 0)
continue;
else
{
flag = 1;
break;
}
}
for(int i= n+1;i<100;i++)
{
int flag1 = 0;
for(int j=2;j<=sqrt(i);j++)
{
if(i%j!=0)
cont... | ALGO | 0.999969 | 3.622571 |
a20841a0-1e70-4494-be40-d339d7de2b94 | dza810/atcoder | cpp/typical90/typical90_g/30963943.cpp | // Contest ID: typical90
// Problem ID: typical90_g ( https://atcoder.jp/contests/typical90/tasks/typical90_g )
// Title: 007. CP Classes(★3)
// Language: C++ (GCC 9.2.1)
// Submitted: 2022-04-14 11:16:37 +0000 UTC ( https://atcoder.jp/contests/typical90/submissions/30963943 )
#include "bits/stdc++.h"
using namespac... | ALGO | 0.999992 | 4.938102 |
befa2c52-ba12-4a7a-a3ae-1f5b084c4bf2 | keli214/Leetcode | slidingWindow/lc658.cpp | #include <vector>
#include <iostream>
using namespace std;
/*
Given a sorted integer array arr, two integers k and x,
return the k closest integers to x in the array.
The result should also be sorted in ascending order.
find the diff for the first k elements in arr,
update the diff as the windo... | ALGO | 0.999998 | 5.271821 |
b963faac-3083-42a0-883e-d294174c3609 | mmp97/Algorithms | c++/directios_reduction.cpp | #include <string>
#include <vector>
class DirReduction
{
public:
static std::vector<std::string> dirReduc(std::vector<std::string> &arr)
{
if (arr.size() <= 1 )
return arr;
for(unsigned long i =0;i<arr.size()-1;i++)
{
if((arr[i] == "NORTH" && arr[i+1] == "SOUTH") || (arr[i] == "SOU... | ALGO | 0.99915 | 4.246148 |
fba9a4ca-ac0d-4306-932c-41f0875e570e | suhas25/LC-Solutions | Backtracking/77. Combinations.cpp | //
// Created by Suhas Reddy on 2/19/25.
//
class Solution
{
public:
vector<vector<int>> result;
void helper(int n, int k, vector<int>&list, int index)
{
//base case
if(list.size()==k)
{
result.push_back(list);
return;
}
if(list.size()>k)
return;
for(int idx = index... | ALGO | 0.999891 | 6.448253 |
0c0b1504-2798-45b9-9023-5c44b68383f6 | gopoma/competitive-programming | UVa/Math03/D.cpp | //* sometimes pragmas don't work, if so, just comment it!
//? #pragma GCC optimize ("Ofast")
//? #pragma GCC target ("avx,avx2")
//! #pragma GCC optimize ("trapv")
//! #undef _GLIBCXX_DEBUG //? for Stress Testing
#include <bits/stdc++.h> //? if you don't want IntelliSense
using namespace std;
#ifdef LOCAL
#incl... | ALGO | 0.999947 | 5.284269 |
25695c7d-76f3-4d6a-84c8-a51e293460ed | ishandutta2007/codeforces | waynetuinfor/normal/17/B.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1000 + 10;
int q[maxn];
bool v[maxn];
struct Dsu {
int par[maxn], sz[maxn];
void init() {
for (int i = 0; i < maxn; ++i) par[i] = i, sz[i] = 1;
}
int find(int x) {
if (x == par[x]) return x;
return par[x] = find(par... | ALGO | 0.999944 | 3.915849 |
fdfd6cda-c375-498c-8b0d-1bcbe129ad97 | PallaviCodeVoyage/DSA | SLIDING WINDOW/76.Min window substring.cpp |
class Solution {
public:
string minWindow(string s, string t) {
if (t.length() > s.length()) {
return "";
}
unordered_map<char, int> m;
for (auto f : t) {
m[f]++;
}
int countreq = t.length();
int i = 0;
int ... | ALGO | 0.999982 | 6.657782 |
2740949f-3db5-4494-87a7-2155a51d6e4c | Ravikisha/CodeArchive | LeetCode/cpp/SetMatrixZeros.cpp | // Brute Force Solution for SetMatrixZeros.cpp:
// Time Complexity: O(n*m*(n+m))
// Space Complexity: O(1)
class Solution
{
public:
void matrixRow(vector<vector<int>> &matrix, int n, int m, int i)
{
for (int j = 0; j < m; j++)
{
if (matrix[i][j] != 0)
{
ma... | ALGO | 0.999756 | 6.77076 |
104e4d1e-8d3f-4b7c-b0c7-7872806cf2f3 | hafizcode02/coding-cpp-kuliah | Semester 1/Random/yahahah.CPP | #include <iostream.h>
#include <conio.h>
#include <stdio.h>
main()
{
int ma[2][3];
int mb[2][3];
int mc[2][3];
int i, j;
cout << "Membaca Matriks A : " << endl;
for(i=0; i<2; i++){
for(j=0; j<3; j++){
cout << "ma["<< i << ", "<< j << "]?";
cin >> ma[i][j];
}
}
cout << "Mem... | ALGO | 0.993876 | 3.310363 |
0c78e5e4-91ae-4094-812d-82c544998487 | sakharamdeshpande/CPPfinal | assignments/16-9-2023/armstrong,cpp.cpp | #include<iostream>
using namespace std;
int main(){
int num=1,count=0;
int n = num,onum,x,res,sum=0;
while(num <=999 )
{
onum = num;
if(n!= 0){
x = n % 10;
n = n/10;
res = x * x * x;
sum = sum + res;
}
if(sum == onum )
{
cout<<onum<<" ";
count++;
}
num++;
}
cout<<"total arm : "<<co... | ALGO | 0.999297 | 3.513025 |
9ac9d53f-178a-416e-88c6-8010b8a333c1 | ishubhranshu/code_soln | 1422-maximum-score-after-splitting-a-string/1422-maximum-score-after-splitting-a-string.cpp | class Solution {
public:
int maxScore(string s) {
int ones=0, zeroes=0, n=s.length();
for(auto c: s)
if(c=='1')
ones++;
zeroes=n-ones;
int left=0, right=ones;
int score=0;
for(int i=0; i<n-1; i++)
{
if(s[i]=='0')
... | ALGO | 0.999985 | 5.658745 |
f1412d0b-6ff6-47ea-9a35-7d936ecc2947 | hack-parthsharma/LeetCode | 812-largest-triangle-area/812-largest-triangle-area.cpp | class Solution {
public:
double largestTriangleArea(vector<vector<int>>& points) {
double ans = 0;
for (const vector<int>& A : points)
for (const vector<int>& B : points)
for (const vector<int>& C : points)
ans = max(ans, 0.5 * abs((B[0] - A[0]) * (C[1] - A[1]) -
... | ALGO | 0.999766 | 6.293064 |
bff09c2a-37b1-46e5-9c44-1e006bac068d | alexjordan/otawa | elm/src/genstruct_SortedBinMap.cpp | #include <elm/genstruct/SortedBinMap.h>
namespace elm { namespace genstruct {
/**
* @class SortedBinMap
* A map implemented using the @ref SortedBinTree class.
*
* Implemented concepts: @ref concept::Collection, @ref concept::Map.
* @param K Type of keys,
* @param T Type of values,
* @param C Used comparat... | TOOL | 0.942592 | 6.926857 |
e133fb4c-580c-45e3-889e-c0e6cdddebb7 | schulzch/qml-ogdf | ogdfplugin/ogdf/src/ogdf/energybased/multilevelmixer/LocalBiconnectedMerger.cpp | /*
* $Revision: 2815 $
*
* last checkin:
* $Author: gutwenger $
* $Date: 2012-10-14 23:25:34 +0200 (So, 14. Okt 2012) $
***************************************************************/
#include <ogdf/energybased/multilevelmixer/LocalBiconnectedMerger.h>
#include <ogdf/decomposition/BCTree.h>
#include <ogdf/b... | ALGO | 0.999717 | 5.867074 |
47f8b242-fb91-431d-ae6c-56c4702aacdb | ishandutta2007/codeforces | superguymj/normal/1407/B.cpp | #include<algorithm>
#include<iostream>
#include<cstring>
#include<cctype>
#include<cstdio>
#include<vector>
#define rep(i,x,y) for(int i=x; i<=y; ++i)
#define pb push_back
using namespace std;
const int N=3005;
int T,n,a[N],ans[N];
bool vis[N];
int gcd(int a,int b)
{
return !b?a:gcd(b,a%b);
}
int main()
{
scanf("... | ALGO | 0.99996 | 3.039794 |
aa64a903-4698-4f05-953f-cff885a0e374 | areian13/PS_BOJ | 2. Silver/Silver 5/[S5] 04158 CD.cpp | #include <iostream>
#include <vector>
#define FastIO ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr)
using namespace std;
bool IsIn(int num, vector<int>& cd)
{
int start = 0;
int end = cd.size() - 1;
while (start <= end)
{
int mid = (start + end) / 2;
if (cd[mi... | ALGO | 0.999887 | 4.587586 |
07d046a0-4bca-4947-b549-4975b788a882 | nimendoza/noi-2023 | training/week-4/hackables/F/jlallas384/206916637.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
struct frac{
ll num, denum;
frac(ll num, ll denum): num(num), denum(denum){}
};
bool comp(frac a, frac b){
if(a.num * b.denum != b.num * a.denum){
return a.num * b.denum < b.num * a.denum;
}
return a.denum > b.denum;
}
int main(){
ios::sync_... | ALGO | 0.999918 | 3.431276 |
47b8d17f-514b-48f9-a49f-2923f171351f | Masahiro-Obuchi/Atcoder | ABC/ABC065/ABC065C.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
long long int MOD = 1000000007;
long long int N, M;
cin >> N >> M;
if (N - M >= 2 or M - N >= 2)
{
cout << 0 << endl;
}
else
{
if (N - M == 1 or M - N == 1)
{
long long int tmp1 = 1, tmp2 = 1;
for (int i = 1; i <= N; i++... | ALGO | 0.999999 | 4.683646 |
2b2ff1c6-ae82-4771-84e9-a9320d9eb5c0 | Asad-Bin/cf-ac-problems | codeforces/807/A..cpp | //...Bismillahir Rahmanir Rahim...
// Code by Asad Bin Saber
// 20 05 2020
#include <bits/stdc++.h>
using namespace std;
// typedefs...
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<ll, ll>... | ALGO | 0.999617 | 4.941105 |
689a870c-824a-4b41-88f6-c64a63c83d8f | Laaaaksh/Cp | leetcode/symettrictree.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.999995 | 6.507783 |
e73934b3-f4ab-48af-9b9f-973dfe3f0950 | zaaaato/kyopro | AOJ/ALDS1/maximumProfit.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
long n, m, max = -1000000001, the_i = 0;
cin >> n;
long r[n];
for (long i = 0; i < n; i++) {
cin >> r[i];
}
for (long i = 0; i < n; i++) {
if (r[i] > r[the_i]) {
continue;
}
for (long j = i + 1; j < n; j++) {
... | ALGO | 0.999942 | 3.593513 |
8f06864b-4244-4268-988f-0ac78a31eaee | sasgawahikaru/GE | DirectXTex/DirectXTexMisc.cpp | #include "DirectXTexP.h"
using namespace DirectX;
using namespace DirectX::Internal;
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wignored-attributes"
#endif
namespace
{
const XMVECTORF32 g_Gamma22 = { { { 2.2f, 2.2f, 2.2f, 1.f } } };
//---------------------------------------... | TOOL | 0.908221 | 6.791554 |
ffc2ee06-2f46-448c-865b-9068ffd72c2f | yaochong-cc/Study-Notes-for-Binary-Trees | 验证二叉搜索树.cpp | ////二叉搜索树
//// 节点的左子树只包含小于当前节点的数。
////节点的右子树只包含大于当前节点的数。
////所有左子树和右子树自身必须也是二叉搜索树。
//
////左子树所有节点小于中间节点,右子树所有节点大于中间节点
//
//
//
//#include <iostream>
//#include<vector>
//#include<stack>
//using namespace std;
//
//struct TreeNode {
// int val;
// TreeNode* left;
// TreeNode* right;
// TreeNode(int x) :... | ALGO | 0.999979 | 4.846734 |
3f6b3e0c-51ee-44db-909a-2735db9af7a9 | uibk-iNNference/eNNclave | core/nn.cpp | //
// Created by alex on 28.07.20.
//
#include "nn.h"
#include "output.h"
#include <iostream>
#include <cmath>
// TODO: make as much compile-time as possible
void eNNclave::dense(const float *input, int h, int w, const float *weights, int neurons, const float *biases, float *ret)
{
for (int i = 0; i < h; ++i)
... | ALGO | 0.962457 | 4.622874 |
305a07f1-32ed-4909-9dbf-c687f2086b65 | Mingda-tech/MingDa_OrcaSlicer | src/libigl/igl/point_mesh_squared_distance.cpp | template <
typename DerivedP,
typename DerivedV,
typename DerivedsqrD,
typename DerivedI,
typename DerivedC>
IGL_INLINE void igl::point_mesh_squared_distance(
const Eigen::PlainObjectBase<DerivedP> & P,
const Eigen::PlainObjectBase<DerivedV> & V,
const Eigen::MatrixXi & Ele,
Eigen::PlainObjectBase<Der... | ALGO | 0.997776 | 6.486227 |
79fd22f7-a1b5-4b0d-883d-be836a068c6a | zhAlpha/paper_related | VINS-Mono-code-annotation/vins_estimator/src/initial/solve_5pts.cpp | #include "solve_5pts.h"
namespace cv {
void decomposeEssentialMat( InputArray _E, OutputArray _R1, OutputArray _R2, OutputArray _t )
{
Mat E = _E.getMat().reshape(1, 3);
CV_Assert(E.cols == 3 && E.rows == 3);
Mat D, U, Vt;
SVD::compute(E, D, U, Vt);
if (determinant(U)... | ALGO | 0.999801 | 6.156259 |
e8acfcaa-0238-4d1b-91b2-23948c50223c | flagrantii/CEDT_works | Year_1_semester_1/DataStrucAlgo_Practice/package/d63_q1b/d63_q1a_multi_insert.cpp | #include <iostream>
#include <vector>
using namespace std;
void multiple_add(vector<int> &v, int value, int position, int count) {
v.insert(v.begin()+position, count, value);
}
int main() {
std::ios_base::sync_with_stdio(false);
cin.tie(0);
int n,value,position,count;
cin >> n >> value >> position >> count;
ve... | ALGO | 0.999744 | 3.252901 |
c13a5bff-efda-4d5e-a0c9-142c44a8e313 | Jaylmen/anjian_C_practice | C语言练习/王道栈括号匹配.cpp | #include<stdio.h>
#include<stdlib.h>
#define MaxSize 10
typedef char ElemType;
typedef struct {
ElemType data[MaxSize];
int top;
}Stack;
bool bracketCheck(char str[], int length) {
Stack S;
S.top = -1;
for(int i=0; i<8; i++) {
if(str[i]=='{' || str[i]=='[' || str[i]=='(') {
if(S.top+1 != MaxSize){
S.top... | ALGO | 0.999414 | 3.090862 |
4bd2c16d-de54-46f3-b535-eb62b1d4a393 | hbayazid969/beecrowd_Solve | BEGINNER/13.Area.cpp | /*
https://www.beecrowd.com.br/judge/en/problems/view/1012
*/
#include <bits/stdc++.h>
using namespace std;
int main()
{
double a,b,c;
double pi=3.14159;
cin>>a>>b>>c;
cout<<fixed<<setprecision(3)<<"TRIANGULO: "<<(0.5*a*c)<<endl;
cout<<fixed<<setprecision(3)<<"CIRCULO: "<<(pi*pow(c,2))<<endl;
... | ALGO | 0.997319 | 3.607805 |
4fddf7ac-fdf6-4c1a-8dad-908c8359959c | seggiani-luca/esercizi-fdp | CLion Projects/risoform/main.cpp | #include <iostream>
#include "btree.h"
using namespace std;
using namespace btree;
double MAX_ITERATION_STEPS = 1000;
char* ottieni_stringa() {
char* str = new char[500];
char c;
c = cin.get();
int count = 0;
while(c != '\n' && count <= 499){
str[count] = c;
c = cin.get();
... | ALGO | 0.999899 | 4.947621 |
2e05ba01-e55b-412c-b491-79b43905f43d | snewptl/stationaryTraveller | old-memory/Wunder_Fund_Round2016/A.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=2e5+10;
int main(){
int n;scanf("%d",&n);
for(int i=30;i>=0;i--){
if(n&(1<<i)){
printf("%d ",i+1);
}
}
printf("\n");
return 0;
} | ALGO | 0.999627 | 3.170669 |
3cedc4b3-9abb-4ea7-ada6-d31091e6dafd | joao-jcc/UFMG-CODE | 2024/algoritmosI/graph/src/dijkstra.cpp | #include "dijkstra.hpp"
struct Compare {
bool operator()(const wVertice& a, const wVertice& b) {
return a.cost > b.cost; // Menor peso tem maior prioridade
}
};
std::vector<int> dijkstra(const std::vector<std::vector<wVertice>>& graph, int start) {
int N = graph.size();
std::priority_queue<wV... | ALGO | 0.999989 | 5.665097 |
5ce0e951-f0c1-44fb-8dbe-e6745c53dc06 | OrionOS-prjkt/android_frameworks_av | media/module/codecs/amrwb/dec/src/band_pass_6k_7k.cpp | /*
------------------------------------------------------------------------------
Filename: band_pass_6k_7k.cpp
Date: 05/08/2004
------------------------------------------------------------------------------
REVISION HISTORY
Description:
---------------------------------------------------------------------... | ALGO | 0.999827 | 5.574719 |
6b180648-266e-4be7-a1d0-982f353eaaec | HendBadr1/flowers | 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 |
d09da1a3-f96a-40ae-aa81-6f8a433512b5 | tohidkhan2464/AuctionAp-main | 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 |
a58058f6-4b59-43f6-b68d-f5557cdba14e | rajkunwar23/CPP-programs | signchange_incr,decr.cpp | #include <iostream>
using namespace std;
class signchange
{
private:int num1;
int num2;
public:void getdata()
{
cout<<"\n enter an integer value:=";
cin>>num1;
}
void operator ++()
{
num1=num1*-1;
... | ALGO | 0.991512 | 3.606229 |
d6d6dac7-2c09-4c98-bd8d-9dabe05f6e07 | yzzupgo/MFTCG | Data/abc123_b/anhhungcolao/ac/4883217.cpp | #include <bits/stdc++.h>
using namespace std;
int a[10];
bool cmp(int a, int b) {
int t = (a%10 == 0) ? 10 : a%10;
int t1 = (b%10 == 0) ? 10 : b%10;
return t < t1;
}
int main() {
int n = 5;
for(int i=0;i<n;i++) {
cin >> a[i];
}
sort(a, a+n,cmp);
long long res = 0;
for(int i=1;i<5;i+... | ALGO | 0.999909 | 3.982032 |
c3f51bfa-34be-435e-9f83-340e323bcddf | overwenyan/hello_world | fib1.cpp | #include<iostream>
#define ll long long
#define mod 10000007
using namespace std;
ll quickpow(ll a,ll n);
int main()
{
ll a,n;
cin>>a>>n;
ll ans=quickpow(a,n);
cout<<ans<<endl;
return 0;
}
//ݣnƻ ,O(logn)
ll quickpow(ll a,ll n){
a=a%mod;
ll ans=1;
while(n){
if(n&1) ans=(ans*a)%mod;//nΪʱִ
a=(a*a)%mod;
... | ALGO | 0.999973 | 4.395671 |
1ca0c546-51c2-41eb-8dfa-38b4b27f5932 | Lingg-1304/template-cpp | tree/z.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
int const maxn = 1e5 + 5;
int n , q ;
ll a[maxn] , tree[maxn * 4] , lazy[maxn * 4];
void build(int id , int l , int r){
if(l == r) {
tree[id] = a[l];
return;
}
int mid = (l+r) / 2;
build(2*id , l , mid);
build... | ALGO | 0.999893 | 5.137664 |
ec0a627a-8c71-41ea-ab71-aba13caacf94 | demo-jun-4/openvino | src/plugins/intel_gpu/src/graph/graph_optimizer/post_optimize_weights.cpp | #include "pass_manager.h"
#include "program_helpers.h"
#include "implementation_map.hpp"
#include "convolution_inst.h"
#include "deconvolution_inst.h"
#include "deformable_convolution_inst.h"
#include "fully_connected_inst.h"
#include "intel_gpu/runtime/format.hpp"
namespace cldnn {
post_optimize_weights::post_optim... | ALGO | 0.976514 | 3.77664 |
25cb60eb-cbff-493f-8a53-28359966f23d | adousj/leetcode | Insertion Sort List.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
... | ALGO | 0.999996 | 5.32881 |
9dc52047-991a-425a-ad9b-c9f10005727d | qqing-li/avalon | examples/apps/eea_token/execution_logic.cpp | #include <iostream>
#include <algorithm>
#include <sstream>
#include <vector>
#include "execution_logic.h"
using namespace std;
/* Helper methods
*
* helper methods for string operations
*/
vector<string> splitString (string input, string delimiter)
{
vector<string> outputs;
size_t pos = 0;
string token... | TOOL | 0.932561 | 4.598214 |
a63cfe0b-c985-4ea2-a884-815122c1f783 | ntmg-clove/competitive-programming | abc/001/b001.cpp | #include <bits/stdc++.h>
using namespace std;
using ull = unsigned long long;
using ll = long long;
int main()
{
int m;
string vv;
cin >> m;
if (m < 100)
{
vv = "00";
}
else if (100 <= m && m <= 5000)
{
vv = to_string(m / 100);
if (vv.size() == 1)
{
... | ALGO | 0.995643 | 4.651597 |
4e7bc2cf-8c6d-419a-8da6-9454c057d72a | anlsys/llvm-project | llvm/tools/llvm-exegesis/lib/SerialSnippetGenerator.cpp | #include "SerialSnippetGenerator.h"
#include "CodeTemplate.h"
#include "MCInstrDescView.h"
#include "Target.h"
#include <algorithm>
#include <numeric>
#include <vector>
namespace llvm {
namespace exegesis {
struct ExecutionClass {
ExecutionMode Mask;
const char *Description;
} static const kExecutionClasses[] = ... | ALGO | 0.937809 | 7.92396 |
cc7558b7-c60e-47d0-bb8d-50f28e10ef58 | shibh308/library | lib/functions/scc.cpp | vector<int> scc(vector<vector<int>>& edges){
int n = edges.size();
vector<vector<int>> rev(n);
for(int i = 0; i < n; ++i)
for(auto& x : edges[i])
rev[x].emplace_back(i);
vector<i64> dfs_num(n, -1);
vector<i64> flag(n, 0);
int num = 0;
function<void(int)> dfs = [&](int p... | ALGO | 0.999915 | 5.304244 |
de288df3-f78c-4798-be2f-e771b4c86452 | yangliang1415/boost_1_57_0 | libs/msm/doc/HTML/examples/ExampleCircularBuffer.cpp | #include <vector>
#include <iostream>
// back-end
#include <boost/msm/back/state_machine.hpp>
// header for support of circular_buffer
#include <boost/msm/back/queue_container_circular.hpp>
//front-end
#include <boost/msm/front/state_machine_def.hpp>
// functors
#include <boost/msm/front/functor_row.hpp>
#include <boos... | TOOL | 0.864503 | 6.317823 |
90f2552a-7f82-4144-aa5c-a29bea03dd61 | Shivsharma779/Leetcode_solutions | 149. Max Points on a Line/piyush_solution.cpp | class Solution {
public:
//logic
//https://www.youtube.com/watch?v=0GTjD5yfkkQ
//theory
//https://leetcode.com/problems/max-points-on-a-line/discuss/47124/C%2B%2B-slope-counter
int maxPoints(vector<vector<int>>& points) {
int gmax=0 , n=points.size();
for(int i=0;i<n;i++)
... | ALGO | 0.999949 | 5.688026 |
20811ad8-acf3-47f3-a05a-510409d0e04b | ashMolly/C-- | PrimeNumber/Prime.cpp | // 2.3
#include <iostream>
#include <bitset>
#include <vector>
#include <math.h>
bool isPrime(int n)
{
if (n <= 1)
return false;
for (int i = 2; i <= n / 2; i++)
if (n % i == 0)
return false;
return true;
}
int main()
{
int n, mp = 0;
std::cout << "N: "; std::cin >>... | ALGO | 0.999925 | 5.55269 |
2140053f-7200-4ed1-b9d3-81bbd3289521 | hyungyoo/42_Cursus | Circle_06/ft_containers/main_tester/test_main_folder/map/map_erase.cpp | // erasing from map
#include <iostream>
#include "../main.hpp"
int main ()
{
map<char,int> mymap;
map<char,int>::iterator it;
// insert some values:
mymap['a']=10;
mymap['b']=20;
mymap['c']=30;
mymap['d']=40;
mymap['e']=50;
mymap['f']=60;
std::cout << "before erase" <<std::end... | TOOL | 0.895166 | 3.977923 |
15dd716b-5605-456e-8e86-2712107aaa6f | mkgursoy/OI-Problems | USACO/MowingTheField.cpp | /*
Author:Matkap(prefixsumenjoyer23)
*/
#include <bits/stdc++.h>
#include <array>
using namespace std;
#define fr freopen("/Users/metinkasim/Documents/in.txt","r",stdin);freopen("/Users/metinkasim/Documents/out.txt","w",stdout);
#define int long long
#define endl "\n"
#define ar array
#define all(x) x.begin... | ALGO | 0.999964 | 4.197431 |
dddd3739-8d4b-4792-80fe-5e9436cd0eaf | oppo-us-research/SpacetimeGaussians | thirdparty/gaussian_splatting/realtimedemolite/CudaRasterizer/CudaRasterizer/third_party/glm/test/gtx/gtx_simd_mat4.cpp | ///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentatio... | TEST | 0.983017 | 6.516428 |
3c517229-fa20-457f-91d1-d9cbc65a6479 | hjiang13/LLMs-in-IR | POJ-104/15/631.cpp | #include <iostream>
using namespace std;
int main()
{
int x[100][100];
int a;
int i,j;
int a1,b1,a2,b2;
a1=a2=b1=b2=0;
int s;
cin >> "%d",&a);
for(i=0; i<a; i++)
{
for(j=0; j<a; j++)
{
cin >> "%d",&x[i][j]);
}
}
for(i=0; i<a; i++)
{
for(j=0; j<a; j++)
{
if(x[i][j]==0)
{
a1=i;
b1=j;
}
}
}
for(i=a-1; i>=0; i--)
{
for(j=a... | ALGO | 0.999717 | 3.048098 |
64b84a5d-3781-4ace-925d-9734a2991dd8 | hwannow/PS | BOJ/4581.cpp | #include<bits/stdc++.h>
//#define x first
//#define y second
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
while (1) {
string str;
cin >> str;
if (!str.compare("#")) break;
int y = 0, n = 0, p = 0, a = 0;
y = count(str.be... | ALGO | 0.999772 | 4.362327 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.