uuid stringlengths 36 36 | repo_name stringlengths 5 123 | relative_path stringlengths 5 4k | content stringlengths 33 2.85M | category stringclasses 6
values | algo_rel_score float64 0.85 1 | quality_score float64 3 8.76 |
|---|---|---|---|---|---|---|
6af730b2-afbf-4e48-9c16-68cd23f043dd | web-logs2/art-3 | libnativeloader/public_libraries.cpp | #define LOG_TAG "nativeloader"
#include "public_libraries.h"
#include <dirent.h>
#include <algorithm>
#include <map>
#include <memory>
#include <regex>
#include <string>
#include <android-base/file.h>
#include <android-base/logging.h>
#include <android-base/properties.h>
#include <android-base/result.h>
#include <a... | TOOL | 0.857954 | 7.449201 |
b4f724ad-736f-48d4-9c3f-6cab53c66b38 | irmaR/halloween_coding | Screaming_ghosts_and_rattling_chains/screaming_ghosts_and_rattling_cains.cpp.cpp | //Streaming ghosts and rattling chains in C/C++
#include <stdio.h>
int main()
{
int a = 10, b = 20, c = 30;
if (c > b > a) // :O
printf("TRUE"); // :O
else
printf("FALSE"); // :O
return 0;
//Question 1: what should be the output?
//Question 2: explain why the output happened?
//Question 3: u... | ALGO | 0.982694 | 3.13294 |
f36dedd0-cbe1-43fe-80ed-1ed7a1362143 | Yakinur-Rahman/Algorithm_lab | number27.cpp | sort(t.begin(), t.end());
sort(s.begin(), s.end());
for (int i = 0; i < s.size(); i++)
{
if (s[i] != t[i])
{
return t[i];
}
}
return t[t.size() - 1];
| ALGO | 0.999734 | 3.830282 |
31cfe2e8-c70d-49c1-a845-b4f58947ca75 | gangwargajendra/cpp-python-WebDev-basics | CPP Basics(APNA COLLEGE)/bubbleSort.cpp | #include<iostream>
using namespace std;
void swap(int *a , int *b){
int t = *a;
*a = *b;
*b = t;
}
void bubbleSort(int *arr ,int n){
bool flag = false;
for(int i = 0 ; i < n-1 ; i++){
for(int j = 0 ; j < n-i-1 ; j++){
if(arr[j] > arr[j+1]){ // if we exchange '>' to this... | ALGO | 0.999817 | 4.356917 |
e8e92a2f-b708-4c2f-b23d-707c97397f08 | IDA-TUBS/lwW2RP | thirdparty/boost_1_73_0/libs/geometry/doc/src/examples/algorithms/append.cpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// QuickBook Example
//[append
//` Shows usage of Boost.Geometry's append to append a point or a range to a polygon
#include <iostream>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/polygon.hpp>
#include <boost/geometry/geometries/adapted/boos... | TOOL | 0.885822 | 6.120062 |
ceb5a53e-8815-4a36-94ce-9c5400b44adf | itsTg1/DataStructures | binarySearch/findMinimum.cpp | class Solution {
public:
int findMin(vector<int>& nums) {
int s=0;
int e=nums.size()-1;
while(s<e){
int mid=s+(e-s)/2;
if(nums[mid]<=nums[e]){
e=mid;
}
else{
s=mid+1;
}
}
return nums[e... | ALGO | 0.999985 | 5.921406 |
113c1698-8030-479e-a945-b49ec2e15f1f | apache/cloudberry | src/backend/gporca/libgpopt/src/xforms/CXformLeftAntiSemiJoinNotIn2NLJoinNotIn.cpp | #include "gpopt/xforms/CXformLeftAntiSemiJoinNotIn2NLJoinNotIn.h"
#include "gpos/base.h"
#include "gpopt/operators/CLogicalLeftAntiSemiJoinNotIn.h"
#include "gpopt/operators/CPatternLeaf.h"
#include "gpopt/operators/CPhysicalLeftAntiSemiNLJoinNotIn.h"
#include "gpopt/xforms/CXformUtils.h"
using namespace gpopt;
//-... | ALGO | 0.988431 | 5.777559 |
093672b6-380e-4790-a55a-8e13773eaddc | chuprakov/trilinos | packages/isorropia/src/epetra/Isorropia_EpetraOrderer.cpp | //@HEADER
/
throw Isorropia::Exception("Ordering only available in Zoltan");
return ;
#endif /* HAVE_ISORROPIA_ZOLTAN */
if (compute_now)
order(true);
}
////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////... | ALGO | 0.98977 | 6.656222 |
0bb1c531-7a0c-47ab-8e39-3f37d4d7a44a | YaminiGarkoti/DSA | series_3.cpp | #include<bits/stdc++.h>
using namespace std;
void series(int n)
{
static int l=0;
if(n==0)
return;
if(l==0)
{
cout<<1;
l++;
series(n-1);
}
else
{
cout<<" + "<<pow(3,l);
l++;
series(n-1);
}
}
int main()
{
int n;
cin>>n;
seri... | ALGO | 0.999678 | 3.50701 |
18fd810c-6c9a-4566-bc9d-cd6389fe8a0d | openharmony/third_party_skia | m133/src/utils/SkShadowTessellator.cpp | #include "src/utils/SkShadowTessellator.h"
#include "include/core/SkColor.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkPath.h"
#include "include/core/SkPoint.h"
#include "include/core/SkPoint3.h"
#include "include/core/SkRect.h"
#include "include/core/SkTypes.h"
#include "include/core/SkVertices.h"
#... | TOOL | 0.97262 | 3.146947 |
3ea57167-7b6a-4fe9-b2a2-260993b60ebc | LordaeronESZ/LeetCode | 0074搜索二维矩阵/搜索二维矩阵.cpp | #include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
bool searchMatrix(vector<vector<int>>& matrix, int target) {
for (size_t i = 0; i < matrix.size(); i++)
{
if (target >= matrix[i].front() && target <= matrix[i].back()) {
size_t first = 0, last = matrix[i].size() - 1;
w... | ALGO | 0.999805 | 5.837221 |
328663e8-a79a-467d-b240-ecd8b193820d | leslieyip02/kattis | completed/relocation.cpp | #include <iostream>
#include <map>
using namespace std;
int main()
{
int n, q, x, a, b, c;
cin >> n >> q;
map<int, int> locations = map<int, int>();
for (int i = 1; i <= n; i++)
cin >> locations[i];
for (int i = 0; i < q; i++)
{
cin >> a >> b >> c;
if (a == 1)
... | ALGO | 0.999926 | 4.192781 |
91c06742-7666-4d03-bf66-2d6072081abc | Meeperbunny/CompetitiveProgramming | archive/CF864/_B.cpp | #include <bits/stdc++.h>
using namespace std;
#define HEADER ios::sync_with_stdio(0);cin.tie(0);if (fopen("file.in", "r")) {freopen("file.in", "r+", stdin);};
using ll = long long;
void dbg_out() { cerr << endl; }
template<typename Head, typename... Tail> void dbg_out(Head H, Tail... T) { cerr << ' ' << H; dbg_out(T...... | ALGO | 0.999956 | 4.830455 |
409c5f21-380c-45b6-8fbd-4804d18c5215 | vertoker/cpp-studyfield | library/1-cpp-primer/ch05/ex09-12.cpp | #include <iostream>
#include <string>
int main()
{
std::string input;
std::cout << "Enter text: ";
std::cin >> input;
int vowelCount = 0, consonantCount = 0, spaceCount = 0, tabCount = 0, newlineCount = 0, pair2Count = 0, otherCount = 0;
for (auto i = 0; i < input.size(); ++i)
{
auto c... | ALGO | 0.974432 | 5.700951 |
db5b7f9d-d9e0-4c83-af08-dfc02915a362 | tangziyi001/competitive-programming | Graph/TopoSort/Beverages.cpp | /*
* UVA 11060
* Created by Ziyi Tang
*
*/
//#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <list>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <bits... | ALGO | 0.999884 | 4.181135 |
ddbaf9cb-a38f-4d2e-805f-61b169286925 | xixi-shredp/xixi-gem5 | src/systemc/tests/systemc/misc/v1.0/dash7/speed.cpp | /*****************************************************************************
speed.cpp -- Definition of the speedometer.
Original Author: Ali Dasdan, Synopsys, Inc.
*****************************************************************************/
/*************************************************************... | ALGO | 0.910047 | 5.898379 |
df6a48ec-ab03-4a4d-86b9-15edec9641f5 | ishandutta2007/codeforces | smax/normal/1366/E.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#define DEBUG(...) debug(#__VA_ARGS__, __VA_ARGS__);
#else
#define DEBUG(...) 6;
#endif
template<typename T, typename S> ostream& operator << (ostream &os, const pair<T, S> &p) {return os << "(" << p.first << ", " << p.second << ")";}
template<typename C, typ... | ALGO | 0.999995 | 4.327708 |
c54de414-7541-4ff1-8a56-e74154e50ca0 | playbar/nstest | dependency/gzip/unpack.cpp | #ifdef RCSID
static char rcsid[] = "$Id: unpack.c,v 1.4 1993/06/11 19:25:36 jloup Exp $";
#endif
#include "tailor.h"
#include "gzip.h"
#include "crypt.h"
#define MIN(a,b) ((a) <= (b) ? (a) : (b))
/* The arguments must not have side effects. */
#define MAX_BITLEN 25
/* Maximum length of Huffman codes. (Minor modifica... | ALGO | 0.999081 | 5.912275 |
ba98758a-5425-416a-bf03-bd9d3cf8794e | OLI9292/cracking_code_interview | 2-3.cpp | /*
Implement an algorithm to delete a node in the middle (i.e. any node except the first or last) of a singly
linked list, given only access to that node.
Ex.
input: node c from linked list a -> b -> c -> d
result: nothing returned, but the linked list is now a -> b -> d
*/
#include <iostream>
#include <algorithm>
#i... | ALGO | 0.9996 | 6.210683 |
700c2fa6-00e3-485f-a6f1-4faa392ee723 | AlexLe08/Cartographers-GameDev1 | Code/frameworks/cocos2d-x/cocos/math/Vec2.cpp | #include "math/Vec2.h"
#include "math/MathUtil.h"
#include "base/ccMacros.h"
NS_CC_MATH_BEGIN
// returns true if segment A-B intersects with segment C-D. S->E is the ovderlap part
bool isOneDimensionSegmentOverlap(float A, float B, float C, float D, float *S, float * E)
{
float ABmin = std::min(A, B);
float A... | TOOL | 0.966939 | 6.889572 |
c24999d0-dd97-42cb-afd0-764f73bc0d64 | ROCm-Developer-Tools/llvm-project | libcxxabi/src/fallback_malloc.cpp | #include "fallback_malloc.h"
#include "abort_message.h"
#include <__threading_support>
#ifndef _LIBCXXABI_HAS_NO_THREADS
#if defined(__ELF__) && defined(_LIBCXXABI_LINK_PTHREAD_LIB)
#pragma comment(lib, "pthread")
#endif
#endif
#include <__memory/aligned_alloc.h>
#include <__assert>
#include <stdlib.h> // for malloc,... | TOOL | 0.93487 | 7.704824 |
520bcf64-a661-4e99-8b48-2631e82c82e1 | MinaHany0/C-CPP-DS | LeetCode-HR/SingleNumber.cpp | class Solution {
public:
int singleNumber(vector<int>& nums) {
int arr[100000] = {0};
int result = 0;
for(int i : nums)
{
arr[i+50000]++;
if(arr[i+50000] == 1) result += i;
if(arr[i+50000] == 2) result -= i;... | ALGO | 0.999981 | 5.694119 |
aeba14a0-b04e-4522-98ae-28572f1b7017 | Hey-Ismail/path-to-proficiency | HackerRank/introduction-to-cpp/hard/Magic_Spells.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
class Spell {
private:
string scrollName;
public:
Spell() : scrollName("") {}
Spell(string name) : scrollName(name) {}
virtual ~Spell() {}
string revealScrollName() {
return scrollName;
}
};
class Fireb... | ALGO | 0.987026 | 4.570521 |
4a990b81-c8bc-42cf-9a35-da517d0986a5 | Fly-coin/Fly-coin | src/scrypt.cpp | #include <stdlib.h>
#include <stdint.h>
#include "scrypt.h"
#include "pbkdf2.h"
#include "util.h"
#include "net.h"
#define SCRYPT_BUFFER_SIZE (131072 + 63)
#if defined (OPTIMIZED_SALSA) && ( defined (__x86_64__) || defined (__i386__) || defined(__arm__) )
extern "C" void scrypt_core(unsigned int *X, unsigned int *V... | ALGO | 0.989365 | 5.510696 |
43347657-8e89-4c9d-8e29-5119700326e5 | whatever2098/codetree-TILs | 240224/짝수이면서 합이 5의 배수인 수/an-even-number-with-a-multiple-of-5-in-the-sum.cpp | #include <iostream>
using namespace std;
bool isSumMul5(int n){
int numOfDigitsIn10 = n / 10;
int sum = n - numOfDigitsIn10 * 10 + numOfDigitsIn10;
return n % 2 == 0 && sum % 5 == 0;
}
int main() {
// 여기에 코드를 작성해주세요.
int n;
cin >> n;
cout << ((isSumMul5(n))? "Yes" : "No") << "\n"; //주의!
... | ALGO | 0.999858 | 4.678242 |
289a9ad9-1a1a-45df-abef-24a0cd6be96a | vishnu-c-r/PolyPlot-Firmware | Electonics/main machine/Motherboard/current machine/FluidNC/FluidNC/src/Settings.cpp | #include "Settings.h"
#include "WebUI/JSONEncoder.h" // JSON
#include "WebUI/WifiConfig.h" // WebUI::WiFiConfig
#include "WebUI/Commands.h" // WebUI::COMMANDS
#include "System.h" // sys
#include "Protocol.h" // protocol_buffer_synchronize
#include "Machine/MachineConfig.h"
#include <map>
... | TOOL | 0.878099 | 6.476148 |
24931fca-9817-4b68-bc32-8817cf3a5247 | RitaG189/CV_ProjetoFinal | Library/PackageCache/com.unity.ide.visualstudio@2.0.22/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <filesystem>
#include <windows.h>
#include <shlwapi.h>
#include <fcntl.h>
#include <io.h>
#include "BStrHolder.h"
#include "ComPtr.h"
#include "dte80a.tlh"
constexpr int RETRY_INTERVAL_MS = 150;
constexpr int TIMEOUT_MS = 10000;
// Often a DTE call m... | TOOL | 0.947374 | 6.926379 |
e2003ea8-f344-4b29-a248-29454ab761f0 | ljcduo/DataStructuresInCpp | src/huffman/Huffman_PQ_Test.cpp | /*DSA*/#include "Huffman_PQ_test.h"
/******************************************************************************************
* ۱ɭбȫѻʽʵ֣Թ̶
* ɭֵʵַʽȼʱǰӦĹֻӦ־
* DSA_PQ_ListDSA_PQ_ComplHeapDSA_PQ_LeftHeap
******************************************************************************************/
int main(int argc,... | ALGO | 0.997033 | 3.855282 |
2cb0f752-1134-4d6e-b482-08d754c3d0ef | offconnectx/ocxmobile | 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 |
269ec25d-a690-407a-8938-cd208073b6de | manikanta2901/ubuntu | .history/SRM/placementPractice/HackerRank/DataStructure/InsertNodeAtTail_20210501143007.cpp | #include <bits/stdc++.h>
using namespace std;
class SinglyLinkedListNode {
public:
int data;
SinglyLinkedListNode *next;
SinglyLinkedListNode(int node_data) {
this->data = node_data;
this->next = nullptr;
}
};
class SinglyLinkedList {
public:
S... | ALGO | 0.999024 | 5.691659 |
e65a2f50-ed64-48fd-9cce-19aa39c072fd | Ecolash/Data-Structures-Algorithms | Tree/avl4.cpp |
#include <iostream>
using namespace std;
struct Node
{
int data;
Node *left;
Node *right;
int height;
};
Node *min_node(Node *root)
{
while (root->left != NULL)
{
root = root->left;
}
return root;
}
Node *NewNode(int data)
{
Node *newNode = new Node();
newNode->data =... | ALGO | 0.999983 | 5.770926 |
1782762c-47f5-47d8-b0f7-dc9adad0fcc3 | balramsingh54/Data__stru_C- | practice/stack.cpp | #include <bits/stdc++.h>
using namespace std;
int N=5;
class Stack
{
int arr[5];
int top;
public:
Stack()
{
top=0;
}
void push(int data)
{
if (top==5)
{
cout<<"Stack is already full. "<<endl;
return;
}
else
{
arr[top]=data;
top++;
}
}
void pop()
{
if (top==0)
{
cout<<"stack is empty. "<<endl;... | ALGO | 0.982786 | 3.863704 |
a4e471a8-0791-4373-9c57-8b64b32e5806 | Vilinz/leetcode | src/225.cpp | #include <iostream>
#include "header.h"
class MyStack {
private:
queue<int> q;
public:
/** Initialize your data structure here. */
MyStack() {
}
/** Push element x onto stack. */
void push(int x) {
q.push(x);
for(int i = 0; i < q.size() - 1; i++) {
q.push(q.front());
q.pop();
}
... | ALGO | 0.892865 | 4.735091 |
183def57-13e4-497a-b197-5c2af53c0320 | RealAnishSharma/Spoj_Interesting_Questions | rec2/main.cpp | #include <bits/stdc++.h>
using namespace std;
int lps(char x[],int i,int j)
{
if(i==j) return 1;
if(x[i]==x[j]&&j-i==1) return 2;
if(x[i]==x[j]) return 2+lps(x,i+1,j-1);
return max(lps(x,i+1,j),lps(x,i,j-1));
}
int main()
{
char str1[]="GEEKSFORGEEKS";
int n=strlen(str1);
printf("Tength... | ALGO | 0.999799 | 4.04555 |
bb5ef403-802c-4ded-9859-dfe8d85d685d | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_9661_2.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int i, n, res1 = 0, res2 = 0;
cin >> n;
int a[n];
for(i=0; i<n; i++){
cin >> a[i];
}
sort(a, a+n);
res2 = a[n-1];
res1 = a[0];
for(i=1; i<n-1; i++){
if(a[i] < 0){
res2 -= a[i];
}else{
... | ALGO | 0.999935 | 3.488333 |
0743a308-6998-4441-98f2-d06314ed1fd4 | HekpoMaH/Olimpiads | grupa A/olimpiada/oblasten/2014/salaries2.cpp | //Task: salaries
//Author: Rusko Shikov
//Solution: O(N)
#include<bits/stdc++.h>
using namespace std;
const int nmax=100000;
const int smax=100000;
int sal[2][nmax+2];
vector<int> salgroups[2][smax+1];
int b[nmax+2];
int ukb;
int n;
int salgroups_count[2];
void clear_salgroups(int p)
{
int i;
for (i=1;i<=sma... | ALGO | 0.999943 | 3.330018 |
428918d9-39d0-4dce-a835-043052b43356 | antEater3005/DSA-Questions | Start/Recursion_Q7.cpp | #include <iostream>
using namespace std;
int firstocc(int arr[], int n, int i, int key)
{
if (i == n)
{
return -1;
}
if (arr[i] == key)
{
return i;
}
return firstocc(arr, n, i + 1, key);
}
int lastocc(int arr[], int n, int i, int key)
{
if (i == n)
{
return -... | ALGO | 0.999945 | 4.989555 |
5f58f8b4-9be0-4ddc-a07d-d78abd2ca1bf | Crimson-Coders-3/cs107-FinalProject | 3PL/eigen-3.3.9/_build/doc/snippets/compile_TopicAliasing_cwise.cpp | static bool eigen_did_assert = false;
#define eigen_assert(X) if(!eigen_did_assert && !(X)){ std::cout << "### Assertion raised in " << __FILE__ << ":" << __LINE__ << ":\n" #X << "\n### The following would happen without assertions:\n"; eigen_did_assert = true;}
#include <iostream>
#include <Eigen/Eigen>
#ifndef M_PI... | ALGO | 0.91145 | 3.871819 |
3571b4ed-e929-4ad6-8c56-ff7a70ff7303 | GobindaGoswamee6328/Algorithms | selection.cpp | #include<bits/stdc++.h>
#include <chrono>
using namespace std;
using namespace std::chrono;
void Swap(int *x,int *y)
{
int temp=*x;
*x=*y;
*y=temp;
}
void selectionSort(int A[],int n)
{
int i,j,min;
for(i=0;i<n-1;i++)
{
min=i;
for(j=i+1;j<n;j++)
if(A[j]<A[min])
mi... | ALGO | 0.999273 | 4.214638 |
d239046b-9be8-4a73-87f2-1266793cd89e | 15757170756/All-Code-I-Have-Done | hihoCode/[Offer收割]编程练习赛61/题目3-质数.cpp | /*
题目3 : 质数
时间限制:10000ms
单点时限:1000ms
内存限制:256MB
描述
众所周知,一个正整数x一定可以写成若干个质数的乘积,
我们称一个数是好的数,当且仅当他可以写成质数个质数的乘积。
现在给定l,r,求[l,r]内有几个好的数。
输入
第一行两个正整数l,r,满足1 ≤ l ≤ r ≤ 109,且0 ≤ r-l ≤ 106。
输出
输出[l,r]内有几个好的数。
样例解释
4=2*2,所以4是好的数。
6=2*3,所以6是好的数。
8=2*2*2,所以8是好的数。
9=3*3,所以9是好的数。
样例输入
1 9
样例输出
4
*/
#include <iostream>
#inclu... | ALGO | 0.999942 | 4.622322 |
eb26211c-72e9-408e-a84d-5bd849ce6c77 | JakeJonas7/Assignment-2 | Functions.cpp |
#include "LinkedList.h"
using namespace std;
template<typename Item_Type>
void Linked_List<Item_Type>::push_front(const Item_Type& item) {
Node* new_node = new Node(item,head);
head = new_node;
if (tail == NULL)
tail = head;
num_items++;
}
template<typename Item_Type>
void Linked_List<Item_Type>::pu... | TOOL | 0.986587 | 4.49763 |
f6fdb53e-8d61-4eba-a984-ce9fe76bec66 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_5745_8.cpp | #include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
namespace std {
template <>
struct hash<pair<int, int>> {
size_t operator()(const pair<int, int> &x) const {
long long P = 38923, Q = 109797901;
return (size_t)((x.first * P + x.second) % Q);
}... | ALGO | 0.999979 | 3.946624 |
bc5111a1-5072-4dbd-b3ff-ef3e2c14e285 | zwvista/PSL | PuzzlesP/Puzzles/ProductSentinels.cpp | #include "stdafx.h"
#include "astar_solver.h"
#include "bfs_move_gen.h"
#include "solve_puzzle.h"
/*
iOS Game: 100 Logic Games/Puzzle Set 11/Product Sentinels
Summary
Multiplicative Towers
Description
1. On the Board there are a few sentinels. These sentinels are marked with
a number.
... | ALGO | 0.999674 | 6.736256 |
1410b895-744a-4028-aa11-1b173ac72bc9 | bruno-avr/competitive-programming | cf/round946/e.cpp | #include "bits/stdc++.h"
using namespace std;
#define optimize ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define endl "\n"
#define ll long long
#define ld long double
#define pii pair<ll,ll>
#define fi first
#define se second
#define pb push_back
#define all(x) x.begin(),x.end()
#define INF ... | ALGO | 0.999972 | 4.214398 |
cdc3e2d0-c64e-427c-8695-2294669a7950 | ishandutta2007/codeforces | rush_d_cat/normal/1355/E.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N = 100000 + 10;
typedef long long LL;
int n, A, R, M;
LL a[N], sum[N];
const LL inf = 1e18 + 1e17;
LL cac(int x, LL val) {
LL y = n - x;
LL c1 = val * x - sum[x];
LL c2 = (sum[n] - sum[x]) - val * y;
LL mn = min(c1, c2);
LL tmp = mn * M... | ALGO | 0.999887 | 3.966784 |
30d66d15-4ba8-42b7-b4d4-207964938fc6 | XavierFox12/CodingPortfolio | Hocking College C++/Xavier_Fox_Chp_6_Exercise_1/Xavier_Fox_Chp_6_Exercise_1/Xavier_Fox_Chp_6_Exercise_1.cpp | /* Program: Xavier_Fox_Chp_6_Exercise_1.cpp
Programmer: Xavier Fox
Date: 27 Oct. 2014
Purpose: To determine is the characters given
can be a palidrome.
*/
#include "stdafx.h"
#include <iostream>
#include <cctype>
#include <string>
using namespace std;
bool isPalidrome(string str)
{
int length = str.leng... | ALGO | 0.998817 | 5.37528 |
c908f69a-19db-4b08-83b4-15eaa76cd0a3 | raincross7/code-similarity | codes/train_code/problem117/problem117_480.cpp | #include <bits/stdc++.h>
#ifdef dbg
#include "./printer.hpp"
#else
#define dump(x) void(0)
#endif
using namespace std;
#define MOD 1000000007
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define ll long long
#define ull unsigned long long
#define pb push_back
#define ALL(x) ((x).begin(), (x).end())
#define sync(); ios... | ALGO | 0.999981 | 3.775398 |
4246c60e-760e-47d7-a03f-2ba7a935d673 | lilinhan/code | c/reverse.cpp | /*************************************************************************
> File Name: reverse.cpp
> Author: lewin
> Mail: <EMAIL>
> Company: Xiyou Linux Group
> Created Time: 2015年05月29日 星期五 10时46分14秒
************************************************************************/
#include<iostream>
#include<st... | ALGO | 0.999802 | 4.688719 |
c1ab86d3-2084-4d62-9955-445a0a9b5b27 | raincross7/code-similarity | codes/train_code/problem371/problem371_380.cpp | #include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <bitset>
#include <complex>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>... | ALGO | 0.999988 | 4.763569 |
3ae59775-f2e3-40fc-96c4-e35330b46737 | gtwilkins/Locass | src/assembly/node_validation.cpp | #include "node.h"
bool Node::anyValid( bool drxn )
{
return ( drxn ? validLimits_[2] > ends_[0] : validLimits_[1] < ends_[1] );
}
void Node::forceValidate( int32_t* limits, NodeSetList &delSets, NodeSetList &goodSets )
{
for ( bool drxn : { 0, 1 } )
{
int hits = 0;
for ( Node* fwd : getDrx... | ALGO | 0.978095 | 5.831736 |
40bf1112-9635-490b-ab9c-cd5dbc721219 | Deepak7308/C-language | pttrn7.cpp | #include <iostream>
using namespace std;
int main(){
int n;
cin>>n;
int i=1;
while(i<=n){
int j=1;
while(j<=n){
char ch='A'+i+j-2;
cout<< ch <<" ";
//ch++;
j++;
}
i++;
cout<<endl;
}
return 0;
} | ALGO | 0.999602 | 3.672531 |
d10e2dc0-6c2d-4ccb-abbb-7afe9f8697b9 | chemoontheshy/trackerTest | 3rd/include/eigen/doc/snippets/Tutorial_AdvancedInitialization_LinSpaced.cpp | ArrayXXf table(10, 4);
table.col(0) = ArrayXf::LinSpaced(10, 0, 90);
table.col(1) = M_PI / 180 * table.col(0);
table.col(2) = table.col(1).sin();
table.col(3) = table.col(1).cos();
std::cout << " Degrees Radians Sine Cosine\n";
std::cout << table << std::endl;
| ALGO | 0.945731 | 3.563988 |
2cca7dc4-7ceb-4001-926e-44cb424b4388 | plasmatic1/dmoj-solutions | cpp/ccc21s2.cpp | // s2.yml
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
const ll INF = 0x3f3f3f3f, LLINF = 0x3f3f3f3f3f3f3f3f;
const int MN = 5e6+1;
int N, M, Q;
bool pr[MN], pc[MN];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> N >> M >> Q;
while (Q--) {
char t; ... | ALGO | 0.999704 | 4.604458 |
37ab5edd-f451-41b1-a342-cae63d31486a | abhishekprajapati29/coding | permutation.cpp | #include <iostream>
using namespace std;
void permute(string s, int l, int r){
if(l == r) cout<<s<<" ";
else {
for(int i=l; i<r; i++){
swap(s[l], s[i]);
permute(s, l+1, r);
swap(s[l], s[i]);
}
}
}
int main() {
int t;
cin>>t;
while(t--){
stri... | ALGO | 0.999926 | 5.269283 |
024b758a-a03e-4201-affc-f1b157e6cf8d | kjayarami/DSA0158-c- | palindrome.cpp | #include <iostream>
using namespace std;
int main() {
string str;
cout << "Enter a string: ";
cin >> str;
int left = 0, right = str.length() - 1;
while (left < right) {
if (str[left++] != str[right--]) {
cout << str << " is not a palindrome." << endl;
return 0;
... | ALGO | 0.999394 | 5.073088 |
e55b3d42-aded-40e2-8104-290be03e035f | vikasjha2003/Daily-Practice | C++/Strings/Intro.cpp | #include<iostream>
using namespace std;
int main () { //implementing string as an array of characters
char st[5] = {'a','e','\0','o','u'};
cout<<st<<endl;
char str[] = "aeiou";
for(int i = 0; str[i]!='\0';i++ ) cout<<str[i];
cout<<endl;
char stri[7] = "birend";
for(int i = 0; i<7; i++) {
... | TOOL | 0.922874 | 3.460719 |
b3ab039b-41ea-4548-bf7a-e10dab9980a2 | mihaimoga/XMLSitemap | boost/libs/math/example/reciprocal_fibonacci_constant.cpp | // This is an example to calculate Reciprocal Fibonacci Constant (A079586 in the OEIS)
// compile with flags: -std=c++11 -lmpfr
//[fibonacci_eg
#include <boost/math/special_functions/fibonacci.hpp>
#include <boost/multiprecision/mpfr.hpp>
#include <iomanip>
#include <iostream>
int main() {
using Real = boost::mu... | ALGO | 0.999214 | 5.608751 |
8be52958-5b28-4e50-a67e-8dacb43a9917 | unicode-org/icu | icu4c/source/i18n/collationcompare.cpp | #include "unicode/utypes.h"
#if !UCONFIG_NO_COLLATION
#include "unicode/ucol.h"
#include "cmemory.h"
#include "collation.h"
#include "collationcompare.h"
#include "collationiterator.h"
#include "collationsettings.h"
#include "uassert.h"
U_NAMESPACE_BEGIN
UCollationResult
CollationCompare::compareUpToQuaternary(Coll... | ALGO | 0.998325 | 7.070002 |
0d5ff677-261b-4af2-a535-9f24460be3c8 | myousuf65/cpp_webserver | dependencies/boost/libs/msm/doc/PDF/examples/Orthogonal-deferred2.cpp | #include <iostream>
// back-end
#include <boost/msm/back/state_machine.hpp>
//front-end
#include <boost/msm/front/state_machine_def.hpp>
#include <boost/msm/front/functor_row.hpp>
namespace msm = boost::msm;
namespace mpl = boost::mpl;
using namespace boost::msm::front;
namespace
{
// events
struct play {};
... | TOOL | 0.899082 | 7.327089 |
7997ef51-3bd7-4cc9-b497-c23d0215aba3 | pshreyam/CPP-Playground | C++ Practice/cpp_test2.cpp | #include <iostream>
using namespace std;
class Node
{
public:
int info;
Node *next;
};
class LinkedList
{
private:
Node *HEAD=NULL;
Node *TAIL=NULL;
public:
LinkedList();
~LinkedList();
void add_to_head(int element);
void add_to_tail(int element);
void add(int data, Node *predeces... | ALGO | 0.999633 | 4.23464 |
5e5a57dd-78d7-41d2-86c1-604b68ff9dbc | M1n01/first_circle | 4-cpp_modules/08/ex01/srcs/Span.cpp | #include "../includes/Span.hpp"
Span::Span() : capacity(0), numbers()
{
}
Span::Span(unsigned int n) : capacity(n), numbers()
{
}
Span::Span(Span const &other) : capacity(other.capacity), numbers(other.numbers)
{
}
Span &Span::operator=(Span const &other)
{
if (this != &other)
{
capacity = other.cap... | TOOL | 0.951828 | 5.411252 |
3fd733d2-306e-4715-9f8e-a64a8bff8a2e | galazaro14/20Ejercicios | Ejercicio 4.cpp | #include<iostream>
#include<string.h>
using namespace std;
int main(){
string palabra;
string palindroma;
int i = 0;
cout<<"\nIngrese una palabra para verificar: ";
cin>>palabra;
for(i=palabra.size()-1;i>=0;i--){
palindroma += palabra[i];
}
if(palabra == palindroma){
cout<<endl;
cout<<"La palabra "<... | ALGO | 0.999706 | 3.794481 |
12b7411b-6037-450e-aaa4-79cc77b477a1 | jacobeverist/opaque | src/modules/alphashape/boost_1_53_0/libs/multiprecision/example/cpp_int_snips.cpp | #include <boost/multiprecision/cpp_int.hpp>
#include <iostream>
void t1()
{
//[cpp_int_eg
//=#include <boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;
int128_t v = 1;
// Do some fixed precision arithmetic:
for(unsigned i = 1; i <= 20; ++i)
v *= i;
std::cout << v ... | ALGO | 0.935797 | 4.462851 |
5dbbc274-3b31-413c-9a31-09ed33bdd7a4 | lballabio/quantlib-old | QuantLib/ql/experimental/mcbasket/adaptedpathpayoff.cpp | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#include <ql/experimental/mcbasket/adaptedpathpayoff.hpp>
namespace QuantLib {
/*
Initializing maximumTimeRead_ to -1 would make more sense,
but it is unsigned and 0 has exactly the same behaviour.
*/
AdaptedPathPayoff::Va... | ALGO | 0.956452 | 7.287377 |
63074331-2279-44f1-a488-8e6f9b9285dc | abhijitgayen/basic_c_and_cpp | basic c and cpp/stl_for_cpp/compitive programming/07_hollow_dimondin_rectangle.cpp | #include<bits\stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
for(int i=1;i<=n;i++){
int j;
for(j=1;j<=(n-i)+1;j++){
cout<<"* ";
}
for(;j<=(n+i-1);j++){
cout<<" ";
}
for(;j<2*n+1;j++){
cout<<"* ";
}
... | ALGO | 0.99989 | 3.208254 |
6c864db5-5917-4df9-b8ad-164ab8dba88d | xiguayizu/ollvm4.0-and-llvm9.0 | lldb/examples/synthetic/bitfield/program.cpp | typedef unsigned int uint32_t;
enum MaskingOperator {
eMaskingOperatorDefault = 0,
eMaskingOperatorAnd = 1,
eMaskingOperatorOr = 2,
eMaskingOperatorXor = 3,
eMaskingOperatorNand = 4,
eMaskingOperatorNor = 5
};
class MaskedData {
private:
uint32_t value;
uint32_t mask;
MaskingOperator oper;
public:
... | TOOL | 0.994106 | 6.231884 |
3c9bc6cc-1148-4848-9947-061e6808353b | ishandutta2007/codeforces | joyfun/normal/401/C.cpp | #include <stdio.h>
#include <string.h>
int n, m;
int main() {
scanf("%d%d", &n, &m);
if (m < n - 1 || m > (n + 1) * 2) {
printf("-1\n");
return 0;
}
if (m - (n - 1) * 2 == 1)
printf("1");
if (m - (n - 1) * 2 >= 2)
printf("11");
int mm;
if (m > (n - 1) * 2) m... | ALGO | 0.999926 | 3.263338 |
f236a9e6-f4e9-401d-b142-efd5577a17c5 | axrdiv/CSES_Problem_Set | 01_Introductory_Problems/Permutations/Permutations.cpp | #include<iostream>
using namespace std;
int n;
int main() {
cin >> n;
if(n == 1) cout << "1" << endl;
else if(n < 4) cout << "NO SOLUTION" << endl;
else {
for(int i = 2; i <= n; i+=2)
cout << i << " ";
for(int i = 1; i <= n; i+=2)
cout << i << (i + 2 > n ? "\n" :... | ALGO | 0.999978 | 4.094269 |
32f674af-1095-44e2-83e9-fc0f0a416fe5 | PranjalAgni/adhoc-practice | rice.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
#ifndef ONLINE_JUDGE
// for getting input from input.txt
freopen("input.txt", "r", stdin);
// for writing output to output.txt
freopen("output.txt", "w", stdout);
#endif
int T;
cin >> T;
while (T-- > 0) {
int n, a, b, c, d;
cin >> n >> a >> b >> c ... | ALGO | 0.999208 | 4.527515 |
4e9cd494-f921-4c04-9780-6c7620391d1f | achyutjagini/cpp-sql | c+_pr/coin_change.cpp | class Solution {
public:
int coinChange(vector<int>& coins, int amount) {
vector<int>dp(amount+1,amount+1);
dp[0]=0;
for(int i=0;i<amount+1;i++)
{
for(int j=0;j<coins.size();j++)
{
if(i-coins[j]>=0)
dp[i]=min(dp[i],1+dp[i-coins[j]... | ALGO | 0.999975 | 5.910345 |
d13031fc-61ce-4c6f-912f-15fb93b00587 | ellynhan/challenge100-codingtest-study | hall_of_fame/wi-seong-cheol/PGS/Resolve/카펫.cpp | //
// 카펫.cpp
// wi-seong-cheol
//
// Created by wi_seong on 3/21/24.
//
/*
[Input]
[Output]
*/
// 시간복잡도: O(n ^ 2)
// 최악시간: 6,250,000
// 난이도: Level 2
// Timer: 5m
// Url: https://school.programmers.co.kr/learn/courses/30/lessons/42842
#include <string>
#include <vector>
using namespace std;
vector<int> sol... | ALGO | 0.99892 | 5.329966 |
4097db40-c80a-4533-909d-a3e09f69db1b | alexandraback/datacollection | solutions_5640146288377856_1/C++/Tata201201/A_BrattleShip.cpp | #include<stdio.h>
int main(){
freopen("A-large.in","r",stdin);
freopen("A-large.out","w",stdout);
int t;
scanf("%d",&t);
for(int tt = 1; tt <= t; tt++){
int r,c,s,ans=0;
scanf("%d%d%d",&r,&c,&s);
ans = (c/s) * r + s - (c%s==0 ? 1 : 0);
printf("Case #%d: %d\n",tt,ans);... | ALGO | 0.996985 | 3.436028 |
f76cb7d0-bd37-4573-835d-4bf8e4cfd6cf | Shivamkumar26/Leetcode-Solutions | 1626-best-team-with-no-conflicts/1626-best-team-with-no-conflicts.cpp | class Solution {
int solve(int i, vector<pair<int, int>>& nums, int prev, vector<vector<int>>& dp) {
if(i == nums.size()) return 0;
if(dp[i][prev]!=-1) return dp[i][prev];
int pick = 0, notPick = 0;
if(prev <= nums[i].second)
pick = nums[i].first + solve(i+1, nu... | ALGO | 0.999938 | 6.250714 |
473141b0-7be5-4d57-b825-32d043b1103c | DimasSalah/flutter_dimas-salahuddin | code_test_spesial_99/quizz_alterra/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.997712 | 6.761023 |
b467276b-f337-4292-92c0-04d54b188928 | shyz222/AtCoder_Omeikan6F | shuyzn/AtCoder/cpp/ABC/20190923_ABC_083_B.cpp | // #include <bits/stdc++.h>
// using namespace std;
// int N, A, B;
// int res;
// int main() {
// cin >> N >> A >> B;
// for (int i = 1; i <= N; i++) {
// int sum;
// while (true) {
// sum += i % 10;
// i /= 10;
// if (i == 0) break;
// }
// if (A <= sum and B >= sum) res += sum... | ALGO | 0.99969 | 5.031445 |
85f51679-1f8b-4ebc-908d-2562b06f6bd8 | Suryansh-Saini09/Pattern-Problems | PrimeNumber.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
int count = 0;
for (int i = 0; i <= n; i++)
{
{
if (n % i == 0)
count++;
}
}
if(count == 2)
cout<<"Number is Prime"<<endl;
else{
cout<<"Not Prime";
... | ALGO | 0.999922 | 4.016309 |
317615c6-9dc2-402b-b1e8-138ba1931e24 | gnipun05/CPP | LinkedList_Operations/11_DetectLoop1.cpp | /* A Program to Detect presence of loop
- Linked List remains the same
- This program needs to change the structure of Node by adding a bool variable
- It takes a time of O(n) */
#include <iostream>
using namespace std;
struct Node
{
int data;
Node *next;
bool visited; // Crux of this program
Node(int... | ALGO | 0.999846 | 5.249776 |
3704f585-fade-43ea-a02a-00f93eb62d6f | szymbaramichal/oop | zaj1_30_09_23/program2.cpp | #include <cmath>
#include <iostream>
#include <cmath>
using namespace std;
int main() {
int num1, num2;
cout << "Podaj liczbe nr 1 = ";
cin >> num1;
cout << "Podaj liczbe nr 2 = ";
cin >> num2;
int sum = num1 + num2;
int difference = num1 - num2;
int product = num1 * num2;
int r... | ALGO | 0.872067 | 3.682013 |
4e672a80-3c36-4c07-a663-032055f450e6 | zwu5heygears/CPPLearn | Sort.cpp | //
// Created by heygears on 23-9-22.
//
#include "Sort.h"
using namespace std;
/// 保证最小的永远在队首 O(n^2)
void Sort::TempSort(int *array, int len) {
for(int i = 0; i < len; ++i){
for(int j = i; j < len; ++j){
int temp = array[i];
if(temp > array[j])
{
array[... | ALGO | 0.9969 | 4.624878 |
c9364812-ce78-4ff6-a7c4-dc992fee4719 | ishandutta2007/codeforces | timmyfeng/normal/1009/C.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout << fixed << setprecision(12);
int n, m;
cin >> n >> m;
ll cur = 0;
for (int i = 0; i < m; ++i) {
ll a, b;
cin >> a >> b;
cur += a * n;
if (b > 0) {
cur += b * n * (n - 1... | ALGO | 0.99987 | 4.012809 |
413e0fbc-e021-4717-8f41-1942e5f787d1 | farhadjaman/Competitive-Programming-Code-Base | tecnique_algorithm/binery index tree_fanwick/Binary Indexed Tree.cpp | #include<bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for(long long int i=a;i<n;i++)
#define all(x) x.begin(),x.end()
#define allara(x,n) x,x+n
#define w(x) long long int x; cin>>x; while(x--)
#define Vector vector<long long int>
#define Vectorpair vector<pair<long long int,long long int>>
... | ALGO | 0.999546 | 3.465486 |
19844710-4035-4768-b1aa-12558066e624 | AkshatAggarwal14/Competitive-Programming | CodeForces/1092/b.cpp | #ifndef ONLINE_JUDGE
#include "Akshat.hpp"
#else
#include "bits/stdc++.h"
using namespace std;
#define dbg(...) 42
#endif
using ll = int64_t;
#define all(x) (x).begin(), (x).end()
#define sz(x) (ll)(x).size()
void Solution() {
ll n;
cin >> n;
vector<ll> a(n);
for (ll i = 0; i < n; ++i) cin >> a[i];
... | ALGO | 0.999946 | 4.711555 |
fa7e81b9-3d49-4995-bbe3-cc280fa76a9f | cocomodo/myAlgorithm | barkingDog Algorithm/26_dijkstra/17835_면접보는_승범이네(myVER_시간초과_2) copy.cpp | /*
내가 구한 방법은, 면접장에서 도시들 까지 가는 길을 구한 것이다.
그런데 이건 단방향 문제로 주어졌기 떄문에, 가는 방향과 오는 방향의 길이가 다르다
그래서 이렇게 구하면 안되고, 모든 길에서부터 다익스트라를 돌려서, k개로 주어진 면접장까지의
거리를 구해서 둘을 비교해야 한다.
*/
#include <bits/stdc++.h>
using namespace std;
int n, m, k;
vector<pair<int,int>> adj[100'005];
int d[100'005];
const int INF = 0x3f3f3f3f;
int minArray[1... | ALGO | 0.999979 | 4.175923 |
85b0be31-2b8f-4288-b800-3d335bada7c3 | Chaitalykundu/Language-Practice | Let-Us-C/Chapter-2/Exercise-H/CPP/Sum_of_digits.cpp | /* Author : Chaitaly Kundu
Date: 18-04-21 */
/*accept a five-digit no and print the sum of digits */
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c,d,e,n,s=0;
cout << "Enter a 5 digit no.: ";
cin >> n;
a=n/10000;
b=(n%10000)/1000;
c=(n%1000)/100;
d=(n%100)/10;
e=... | ALGO | 0.999743 | 3.949331 |
3d283157-8401-409d-90ec-eba26106e5d8 | mooner92/2022algo | 9656-돌게임2/9656-돌게임2.cpp | #include <iostream>
using namespace std;
int main(){
int n;
cin >> n;
if(n%2==0){
cout <<"SK";
}
else if(n%2==1){
cout <<"CY";
}
} | ALGO | 0.996874 | 3.002595 |
dd4d402b-7b27-45d0-b5bd-c46336208938 | prabalb/NoC_Power_Supply_Noise_Estimation_Tool | networks/anynet.cpp | // $Id: anynet.cpp 5379 2013-01-10 03:58:09Z dub $
/*anynet
*
*Network setup file format
*example 1:
*router 0 router 1 15 router 2
*
*Router 0 is connect to router 1 with a 15-cycle channel, and router 0 is connected to
* router 2 with a 1-cycle channel, the channels latency are unidirectional, so channel
* ... | TOOL | 0.850808 | 3.882843 |
cf27699e-1669-46eb-abfe-f24ea0502267 | SUSHANTSINGH01/CP-AND-DSA | DSA/array/missing_number.cpp | class Solution {
public:
int missingNumber(vector<int>& nums) {
long long int ans=0;
int n=nums.size();
for(auto it:nums)
ans+=it;
return n*(n+1)/2-ans;
}
};
| ALGO | 0.999894 | 5.284873 |
94816fb4-fc70-4fa5-b42c-002c48d64078 | LLNL/zero-rk | applications/jacobian_stats/idtSolvers.cpp | #include <math.h>
#include <cvode/cvode.h> // prototypes for CVODE fcts. and consts.
#include <nvector/nvector_serial.h> // serial N_Vector types, fcts., and macros
#include "ode_funcs.h"
#include "utility_funcs.h"
#include "jacobian_stats.h"
#include "idtSolvers.h"
using zerork::getHighResolutionTime;
... | ALGO | 0.999723 | 6.442727 |
d3944e22-7867-4c00-96b4-6b7cd369cfce | Barani2504/barani192211152 | easy 18 add 2 num by pointer.cpp | #include <stdio.h>
int main()
{
int num1, num2, sum;
printf("Enter first number: ");
scanf("%d", &num1);
printf("Enter second number:");
scanf("%d", &num2);
sum = num1 + num2;
printf("Sum of %d and %d = %d", num1, num2, sum);
return 0;
}
| TOOL | 0.98415 | 4.112622 |
dbd9e524-99e1-4667-a426-f1ec635c917e | ryan597/ProgrammingPrinciplesPracticeCpp | Chapter4/example9_temperaturevector.cpp | #include <iostream>
#include <algorithm>
#include <vector>
int main()
{
std::vector<double> temps;
for (double temp; std::cin >> temp;){
temps.push_back(temp);
}
double sum{0};
for (int x: temps){
sum += x;
}
std::cout << "Average temperature: " << sum / temps.size() << "\n... | ALGO | 0.999149 | 5.450937 |
07f7fe4e-8a16-40fa-bbdd-b947d932df22 | RHJihan/problem-solving | UVA/11530-SMS_Typing.cpp | // https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2525
#include <iostream>
#include <map>
using namespace std;
int main() {
#ifndef ONLINE_JUDGE
(void)!freopen("input.txt", "r", stdin);
// (void)!freopen("output.txt","w",stdout);
#endif
int T;
cin >> T;
cin.ignor... | ALGO | 0.999154 | 5.614688 |
1ccee717-5ed9-4ac7-b89a-890aae8756a1 | hjiang13/LLMs-in-IR | processed_data/DecompiledResuts_Human_x_164_O1/GPT4o_Human_x_164_O1_decompiled/CPP_149.cpp | ```cpp
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
void sorted_list_sum(std::vector<std::string>& result, const std::vector<std::string>& input) {
result.clear();
if (input.empty()) return;
for (const auto& str : input) {
if (std::find(result.begin(), result.end(),... | ALGO | 0.99997 | 6.83694 |
f29a6e16-4aa6-4857-a4b3-0a189d71d66e | theVCS/competitveProgramming | basicAlgo/binarySearch/av/5countNoOfEle.cpp | #include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//using namespace boost::multiprecision;
using namespace std;
#define ll long long int
//#define bint cpp_int
#define pii pair<int, int>
#define mod 1000000007
#define REP(i, a, b) for (int i = a; i < b; i++)
#define maxN 1000001
#define all(x) (x).... | ALGO | 0.999982 | 5.089503 |
b8821f13-bbd8-41c5-a6cc-e35759f458f3 | nikhil-edulakanti/bank_testing | testing/mutants/BankAccount.mutant.190.cpp | #include <iostream>
#include <vector>
#include <string>
#include <ctime>
using namespace std;
// Enum for different account types
enum AccountType
{
SAVINGS,
CHECKING,
INVALID
};
// Transaction struct to store transaction details
struct Transaction
{
string timestamp;
string type; // "deposit" or... | TOOL | 0.935555 | 7.125568 |
f2d1a51b-c144-42c6-9347-c8666d1af6c8 | atrainag/code-repo | Codeforces/#Ujian/Jericho-PizzaPieces.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(){
int t,n,a;
cin >> t;
for(int j =0 ; j < t ; j++){
vector<int> x;
vector<int> y;
cin >> n;
for(int i = 0 ; i < n ;i++){
cin >> a;
x.push_back(a);
}
... | ALGO | 0.999927 | 3.602887 |
6225c262-0329-461c-b67d-b14231490c5c | MuhamadAwaisKhan/Education-Path-internees-internship | 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 |
8a164b45-6773-41cb-9c5d-5930d73be205 | berenger-eu/tbfmm | examples/testUnifKernel.cpp | #include "spacial/tbfmortonspaceindex.hpp"
#include "spacial/tbfspacialconfiguration.hpp"
#include "utils/tbfrandom.hpp"
#include "core/tbfcellscontainer.hpp"
#include "core/tbfparticlescontainer.hpp"
#include "core/tbfparticlesorter.hpp"
#include "core/tbftree.hpp"
#include "algorithms/tbfalgorithmselecter.hpp"
#inclu... | ALGO | 0.999343 | 5.850232 |
bef5cb49-0e7e-4ee3-8b7f-67abc3e3aef6 | mateicojo/Data-Structures-Algorithms | lab5 sorted set bst/SortedSetIterator.cpp | #include "SortedSetIterator.h"
#include <exception>
using namespace std;
//SortedSetIterator::SortedSetIterator(const SortedSet& m) : multime(m)
//{
// //TODO - Implementation
// //push all the left nodes in the stack
// this->stack = new TElem[m.cap];
// this->stackSize = 0;
// TElem current = this->mult... | ALGO | 0.965733 | 4.516741 |
45fa17c2-468f-45aa-9637-e2661b27ef0a | magicmoo/codeforces | #733div1+2/C.cpp | #include<bits/stdc++.h>
using namespace std;
#define CAS ll CASE; \
cin>>CASE; \
while(CASE--)
#define YON if(flag) cout<<"YES\n"; \
else cout<<"NO\n"
typedef long long ll;
const double PI = acos(-1.0);
const ll INF = 0x3f3f3f3f;
const ll maxn = 1e5+5;
ll a[maxn],b[maxn];
bool cmp(l... | ALGO | 0.999898 | 3.42118 |
7aec2cb9-aa22-4704-8aab-b02f4abb695a | Ibn-Omar-Romel/Competitive_Programming_Codeforces | Round 995/E_Best_Price.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define yes cout << "YES\n"
#define no cout << "NO\n"
#define vsort sort( vec.begin(), vec.end())
#define asort sort( veca, veca+size )
#define ok cout << "ok" << endl
#define nl cout << endl
// loops
#define fr(a, b) for(int i = a; i < b; i++)
v... | ALGO | 0.999953 | 3.66652 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.