uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
b03aa0a4-ba7b-4eef-b1dd-034860681698 | 0sun-creater/coding-test | c++/programmers Lv.3/[์นด์นด์ค]ํ ๋ณํฉ.cpp | #include <string>
#include <vector>
#include <iostream>
#include <sstream>
//๊ตฌํ
using namespace std;
//ํ์ ํฌ๊ธฐ๋ 50 50 ๊ณ ์
string table[51][51];
int merge_table[51][51];
vector<string> solution(vector<string> commands) {
vector<string> answer;
fill(&table[0][0], &table[50][51], "EMPTY");
int merge_cnt = 0;
fo... | ALGO | 0.998925 | 5.487738 |
ddb7140f-d3e4-4202-b748-32ee896c7eee | hasnain-cyber/competitive-programming | codeforces/D_1_RGB_Substring_easy_version.cpp | #include <bits/stdc++.h>
#define MOD 1000000007
//#define MOD 998244353
#define infinity numeric_limits<int>::max()
#define int long long int
#define double long double
#define endl '\n'
using namespace std;
void print_arr(vector<int> arr) {
for (int element : arr) cout << element << ' ';
cout << endl;
}
... | ALGO | 0.999022 | 5.398743 |
244fa3db-d619-42b7-89bb-4f4cb120a691 | raincross7/code-similarity | codes/train_code/problem200/problem200_170.cpp | //#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; ++i)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
using ll = int64_t;
using ld = long double;
using P = pair<int, int>;
using vs = vector<string>;
using vi = vector<int>;
using vvi = vect... | ALGO | 0.99998 | 4.643119 |
2f2e5b6b-1700-4ccc-8b93-cfb63864387d | Tramonto/Tramonto | src/dft_HardSphereLinProbMgr.cpp | #include "dft_HardSphereLinProbMgr.hpp"
#include "Epetra_CrsMatrix.h"
#include "Epetra_Map.h"
#include "Epetra_Vector.h"
#include "Epetra_IntVector.h"
#include "Epetra_IntSerialDenseVector.h"
#include "Epetra_SerialDenseVector.h"
#include "Epetra_LinearProblem.h"
#include "Epetra_Import.h"
#include "AztecOO.h"
#include... | ALGO | 0.982575 | 3.536364 |
e058bd32-6f80-4c0f-8ea8-b15b57bbf374 | romilpunetha/Online-Judges | HackerEarth/AprilClash/treeedgecolouring.cpp | #include <bits/stdc++.h>
#define mp make_pair
using namespace std;
typedef long long ll;
typedef vector<vector<int> > graph;
vector<int> degree;
vector<int> base;
bool myfun(int &a, int &b) {
return degree[a] < degree[b];
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int test;
sc... | ALGO | 0.999189 | 4.126978 |
56d79a57-ff80-47d5-98e1-7ff5d34d72ec | ITIS-Kien/Data-structure-and-algorithm-2025 | DSA05026.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define mod 1000000007
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define fixs(x, n) fixed << setprecision(n) << x
#define setf(x, n, c) setw(n) << setfill(c) << x
//ITIS LA NHA
int main(){
int c, n; cin >>... | ALGO | 0.999977 | 3.824469 |
b453eefe-7743-4e66-95c3-896004f2c8c2 | wuyinjun-1993/concept_based_retrieval | Dessert-main-v4/deps/eigen/failtest/qr_int.cpp | #include "../Eigen/QR"
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
#define SCALAR int
#else
#define SCALAR float
#endif
using namespace Eigen;
int main()
{
HouseholderQR<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
}
| TEST | 0.976534 | 3.076401 |
d15e1d71-0606-4ea2-b819-733174036c9b | Vehicle-Telematics-Control-Unit/external-ECUs-gateway | docker-vsomeip-build/vsomeip/implementation/e2e_protection/src/crc/crc.cpp | #include "../../include/crc/crc.hpp"
#include <iostream>
#include <string>
#include <iomanip>
namespace vsomeip_v3 {
/**
* Calculates the crc over the provided range.
*
* @param begin Constant iterator pointing to begin of the range.
* @param end Constant iterator pointing to end of the range.
* @param startValu... | ALGO | 0.997598 | 6.43624 |
f0a93fcc-a74a-4527-a798-0d84b353a5cc | MakeContributions/DSA | algorithms/CPlusPlus/Sorting/wave-sort.cpp | #include <iostream>
using namespace std;
void WaveSort(int arr[], int n)
{
for(int i=1;i<n;i+=2)
{
if(arr[i] > arr[i+1] && i<=n-2)
{
int temp=arr[i];
arr[i+1]=arr[i];
arr[i]=temp;
}
if(arr[i] > arr[i-1])
{
int temp=arr[i];... | ALGO | 0.999998 | 4.767208 |
d3e86e8a-be28-40cc-a219-79bb717f32bc | IOSD/IOSD-UIETKUK-HacktoberFest-Meetup-2019 | Intermediate/bsearch.cpp | #include <stdio.h>
int binarySearch(int arr[], int l, int r, int x)
{
if (r >= l) {
int mid = l + (r - l) / 2;
if (arr[mid] == x)
return mid;
if (arr[mid] > x)
return binarySearch(arr, l, mid - 1, x);
return binarySearch(arr, mid + 1, r, x);
}
return -1;
}
int main(void)
{
int n... | ALGO | 0.999816 | 4.828486 |
356cfd05-2702-4a2e-8352-ae0dab054b3c | dongxiaohuang/C-Exercise | Standard Template Library/Maps and Multimaps/main.cpp | #include <map>
#include <string>
#include <iostream>
#include <algorithm>
#include <iomanip>
using namespace std;
/**
- key value pair
- difference between map and multimap is that multimap allows duplicate keys
- sort automatically according to keys(default is less<> or <)
- key: element.first yeild the k... | TOOL | 0.967881 | 4.418245 |
e1fb0e4a-11eb-4505-b380-4d78c0feefa0 | fmfalgun/A2oJ_solution | Codeforces Rating < 1300/insomnia_cure.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int lcm(int a, int b){
return a*(b/__gcd(a,b));
}
int main() {
int k, l, m, n, d;
cin >> k >> l >> m >> n >> d;
int count = 0;
// Counts of dragons divisible by each number
int count_k = d / k;
int count_l = d / l;
int c... | ALGO | 0.999907 | 4.930251 |
bd9f5e9b-1885-4850-8f15-4cb5da646f29 | sdasgup3/gri | source/lib/generated/nodebinaryngbaccess.cpp | #include "generated/nodebinaryngbaccess.h"
#include "value.h"
#include "valuenull.h"
#include "context.h"
#include "valuevertex.h"
#include "valueset.h"
#include "valuearray.h"
/////////////////////////////////////////////////////////////////////////////
////
NodeBinaryNgbAccess::NodeBinaryNgbAccess(Node* left, Node*... | ALGO | 0.992757 | 5.831905 |
7f261b2c-1a81-4a70-9619-03c722d1722d | 06suraj/GeekforGeeks-And-Leetcode | 2115. Find All Possible Recipes from Given Supplies.cpp | class Solution {
public:
vector<string> findAllRecipes(vector<string>& recipes, vector<vector<string>>& ingredients, vector<string>& supplies) {
unordered_set<string>supply,check;
vector<string>ans;
for(string s:supplies)supply.insert(s);
int flag1=0;
//brute force solution u... | ALGO | 0.999938 | 5.995569 |
98523892-51ab-4349-8f99-4352d92eea70 | sogapalag/problems | atcoder/agc029e.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 2e5+10;
int c[N];
vector<int> g[N];
int down(int u, int p, int lim) {
int sum = 0;
for (int v: g[u])if(v!=p){
if (v < lim) sum += 1 + down(v, u, lim);
}
return sum;
}
// mp max[1..p] p = pa(u)
// mg max[1..g] g = pa(p)
void dfs(int... | ALGO | 0.999929 | 4.287658 |
7238e99e-164a-45a1-abcd-f4319f88f69c | TechyCSR/CipherSchoolAssigments | Day 11/Ques-01.cpp | #include <iostream>
using namespace std;
string findTarget(const int arr[], int size, int target) {
for (int i = 0; i < size; i++) {
if (arr[i] == target) {
return "YES";
}
}
return "NO";
}
int main() {
int arr[] = {2, 4, 6, 7, 8};
int size = sizeof(arr) / sizeof(arr[0]... | ALGO | 0.999202 | 5.519354 |
61720222-50c5-4251-b196-3d6ac8796e71 | 1Mohitpl/DSA-JOURNRY | Leetcode/2559. Count Vowel Strings in Ranges/code.cpp | vector<int> vowelStrings(vector<string>& words, vector<vector<int>>& queries) {
int n = words.size();
int q = queries.size();
unordered_set<char> vowels = {'a', 'e', 'i', 'o', 'u'};
vector<int>result(q);
vector<int> cumusum(n);
int sum = 0;
for(int i = 0; i<n; i++... | ALGO | 0.999626 | 6.224041 |
d768e476-9198-4f0d-8ff0-cc9182a77ce4 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_11890_10.cpp | #include <bits/stdc++.h>
using namespace std;
int flag[205][205];
int ask(int i, int j) {
if (i == j) return 0;
if (flag[i][j]) return flag[i][j];
printf("? %d %d\n", i, j);
fflush(stdout);
char s[2];
scanf("%s", s);
if (s[0] == '<') {
flag[i][j] = -1;
flag[j][i] = 1;
return -1;
} else {
... | ALGO | 0.999907 | 3.453525 |
3debf0d6-86d4-409d-8e6d-b0e71cce7cf1 | priyamore18/PrepInsta_DSA | pattern/pattern7.cpp | /*
1
2 2
3 3 3
4 4 4 4 */
#include<iostream>
using namespace std;
int main(){
int n;
cout<<"enter the number";
cin>>n;
for(int i=1;i<=n;i++){
for(int j=1;j<=i;j++){
cout<<i;
}
cout<<endl;
}
}
| ALGO | 0.999829 | 3.584507 |
90845b14-6a95-41d8-9e7a-4926d17f15e5 | codgician/competitive-programming | Codeforces/1000B/greedy.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <iomanip>
#include <climits>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <functional>
#include <iterator>
using namespace std;
#define SIZE 100010
in... | ALGO | 0.999866 | 3.36947 |
7bb4793e-d3e7-45d7-9cd9-f601dd58b3d7 | shaowei-cai-group/Z3-Parti-Z3pp-at-SMT-COMP-2024 | solver-files/common/resources/partitioner-src/src/util/mpz.cpp | #include <cstring>
#include <sstream>
#include <iomanip>
#include "util/mpz.h"
#include "util/buffer.h"
#include "util/trace.h"
#include "util/hash.h"
#include "util/bit_util.h"
#if defined(_MP_INTERNAL)
#include "util/mpn.h"
#elif defined(_MP_GMP)
#include<gmp.h>
#else
#error No multi-precision library selected.
#end... | TOOL | 0.975994 | 5.234023 |
734b9fca-44c6-4fdd-a0e2-d2aab3f6bcc6 | jl3329/keyboard | lib/usbhost/arduino-1.0.1/cores/arduino/USBCore.cpp | #include "Platform.h"
#include "USBAPI.h"
#include "USBDesc.h"
#if defined(USBCON)
#define EP_TYPE_CONTROL 0x00
#define EP_TYPE_BULK_IN 0x81
#define EP_TYPE_BULK_OUT 0x80
#define EP_TYPE_INTERRUPT_IN 0xC1
#define EP_TYPE_INTERRUPT_OUT 0xC0
#define EP_TYPE_ISOCHRONOUS_IN 0x41
#define EP_TYPE_ISOCHRONOUS_OUT... | TOOL | 0.8593 | 5.931091 |
126b4369-006b-4836-8112-60edcc75432c | mars-tu/SkyLark | src/PX4-Autopilot/src/modules/commander/level_calibration.cpp | #include "level_calibration.h"
#include "calibration_messages.h"
#include "calibration_routines.h"
#include "commander_helper.h"
#include <px4_platform_common/defines.h>
#include <px4_platform_common/posix.h>
#include <px4_platform_common/time.h>
#include <drivers/drv_hrt.h>
#include <lib/mathlib/mathlib.h>
#include ... | TOOL | 0.970173 | 5.955118 |
663425b5-7818-44aa-85f2-1a7cb068b1fa | EthanParisGrape/Variousa | flutter_local_notifications/example/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.99879 | 6.797273 |
ea1d93c8-da89-48da-9267-a2efc51638a4 | wildbohana/cpp_oop | za_otisak/kodovi/dodatno7.cpp | // ล ta ฤe biti ispisano na ekranu nakon izvrลกavanja sledeฤeg koda?
#include <iostream>
using namespace std;
class X {
private:
int y;
public:
X(int yy = 0) {y = yy;}
const X operator++(int a) { // postfiksni (nema &)
cout << "1";
X x(y);
y++; // inkrementira
return x; // vraฤa neinkremen... | ALGO | 0.920453 | 4.735497 |
58a0d309-d3d4-45ff-b5fd-e4cbd572e40c | Tphuong612/DSA | DSA anh loc/2.ham, li thuyet so/bai 37 luy thua.cpp | #include <bits/stdc++.h>
using namespace std;
long long binpow(long long a,long long b)
{
long long m= (long long) 1e9+7;
if(b==0) return 1;
long long x=binpow(a%m,b/2);
if(b%2==1) return ((x%m)*(x%m)%m*(a%m))%m;
else return ((x%m)*(x%m)%m)%m;
}
int main()
{
long long a,b;
cin>>a>>b;
cout<<binpow(a,b);
}
| ALGO | 0.999965 | 5.152662 |
3c5bdaba-e636-4e70-9c19-9e0a969707c1 | shashank-amireddy/LeetCode | DCP-02-25/3151-Special-Array-I.cpp | class Solution {
public:
bool isArraySpecial(vector<int>& nums) {
for(int i=1; i< nums.size();i++){
if(nums[i]%2 == nums[i-1]%2){
return false;
}
}
return true;
}
}; | ALGO | 0.999266 | 5.523778 |
d570c358-328f-41ca-9fc5-03f619433a44 | Edson-source/Data_Structures | alg.marlon/Pilha.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <conio.h>
#define capacidade 5 //tamanho da pilha
struct Stack
{
int topo, item[capacidade];
};
typedef struct Stack stack;
/*============== Inicia Pilha ======================*/
void inic_pilha(stack *p)
{
p->topo = -1;
}
/*===========... | ALGO | 0.999004 | 4.069228 |
04bed23d-5710-4b95-9b15-90da1fc7dc6c | fadyat/ITMO-PROBLEMS | algorithms/term1/intro/a-plus-b2.cpp | #include <bits/stdc++.h>
typedef long long ll;
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
int main()
{
freopen("aplusbb.in", "r", stdin);
freopen("aplusbb.out", "w", stdout);
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
ll a, b;
cin >> a >> b;
... | ALGO | 0.999704 | 3.995362 |
ce886ce2-483f-4c9d-aa02-05b373fd2031 | Youssef645561/Problem-solving | 03 - Seventh course/A08 - Multiply two matrices.cpp | #include <iostream>
#include <iomanip>
#include <cstdio>
using namespace std;
int RandomNumInRange(int From, int To)
{
return rand() % (To - From + 1) + From;
}
void FillMatrixWithRandomNums(int Matrix[3][3], const short& Rows, const short& Cols)
{
for (short i = 0; i < Rows; i++)
{
for (short C = 0; C < Cols; ... | ALGO | 0.999283 | 3.660042 |
32e539ed-9013-41f3-8454-de94656f35ed | Rudking/ADS | assign6h.cpp | #include <iostream>
using namespace std;
# define max 1000
class node
{
public:
string key,value;
node *next;
node()
{
next=NULL;
}
node(string key,string value)
{
this->key=key;
this->value=value;
}
friend class dictionary;
};
class dictionary
{
public:
node *head[max];
dictionary()
{
for(int ... | ALGO | 0.993445 | 4.301239 |
00b8af60-7804-4c85-8318-7637afc61345 | aarindey/Leetcode-Solution-By-aarindey | 1316-distinct-echo-substrings/1316-distinct-echo-substrings.cpp | class Solution {
public:
int distinctEchoSubstrings(string text) {
int n=text.size();
unordered_set<string> ans;
for(int len=1;len<=n/2;len++)
{
int count=0;
for(int left=0,right=len;right<n;right++,left++)
{
if(text[left]==text[right]... | ALGO | 0.999778 | 5.953961 |
b8121563-8a57-40b0-b989-a5d913680efb | jeetmehta/hackerrank-cracking-the-coding-interview | Techniques:Concepts/time-complexity-primality.cpp | #include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#inc... | ALGO | 0.999433 | 4.026286 |
1a72f02e-a3fa-4d89-ae13-5cad1bb1c65a | Patrickcxt/C-Store | src/Index.cpp | #include "Index.h"
#include <stdio.h>
#include <string.h>
Index::Index() {
}
Index::~Index() {
if (root != NULL) delete root;
}
Index::Index(char* tname) {
strcpy(tblName, tname);
init();
}
void Index::buildBtree() {
int arr[4096];
int result = 0;
int pos = 0;
char p[100];
cnt = 0;
create_File_Na... | TOOL | 0.902645 | 3.33456 |
f5ab2137-c716-47de-a6c8-7fb23ae9fb9b | BenuG-Shanker/ANSI_Clanguage | tut77.cpp | #include <iostream>
#include <string>
using namespace std;
class binary
{
// it is not neccessary to write private keyword in the class while programming, because by default all the members of the class are private.
string s;// here, variable s is the private member of the class binary
public:
void read(... | ALGO | 0.96959 | 5.573355 |
bc831eb7-8427-4170-9ab8-58c4d967f846 | thinkhy/LeetCode | boyer_moore.cpp | #include <iostream>
#include <string>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#include <limits>
#include <utility>
#include <cstring>
using namespace std;
#define DE(a) cout << #a << ": " << a << endl;
/*... | ALGO | 0.999954 | 4.775363 |
e46b956d-698e-498f-9d87-fcc99a9a6c03 | sarvex/leetcode-chez | solution/1300-1399/1305.All Elements in Two Binary Search Trees/Solution.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.999983 | 5.779255 |
a90b5a12-3940-48d8-a82b-f12bf215c993 | sh-sho1kat/CODEFORCES | Codeforces Round 1037 (Div. 3)/E_G_C_D_Unlucky.cpp | #include <bits/stdc++.h>
using namespace std;
// 2025-07-17 22:12:04
#define fastio ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
#define mod 1000000007
#define inf (1LL << 62)
#define all(x) x.begin(), x.end()
#define eb push_back
#define ff first
#define ss second
#define yes cout << "YES" << nl
#d... | ALGO | 0.999872 | 3.911379 |
c5e33035-e417-411e-a434-eeca1c078a0b | Ashis101/py-dsa | recursion/pow.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
int pow(int a,int b){
if(b == 0){
return 1;
}
if(b == 1){
return a;
}
int ans=pow(a,b/2);
if(b%2 == 0){
return ans * ans;
}else{
return a * ans * ans;
}
}
int main(){
int a,b;
... | ALGO | 0.999962 | 4.83515 |
60394610-46f9-4d44-906f-683e4722151e | vamsivallepu/AdvancedDS | kruskals.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
class DSU{
int *parent;
int *rank;
public:
DSU(int n){
parent = new int[n];
rank = new int[n];
for(int i=0;i<n;i++){
parent[i] = -1;
rank[i] = 1;
}
}
int find(int i){
if(parent[i]==-1){
return i;
}
return parent... | ALGO | 0.999988 | 4.674668 |
56962601-09de-4a37-ac08-3608d9ecbed9 | intfloat/AlgoSolutions | bzoj/1010.cpp | #include <vector>
#include <list>
#include <limits.h>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <... | ALGO | 0.999932 | 3.017968 |
969ed862-19aa-48a8-9105-23e2fe7ff9ad | svn2github/scidvspc | engines/toga/src/hash.cpp |
// hash.cpp
// includes
#include "board.h"
#include "hash.h"
#include "piece.h"
#include "random.h"
#include "square.h"
#include "util.h"
// variables
uint64 Castle64[16];
// prototypes
static uint64 hash_counter_key (int piece_12, int count);
// functions
// hash_init()
void hash_init() {
int i;
for ... | ALGO | 0.988689 | 7.098818 |
df598bae-8c29-4ef7-a097-1972321e0ba5 | Haldhardwivedi/Leetcode | 129-sum-root-to-leaf-numbers/129-sum-root-to-leaf-numbers.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.999964 | 5.815436 |
a75e752e-77b7-437c-842e-590906981ff7 | showmic96/Online-Judge-Solution | LightOJ/1135/10914724_AC_416ms_11844kB.cpp | // In the name of Allah the Lord of the Worlds.
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAX = 1e5+9;
ll ar[MAX+9] , one[3*MAX+9] , two[3*MAX+9] , three[3*MAX+9] , lazy[3*MAX+9];
void build(int node , int st , int en)
{
if(st==en){
ll temp = ar[st]%3;
if(tem... | ALGO | 0.999878 | 3.986662 |
34f4ec9a-1cb2-46ea-8a74-06dc876c201c | NoobMaster-96/Codeforces | Contests/Round_670/ProblemC.cpp | #include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define lli long long int
class graph{
vector<int> *adjlist;
vector<int> parent;
vector<int> childcount;
vector<int> c;
int num;
int N;
public:
graph(int n){
N = n;
adjlist = new vector<int>[N];
parent = ... | ALGO | 0.999967 | 4.308311 |
4c3ee25a-c4b9-49ef-ab5d-887464ce111b | blinderchief/CP_Practice | Contest_Sol/PWIOI_CodingClub_Contest_1_Maximum_Frequency_of_an_Element_After_Performing_Operations_II.cpp | // #include <bits/stdc++.h>
// using namespace std;
// #define ll long long int
// #define f(i, a, n) for (int i = a; i < n; i++)
// #define vll vector<ll>
// #define vi vector<int>
// #define pb push_back
// #define po pop_back
// #define me(a, x) memset(a, x, sizeof(a))
// #define all(v) v.begin(), v.end()
// #define... | ALGO | 0.999895 | 4.395391 |
cec60059-3f9d-4203-b46c-0006c72aaace | jazzsterq/programs | CPP/paint.cpp |
#include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
long long a[n];
int min =0;
for(int i=0;i<n;i++)
{
cin >> a[i];
if(a[i]< a[min])
{
min =i;
}
}
int j=0;
int count =0,maxcount=0;
for(int i=0;i<2*n;i++)
{
... | ALGO | 0.999968 | 3.296842 |
a7eab23c-b350-464c-b8dd-956910364344 | vgptjdslav12/BaekJoon | BJ_15829.cpp | #include <iostream>
#include <math.h>
using namespace std;
int main()
{
int l;
int r = 31, m = 1234567891;
long long sum = 0;
long long temp;
string str;
cin >> l;
cin >> str;
for (int i = 0; i < l; i++)
{
temp = 1;
for (int j = 0; j < i; j++)
{
temp %= m;
temp *= r;
}
sum += ((str[i] - 96) * ... | ALGO | 0.999955 | 3.913017 |
ad576ddc-f1b3-4478-acb5-dac7f22586be | ncduy0303/cses-solutions | src/1728.cpp | #include <bits/stdc++.h>
using namespace std;
#define print_op(...) ostream& operator<<(ostream& out, const __VA_ARGS__& u)
template<typename A, typename B> print_op(pair<A, B>) { return out << "(" << u.first << ", " << u.second << ")"; }
template<typename T_container, typename T = typename enable_if<!is_same<T_conta... | ALGO | 0.998933 | 4.14281 |
3f80ca78-bebc-46eb-a77b-c85d431eb511 | SebastianFaller/Composable-OPRF-via-Garbled-Circuits | PQ-MPC/extern/SEAL/src/seal/util/numth.cpp | #include "seal/util/numth.h"
#include "seal/util/uintcore.h"
using namespace std;
namespace seal
{
namespace util
{
vector<uint64_t> conjugate_classes(uint64_t modulus,
uint64_t subgroup_generator)
{
if (!product_fits_in(modulus, subgroup_generator))
{
... | ALGO | 0.999566 | 6.830489 |
01b90d9e-2d6d-40f3-9df5-4abbc4271fb4 | Naveen13s/Test | Binary Search/Logic Building/Searchinsertposition.cpp | //Search insert position
/* Given a sorted array of nums consisting of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.
Examples:
Input: nums = [1, 3, 5, 6], target = 5
Output: 2
Explanation: The target value 5 is f... | ALGO | 0.999959 | 6.074231 |
0fcd6452-ed0a-4481-b2d0-83d42d0dc814 | artiam99/GeeksforGeeks | 10 Dynamic Programming/3 Hard Problems/17 Min No of Elements not added to Incr, _ Decr. Sequence.cpp | #include<bits/stdc++.h>
using namespace std;
int Rec(vector<int> &a,int n,int i,int I,int D,vector<vector<vector<int>>> &dp)
{
if(i < 0) return 0;
if(dp[i][I][D] != -1) return dp[i][I][D];
int ans = INT_MIN;
if(I == n || a[i] < a[I])
ans = max(ans , Rec(a,n,i-1,i,D,dp) + 1);
... | ALGO | 0.999965 | 4.729424 |
ab38ae26-c3fc-4958-980b-342bd1553cdb | TooniMike/netflix-Clone | 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 |
a79ee000-5ea1-4c24-8ef0-51c2066b6b64 | Burhanuddin1999/Autoremesher | thirdparty/geogram/geogram-1.7.5/src/lib/geogram/numerics/lbfgs_optimizers.cpp | #ifdef GEOGRAM_WITH_HLBFGS
#include <geogram/numerics/lbfgs_optimizers.h>
#include <geogram/basic/command_line.h>
#include <geogram/basic/argused.h>
#include <geogram/third_party/HLBFGS/HLBFGS.h>
#include <geogram/bibliography/bibliography.h>
#include <setjmp.h>
#include <iostream>
namespace GEO {
/**
* \b... | ALGO | 0.971546 | 7.66608 |
192924ae-5276-41b2-b7d1-0d6c0f2cbf42 | whgusdn321/Competitive-programming | atcoder/abc-175-d/main.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n, k;
int p[5001];
int c[5001];
long long ans[5001] = {0};
cin >> n >> k;
for(int i=0; i<n; i++)
cin >> p[i];
for(int i=0; i<n; i++)
cin >> c[i];
... | ALGO | 0.999961 | 3.321373 |
72feed37-fbbe-4732-8eff-b97f8777d77a | YasArcher/CursoP2 | CursoP2/ejercicio12.cpp | #include <iostream>
#include <iomanip>
using namespace std;
void lab_2_0_4() {
int sys;
float m, ft, in;
cin >> sys;
if (sys == 0) {
cin >> m;
if (m < 0) {
cout << "Invalid input" << endl;
return;
}
ft = static_cast<int>(m / 0.3048);
in ... | TOOL | 0.902193 | 4.483453 |
65f84a7b-9158-42ce-8a51-81749192cfa8 | Sanketh149/LC4EVER | 2126-destroying-asteroids/2126-destroying-asteroids.cpp | class Solution {
public:
bool asteroidsDestroyed(int mass, vector<int>& asteroids) {
sort(asteroids.begin(), asteroids.end());
int n = asteroids.size();
long long masss = mass;
for(int i = 0;i<n;i++)
{
if(asteroids[i] > masss) return false;
masss += as... | ALGO | 0.999873 | 5.913998 |
2535f472-6150-4669-8346-ed63f4dacaf4 | C1ouDreamW/Cpp_Study | VScode/20690.cpp | #include <bits/stdc++.h>
using namespace std;
#define PII pair<int, int>
#define int long long
// int dx[4] = { 0, 0, 1, -1 };
// int dy[4] = { 1, -1, 0, 0 };
// int dx[8] = {0, 0, 1, -1, -1, -1, 1, 1};
// int dy[8] = {1, -1, 0, 0, -1, 1, -1, 1};
void solve() {
string s = "";
int n;
cin >> n;
for (int i = 2; ... | ALGO | 0.999334 | 4.626825 |
cda1b7d3-6f96-4865-85c3-b5266dba5cdf | ishandutta2007/codeforces | gmusya/normal/780/C.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
vector <int> col;
vector <bool> used;
vector <vector <int>> g;
void dfs(int u, int p, int gp) {
used[u] = true;
int cnt = 1;
for (int i = 0; i < g[u].size(); i++) {
while (cnt == col[u] || cnt == col[p])
cnt++;
if (!used[g[u][i... | ALGO | 0.999982 | 4.655901 |
f24da140-931a-4a90-ac65-d298564a0dc2 | jyotideepjee1803/DSA- | Binary Tree/105. Construct Binary Tree from Preorder and Inorder Traversal/construct_binary_tree_from_pre_in.cpp | #include<bits/stdc++.h>
using namespace std;
TreeNode* f(int s_pre, int s_in, int e_in,vector<int>& preorder, vector<int>& inorder, unordered_map<int,int> &mp){
if(s_in > e_in || s_pre > preorder.size()-1){
return NULL;
}
TreeNode* root = new TreeNode(preorder[s_pr... | ALGO | 0.999995 | 6.129039 |
6f01bc49-53eb-49b5-90c6-9de6e8dbf72a | ganireddikumar/Introduction-to-CPP-Coding-Ninjas-codes | starpttrn.cpp | #include <iostream>
using namespace std;
int main() {
int n;
cin>>n;
for(int i=0;i<n;i++){
for(int k=n-i-1;k>=1;k--){
cout<<" ";
}
for(int j=1;j<= (2*i)+1;j++){
cout<<"*";
}
cout<<endl;
}
}
| ALGO | 0.999945 | 3.704307 |
40b20b05-19a9-4b8e-9da6-f3aab4038f8a | weiii8708271688/UVA | UVA/10286/33594770_AC_10ms_0kB.cpp | #include <iostream>
#include <map>
#include <algorithm>
#include <iomanip>
#include <cmath>
using namespace std;
int main() {
double n;
double PI = acos(-1.0);
while(cin >> n) {
cout << fixed << setprecision(10) << n/sin(63.0*PI/180.0)*sin(108.0*PI/180.0) << endl;
}
}
| ALGO | 0.998822 | 4.024206 |
bbc5caa8-18f7-466a-a2be-375abe5df6b1 | YEon00/Yeon-Algorithm | BOJ/15686 ์นํจ๋ฐฐ๋ฌ.cpp |
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int map[51][51];
int copy_map[51][51];
int n, m; int res;
int distance = 0;
bool visited[13];
vector <pair<int, int>> house, chicken;
void dfs(int x, int check) {
if (check == m) {
int temp = 0;
for (int i = 0; i < house.size(); ... | ALGO | 0.999841 | 3.694254 |
a2447866-723a-482b-b7f6-552075176ef4 | umang537/Competitive-Programming | Backtracking/N_Queen_problem.cpp | #include<bits/stdc++.h>
using namespace std;
bool isSafe(vector<vector<int>> board, int row, int col, int n)
{
// Checking in this row prev cols
for(int i = 0 ; i < col; i++)
{
if(board[row][i] == 1)
return false;
}
// Upper left Diagonal
for(int i = row, j = col; i >= 0 &&... | ALGO | 0.999882 | 5.15859 |
bdb906b6-20ba-48ad-9af2-bd877de1c8bd | Bhu03sun/CSA0429-Operating-Systems-for-Virtualization | Best Fit Algorithm.cpp | #include <stdio.h>
#define MAX_BLOCKS 100
#define MAX_PROCESS 100
void bestFit(int blockSize[], int m, int processSize[], int n) {
int allocation[MAX_PROCESS];
for (int i = 0; i < n; i++) {
allocation[i] = -1; // Initialize allocation array to -1 (indicating not allocated)
}
for (int i = 0; ... | ALGO | 0.999862 | 4.847417 |
33a04219-23cd-4e88-ac05-1032ef1fcbd2 | siddh61103/DSA | 0552-student-attendance-record-ii/0552-student-attendance-record-ii.cpp | class Solution {
public:
int mod = 1e9+7;
int solve(int n, int a, int l,vector<vector<vector<int>>> &dp){
if(n==0) return 1;
long long sum = 0;
if(a==0){
if(dp[n-1][a+1][0]!=-1){
sum+=dp[n-1][a+1][0];
}
else sum+=solve(n-1,a+1,0, dp);
... | ALGO | 0.999978 | 5.349747 |
d4f60aa2-122e-474b-b0f4-8e5222e0a2e7 | rsharifnasab/sbu_basic_programming | tamrin4/kelas.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main()
{
double n,sum = 0;
cin >> n;
for(int i =1; i <= n; i++ )
{
int temp = 0;
cin >> temp;
sum += temp /( pow(2,i-1)) ;
//s2 += 2/( pow(2,i)) ;
}
cout << sum/ n << endl;
}
| ALGO | 0.999788 | 3.05449 |
c095d1a9-e79f-4943-a6fa-ade72d649334 | Rasbats/onavsim_pi | src/bbox.cpp | // For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#include "bbox.h"
wxBoundingBox::wxBoundingBox()
{
m_minx = m_miny = m_maxx = m_maxy = 0.0;
m_validbbox = FALSE;
}
wxBoundingBox::wxBoundingBox(const wxBoundingBox &other)
{
m_minx = other.m_minx;
m_miny = other... | TOOL | 0.981559 | 7.009681 |
9c9240a9-2ae9-46ff-b91f-9bd1df03ed5f | CodeTrans-Research/RefuTra | result/translate/transcoder/java2cpp2/cpp_eval/TOTAL_NUMBER_OF_NON_DECREASING_NUMBERS_WITH_N_DIGITS.cpp | #include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <fstream>
#include <iomanip>
#include <bits/stdc++.h>
using namespace std;
long long int f_gold ( int n ) {
long long int dp [ 10 ] [ n + 1 ];
memset ( dp, 0, sizeof dp );
for ( int i = 0;
i < 10;
i ++ ) dp [ i ] [ 1 ] = 1;
... | TEST | 0.998767 | 6.86945 |
d1d2a60b-5b98-4326-9dd8-fa4a46a489ab | sunbines/log | boost/libs/hana/example/define_struct.cpp | #include <boost/hana/accessors.hpp>
#include <boost/hana/assert.hpp>
#include <boost/hana/core/to.hpp>
#include <boost/hana/define_struct.hpp>
#include <boost/hana/equal.hpp>
#include <boost/hana/find.hpp>
#include <boost/hana/first.hpp>
#include <boost/hana/map.hpp>
#include <boost/hana/not_equal.hpp>
#include <boost/... | TEST | 0.887406 | 6.964081 |
4c4dad7d-bca6-4b4f-96fc-11d281ebee0f | bekmirzayevelnur/code | daraxt.cpp | #include <bits/stdc++.h>
using namespace std;
#define mx 100005
vector<int>adj[mx];
bool vis[mx];
long long d;
void dfs(int u, int s) {
vis[u] = true;
for (auto x : adj[u]) {
if (vis[x] == false) {
d += s+1;
dfs(x, s+1);
}
}}
void add(int u, int v)
{ adj[u].push_ba... | ALGO | 0.999604 | 3.292 |
ece46db8-26dc-4afc-bbfd-2ee731baadc4 | ahmedsaed/LeetCode-Solutions | 1679-max-number-of-k-sum-pairs/1679-max-number-of-k-sum-pairs.cpp | class Solution {
public:
int maxOperations(vector<int>& nums, int k) {
int op = 0;
map<int, int> mp;
for (int i = 0; i < nums.size(); i++) {
int x = k - nums[i];
if (mp[x]) {
op++;
mp[x]--;
}
else mp[nums[i]]++;
... | ALGO | 0.999935 | 6.088887 |
22e46fcb-542a-4348-9ee7-57e4cda6e9bd | ishandutta2007/codeforces | raccer/normal/414/C.cpp | #include <bits/stdc++.h>
using namespace std;
int N;
long long f[30], g[30];
int a[1 << 20];
int tmp[1 << 20];
void Build(int l, int r, int dep = 0) {
if (l == r) return ;
int mid = l + r >> 1;
Build(l, mid, dep + 1), Build(mid + 1, r, dep + 1);
int p1 = l, p2 = mid + 1, cur = l;
long long sum = 0, sss = 0;
whi... | ALGO | 0.999585 | 3.728504 |
53e3a62f-f5f0-428a-9aae-d0608dcb4053 | ye0jin/BaekJoon | ํ๋ก๊ทธ๋๋จธ์ค/lv2/43165.โ
ํ๊ฒโ
๋๋ฒ/ํ๊ฒโ
๋๋ฒ.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
int targetNum = 0;
int answer = 0;
void DFS(vector<int> v,int i, int sum) {
if (i == v.size()) {
if(sum == targetNum) answer++;
return;
}
DFS(v,i + 1, sum + v[i]);
DFS(v,i + 1, sum - v[i]);
}
int solution(vector<int> numbers, int targe... | ALGO | 0.999953 | 5.372455 |
1fdea2d4-11ce-4fe4-b4ae-ee80d6c27f0a | isanchez-aguilar/UVa-Solutions | 1262 - Password.cpp | /*
* User: Isanchez_Aguilar
* Problem: UVA 1262 - Password
*/
#include <bits/stdc++.h>
using namespace std;
int main(void)
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int testCases;
cin >> testCases;
while(testCases--)
{
int n;
cin >> n;
bitset<26> grid1[6];
bitset<26> grid2[6];
for(int i = 0; i <... | ALGO | 0.999718 | 3.548235 |
e6a6b9cd-6491-4bd0-90ab-bae3474c055e | ishandutta2007/codeforces | realcomplex/normal/1499/F.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int>pii;
#define fi first
#define se second
#define mp make_pair
#define fastIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
const int N = 5010;
const int MOD = 998244353;
int dp[N][N];
int sub[N];
int k;
vector<int> T[N];
... | ALGO | 0.999974 | 4.712652 |
90e97742-e28c-4a1b-b2dd-ee434d066057 | TruptiBhatlekar/Logic-Building-Assignments | Assignment_38/GenericTemp_5.cpp | ///////////////////////////////////////////////////////
//
// File name : GenericTemp_5
// Description: Generic program to return the smallest value from N elements.
// Author : Trupti Bhatlekar
// Date : 30/06/2025
//
///////////////////////////////////////////////////////
#include <iostrea... | ALGO | 0.999297 | 4.75122 |
63d869e0-fb3b-4b9b-a4ef-55249de176b1 | Geminicodedreamer/Cplus | do/check.cpp | #include <iostream>
#include <vector>
#include <set>
#include <cstdlib>
#include <ctime>
#include <fstream>
#include <cstdio>
#define MOD 998244353
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
ll mod_pow(ll base, ll exp, ll mod)
{
ll result = 1;
while (exp > 0)
{
if (ex... | ALGO | 0.99928 | 4.939642 |
927b3c8c-f3df-4804-8a2b-b988e4de39ce | okinc/litecoin | src/checkpoints.cpp | #include <boost/assign/list_of.hpp> // for 'map_list_of()'
#include <boost/foreach.hpp>
#include "checkpoints.h"
#include "main.h"
#include "uint256.h"
namespace Checkpoints
{
typedef std::map<int, uint256> MapCheckpoints;
// How many times we expect transactions after the last checkpoint to
// be slowe... | TOOL | 0.888501 | 6.372063 |
6ab378d8-da5e-4ecc-b577-4c75bbfed433 | KashifMushtaq/AesGcm_Linux | GcmAes/cryptopp870/iterhash.cpp | // iterhash.cpp - originally written and placed in the public domain by Wei Dai
#ifndef __GNUC__
#define CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES
#endif
#include "iterhash.h"
#include "misc.h"
#include "cpu.h"
NAMESPACE_BEGIN(CryptoPP)
template <class T, class BASE> void IteratedHashBase<T, BASE>::Update(const byte ... | ALGO | 0.998703 | 6.907722 |
4f7db2d9-8df4-4bc3-af7d-33b14621b53c | availrum/newb | getmincost.cpp | #include<iostream>
#include<queue>
using namespace std;
int main(){//1916
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int N,M;
cin>>N>>M;
int arr[N+1][N+1];
long long int cost[N+1];
for(int i=0; i<=N; ++i){
cost[i]=2147483646;
for(int j=0; j<=N; ++j) arr[i... | ALGO | 0.99995 | 4.328074 |
89ab4d62-169d-4009-b117-e70b40733949 | Keshav1707/Submissions | A_Fox_And_Snake.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int x,y;
cin>>x>>y;
bool flag =1;
for (size_t i = 0; i < x; i++)
{
for (size_t j = 0; j < y; j++)
{
if(flag&&i%2!=0&&j==y-1)
{
cout<<'#';
continue;
}
else if(!flag&&i%2!=0&&j==0)
{
... | ALGO | 0.999948 | 3.043514 |
462a5145-3070-4f2a-9f29-9141f85002df | lmark1/aoc2020 | day17.cpp | #include "util.hpp"
#include <cmath>
#include <numeric>
#include <type_traits>
#include <unordered_map>
using pos_t = std::tuple<long long, long long, long long>;
using hyper_pos_t = std::tuple<long long, long long, long long, long long>;
template <typename Key>
struct key_hash : public std::unary_function<Key, std::... | ALGO | 0.999734 | 6.311031 |
b34a1a06-52d1-417f-a318-8aafdc6cf221 | jinhan814/solutions | UCPC/ucpc11_b.cpp | #include <bits/stdc++.h>
using namespace std;
struct union_find {
union_find(int n) : p(n, -1) {}
int find(int x) {
return p[x] < 0 ? x : p[x] = find(p[x]);
}
int cnt(int x) {
return -p[find(x)];
}
bool merge(int a, int b) {
a = find(a), b = find(b);
if (a == b) return 0;
if (p[a] > p[b]) swap(a, b);
... | ALGO | 0.999967 | 4.751626 |
f17d9446-4d04-4156-b973-170185280ff3 | iblackcat/mobilefusion | include/eigen3/doc/examples/TutorialLinAlgExSolveLDLT.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Matrix2f A, b;
A << 2, -1, -1, 3;
b << 1, 2, 3, 1;
cout << "Here is the matrix A:\n" << A << endl;
cout << "Here is the right hand side b:\n" << b << endl;
Matrix2f x = A.ldlt().solve(b);
cout << "... | ALGO | 0.999943 | 3.807622 |
13cf5225-df61-439e-8992-154ffbf774f1 | PNUHyeonWoo/Baekjoon | cpp/gold/gold1/grp_1115_permutation.cpp | #include <iostream>
#include <cmath>
using namespace std;
int n;
int* p;
int getCycles();
int main()
{
cin >> n;
p = new int[n];
for (int i = 0; i < n; i++)
cin >> p[i];
cout << getCycles();
}
int getCycles()
{
int result = 1;
bool* check = new bool[n];
for (int i = 0; i < n; i++)
check[i] = false... | ALGO | 0.999947 | 3.474846 |
5925ecb4-4834-4943-81c8-e6c610548c5e | HawDinh/CodePTIT | Code_DSA/DSA_01007.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
string s;
int ok;
int n;
void ktao(){
for (int i=1;i<=n;i++) s[i]='A';
}
void in(){
for (int i=1;i<=n;i++) cout << s[i];
cout << " ";
}
void sinh(){
int i=n;
while (i>0 && s[i]=='B') --i;
if (i==0) ok=0;
else {
s... | ALGO | 0.997612 | 4.0984 |
3d6b202e-608b-49e2-a0ab-ddbde0aa9c58 | apache/madlib | src/modules/linear_systems/sparse_linear_systems.cpp | /* ----------------------------------------------------------------------- *//**
*
* @file sparse_linear_systems.cpp
*
* @brief sparse linear systems
*
* We implement sparse linear systems using the direct.
*
*//* ----------------------------------------------------------------------- */
#include <limits>
#inc... | ALGO | 0.996704 | 5.036091 |
41b10591-2300-4ba8-ac78-44b29b997598 | aufanam/Competitive-Programming | 2_C_Bebek_Usil.cpp | #include <bits/stdc++.h>
#define int long long
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
using namespace std;
int ask(int x, int y) {
cout << "? " << x << " " << y << endl;
int ret;
cin >> ret;
return ret;
}
int32_t main()
{
ios_base::sync_with_std... | ALGO | 0.999987 | 3.301767 |
e5382504-e8ca-4bdd-9e81-b82cd9013828 | pasbi/ommpfritt | src/properties/propertyfilter.cpp | #include "properties/propertyfilter.h"
#include "aspects/abstractpropertyowner.h"
namespace omm
{
PropertyFilter::PropertyFilter(const Disjunction<Kind>& kind, const DNF<Flag>& flag)
: kind(kind), flag(flag)
{
}
PropertyFilter::PropertyFilter() = default;
PropertyFilter::PropertyFilter(const DNF<Flag>& flag)
... | TOOL | 0.872791 | 6.321415 |
f424ab42-0d26-4c3c-ada5-f108677eb74d | therahulkumar9/CPP | 01_Basics/02_addTwoNumbers.cpp | #include <iostream>
using namespace std;
int main()
{
int a, b, c;
cout << "Enter first number: ";
cin >> a;
cout << "Enter second number: ";
cin >> b;
c = a + b;
cout << "Sum of a and b is: " << c;
return 0;
} | TOOL | 0.889226 | 3.887221 |
1cb1445e-1501-49db-8cd9-77e7be5d1286 | SSp1ash/LeetCode | src/26. Remove Duplicates from Sorted Array/26. Remove Duplicates from Sorted Array.cpp | #include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
int removeDuplicates(vector<int>& nums) {
int x=0x7fffffff;
int count=0;
for(int i=0;i<nums.size();i++){
if(nums[i]!=x){
x=nums[i];
count++;
}
else{
nums.erase(nu... | ALGO | 0.999771 | 5.46427 |
22cb046c-5dbd-4c31-802a-4d83cadd7da1 | s417-lama/ppopp21-preemption-artifact | lammps/src/MISC/fix_thermal_conductivity.cpp | /* ----------------------------------------------------------------------
Contributing author: Craig Tenney (UND) added support
for swapping atoms of different masses
------------------------------------------------------------------------- */
#include "fix_thermal_conductivity.h"
#include <... | ALGO | 0.991011 | 5.303722 |
edade62c-0436-493d-9c1e-c7cd0ea2db01 | LoveHRTF/ENGN-2912B | example/ex22-master/src/main3.cpp | // example adapted from Williams "C++ Concurrency in Action" (Manning, 2nd Ed., 2019)
// listing_2.8.cpp
#include <thread>
#include <numeric> // provides accumulate (serial)
#include <algorithm>
#include <functional>
#include <vector>
#include <iostream>
#include <cassert>
#include <cmath>
template<typename Iter... | ALGO | 0.999936 | 6.708148 |
138ea102-5b0c-44c0-b551-0a678fb618f6 | aaryan2001/data-structure-patterns | Assignment1/Ass1/Res/Main.cpp |
#include <iostream>
#include <cmath>
#include "Matrix3x3.h"
void testProblem1()
{
Matrix3x3 M ( Vector3D( 2.0f, 3.0f, 8.0f ),
Vector3D( 6.0f, 0.0f, -3.0f ),
Vector3D( -1.0f, 3.0f, 2.0f ) );
std::cout << "Test matrix M:" << std::endl;
std::cout << M << std::endl;
... | TEST | 0.970521 | 6.14813 |
3f84d56b-61bf-4327-8ebc-b69e445f9ac9 | tic40/atcoder | abc/abc301/c/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<n;i++)
#define endl '\n'
int main() {
const string atc = "atcoder";
string s,t; cin >> s >> t;
set<char> st;
map<char,int> ms,mt;
for(auto c: s) { st.insert(c); ms[c]++; }
for(auto c: t) { st.insert(c); mt[c]++; }
bool ok = tru... | ALGO | 0.999969 | 4.027088 |
a80784e8-0b36-47ff-8315-54863e8110b3 | tuananh2k321/shoe_store | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998859 | 6.785645 |
eead7d85-893c-4899-bcb8-54540194d9f7 | Ammar1ja/CodeForces | Official/Ultra-FastMathematician/Ultra-Fast Mathematician.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
string s1, s2;
cin >> s1;
cin >> s2;
for (int i = 0; i < s1.size(); i++)
{
if (s1[i] == s2[i])
cout << '0';
else
cout << '1';
}
} | ALGO | 0.999987 | 3.454716 |
73cc124f-4582-4b88-ab06-ef02d078850b | PhilipHsu609/LeetCode | 2938-separate-black-and-white-balls/2938-separate-black-and-white-balls.cpp | class Solution {
public:
long long minimumSteps(string s) {
int pos = 0;
long long ans = 0;
for(int i = 0; i < s.length(); i++) {
if(s[i] == '0') {
ans += i - pos;
pos++;
}
}
return ans;
}
}; | ALGO | 0.999879 | 5.917885 |
8434541b-3704-499c-b3c7-42ee32289633 | xyliuke/boost_ios_mac | boost-ios/src/boost_1_55_0/libs/intrusive/example/doc_avl_set.cpp | using namespace boost::intrusive;
//This is a base hook optimized for size
class MyClass : public avl_set_base_hook<optimize_size<true> >
{
int int_;
public:
//This is a member hook
avl_set_member_hook<> member_hook_;
MyClass(int i)
: int_(i)
{}
friend bool operator< ... | TOOL | 0.964019 | 5.919651 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.