uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
d28656cb-6044-474b-bf2c-f64648e2668d | memphis242/leetcode | 3584maxProdSubSeq/maxProdSubSeq.cpp | #include <vector>
#include <algorithm>
using namespace std;
class Solution1 {
public:
long long maximumProduct(vector<int>& nums, int m) {
long long localMax = nums[0], localMin = nums[0];
long long maxProd = (long long)nums[0] * nums[m-1];
for ( ptrdiff_t i = m; i < (long long)nums.size()... | ALGO | 0.999866 | 6.209279 |
ec67d658-9613-44c0-a321-5f93204b2c69 | brunostega/Lab_Sim_Numerica | random.cpp | #include <iostream>
#include <fstream>
#include <cmath>
#include <cstdlib>
#include "random.h"
#include "function.h"
#include <string>
using namespace std;
const string path="/home/bruno/Scrivania/universita/magistrale1/lab_simulaz/esercizi/";
Random :: Random(){} //coustruttore (posso eventualmente dargli u... | ALGO | 0.997373 | 3.851711 |
98f3d181-b471-4149-87a3-cea3ebc8c65b | gtkn/atcoder | ABC_134_A.cpp | //title
#include <bits/stdc++.h>
using namespace std;
//#include <atcoder/all>
//using namespace atcoder;
#define rep(i,n) for (ll i = 0; i < (n); ++i)
#define rep1(i,n) for (ll i = 1; i <= (n); ++i)
#define repr(i,n) for (ll i = (n)-1; i >= 0; --i)
#define rep1r(i,n) for (ll i = (n); i > 0; --i)
#define bit(n,k) ((n>>... | ALGO | 0.999765 | 3.654659 |
ffb8b26e-bca1-45da-a53c-598b8dc0e371 | ishandutta2007/codeforces | stupid_justin/normal/1530/D.cpp | #include<bits/stdc++.h>
#define int long long
#define endl "\n"
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#define rd(x) x=read()
#define write(x) wt(x),putchar(10)
#define pos(x) (((x)-1)/SZ+1)
using namesp... | ALGO | 0.999986 | 3.491425 |
36129065-506f-44fd-98cc-7b611b69ce22 | seokwoo-jung/caffe-merge | src/caffe/layers/argmax_layer.cpp | #include <algorithm>
#include <functional>
#include <utility>
#include <vector>
#include "caffe/layers/argmax_layer.hpp"
namespace caffe {
template <typename Dtype>
void ArgMaxLayer<Dtype>::LayerSetUp(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top) {
const ArgMaxParameter& argmax_param =... | DATA | 0.944569 | 6.640243 |
b895ca58-9146-4121-9755-7f9228a4ad2d | vedantBCodes/Data-Structures-and-Algorithms-DSA- | Algorithms on Arrays/moore'sVotingAlgorithm.cpp | /* Given an array of size n, find the majority element — the element that appears more than ⌊n / 2⌋ times .
If such an element exists, return it. If not, return -1 (optional based on variation) .
If an element occurs more than half the times, it will survive cancellation against all other elements .
📌 Intuition:
Kee... | ALGO | 0.999981 | 6.502198 |
c135d871-43a1-4c1b-b3d8-a2308d5c27b9 | sourav-islam/Phitron_batch4 | Semester2/Basic DataStructure/Module 10/0Input_linked_list.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int val;
Node *next;
Node *prev;
Node(int val)
{
this->val = val;
this->next = NULL;
this->prev = NULL;
}
};
int main()
{
Node *head = NULL;
Node *tail = NULL;
list<int> list1;
int val;
... | ALGO | 0.999402 | 4.040264 |
ebdd9686-f611-4123-9033-e63b18fe7d7e | pexa/core | src/test/util_tests.cpp | #include <util/system.h>
#include <clientversion.h>
#include <hash.h> // For Hash()
#include <key.h> // For CKey
#include <optional.h>
#include <sync.h>
#include <test/util/setup_common.h>
#include <test/util/str.h>
#include <uint256.h>
#include <util/message.h> // For MessageSign(), MessageVerify(), MESSAGE_MAGIC
#i... | TEST | 0.902169 | 4.118834 |
42f8d908-4930-40bc-b8af-2ea05cf09261 | Sumanth-NR/CompetitiveProgramming | Platforms/ICPC/Practise_2023_09_09/C_Bear_and_Tree_Jumps.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, k;
cin >> n >> k;
vector<vector<int>> e(n);
vector<vector<ll>> f(n, vector<ll>(k));
vector<vector<ll>> ans(n, vector<ll>(k));
for (int u, v, i = 0; i... | ALGO | 0.999924 | 4.577954 |
8e95a345-e642-4d14-91aa-fbffaf25684b | sonnh173341/TTUDSS | Train5/warehouse.cpp | #include<bits/stdc++.h>
using namespace std;
const int N = 1010;
int n, T, D;
int a[N];
int t[N];
void input(){
cin >> n >> T >> D;
for (int i = 1; i <= n; i ++) cin >> a[i];
for (int i = 1; i <= n; i ++) cin >> t[i];
}
void output(){
int f[N][N];
int ans = 0;
for(int i = 1; i <= n; i ++){
... | ALGO | 0.99992 | 4.110661 |
827d2b94-4e96-4e91-a407-4f0e7889a70d | tesion99/LeetCode | cpp/levelOrder.cpp | /*
给定一个二叉树,返回其按层次遍历的节点值。 (即逐层地,从左到右访问所有节点)。
例如:
给定二叉树: [3,9,20,null,null,15,7],
3
/ \
9 20
/ \
15 7
返回其层次遍历结果:
[
[3],
[9,20],
[15,7]
]
来源:力扣(LeetCode)
链接:https://leetcode-cn.com/problems/binary-tree-level-order-traversal
---------------------------
Note:
层次遍历需要用到queue,但同时需要将每一层的值保存在一个v... | ALGO | 0.999971 | 6.920687 |
a92d0e49-59db-4004-abc6-051c588c3e0b | wsmoses/llvm-project-tok | libcxx/test/std/utilities/template.bitset/bitset.members/op_and_eq.pass.cpp | // test bitset<N>& operator&=(const bitset<N>& rhs);
#include <bitset>
#include <cstdlib>
#include <cassert>
#include "test_macros.h"
#if defined(TEST_COMPILER_CLANG)
#pragma clang diagnostic ignored "-Wtautological-compare"
#elif defined(TEST_COMPILER_C1XX)
#pragma warning(disable: 6294) // Ill-defined for-loop: i... | TEST | 0.994063 | 7.73735 |
47f553f3-50c7-4dfd-86d9-e7e2ee36914c | ghilmanm/elisoft | elisoft_bloc/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.99875 | 6.785645 |
18d23a0f-850b-4a57-95ab-89ab721ec7fb | PaulLandaeta/Algoritmica-1-2021 | Capitulo 2/parentesis.cpp | #include <bits/stdc++.h>
#define input freopen("in.txt","r",stdin)
#define output freopen("out.txt","w",stdout)
using namespace std;
int main() {
string parentesis;
// cin >> parentesis;
parentesis = "]]][[[";
stack<char> pila;
for(int i=0 ;i< parentesis.size() ;i++){
if(parentesis[i] == ... | ALGO | 0.999837 | 4.154921 |
6fde8489-60a1-4654-a814-a741c48c06b9 | mamun4122/My-Online-Judge-Submission | UVA/12149.cpp | #include<stdio.h>
int main()
{
int n;
while(scanf("%d",&n)&&n)
{
int res=0;
for(int i=1;i<=n;i++)
{
res+=(i*i);
}
printf("%d\n",res);
}
return 0;
}
| ALGO | 0.997922 | 3.485846 |
f2e23ef0-d96e-42cb-9dfd-dab1550f609e | itsprinceraj/LogicHub | Pattern Printing/floydsTrianglePattern.cpp | #include <iostream>
using namespace std;
/*
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
*/
// main function ;
int main()
{
int n;
cout << "enter number of rows: ";
cin >> n;
cout << endl;
int count = 1;
// outer loop
for (int r = 0; r < n; r++)
{
// inner loop
for (int c... | ALGO | 0.996847 | 4.311346 |
e24f3a05-0e97-4b05-a15e-e0ce570a8ed4 | raincross7/code-similarity | codes/train_code/problem255/problem255_325.cpp | #include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
sort(s.begin(), s.end());
bool ans = s == "abc";
cout << (ans? "Yes" : "No") << endl;
} | ALGO | 0.999979 | 4.259571 |
0596714c-4382-4ee9-b26e-e20d1c86486d | arshan-01/DATA_STRUCTURE_And_ALGORITHM_With_CPP | Array/threeSum.cpp | #include <iostream>
using namespace std;
void threeSum(int arr[], int size)
{
int target = 10;
for (int i = 0; i < size-2; i++)
{
for (int j = i+1 ; j < size-1; j++)
{
for (int k = j+1; j < size; j++)
{
if(arr[i]+arr[j]+arr[k]==target)
cout<<arr[i]<<" "<<arr[j]<<" "<<arr[k]<<endl;
}
}
}
}
in... | ALGO | 0.998294 | 4.492671 |
40d8d5c5-6cbc-4067-ab5e-cf4e81fed0e6 | hundong2/modern-cpp | example/standard_concept_ex1.cpp | #include <iostream>
#include <list>
#include <vector>
#include <algorithm>
#include <iterator>
template<std::random_access_iterator T>
void sort(T frist, T last)
{
std::cout << "random_access_iterator" << std::endl; //vector
}
template<std::bidirectional_iterator T>
void sort(T first, T last)
{
std::cout << "... | ALGO | 0.997559 | 4.555133 |
2dbed218-33d9-4714-9bff-babbb37cc452 | ishandutta2007/codeforces | anadi/normal/1250/K.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int LL;
#define st first
#define nd second
#define PLL pair <LL, LL>
#define PII pair <int, int>
const int N = 1e6 + 7;
const int MX = 1e9 + 7;
const LL INF = 1LL * MX * MX;
LL n;
vector <LL> dv;
int main(){
scanf("%lld", &n);
for(LL i = 2; i * i <... | ALGO | 0.999981 | 4.498901 |
bdf77d05-5f87-4e40-b982-a680edb36909 | codetalker7/cp-res | Codeforces/CF1535B.cpp |
/*
template by: codetalker7
editor: sublime text 3
file name: CF1535B
date created: 2021-06-04 20:15:12
problem link: https://codeforces.com/contest/1535/problem/B
*/
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
#include<unordered_set>
#include<cmath>
#include<nume... | ALGO | 0.999485 | 4.096686 |
4db67e32-b8b6-454f-b6b8-5d2e98612d7d | JeongChangBeom/codetree-TILs | 240408/살 수 있는 물건/things-able-to-buy.cpp | #include <iostream>
using namespace std;
int main() {
int book = 3000;
int mask = 1000;
int n;
cin >> n;
if(n>=book){
cout << "book";
}
else if(n<book && n>=mask){
cout << "mask";
}
else{
cout << "no";
}
return 0;
} | ALGO | 0.998996 | 3.339396 |
edac3f7d-a4f5-448a-89d3-74b449ef63b2 | mcrl/SnuRHAC | mapa/lib/XRay/Profile.cpp | #include "llvm/Support/DataExtractor.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/XRay/Trace.h"
#include <deque>
#include <memory>
namespace llvm {
namespace xray {
Profile::Profile(const Profile &O) {
// We need to re-create all the tries from the original (O), into the cu... | TOOL | 0.895234 | 6.773438 |
b2724fb9-4fd4-4a33-bdf1-6472b02b3012 | aatiq1443/Leetcode-Practice | 2008-maximum-earnings-from-taxi/2008-maximum-earnings-from-taxi.cpp | class Solution {
public:
int getindex(vector<vector<int>>& jobs, int idx, const int& n)
{
int lo = idx+1, hi = n-1, ans = n;
while(lo <= hi) {
int mid = (lo + hi) / 2;
if(jobs[idx][1] <= jobs[mid][0])
{
ans = mid;
hi = mid-1;
}
else lo = mid + 1;
}
return ans;
}
long long maxTaxiEarnings(i... | ALGO | 0.999887 | 5.799861 |
313e9fc5-8e1d-4955-b1a6-8ecb6b2ac685 | Leanse1/Cpp-Basics | 6.STL/8.Sets.cpp | // sorted order & unique elements
#include <iostream>
#include <set>
using namespace std;
int main() {
// Create a set of integers
set<int> mySet;
// Adding elements to the set
mySet.insert(10);
mySet.insert(20);
mySet.insert(30);
mySet.insert(40);
mySet.insert(50);
// Print the... | ALGO | 0.975277 | 6.337306 |
d6ccd02f-2404-4506-8fe0-b20a5bef0681 | snmath-pi/DataStructures | StriverDP/DP32k1D.cpp | class Solution {
public:
int numDistinct(string s, string t) {
int n = s.size(), m = t.length();
vector<double> dp(m + 1, 0);
dp[0] = 1;
for(int i=1; i<=n; i++) {
for(int j=m; j>=1; j--) {
if(s[i-1] == t[j-1]) dp[j] += dp[j-1];
}
}
... | ALGO | 0.99997 | 6.472084 |
82b16783-4ff1-4e8d-9c80-f218d688985a | wwmmyy/PAT | AdvancedLevel_C++/1049. Counting Ones (30) .cpp | #include <iostream>
using namespace std;
int main() {
int n, left = 0, right = 0, a = 1, now = 1, ans = 0;
scanf("%d", &n);
while(n / a) {
left = n / (a * 10), now = n / a % 10, right = n % a;
if(now == 0) ans += left * a;
else if(now == 1) ans += left * a + right + 1;
else a... | ALGO | 0.999888 | 3.740735 |
11db003a-b63f-462a-ae7a-d78dfdfda78b | soban09/DSA-Problems | Graphs/16_StronglyConnectedKosaraju.cpp | // Kosaraju's Algo for stronly connected component
// only for Directed Graph
// Strongly connected component means if you pick a directed edge btw 2 nodes A and B in a component, there also must be a direct/indirect edge from B to A.
// Idea is that when we do DFS we jump from one SCC to another, if we revert or take ... | ALGO | 0.999892 | 5.31394 |
2399c9ed-4714-4657-aa12-92c0cedf72a3 | honguyenuet/LTNC | LTNC-09/2D Arrays.cpp | #include <bits/stdc++.h>
using namespace std;
int a[9][9],maxa=-63;
int main()
{
for(int i=0;i<=5;i++)
for(int j=0;j<=5;j++)
cin>>a[i][j];
for(int i=0;i<=3;i++)
for(int j=0;j<=3;j++)
maxa=max(maxa,a[i][j]+a[i][j+1]+a[i][j+2]+a[i+1][j+1]+a[i+2][j]+a[i+2][j+1]+a[i+2][j+2])... | ALGO | 0.999927 | 3.565036 |
c393a912-80fa-44df-acc1-fde5ad3a117f | Lee-W/ACM | UVa/10806/10806.cpp | #include <cstdio>
#include <vector>
#include <queue>
#include <cstring>
#include <climits>
using namespace std;
#define maxN 105
#define maxM 5005
#define INF INT_MAX/10
vector<int> edge[maxN];
int cost[maxN][maxN], capacity[maxN][maxN];
int flow[maxN][maxN], dis[maxN], pre[maxN];
void init(int);
int MCMF(int , int... | ALGO | 0.999903 | 4.353562 |
ec3cab4e-b351-4a81-beb9-36218cfc9af6 | haliludaxrfg/test | leetcode/935.骑士拨号器.cpp | /*
* @lc app=leetcode.cn id=935 lang=cpp
* @lcpr version=20004
*
* [935] 骑士拨号器
*
* https://leetcode.cn/problems/knight-dialer/description/
*
* algorithms
* Medium (55.55%)
* Likes: 164
* Dislikes: 0
* Total Accepted: 17.7K
* Total Submissions: 28.4K
* Testcase Example: '1'
*
* 象棋骑士有一个独特的移动方式,它可以垂... | ALGO | 0.999965 | 6.206551 |
54e5f242-d40e-48d1-b15d-b97829f79d92 | v2v3v4/xray-cop | engine/3rd party/cximage/CxImage/ximasel.cpp | // xImaSel.cpp : Selection functions
/* 07/08/2001 v1.00 - Davide Pizzolato - www.xdp.it
* CxImage version 6.0.0 02/Feb/2008
*/
#include "ximage.h"
#pragma warning(disable:4995)
#if CXIMAGE_SUPPORT_SELECTION
////////////////////////////////////////////////////////////////////////////////
/**
* Checks if the imag... | TOOL | 0.976408 | 5.75481 |
bed55008-9830-482b-ab79-d7b3e954c667 | krishnapatil1406/Data-Structures | prims_algorithm.cpp | #include <iostream>
using namespace std;
class graph
{
int cost[10][10]; //for adjacency list representation
int tcities;
public:
graph(); //default constructor
void create(); //member functions
void display();
void prims();
};
graph::graph(){
cout<<"\nEnter no. ... | ALGO | 0.999691 | 3.512614 |
3608a855-114c-416e-b3cc-9700ecba9fee | tanus786/CP-Codes-HackOctober-Fest-2023 | CPP DSA/segregate0And1.cpp | #include <bits/stdc++.h>
using namespace std;
void segregate0and1(int arr[], int n)
{
int count = 0;
for (int i = 0; i < n; i++)
if (arr[i] == 0)
count++;
for (int i = 0; i < count; i++)
arr[i] = 0;
for (int i = count; i < n; i++)
arr[i] = 1;
}
void print(int arr[... | ALGO | 0.99957 | 4.992416 |
2a798974-1384-4da6-817c-334ce80dc8b5 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_8189_7.cpp | #include <bits/stdc++.h>
using namespace std;
int arr[100005];
int cnt = 0;
void solve() {
int n;
cin >> n;
for (int i = 1; i <= 2 * n; i++) {
cin >> arr[i];
}
for (int i = 1; i <= 2 * n; i += 2) {
for (int j = i + 1; j < 2 * n; j++) {
if (arr[j] == arr[i]) {
for (int k = j; k > i + 1; k... | ALGO | 0.999869 | 3.759022 |
658a0b16-733a-4722-9d55-2e694693f608 | iSuneast/uva-codes-for-acm-icpc | UVa 100 - 9999/748 - Exponentiation_0303_Bignum.cpp | /*
748 - Exponentiation
*/
#include<iostream>
#include<cmath>
using namespace std;
double r,n;
char ans[200],key[10];
int buf[200]; //֮int,Ϊcharʱм..
int main()
{
// freopen("in.txt","r",stdin);
// freopen("748.txt","w",stdout);
while(cin>>r>>n)
{
int la=floor(n*log10(r))+1;
if(la<0)
la=0;
sprintf(key,"%... | ALGO | 0.999951 | 3.389066 |
d2f76313-6187-48c1-844b-9b322a332e10 | ishandutta2007/codeforces | boook/normal/979/A.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define REP(i , j , k) for(int i = j ; i < k ; ++i)
#define RREP(i , j , k) for(int i = j ; i >= k ; --i)
#define A first
#define B second
#define mp make_pair
#define pb emplace_back
#define PII pair<... | ALGO | 0.999776 | 3.693921 |
3259f9c5-47eb-45cb-ae45-51ff83e3eb24 | ywchiao/DS_Practice | 7th/linked/linked.cpp |
#include <iostream>
#include "linked.h"
/**
* 生成指定長度的 Linked List。節點內容預設為由 0 開始的流水號。
*
* @param len: 要生成的 Linked List 的長度
**/
Linked::Linked(int len) {
head = new Node();
Node *node = head;
for (int i = 0; i < len; i ++) {
node->next = new Node();
node = node->next;
... | ALGO | 0.989067 | 4.175053 |
7f5e5fd6-0a51-4c61-9dcb-42323a2e48c8 | zhaolingxi/RenderZ | triLibrary/proj-9.6.2/src/projections/gnom.cpp |
#include <errno.h>
#include <float.h>
#include <math.h>
#include "geodesic.h"
#include "proj.h"
#include "proj_internal.h"
PROJ_HEAD(gnom, "Gnomonic") "\n\tAzi, Sph";
#define EPS10 1.e-10
namespace pj_gnom_ns {
enum Mode { N_POLE = 0, S_POLE = 1, EQUIT = 2, OBLIQ = 3 };
}
namespace { // anonymous namespace
struc... | ALGO | 0.974001 | 6.178208 |
8261bb8b-af5d-4ced-87bf-aba953a160d0 | terrificmn/cpp_practice_playground | c++-/recursive.cpp | #include <iostream>
int myCountdown(int n) {
// 1. recursive을 하려면 base 컨디션이 있어야 한다. 그래서 최종 마무리가 될 수 있게 한다.
if(n == 0) {
std::cout << "countdown done. " << std::endl;
return 0;
}
/// 2. recuresive 로 다시 한번 함수를 실행한다.
std::cout << n << std::endl;
return myCountdown(n-1);
}
in... | ALGO | 0.994177 | 6.726467 |
d9de4b78-5fd3-4b56-9ba6-9d3c093b3fa2 | Rajkumar992199/C-Plus-Plus | codeforces/1200/492B_Vanya_and_Lanterns.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
long long n, l;
cin >> n >> l; //storing number of lanterns and street length
double a[n];
for (int i = 0; i < n; i++) cin >> a[i]; // storing lantern locations
sort(a, a + n);
double mx = max(a[0] - 0, l - a[n - 1]), diff; // maximum l... | ALGO | 0.998778 | 3.252586 |
28cc2605-10c6-4f9e-bcfd-a7f9c1af14f6 | ishandutta2007/codeforces | radal/normal/741/C.cpp | #include <bits/stdc++.h>
#pragma GCC target ("avx,avx2,fma")
#pragma GCC optimize ("O2")
#pragma GCC optimize ("unroll-loops")
#define X first
#define Y second
#define debug(x) cerr << #x << ": " << x << endl;
#define endl '\n'
#define pb push_back
#define rep(i,l,r) for (int i=l; i<r; i++)
#define repr(i,r,l) for (int... | ALGO | 0.999983 | 4.236293 |
90dc8203-ddf0-40c5-977c-dfbe66a408cb | seungmin-son/cpp_study | src/chapter7/7.9.cpp | #include <iostream>
#include <array>
#include <functional>
using namespace std;
int fun()
{
return 5;
}
int goo()
{
return 10;
}
bool isEven(const int& element)
{
if(element % 2 ==0) return true;
else return false;
}
bool isOdd(const int& element)
{
if(element % 2 !=0) return true;
else re... | TOOL | 0.912523 | 4.811323 |
0d8d5acd-0b63-433b-a440-8c898e13824f | Minephliss/practice | luogu/uncategorized/p1120.cpp | #include <iostream>
using namespace std;
int main()
{
int i, n, temp;
cin >> n;
int val[n];
for (i = 0; i < n; i++)
{
cin >> temp;
if (temp > 50)
{
n--;
i--;
continue;
}
val[i] = temp;
}
// for (i = 0; i < n; i++... | ALGO | 0.999899 | 3.263244 |
f0a68e76-e3f5-4675-8d2e-dacf6ba27a1c | evertheylen/TA_TO | oude_rommel/fase1/TFA/TFA.cpp | #include "TFA.h"
#include <vector>
#include <iostream>
using namespace std;
bool block::operator==(block const& b){
if(b.state1 == this->state1 and b.state2 == this->state2){
return true;
}
else return false;
}
bool block::hasFinal(s_DFA D){
if(D.isFinal(state1) == true xor D.isFinal(state2) =... | ALGO | 0.99965 | 4.364388 |
3e8764f3-e722-4c6a-bacd-37eba100723b | Morshed-islam/50-DaysOf-Futter-Projects | crypto_wallet_app/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.998816 | 6.76073 |
cabe9ec3-ecfe-4b1b-9ac8-e4b89c6655d6 | evgeny9042/homework02 | main.cpp |
#include "lib.h"
#include <cassert>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <tuple>
my_lib::ip_pool_t get_ip_pool()
{
my_lib::ip_pool_t ip_pool;
for ( std::string line; std::getline(std::cin, line);) {
my_lib::ip_t v = my_lib::split(line, '\t');
ip_pool.push_back(my_lib::spli... | TOOL | 0.954217 | 4.5096 |
ce04fd6f-98a5-4efb-b154-9270545ec0de | turkcoin-project/turkcoin | src/addrman.cpp | #include "addrman.h"
#include "hash.h"
using namespace std;
int CAddrInfo::GetTriedBucket(const std::vector<unsigned char> &nKey) const
{
CDataStream ss1(SER_GETHASH, 0);
std::vector<unsigned char> vchKey = GetKey();
ss1 << nKey << vchKey;
uint64 hash1 = Hash(ss1.begin(), ss1.end()).Get64();
CDat... | ALGO | 0.970691 | 6.083518 |
bedf4a79-5100-4f1e-a718-b403993bdf41 | jqzhangiii/OJ_Code | BZOJ/bzoj 4052 乱搞+分析.cpp | #include<bits/stdc++.h>
#define N 100010
using namespace std;
typedef long long ll;
ll a[N] , pos[N] , val[N];
int tot;
ll gcd(ll x,ll y){ll t; while(y) t=x,x=y,y=t%x; return x;}
int main()
{
int T;
scanf("%d" , &T);
while(T -- )
{
tot = 0;
int n , i , j , last;
ll t , ans = 0;
... | ALGO | 0.999904 | 3.333921 |
799353c8-d743-4e26-9215-c832454c6782 | Adit0507/LeetCode | 844-backspace-string-compare/844-backspace-string-compare.cpp | class Solution {
public:
bool backspaceCompare(string s, string t) {
stack <char> s1, s2;
for (int i= 0; i < s.size(); i++){
if(s[i] != '#')
s1.push(s[i]);
else if(!s1.empty())
s1.pop();
}
for(int ... | ALGO | 0.999916 | 6.197176 |
9e4bdd73-dc3c-4186-8f61-0a1f107af7e7 | NaufaliLutS/2311102125_Naufal_Luthfi_Assary | Pertemuan 9- Graf and Tree/Unguided1.cpp | // Laprak 9 - Unguided 1
// Naufal Luthfi Assary - 2311102125
// IF-11-D
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
using namespace std;
// Vektor untuk menyimpan nama-nama kota (simpul)
vector<string> simpul;
// Matriks 2D untuk menyimpan jarak antar kota (busur)
vector<vector<int>> ... | ALGO | 0.997561 | 6.170923 |
6f921fcf-3679-43ff-80bf-29ff45ff4339 | mnemonyc/platform_frameworks_av | media/libstagefright/codecs/amrnb/dec/src/post_pro.cpp | /*----------------------------------------------------------------------------
; INCLUDES
----------------------------------------------------------------------------*/
#include "post_pro.h"
#include "typedef.h"
#include "basic_op.h"
/*----------------------------------------------------------------------------
; MACR... | ALGO | 0.989818 | 5.760083 |
33b797f7-893e-4b30-9fe2-5504efc49754 | sunoogy99/codetree-TILs | 240225/크기가 n인 순열/n-permutation.cpp | #include <iostream>
#include <vector>
using namespace std;
int n;
bool arr[9];
vector<int> ans;
void per() {
if (ans.size() < n) {
for (int i = 1; i <= n; i++) {
if (!arr[i]) {
ans.push_back(i);
arr[i] = true;
per();
ans.pop_back(... | ALGO | 0.99944 | 4.908144 |
94a968fa-dba0-429a-bb6e-4e290f5efe89 | bollig/rbffd_gpu | src/pdes/parabolic/heat_pde_cl.cpp | #include "rbffd/rbffd_cl.h"
#include "heat_pde_cl.h"
//----------------------------------------------------------------------
void HeatPDE_CL::setupTimers()
{
tm["advance_gpu"] = new EB::Timer("Advance the PDE one step on the GPU") ;
tm["loadAttach"] = new EB::Timer("Load the GPU Kernels for HeatPDE");
}
void... | ALGO | 0.998722 | 5.863686 |
4e88492e-6fda-4f07-8785-ffcfd88ffe7e | Jubayer8382/CSE-122-FAL-2023-50-06 | Codeforces/14.Soldier and banana.cpp | #include <iostream>
using namespace std;
int main()
{
int k,n,w;
cin>>k>>n>>w;
int sum=0;
for(int i=1;i<=w;i++)
{
sum+=i;
}
int d=(sum*k)-n;
if (d<0)
cout<<"0";
else
cout<<d;
}
| ALGO | 0.999963 | 3.415359 |
fd50c18e-e4d5-4c63-8854-ba5c4630fb56 | awaisaltaf5/FirstSemester-CPlusPlus | After Mid PF/Class9functions/task3.cpp | #include<iostream>
using namespace std;
void square(int z){
cout<<"Square="<<z*z;
}
int main(){
int a,b,c;
cout<<"Enter the numbers:";
cin>>a>>b>>c;
square(a);
square(b);
square(c);
return 0;
} | TOOL | 0.986501 | 3.793483 |
1ee04a37-fe88-4814-bb0e-23378db3aa90 | SimonDirckx/pqraaa | pqraaa-support/eigen-3.4.0/bench/vdw_new.cpp | #include <iostream>
#include <Eigen/Core>
using namespace Eigen;
#ifndef SCALAR
#define SCALAR float
#endif
#ifndef SIZE
#define SIZE 10000
#endif
#ifndef REPEAT
#define REPEAT 10000
#endif
typedef Matrix<SCALAR, Eigen::Dynamic, 1> Vec;
using namespace std;
SCALAR E_VDW(const Vec &interactions1, const Vec &inter... | ALGO | 0.999624 | 3.519938 |
adee0673-c6b7-4f26-a7e7-583c022f8158 | AmandeepSinghBisht/dsa-cpp | code4.cpp | #include<iostream>
using namespace std;
int main(){
int a,b;
cin>>a>>b;
int i;
for(int num=a;num<b;num++){
for(i=2;i<num;i++){
if(num%i==0){
break;
}
}
if(i==num){
cout<<num<<endl;
}
}
return 0;
} | ALGO | 0.999724 | 3.061658 |
1bfb3feb-f622-4801-a4af-3d89d903b480 | gautam-bits/CompetitiveCoding | Codeforces/729(DIv2)/C.cpp | // This is an intellectual property of Diablo Escada ,
// So please use it with extreme CAUTION .
//-------We can be heroes , just for one day!!.---------//
#include <bits/stdc++.h>
using namespace std;
//*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ knowledge $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*//
#... | ALGO | 0.999968 | 4.437776 |
a5bccf1e-0a22-4dce-8fa7-7674444da29b | ishandutta2007/codeforces | chemthan/normal/1468/H.cpp | #include <bits/stdc++.h>
using namespace std;
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define ms(s, n) memset(s, n, sizeof(s))
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORd(i, a, b) for (int i = (a) - 1; i >= (b); --i)
#define... | ALGO | 0.999972 | 3.884743 |
234f3ea3-fbd8-47e4-b5f8-e8517ff8e21c | tiankonguse/ACM | tmpleate-2020/code/Datastructure/2D-SegmentTree.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <cassert>
using namespace std;
#define N 505
int n , m , Q;
int mx[N << 1][N << 1] , mn[N << 1][N... | ALGO | 0.999801 | 3.9716 |
26982886-4fd8-445e-bb38-ec8ecadb5548 | bhaveshranjan/DSA-Sheet | que2.cpp | #include<iostream>
using namespace std;
int main()
{
int n,max,min;
cin>>n;
int arr[n];
for(int i=0;i<n;i++)
{
cin>>arr[i];
}
max=arr[0];
min=arr[0];
for(int i=0;i<n;i++)
{
if(max<=arr[i]){
max=arr[i];
}... | ALGO | 0.999934 | 4.006946 |
005a2cdc-1560-4df8-bc8c-8c657c8d06d3 | lavishmlk/My-leetcode-and-gfg-solutions-in-Cpp | 1423-maximum-points-you-can-obtain-from-cards/1423-maximum-points-you-can-obtain-from-cards.cpp | class Solution {
public:
int maxScore(vector<int>& cardPoints, int k) {
int n = cardPoints.size(), totalSum = 0, minSubarray = 0;
for (int i=0; i<n; i++) {
totalSum += cardPoints[i];}
int currSum=0;
for (int i=0; i<n; i++) {
currSum += cardPoints[i];
if (i < n-k) m... | ALGO | 0.999938 | 5.79142 |
f87fa6da-93fb-4a01-83aa-54da116fd025 | Alaxe/noi2-ranking | 2018/solutions/E/ODR-Sofia/flowers.cpp | #include<iostream>
#include<cstring>
using namespace std;
int main(){
int n, naiVisoko=0;
cin>>n;
int visochina[n];
long long q, kapki=0;
for(int index=0;index<n;index++)cin>>visochina[index];
cin>>q;
for(int index=0;index<n;index++){
if(naiVisoko<visochina[index])naiVisoko=visochina... | ALGO | 0.999611 | 3.055302 |
af95aacc-48f0-41bb-b687-320b48661cf1 | jsarthak/LeetCode | roman_to_int.cpp | #include <bits/stdc++.h>
using namespace std;
const vector<pair<char, int>> lookup = {{'I', 1}, {'V', 5}, {'X', 10}, {'L', 50}, {'C', 100}, {'D', 500}, {'M', 1000}};
int getRank(char c)
{
for (int i = 0; i < lookup.size(); i++)
{
if (c == lookup[i].first)
{
return lookup[i].second;
}
}
return -1;
}
int ... | ALGO | 0.999872 | 5.730215 |
f111a09e-730b-457e-8849-f154f943468e | KotegovNikita/HomeAssignments | Assignment_2b/main_2b.cpp | /* Nikita Kotegov <EMAIL> Group B81 Assignment_2b */
#include "header_2b.hpp"
int main() {
std::string input_string; // String on input
std::getline(std::cin, input_string);
capacity = input_string.length();
stack = new int[capacity]; // Create array for stack
for (int i = 0; i < input_stri... | ALGO | 0.999173 | 4.575219 |
a7d4c1dc-efa9-42bf-88a9-3e7697fe71f1 | sb-ncbr/ChargeFW2 | src/structures/molecule.cpp | #include <queue>
#include <utility>
#include <string>
#include <vector>
#include <nanoflann.hpp>
#include "atom.h"
#include "bond.h"
#include "molecule.h"
Molecule::Molecule(std::string name, std::unique_ptr<std::vector<Atom> > atoms,
std::unique_ptr<std::vector<Bond> > bonds) {
name_ = std::mo... | ALGO | 0.972858 | 5.205028 |
671f938c-e9af-4e0e-a741-f7ccb42ffd4e | campim/DSACPP | binarysearch.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
/* global variables */
int iterations = 0;
std::vector<int> my_list;
/** create_list : adds to the int vector my_list random numbers with 'top' as max number of items and max value */
void create_list(int top)
{
int i, j;
my_list.... | ALGO | 0.999941 | 5.363598 |
b542f64a-5ab6-4a44-b639-f5fbd0f3620d | FinalTheory/ACM_Code | UVA/UVa_10049.cpp | /*
⣬ʽΪ
f( n + f(f(n)) ) = f(n) + 1
*/
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <cctype>
#include <climits>
#include <ctime>
#define MAX(x, y) (x) > (y) ? (x) : (y)
#define MIN(x, y) (x) < (y) ? (x) : (y)
#define SWAP(x, y) (x) ^= (y) ^=... | ALGO | 0.999834 | 3.888375 |
8f405b7d-8f49-466d-9bda-ddc70da9db9b | avashlin/eyes-free | ocr/ocrservice/jni/opticalflow/optical_flow.cpp | // Author: Andrew Harp
#include "utils.h"
#include "time_log.h"
#include "image.h"
#include "math.h"
#include "optical_flow.h"
#include "feature_detector.h"
namespace flow {
OpticalFlow::OpticalFlow(const int32 frame_width,
const int32 frame_height,
const int32 do... | ALGO | 0.973174 | 7.700357 |
47c7c325-3e09-44d5-8078-735e459d88c9 | codewithAkash1326/100DaysOfCode | DAY 83/102_Binary_Tree_Level_Order_Traversal.cpp | #include<bits/stdc++.h>
using namespace std;
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), left... | ALGO | 0.999955 | 5.256212 |
7ee0c9c0-fe34-47f4-86ca-f1e7dc369753 | 1lonely6legend/interview | QP_demo/src/main.cpp | // osqp-eigen
#include "OsqpEigen/OsqpEigen.h"
// eigen
#include <Eigen/Dense>
#include <iostream>
int main(){
// allocate QP problem matrices and vectores
Eigen::SparseMatrix<double> hessian(2, 2); //P: n*n正定矩阵,必须为稀疏矩阵SparseMatrix
Eigen::VectorXd gradient(2); //Q: n*1向量
Eigen:... | ALGO | 0.999485 | 4.119152 |
a49c04c9-b472-4e14-b68c-f653bde31f2e | ishandutta2007/codeforces | rubikun/normal/1515/G.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define fi first
#define ... | ALGO | 0.999967 | 5.002233 |
b4be3524-1ac3-4aa2-be18-0e029687640f | shivgupta198922/HACKEREARTH-MASTER | Basic Programming/Bit Manipulation/Basics of Bit Manipulation/Natural XOR elements.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
int t;
cin >> t;
while(t--)
{
long long int n;
cin >> n;
int x = n % 4;
if(x == 0)
cout << "1" << " " << n << endl;
else if... | ALGO | 0.999674 | 3.862155 |
3bc9afb1-7d5e-4a24-a407-5ae83bc7751a | DavidTG7/Cpp_Projects | Cpp_Challenges/square.cpp | #include <iostream>
using namespace std;
/* Program that prints a square */
int main(){
int a, i, size;
cout << "Give the size of the square:\n";
cin >> size;
for (i = 1; i <= size; i++){
for (a = 1; a <= size + size - 2; a++){
if (i == 1 || i == size)
cout << "8... | ALGO | 0.962298 | 3.428292 |
8c3db795-4150-46f4-882f-dfec5a4d17a3 | tinicius/programing-problems | Contest/Sub Regional 2023/F - Fatigue-Fighting Vacation.cpp | #include <bits/stdc++.h>
using namespace std;
#define _ \
ios_base::sync_with_stdio(0); \
cin.tie(0);
#define endl '\n'
#define dbg(x) cout << #x << " = " << x << endl
typedef long long ll;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fll;
int main() {
_;
int d, c, r... | ALGO | 0.999671 | 3.87424 |
93c82c12-93e8-439f-aa74-96be320b4363 | Muhammadalif1213/easd_1_075_b | Exercise1_algoritma&strukturdata/Exercise1_algoritma&strukturdata.cpp | // jawabas soal exercise
//1. algoritma sangat penting dalam menyelesaikan suatu masalah program karena algoritma merupakan langkah awal dalam mengurutkan suatu cara/ fungsi agar berjalan secara terstruktur.
//2. dalam algoritma, struktur data di bagi menjadi 2 yaitu :
// statis/ linear, contohnya array
// dinamis/... | ALGO | 0.999769 | 4.038499 |
1ab25cff-6ad8-4689-9e99-d6e8ffde899d | AkshatAggarwal14/Competitive-Programming | CodeForces/1400/e-faster.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <typename T>
struct RMQ {
int n, levels;
vector<T> values;
vector<vector<int>> range_low;
int min_index(int a, int b) const { return values[b] < values[a] ? b : a; }
void build(const vector<T> &_values) {
values ... | ALGO | 0.99997 | 5.42025 |
ba0df2c8-15a5-4429-babb-a33e9008dc5e | mdakram28/leetcode-archive | my-folder/problems/detonate_the_maximum_bombs/solution.cpp | class Solution {
public:
int dfs(int at, vector<int> &visited, vector<vector<int>> &g) {
if (visited[at]) return 0;
visited[at] = 1;
int total = 1;
for (int to: g[at]) {
total += dfs(to, visited, g);
}
return total;
}
int maximumDetonation(vector<... | ALGO | 0.999814 | 5.635657 |
88ff9767-26dc-406f-a1be-fb675ce42cbb | heavenMOJANG/ICPC | .history/AtCoder/abc382/D_20241130203840.cpp | #pragma GCC optimize(1)
#pragma GCC optimize(2)
#pragma GCC optimize(3, "Ofast", "inline")
#include <bits/stdc++.h>
#define int long long
using namespace std;
constexpr int INF = 0x7fffffff;
int n, a[20];
void dfs(int x) {
if (x == n + 1) {
for (int i = 1; i <= n; ++ i) cout << a[i] << " \n"[i == n];
... | ALGO | 0.999772 | 4.142719 |
964a16f1-641b-4e69-81d4-3ce730776b8e | dbblumenthal/gedlib | ext/nomad.3.8.1/tools/SENSITIVITY/problems/styrene/black-box/surrogate/pump.cpp | #include "pump.hpp"
using namespace std;
bool pump::solve() {
// out->chem = in->chem;
out->set ( in->nb , in->chem );
out->m = in->m;
in->set(in->P,in->T);
for ( i = 0 ; i < in->nb ; i++ )
if(in->chem[i]->m>EPS) {
in->chem[i]->find_v();
if(in->chem[i]->state==1) {
W+=in->chem[i]->gamma()*... | ALGO | 0.8786 | 3.908185 |
dde0a1f7-e0fb-4c28-bd61-92d5f40f671d | giuliopedicone02/Programmazione1 | Simulazione Prova Itinere/Es2AL.cpp | /*Scrivere un metodo che prenda in input una matrice A di stringhe di dimensioni n × m
ed una matrice B di puntatori a
stringhe di dimensioni m × l.
Il metodo restituisca un vettore di booleani C di dimensione l in cui cj = true se e solo se `e
possibile trovare almeno una stringa, nella colonna j −esima di B (sia bkj ... | ALGO | 0.99695 | 4.667044 |
683b25aa-bb93-4c26-83d0-d788879ccfdc | KYENS/gem5_v20.1_ramulator | src/systemc/tests/systemc/misc/unit/data/datawidth_signed/extension/datawidth.cpp | /*****************************************************************************
datawidth.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/**************************************************************************... | ALGO | 0.98467 | 5.322278 |
02eae720-fb3a-4fca-9902-e3f6bea8c2a1 | blackberry/RecastNavigation | Detour/Source/DetourCommon.cpp | #include <math.h>
#include "DetourCommon.h"
//////////////////////////////////////////////////////////////////////////////////////////
float dtSqrt(float x)
{
return sqrtf(x);
}
void dtClosestPtPointTriangle(float* closest, const float* p,
const float* a, const float* b, const float* c)
{
// Check if P in... | ALGO | 0.999815 | 7.036354 |
67824bba-996e-4224-aca1-778470a00602 | SabariKannanM/NPTEL | Assignments/5.3.cpp | /*
Write a program in C++ to implement the String Class functions.
Given an input string S, find whether it contains only digits or not and replace the whitespaces (if any) with "IIT".
The length of string S is less than or equal to 100.
Input:
The string S in a single line.
Output:
In the first line, output "Y... | ALGO | 0.938479 | 4.815943 |
beced14b-5015-4f40-8d48-c00e20912d9a | hydrus3109/USACOSolutions | practice/grid.cpp | #include <iostream>
#include <algorithm>
using namespace std;
typedef pair<int,int> Point;
bool ycomp(Point p, Point q) { return p.second < q.second; }
const int MAX_N = 2500;
int N, Psum[MAX_N+1][MAX_N+1];
Point P[MAX_N];
int rsum(int x1, int y1, int x2, int y2)
{
return Psum[x2+1][y2+1] - Psum[x2+1][y1] - Psu... | ALGO | 0.999447 | 4.191376 |
3a23be03-0f31-4105-8e0c-51e80a4c6160 | ishandutta2007/codeforces | gustav/normal/39/B.cpp | #include <cstdio>
#include <cstring>
int N;
int a[ 105 ];
int main( void )
{
scanf( "%d", &N );
for( int i = 0; i < N; ++i )
scanf( "%d", a+i );
int pos = 0;
int cnt = 0;
for( int i = 1; i <= N; ++i ) {
while( pos < N && a[pos] != i ) ++pos;
if( pos == N || a[pos] != i ) break;
a[pos] = 1... | ALGO | 0.999866 | 3.036832 |
c3a82c2e-1a00-4fbe-b395-3ab8ec24904d | VoidUI-Andromeda/frameworks_av | media/libeffects/loudness/dsp/core/dynamic_range_compression.cpp | //#define LOG_NDEBUG 0
#include <cmath>
#include "common/core/math.h"
#include "common/core/types.h"
#include "dsp/core/basic.h"
#include "dsp/core/interpolation.h"
#include "dsp/core/dynamic_range_compression.h"
#include <android/log.h>
namespace le_fx {
// Definitions for static const class members declared in
/... | ALGO | 0.996097 | 6.419666 |
9114b447-774c-4d7b-84e5-3355ecf71b93 | am-saksham/Codeforces-solution | 158A - Next Round.cpp | #include <iostream>
int main()
{
std::ios::sync_with_stdio(false);
std::cin.tie(NULL);
int n,k;
std::cin >> n >> k;
int a[n];
for(int i = 0; i < n; i++)
{
std::cin >> a[i];
}
if(a[0] == 0)
{
std::cout << 0 << std::endl;
}else
{ int c = 0;
for(int i... | ALGO | 0.999909 | 3.890351 |
9a02972f-c713-4ca8-890b-9aec1be53322 | 1005-AsadUllah/DSA-Phitron | midterm/Browser_History.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
string a;
Node *next;
Node *prev;
Node(string a)
{
this->a = a;
this->next = NULL;
this->prev = NULL;
}
};
void insert(Node *&head, Node *&tail, string a)
{
Node *newnode = new Node(a);
if (head =... | ALGO | 0.999875 | 4.510563 |
76e3071b-3ef3-4660-b5ac-6e55e82c0d70 | hjiang13/LLMs-in-IR | POJ-104/40/2979.cpp | #include <iostream>
using namespace std;
double area(double a,double b,double c,double d,double p)
{
double s=(a+b+c+d)/2;
double PI=3.1415926;
double S=sqrt((s-a)*(s-b)*(s-c)*(s-d) - a*b*c*d*cos(p*PI/360)*cos(p*PI/360));
return S;
}
main()
{
double a,b,c,d,p,S;
double PI=3.1415926;
cin >> "%lf %lf %lf %lf %lf",&a,&b,&... | ALGO | 0.999735 | 3.829015 |
c4ebafe7-5d7e-4af5-8b67-552d6e6f4399 | palilo815/ps | baekjoon/8000/8462.cpp | #include <bits/stdc++.h>
#define LOOP(i,n) for(int i=1;i<=n;++i)
using namespace std;
using ll = long long;
struct query {
int l, r, i;
};
const int max_N = 1e5 + 1;
const int max_a = 1e6 + 1;
int a[max_N], cnt[max_a];
query q[max_N];
ll ans[max_N];
ll apply(int i, int v) {
ll n = a[i];
ll ret = -n * cn... | ALGO | 0.999874 | 3.72616 |
af059957-8979-43a2-bef0-455322d4ac60 | hojelse/aps | 03-dynamic_programming/pebblesolitaire.cpp | #include "../header.hpp"
#define RIGHT 0b110
#define LEFT 0b011
#define MASK 0b111
ll f(ll board, ll count, ll n, map<ll, ll>& cache)
{
if (cache.count(board))
return cache[board];
ll m = count;
for (ll i = 0; i < n-2; i++)
if(((board >> i) & MASK) == RIGHT)
// 0b110 - 5 = 0b001
m = min(m, f(board - (5... | ALGO | 0.999504 | 4.464654 |
3cd9d690-3d40-4dc1-882b-f1262942bf40 | chakitg/cp_solutions | leetcode-potd/2699. Modify Graph Edge Weights.cpp | You are given an undirected weighted connected graph containing n nodes labeled from 0 to n - 1, and an integer array edges where edges[i] = [ai, bi, wi] indicates that there is an edge between nodes ai and bi with weight wi.
Some edges have a weight of -1 (wi = -1), while others have a positive weight (wi > 0).
Your... | ALGO | 0.999995 | 6.349275 |
33955d99-3d7b-4f05-84d6-e69fac980ff1 | aksharanigam1112/Cpp-Codes | weighted_grph.cpp | #include<bits/stdc++.h>
using namespace std;
void addEdge(vector <pair<int, int> > adj[], int u,int v, int wt)
{
adj[u].push_back(make_pair(v, wt));
}
void printGraph(vector <pair<int, int> > adj[], int V)
{
int v, w;
for (int u = 0; u < V; u++)
{
vector<pair<int,int> >::iterator it= adj[u].b... | ALGO | 0.991439 | 4.074338 |
d09c428f-fa4d-4db0-b4b3-0f24f309cddf | cuongpiger/algorithms-training | solutions/old/Philosophers Stone - SPOJ.cpp | #pragma warning(disable:4996)
#include <iostream>
#include <cstdint>
#include <algorithm>
#include <functional>
#include <queue>
#include <stack>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <bitset>
#include <cmath>
#include <iomanip>
#include <sstream>
#include <unordered_set>
#include <... | ALGO | 0.999916 | 4.209126 |
36d0258c-3bb0-4952-b333-31c47fa702f5 | randisihombing/calculator | 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 |
84d6dc4c-6ecb-48b2-96bb-ab3dfc70070f | testvscode2020/update | v02/Zadatak06/Source.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <array>
using namespace std;
/*
Napišite program koji u array učitava sve riječi
iz datoteke NekiTekst.txt (kao granicu „riječi”
uzmite bilo koju bjelinu – razmak, tab, enter).
Ispišite koliko puta se u tekstu pojavljuje riječ „the”.
Hint: kad učita... | ALGO | 0.97141 | 4.004859 |
e3f92b6b-4f1c-43fe-accc-314b25e08d05 | funglf/ComPPare | examples/max_reduction/max_cpu.cpp | #include <chrono>
#include <algorithm>
#include <limits>
#include <thread>
#include <vector>
#include <omp.h>
#include <cmath>
#include <comppare/comppare.hpp>
#include "max_cpu.hpp"
void cpu_max_serial(std::span<const float> in, float &out)
{
HOTLOOPSTART;
out = *std::max_element(in.data(), in.data() + in.s... | ALGO | 0.999497 | 6.261013 |
c506b8fd-65b7-490f-aebd-274c08a7d3f7 | mvialette/flutter_training | flutter_training_step_03/quizz_app/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.993164 | 6.786404 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.