uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
7c22ecfb-f612-416f-a929-421a65ee7da2 | daidezhi/alphaInitializerFoam | libigl/include/igl/loop.cpp | #include "loop.h"
#include <igl/adjacency_list.h>
#include <igl/triangle_triangle_adjacency.h>
#include <igl/unique.h>
#include <vector>
template <
typename DerivedF,
typename SType,
typename DerivedNF>
IGL_INLINE void igl::loop(
const int n_verts,
const Eigen::PlainObjectBase<DerivedF> & F,
Eigen::Spars... | ALGO | 0.998902 | 5.897307 |
dc37ec4e-5016-47cd-a9d9-12e9bf28b40c | oneskovic/CP-Problems | CodeForces/Educational Round 121/B.cpp | #include <algorithm>
#include <iostream>
#include <vector>
#include <string>
using namespace std;
typedef long long ll;
ll bruteforce(ll x)
{
vector<ll> possible_numbers;
ll right = 0;
ll right_pow_10 = 1;
while (x >= 10)
{
ll digit1 = x % 10;
x /= 10;
ll digit2 = x % 10;
x /= 10;
ll new_number = 0;
... | ALGO | 0.999971 | 6.56472 |
5d8a7b01-4e51-4199-9853-ad15d3234f9b | Binay28/Binay-s_Code | C++ code/HR45_Jumping_on_clouds.cpp | #include <bits/stdc++.h>
using namespace std;
vector<string> split_string(string);
// Complete the jumpingOnClouds function below.
int jumpingOnClouds(vector<int> c)
{
vector<int>::iterator itr=c.begin();
int count;
while(itr!=c.end())
{
if(*(itr+2)==0 && itr+1!=c.end()){count++;itr+=2;}
else {count++;itr+=... | ALGO | 0.999953 | 5.224052 |
84bbe64f-a01e-467e-92d8-0bdff62d0700 | Zeta0080-cell/c-- | 陈sk计算器.cpp | #include <stdio.h>
int main ()
{
double a,b;
char op;
printf("ʽ");
scanf("%lf%c%lf",&a,&op,&b);
if(op=='+')
{
printf("%.2f\n",a+b);
}
else if(op=='-')
{
printf("%.2f\n",a-b);
}
else if(op=='*')
{
printf("%.2f\n",a*b);
}
else if(op=='/')
{
printf("%.2f\n",a/b);
}
return 0;
}
| ALGO | 0.989069 | 3.280571 |
06b5e145-0ac2-49c5-bc18-020850dbeb2f | yingziyu-llt/program_in_univ | introToAI/HW05/c++/short_path_ucs.cpp | #include "problem/directed_graph.hpp"
#include "algorithm/heuristic_search.hpp"
#include "algorithm/uniform_cost_search.hpp"
const char pos_names[][ 20 ] = { "Oradea", // 0
"Zerind",
"Arad", // start:2
"Sibiu", ... | ALGO | 0.999912 | 4.388416 |
8f92070a-d4a5-49c2-b1b1-0a6d59ac58f9 | cziwen/AMATH483 | HW7/Q1/blas_bench.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
#include <chrono>
#include "my_cblas.h"
// 向上对齐字节数到 64 的倍数
size_t aligned_bytes(size_t n_elem) {
size_t bytes = n_elem * sizeof(double);
return ((bytes + 63) / 64) * 64;
}
void benchmark_daxpy(int n) {
size_t bytes = aligned_bytes(n);
double* X =... | TOOL | 0.989001 | 5.561111 |
6adef042-45f3-4c32-994d-09289143de6b | chandrikadeb7/Hacktoberfest_2021 | Task 3/sieve-of-eratosthenes/sieve-of-eratosthenes.cpp | #include <bits/stdc++.h>
using namespace std;
void SieveOfEratosthenes(int n)
{
bool prime[n+1];
memset(prime, true, sizeof(prime));
for (int p=2; p*p<=n; p++)
{
if (prime[p] == true)
{
for (int i=p*p; i<=n; i += p)
prime[i] = false;
... | ALGO | 0.999839 | 4.66747 |
23de8208-79b3-46b7-9a04-add483ac69f3 | ttt977/algorithm | lg/건물옥상정원.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int N;
int H[80010];
void Input_Data(void){
cin >> N;
int tmp;
for (int i = 0; i < N; i++){
scanf("%d",H+i);
}
}
long long solve(){
long long cnt=0;
for(int i=0;i<N;i++)
{
for(int j=i+1;j<N;j++)
{
if(H[j] >= H[i... | ALGO | 0.999642 | 3.602794 |
d4e21e7b-3ffe-4143-8b4e-1b80d6205648 | iamvinayvk/LeetCode | 118-pascals-triangle/118-pascals-triangle.cpp | class Solution {
public:
vector<vector<int>> generate(int numRows) {
vector<vector<int>> ans;
for(int i=0;i<numRows;i++)
{
vector<int> v(i+1,0);
int index=0;
v[0]=v[i]=1;
for(int j=1;j<(i);j++)
{
v[j]=ans[i-1... | ALGO | 0.999983 | 5.579526 |
88d890dd-f287-44b1-9c33-d39ee868c0f5 | khanadilgithub/GFG_DSA | String/LexicoGraphicRankOfString.cpp | #include<iostream>
#include<math.h>
using namespace std;
const int charsize=256;
int factorial(int n)
{
int res=1;
for(int i=1; i<=n; i++)
{
res= res*i;
}
return res;
}
int lexicographicalRank(string &str)
{
int res=1;
int count[256] = {0};
int n = str.length();
int fact... | ALGO | 0.99979 | 3.871561 |
496ac899-1d67-41bd-8bca-b1dc800ccd53 | huitiancontinue/V2G-Vehicloak | libsnark-vnt/src/mint/mintcgo.cpp | #include <stdio.h>
#include <iostream>
#include <boost/optional.hpp>
#include <boost/foreach.hpp>
#include <boost/format.hpp>
#include "libsnark/zk_proof_systems/ppzksnark/r1cs_ppzksnark/r1cs_ppzksnark.hpp"
#include "libsnark/common/default_types/r1cs_ppzksnark_pp.hpp"
#include <libsnark/gadgetlib1/gadgets/hashes/sha... | ALGO | 0.991702 | 4.96257 |
7d2e1d68-ee74-4375-8344-f0a71ae740e4 | ishandutta2007/codeforces | fizzydavid/normal/293/B.cpp | /*
Author : JZdavid
From : CF
Problem : 293B
Time :
Verdict : Accepting
*/
#include<algorithm>
#include<cstdlib>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<map>
#include<queue>
#include<stack>
#include<string>
#include<set>
#include<utility>
#include<vecto... | ALGO | 0.999983 | 3.916125 |
80cda131-6d50-4e37-b200-8383e46eaa1c | HweDongJung/code_test | 7795.cpp | //https://www.acmicpc.net/problem/7795
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
using namespace std;
int main() {
int t;
cin >> t;
cin.ignore();
for(int i=0; i< t; i++){
int A, B;
cin >> A >> B;
vector<int> avec, bvec;
cin.ignore();
string s;
get... | ALGO | 0.997464 | 3.295535 |
d61f87cf-5031-4c74-9fb8-974f8121e800 | techtim/lightSequencer | qm_btrack/OnsetDetectionFunction.cpp | #include <math.h>
#include <iostream>
#include "OnsetDetectionFunction.h"
using namespace std;
//-------------------------------------------------------------------------------
// Constructor
OnsetDetectionFunction :: OnsetDetectionFunction()
{
// indicate that we have not initialised yet
initialised = 0;
// s... | ALGO | 0.969396 | 6.154178 |
fb38c5ca-7532-47b5-8a2d-353c81e9b923 | ishandutta2007/codeforces | royappa/normal/4/A.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <c... | ALGO | 0.999432 | 3.464404 |
74e51927-3bcc-4a1c-9e44-2f294b5d8610 | raincross7/code-similarity | codes/train_code/problem150/problem150_209.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<vector<ll> > AdjMat;
#define INF (ll)1e+15
int main(){
int V,E; cin >> V >> E;
AdjMat G(V,vector<ll>(V,INF));
for(int i=0; i<E; i++){
int s,t,d; cin >> s >> t >> d;
G[s][t] = d;
}
for(int i=0; i<V; i++) G[i][i] ... | ALGO | 0.999981 | 4.054749 |
e0339fe8-d0e3-437f-b631-70c844df3efa | Jlassi-Mohamed/Competitive-Programming-Solutions | Codeforces/A. Numbers.cpp | #include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define GRAPH vector<vector<int>>
#define loop(i, s, e) for(int i=s ; i<e ; i++)
#define lloop(i, s, e) for(long long i=s ; i<e ; i++)
#define bloop(i, e, s) for(int i=e-1; i>=s; i--)
#define... | ALGO | 0.999946 | 4.933311 |
d3dc93c9-f346-4ef0-a290-240eaa455350 | setak482/2022_BOJ_solved | Gold/G2/3745 오름세.cpp | #include <bits/stdc++.h>
#define endl '\n'
using namespace std;
int num;
vector<int> ldp;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int arrsize;
while(cin >> arrsize){
ldp.push_back(20040802);
for(int i = 0; i < arrsize; i++){
cin >> num;
... | ALGO | 0.999296 | 3.978742 |
ba3073dc-c358-4223-ba5d-e2810c2cd473 | ishandutta2007/codeforces | peti1234/normal/1733/D2.cpp | #include <bits/stdc++.h>
using namespace std;
long long n, x, y, dp[5005][2][2], sok=1e16;
string a, b;
void solve() {
cin >> n >> x >> y >> a >> b;
x=min(x, 2*y);
//cout << "valasz............ ";
if (y<=x) {
int si=0;
vector<int> sz;
for (int i=0; i<n; i++) {
if (a[... | ALGO | 0.99989 | 3.678851 |
99b5b528-edda-47fc-8ab7-12a82d85bb84 | VolumetricBio/prusa3d-Slic3r | src/igl/bounding_box_diagonal.cpp | IGL_INLINE double igl::bounding_box_diagonal(
const Eigen::MatrixXd & V)
{
using namespace Eigen;
VectorXd maxV,minV;
VectorXi maxVI,minVI;
mat_max(V,1,maxV,maxVI);
mat_min(V,1,minV,minVI);
return sqrt((maxV-minV).array().square().sum());
}
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
#en... | ALGO | 0.995834 | 6.224428 |
76c02b29-3fad-48ec-b652-14a8d9505e2f | weimingtom/db-verkstan | db-builder/lib/src/texturefilters/cloudstexturefilter.cpp | #include "db-util.hpp"
#include "filters.hpp"
#include "texture.hpp"
void divideGrid(int x,
int y,
int width,
int height,
float c1,
float c2,
float c3,
float c4,
int Scale,
Texture... | ALGO | 0.967817 | 4.070387 |
a2635135-76a5-4c58-be28-32abe3315918 | manohar2902/CSA1342-TOC | SIMULATING TURING MACHINE.cpp | #include<stdio.h>
#include<string.h>
int main()
{
int i,j,le,flag,flag1,flag2;
char str[20];
printf("Program to show how a turing machine will process 0n1n2n\n");
printf("Enter a string : ");
scanf("%s",str);
le=strlen(str);
j=0;
while(1)
{
flag=0;flag1=0;flag2=0;i=0;
while(i<le)
{
if((str[i]=='0')&&(flag==0))
{
str[i]... | ALGO | 0.999972 | 3.027321 |
5364d370-111d-43b7-a066-49eefa93a2a3 | DanejSakshi13/Data-Structures-And-Algorithms | assignment10.cpp | /*Read the marks obtained by students for second year in an online examination of a particular subject. Find out maximum and minimum marks obtained in that subject. Use heap data structure. Analyze the algorithm.*/
#include <iostream>
using namespace std;
// A heap data structure
struct Heap {
int* data; ... | ALGO | 0.999559 | 4.852881 |
d71febf8-a1c1-49bd-8c15-86fefb194280 | borhanur-rahman/Data_Structure_lab | Data Structure_lab_Practice/Tree/Binary_Search_Tree_FindAndInsert.cpp | #include<bits/stdc++.h>
using namespace std;
int tree[100]= {0};
void Insert(int item)
{
int i=0;
while(1)
{
if(tree[i]==item)
{
cout<<item<<"is already in the position :"<<i<<endl;
break;
}
else if(tree[i]==0)
{
tree[i]=item;
... | ALGO | 0.999643 | 4.520249 |
654eec57-0003-4bdf-94df-9a2b799ba6c6 | Neo-X/TerrainRLSim | learning/CaclaTrainer.cpp | #include "CaclaTrainer.h"
#include "util/FileUtil.h"
#include "QNetTrainer.h"
#include "ACLearner.h"
//#define ENABLE_CRITIC_IS
//#define ENABLE_INVERTING_GRADIENTS
//#define OUTPUT_TD_TEST
#define CLAMP_VAL
#if defined(OUTPUT_TD_TEST)
const std::string gTDTestOutputFile = "output/td_test.txt";
#endif
cCaclaTrainer:... | ALGO | 0.943036 | 5.605655 |
287e2227-96c8-4a9c-a555-cc44a69609b3 | alexandraback/datacollection | solutions_5686313294495744_0/C++/vladvd/c.cpp | #include <iostream>
#include <vector>
#include <cstdio>
#include <string>
using namespace std;
vector<pair<string, string> > v;
vector<pair<string, string> > fakes;
vector<pair<string, string> > others;
int cur_perm[20];
int n;
int ans = 0;
int check() {
fakes.clear();
others.clear();
//for (int i = 0; i < n; ... | ALGO | 0.999798 | 4.199234 |
2b41341c-439c-4c06-9e6f-4e7cdc97643d | salonijaiswal7412/DSA | Linked list/InsertHead.cpp | Node* insertAtFirst(Node* list, int newValue) {
// Write your code here
Node * n=new Node(newValue);
n->next=list;
return n;
}
| ALGO | 0.984262 | 4.193181 |
a8ebf0fe-85e8-4a07-8c30-db5bbb91abba | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/07/0716/personal_submission/cf442b_kamtuo.cpp | /*----------------------------------*/
/* Author : KaMtuo */
/* Email : <EMAIL> */
/* Creation_time : 2024-07-16 17:20 */
/* Software : Visual Studio Code */
/*----------------------------------*/
const int N = 123;
priority_queue<double> q;
double ans;
double a[N];
bool cmp(double x, ... | ALGO | 0.999732 | 4.03215 |
74c5d097-6fac-4f61-bf3d-87ad79fdf9aa | DevlTz/ITP | LOP 2 Sem/MatrizGuerreiro/campoagricola.cpp | #include <iostream>
int main() {
int m, n, ferteis, irrigados;
std::cin >> m >> n;
int campo[m][n];
for(int lin = 0; lin < m; lin++) {
for(int col = 0; col < n; col++) {
std::cin >> campo[lin][col];
}
}
ferteis = 0;
irrigados = 0;
for(int lin = 0; lin <... | ALGO | 0.999969 | 5.989708 |
fb3f4d9d-61de-486a-b34f-94e3d07925f0 | mingc39/BOJ | 2000/2751.cpp | #include <stdio.h>
#include <stdlib.h>
int compare(const void *a, const void *b) {
int i = *(int *)a;
int j = *(int *)b;
if(i < j) return -1;
if(i > j) return 1;
return 0;
}
int main() {
int N, *n;
n = (int*)malloc(sizeof(int) * 1000000);
scanf("%d", &N);
for(int i = 0 ; i < N; i++) scanf... | ALGO | 0.999788 | 3.795623 |
7dc2460c-a98c-4795-b890-1d1db44db41e | ThoMut/v4r | modules/recognition/src/local_recognition_pipeline.cpp | #include <v4r/common/graph_geometric_consistency.h>
#include <v4r/recognition/local_recognition_pipeline.h>
#include <v4r/features/types.h>
#include <pcl/common/time.h>
#include <pcl/registration/transformation_estimation_svd.h>
namespace v4r
{
template<typename PointT>
void
LocalRecognitionPipeline<PointT>::initial... | ALGO | 0.953659 | 6.353866 |
ffeb0e5c-8762-4ac0-97d5-1ae94dd55495 | bluster980/Leetcode-Solutions | 2490-circular-sentence/2490-circular-sentence.cpp | class Solution {
public:
bool isCircularSentence(string sentence) {
stringstream ss(sentence);
string word;
vector<string> words;
while (ss >> word) {
words.push_back(word);
}
int n = words.size();
for (int i = 0; i < n; i++) {
string cur... | ALGO | 0.999461 | 6.28965 |
d6f7cf55-1f23-4e9e-988f-1c753275b1ae | KyleWong288/codeforces | practice/1600/1526C.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <utility>
#include <queue>
using namespace std;
typedef long long ll;
int N;
// track running pos amount and take all takeable negs
// since we blindly take all negs, we can use a heap to decide and replace bad decisions
int solutio... | ALGO | 0.999977 | 4.664594 |
c0338438-721d-4d9d-a3a2-eefd6f9f34b7 | PlanarG/Code | Practise/6.24/269E.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 400010;
int val[N];
vector<int> minimal(vector<int> v) {
int n = v.size(), i = 0, j = 1, k = 0;
while (i < n && j < n && k < n) {
if (val[v[(i + k) % n]] == val[v[(j + k) % n]]) k++;
else {
if (val[v[(i + k) % n]] > val[v... | ALGO | 0.999991 | 3.902678 |
38ae8cdf-77ac-4591-92c5-3d01e4d58a22 | yatharth811/Ladders | 1600/D_Vupsen_Pupsen_and_0.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<ll> vi;
typedef pair<ll, ll> pi;
#define FAST ios::sync_with_stdio(0), cin.tie(0)
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define per(i,a,b) for(ll i=a;i>b;i--)
#define endl '\n'
const ll MAX = INT_MAX;
const ll MIN = INT_MIN;
cons... | ALGO | 0.999778 | 3.614423 |
5e5112fb-450b-4550-a3ea-99b81d6e2859 | rainbow-auto/rainbow-codes | Comp/24-07-20 ABC363/B.cpp | #include <iostream>
const int maxn = 1005;
int n, t, p;
int a[maxn];
int main () {
std::cin >> n >> t >> p;
for (int i = 1; i <= n; i++) { std::cin >> a[i]; }
int day = 0;
while (true) {
int cnt = 0;
for (int i = 1; i <= n; i++) { cnt += (a[i] >= t); }
if (cnt >= p) { brea... | ALGO | 0.999939 | 3.980129 |
90a0aa15-9b6e-4626-8d56-18491aa032f1 | pmanu91/algorithm | C++/Course6/fuckingCalculator.cpp |
#include <iostream>
#include <queue>
using namespace std;
const int MAX = 99999;
bool visited[MAX + 1] = { false };
int n;
void bfs(int start) {
queue<pair<int, int> > q;
q.push({1, 0});
visited[1] = true;
while (!q.empty()) {
int k = q.front().first;
int count = q.front().second;
q.pop();
// succ... | ALGO | 0.999879 | 3.797197 |
bd31dc8f-960f-45b4-84a4-90154454465f | NkOffiCiAL07/Leetcode | 2062-count-vowel-substrings-of-a-string/2062-count-vowel-substrings-of-a-string.cpp | class Solution
{
private:
inline bool is(char ch)
{
return (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u');
}
public:
int countVowelSubstrings(string word)
{
unordered_set<char> set;
int len = word.length(), count = 0;
for (int i = 0... | ALGO | 0.999913 | 6.176224 |
23630d3a-f32a-4cd0-b265-ada5bc005c29 | Baumi/mangos | contrib/git_id/git_id.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <sstream>
#include <assert.h>
#include <set>
#include <list>
#include <sstream>
#include "../../src/framework/Platform/CompilerDefs.h"
#if PLATFORM == PLATFORM_WINDOWS
#include <direct.h>
#define popen _popen
#define pclose _pclose
#... | TOOL | 0.886744 | 5.579508 |
03696f36-46b3-49eb-8a98-f5249c90a3d7 | Manvityagi/Codechef-Codeforces-spoj | codechef/LONG CHALLENGE/APRIL_LONG/Carsell.cpp | #include <bits/stdc++.h>
using namespace std;
#define PB push_back
#define F first
#define S second
#define MP make_pair
#define LL long long
#define ULL unsigned long long
#define LB lower_bound
#define MOD1 1000000007
#define MOD2 1000000009
void erast()
{
int n;
vector<char> is_prime(n + 1, true);
is_p... | ALGO | 0.999913 | 4.272957 |
f225c1ee-3d0d-4e92-ad4d-7dcc30215bfc | Shreyanshsingh23/leetcode-GFG | 103-binary-tree-zigzag-level-order-traversal/binary-tree-zigzag-level-order-traversal.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999994 | 6.132185 |
ab7ada9b-6b57-41b4-95c1-2cc0d4503569 | iamrubayet/CSES-Solutions | Additional Problems/Chess Tournament.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef pair<int,int> pii;
int N, K;
vector<pii> added, ans;
tree<pii, null_type, less<pii>, rb_tree_tag,
tree_order_statistics_node_update> T;
int main(){
scanf... | ALGO | 0.999974 | 3.79141 |
59d70cac-36ad-453a-b72c-8b8fa0e868ae | iainnicol/open-watcom-1.x | bld/plustest/regress/stl.94/examples/iter4.cpp | // This example compiles using the new STL<ToolKit> from ObjectSpace, Inc.
// STL<ToolKit> is the EASIEST to use STL that works on most platform/compiler
// combinations, including cfront, Borland, Visual C++, C Set++, ObjectCenter,
// and the latest Sun & HP compilers. Read the README.STL file in this
// directory ... | TOOL | 0.968006 | 3.060784 |
531061d6-8add-4da3-b826-2de360dada50 | kkoma2623/ProblemSolving | Baekjoon/20056Baek.cpp | #include <iostream>
#include <vector>
#define MAX_N 51
using namespace std;
class info{
public:
int m, s, d;
};
int d[8][2] = {{-1, 0}, {-1, 1}, {0, 1}, {1, 1}, {1, 0}, {1, -1}, {0, -1}, {-1, -1}};
vector<info> v1[MAX_N][MAX_N], v2[MAX_N][MAX_N];
int N, M, K;
void getInput(){
cin >> N >> M >> K;
for(int... | ALGO | 0.999824 | 4.496078 |
8e822aed-fb2c-40d6-b0c2-7d070ef3159c | ysakuragi16/ofSplineSample | src/BezierCurve.cpp | //
// BezierCurve.cpp
// ofSplineSample
//
// Created by SakuragiYoshimasa on 2015/10/31.
//
//
#include "BezierCurve.h"
void BezierCurve::reset(){
points.clear();
points.push_back(ofVec3f(100,100,0));
points.push_back(ofVec3f(100,200,0));
points.push_back(ofVec3f(300,100,0));
points.push_back(... | ALGO | 0.951052 | 5.218894 |
ecd42828-d04f-4c42-a600-93cc6efa6c00 | knarloch/CppExercises | sudoku/sudoku.cpp | #include <array>
#include <vector>
#include <cassert>
#include <iostream>
#include <cmath>
using namespace std;
class SudokuLookup {
public:
SudokuLookup(const vector<vector<int>> &board) {
N = board.size();
sqrtN = std::sqrt(N);
rows = vector<vector<bool>>(N, vector<bool>(N, false));
... | ALGO | 0.999175 | 6.974769 |
f5b4aa84-7722-4a2a-8286-850c1f453a97 | JorgeIba/Competitive-Programming-Problems | CodeForces/TCArg2021/Avanzados #6/E. Epidemic in Monstropolis.cpp | #include <bits/stdc++.h>
#define endl '\n'
#define lli long long int
#define ld long double
#define forn(i,n) for (int i = 0; i < n; i++)
#define all(v) v.begin(), v.end()
#define fastIO(); ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define SZ(s) int(s.size())
using namespace std;
typedef vector<lli> VL... | ALGO | 0.99999 | 3.55309 |
2cfe253c-a936-4229-97d4-25046dcbed71 | Johan-su/Space_game | src/Game/systems/CollisionSystem.cpp | #include "CollisionSystem.hpp"
#include "../Components_Events.hpp"
#include <assert.h>
const Usize MAX_ENTITIES_IN_TREE = 256;
const Usize SUBTREE_AMOUNT = 4;
enum BoxOrCircle
{
Box,
Circle
};
struct QuadTree
{
Vector2f pos;
Vector2f size;
QuadTree *sub_trees[SUBTREE_AMOUNT]; // 0th tree start... | TOOL | 0.920194 | 5.959691 |
63e3a7d4-9815-43da-92a2-6a282f4137bd | rawoctopus/BoyoungKim | 다트게임.cpp | #include <string>
#include <iostream>
#include <vector>
using namespace std;
int num[3];
int bonus[3];
int solution(string dartResult) {
int answer = 0;
int idx = 0;
for (int i = 0; i<3; i++) {
bonus[i] = 1;
}
for (int i = 0; i<dartResult.size(); i++) {
if (dartResult[i]... | ALGO | 0.99963 | 5.012213 |
2963aed4-12ab-40cf-b408-3332f676f920 | smartfoxteam/smartfox | src/utilstrencodings.cpp | #include "utilstrencodings.h"
#include "tinyformat.h"
#include <cstdlib>
#include <cstring>
#include <errno.h>
#include <limits>
#include <openssl/bio.h>
#include <openssl/buffer.h>
#include <openssl/crypto.h> // for OPENSSL_cleanse()
#include <openssl/evp.h>
using namespace std;
string SanitizeString(const string... | TOOL | 0.961623 | 6.930681 |
1844a2e7-2b72-4217-8730-74288f9d8fd8 | Anon0/dalvik | vm/interp/Interp.cpp | /*
* Main interpreter entry point and support functions.
*
* The entry point selects the "standard" or "debug" interpreter and
* facilitates switching between them. The standard interpreter may
* use the "fast" or "portable" implementation.
*
* Some debugger support functions are included here.
*/
#include "Da... | TOOL | 0.904126 | 4.319908 |
5ce105d7-7288-4d0d-ae6d-a99257613c1d | YooBIK/Algorithms | Cpp_for_codingtest/chapter4/#3.cpp | #include <iostream>
using namespace std;
int map[50][50];
int route[50][50];
int dx[4] = {-1, 0, 1, 0};
int dy[4] = {0, 1, 0, -1};
int main(){
int n,m;
cin >> n >> m;
int row,col,dir;
cin >> row >> col >> dir;
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
cin >> map[i][j];
... | ALGO | 0.999958 | 4.19184 |
1ac668fa-89a3-415c-8b24-2bd6dce24a7f | MRwangmaomao/HaibotBase | track_line/src/warning_line.cpp |
#include <time.h>
#include <thread>
#include <opencv2/opencv.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/imgproc/types_c.h>
#include <ros/console.h>
#include "filter_line/utils.h"
#include "image_follow_line/image_follow_line.h"
#include "filter_line/vincent_soille_watershed.... | ALGO | 0.999314 | 3.581504 |
33991230-978c-405f-872a-b18c6cd7efe4 | ishandutta2007/codeforces | chasedream/normal/1068/B.cpp | #include <bits/stdc++.h>
using namespace std;
template <typename T>
void read(T &x) {
cin >> x;
}
long long b;
int main() {
ios :: sync_with_stdio(false); cin.tie(0);
read(b);
long long ans = 1, sq = sqrt(b);
for (long long i = 2; i <= sq; i++) {
int cnt = 0;
while (b % i == 0) {
b /= i, cnt+... | ALGO | 0.99997 | 4.857879 |
b31fd657-6326-4932-9d72-330708a28509 | mariemelendez88/Data_Projects | sparselizard-master/examples/magnetostatics-scalar-potential-2d/main.cpp | // This code simulates the static magnetic field created by 5 permanent magnets (1cm x 1cm) placed side by side.
// A steel region above the magnets is perturbing the magnetic field lines.
//
// The magnetic scalar potential is used to solve this problem. This is valid since there are no current sources.
// The permane... | ALGO | 0.998869 | 4.771075 |
bbb310cf-d9f7-4cb1-98bd-21b1acae923d | Alberto1Artoni/intersection | lib/CGAL-5.5.2/examples/Point_set_processing_3/normals_example.cpp | #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/compute_average_spacing.h>
#include <CGAL/pca_estimate_normals.h>
#include <CGAL/mst_orient_normals.h>
#include <CGAL/property_map.h>
#include <CGAL/IO/read_points.h>
#include <utility> // defines std::pair
#include <list>
#include <fstrea... | ALGO | 0.998241 | 6.98423 |
d994666e-30e9-4f66-b0f0-6810761cc76d | bae1776/A4_BOJPractice | A4_BOJPractice/16920.cpp | //https://www.acmicpc.net/problem/16920
//Ȯ
// ִ ǿ Ģ ڽ Ȯ ,
// Ͻÿ. (ڼ Ģ Ʈ )
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
//using DIRECTION = enum { UP, DOWN, LEFT, RIGHT };
vector<int> spreadList;
vector<vector<char>> board;
vector<queue<pair<int, int>>> spreadQueue;
void sprea... | ALGO | 0.999775 | 4.076586 |
bca1e913-f1a0-4cdf-9ae0-b7ea765c4ab1 | Priyanka-2468/DSAProblems | MinRotatedArray.cpp | class Solution {
public:
int findMin(vector<int>& nums) {
int start=0,end=nums.size()-1;
int mid;
if(nums[start]<=nums[end]){
return nums[start];
}
while(start<end){
mid=(start+end)/2;
if(nums[mid]>=nums[0]){
start=mid+1;
}
... | ALGO | 0.99996 | 5.888268 |
e4e81df6-7fba-46d0-89ea-07fec7273427 | Tonz24/restir-embree | template/src/pg/pg1_embree/DirectBRDFIntegrator.cpp | #include "stdafx.h"
#include "DirectBRDFIntegrator.h"
#include "Intersection.h"
glm::vec3 DirectBRDFIntegrator::calculateDirectLighting(const Scene& scene, const Ray& ray, const IntersectionResult& intersection, const RenderParams& renderParams, const glm
::vec<... | ALGO | 0.997822 | 5.151976 |
b03ccfb0-814e-4f8c-834a-5fb301138559 | chopinex/IA2020 | perceptron/Perceptron.cpp | #include <iostream>
#include <fstream>
#include <stdlib.h>
#include <time.h>
#define PRUEBAS 21
#define TASAENT 0.6
#define EPOCAS 10
using namespace std;
ifstream ds("entrenamiento.txt");
int ts[PRUEBAS][32];
double pesos[3][33];//bias
int esperados[3][3] = { {1,-1,-1},{-1,1,-1},{-1,-1,1} };
char valores[3] = { '0'... | ALGO | 0.999882 | 3.107159 |
180d4190-9c0e-4972-8180-49b6e9903dad | cgao3/benzene-vanilla-cmake | src/solver/ProofUtil.cpp | //----------------------------------------------------------------------------
/** @file ProofUtil.cpp */
//----------------------------------------------------------------------------
#include "Hex.hpp"
#include "BoardUtil.hpp"
#include "BitsetIterator.hpp"
#include "DfsSolver.hpp"
#include "ProofUtil.hpp"
#include "... | ALGO | 0.999653 | 7.336099 |
144466a2-9e8f-4c2c-a135-68c4fd725308 | rahulgrover99/Competitive | Codechef/Learn DSA/LRNDSA01/TEST.cpp | #include<bits/stdc++.h>
#define FOR0(i,n) for(int i=0;i<n;i++)
#define FOR1(i,n) for(int i=1;i<=n;i++)
#define FORl(i,l,n) for(int i=l;i<n;i++)
using namespace std;
#define pi pair<ll,ll>
#define pb push_back
#define ll long long
#define ld long double
#define ff first
#define ss second
#define mp make_pair
#define mst... | ALGO | 0.999735 | 3.197045 |
613af9b6-d8ab-4235-ac30-d9d17822e537 | Tonaeus/neetcode-250 | Trees/144-binary-tree-preorder-traversal.cpp | #include <bits/stdc++.h>
using namespace std;
// Time Complexity: O(n)
// Space Complexity: O(n)
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... | ALGO | 0.999994 | 6.639464 |
13caf9d5-b0f8-41ff-bb9f-1cccd111dbb6 | Le-ECE/Air-Wheel-Driver | opencv/sources/3rdparty/openexr/IlmImf/ImfLut.cpp | //-----------------------------------------------------------------------------
//
// Lookup tables for efficient application
// of half --> half functions to pixel data,
// and some commonly applied functions.
//
//-----------------------------------------------------------------------------
#include <ImfLut.h>
#incl... | TOOL | 0.984012 | 6.544207 |
78ef1713-42fd-4e86-897c-5a89da2865e6 | stormbringer667/mcsparalelalg | array2.cpp | #include <iostream>
using namespace std;
int main() {
int y, m, d, days[] = { 31,28,31,30,31,30,31,31,30,31,30,31 };
cout << "enter year, month, day: ";
cin >> y >> m >> d;
if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0) days[1] = 29;
int dayOfYear = d;
for (int i = 0; i < m - 1; i++) dayOfYe... | ALGO | 0.998839 | 3.951501 |
2736e3a9-5da6-4835-8215-fd8c1c54ed82 | rmcolq/charon | src/utils.cpp | #include "utils.hpp"
#include "index_main.hpp"
#include <plog/Log.h>
#include <gzip/compress.hpp>
std::filesystem::path make_absolute(std::filesystem::path path) { return std::filesystem::absolute(path); }
std::vector<std::string> split(const std::string &s, const std::string &delimiter) {
std::vector<std::strin... | DATA | 0.934419 | 5.404099 |
e0332725-a748-4584-9757-6067e6bc3825 | alibaba/nann | blaze-benchmark/thirdparty/boost_1_53_0/libs/test/example/cla/custom_parameter.cpp | // See http://www.boost.org/libs/test for the library home page.
// Boost.Runtime.Param
#include <boost/test/utils/runtime/cla/named_parameter.hpp>
#include <boost/test/utils/runtime/cla/parser.hpp>
namespace rt = boost::runtime;
namespace cla = boost::runtime::cla;
// STL
#include <iostream>
#include <iterator>
... | TOOL | 0.984198 | 7.668168 |
5ebe0b80-765a-4fbf-ae13-5617b4fb19b8 | ferconde87/LeetCode | 169. Majority Element/majorityElement-Boyer-Moore Voting.cpp | class Solution {
public:
int majorityElement(vector<int>& nums) {
int n = nums.size();
int candidate = nums[0];
int count = 1;
for(int i = 1; i < n; ++i){
if(nums[i] == candidate) count++;
else count--;
if(count == 0){
candidate = n... | ALGO | 0.999936 | 5.946597 |
d6386683-e88a-4028-8cbd-b7c9f6e999e1 | ishandutta2007/codeforces | _guoyh_/normal/1101/F.cpp | # include <cstdio>
# include <cstring>
# include <algorithm>
# define ll long long
using namespace std;
const int MAXN = 405;
const int MAXM = 250051;
struct Truck{
int s, t, r;
ll c;
} tr[MAXM];
int n, m;
ll ans;
ll a[MAXN];
ll f[MAXN][MAXN];
bool cmp(Truck x, Truck y){
return x.r < y.r;
}
int main(){
memset(f, 0x... | ALGO | 0.999904 | 3.640308 |
3ad82038-36ee-48b9-bc4f-a1175b44e7f4 | nmhlog/Thesis | buff_agg/CrossValidation/50/cv55025hierarchical_aggregation.cpp | #include "hierarchical_aggregation.h"
#include "time.h"
/* ================================== hierarchical_aggregation ================================== */
// instance point num for each class, statistical data from the training set
float class_numpoint_mean_dict[15] = {-1., 4270.0, 54.0, 112.0, 1007.0, 141.0, 355.0... | ALGO | 0.982138 | 4.370762 |
bfd4891f-8706-412a-bf22-e41a70ccb573 | tienpm/GETP | main-course/week02/mat_mul_pthread/mat_mul.cpp | #include "mat_mul.h"
#include "util.h"
#include <pthread.h>
#include <immintrin.h>
#include <algorithm>
#include <iostream>
#include <vector>
#include <sys/time.h>
#define ITILESIZE (32)
#define JTILESIZE (1024)
#define KTILESIZE (1024)
struct ThreadArg {
int M, N, K;
int row_start, row_end;
float *A, *B, *C;
... | ALGO | 0.999357 | 5.070777 |
3fa2e0f2-0b6d-4461-b697-df18a1831f35 | Saber7X/DaiMaDaQuan | 蓝桥杯选拔赛/AT4896 [ABC161C] Replacing Integer2.cpp | #include<stdio.h>
#include<math.h>
#include<algorithm>
#define int long long
using namespace std;
signed main()
{
int n, k;
scanf("%lld%lld", &n, &k);
int ans = n % k;
if (abs(ans - k) < ans) ans = abs(ans - k);
printf("%lld\n", ans);
return 0;
}
| ALGO | 0.99996 | 3.245624 |
fa8bb6c4-bced-4fd0-a970-1a09af4e9f50 | refiel-l/caffe-libs | opencv/samples/cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp | /**
* @file Sobel_Demo.cpp
* @brief Sample code using Sobel and/orScharr OpenCV functions to make a simple Edge Detector
* @author OpenCV team
*/
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <stdlib.h>
#include <stdio.h>
using namespace cv... | ALGO | 0.91375 | 6.249539 |
318df753-cde2-4a86-abd1-2ec495800719 | XwanXuanX/abstract-nonsense | cf/2104C.cpp | #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
#define all(x) x.begin(), x.end()
#define rep(x) for (int _ = (0); _ < (x); ++_)
template <typename T> using V = vector<T>;
template <typename T> using pr = pair<T, T>;
templ... | ALGO | 0.999971 | 5.313066 |
aa1896f2-5cea-4724-aaa2-43a0275676ae | ishandutta2007/codeforces | ashishgup/normal/505/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long
const int N = 1e5 + 5;
int n, m;
vector<int> undirG[N];
int grp = 0;
vector<int> g[N], newg[N], rg[N], todo;
int comp[N], indeg[N], sz[N];
bool vis[N];
set<int> gr[N];... | ALGO | 0.999621 | 5.017381 |
a5153152-1fc8-4704-b06d-250dc21e6e86 | mapleelpam/boost | libs/bimap/example/mi_to_b_path/mi_hashed_indices.cpp | /*****************************************************************************
Boost.MultiIndex
*****************************************************************************/
#include <boost/config.hpp>
//[ code_mi_to_b_path_mi_hashed_indices
#include <iostream>
#include <iomanip>
#include <boost/tokenizer.hpp>
#i... | ALGO | 0.923067 | 6.647751 |
0a0bdb39-2fde-4fa1-933c-2d0176372e3f | Gurpreet3131/competitiveProgramming | codeforces/709c.cpp | #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <string.h>
#include <cmath>
using namespace std;
int main()
{
char s[100003];
scanf("%s",s);
int length=strlen(s),start=0,count=0;
for(int i=0;i<length;i++) if(s[i]=='a') count++;
if(count==length)
... | ALGO | 0.98996 | 3.105953 |
553dc5bd-c036-4f0c-812e-abd529f5bed8 | alexandruionascu/fmi | codeforces/queries_about_less.cpp | #include <fstream>
#include <iostream>
#include <algorithm>
#define FIN "queries.in"
#define MAXN 200002
using namespace std;
ifstream f(FIN);
int n, m;
long long a[MAXN];
long long b[MAXN];
int read()
{
cin >> n;
cin >> m;
for(int i = 1; i <= n; i++)
cin >> a[i];
}
int search(int value)
{
i... | ALGO | 0.999976 | 4.195412 |
a2c0c8e3-1226-4f6b-9cb6-958d45057906 | yaymalaga/advent_of_code_2023 | src/day_5/almanac.cpp | #include "almanac.hpp"
#include "common/utils.hpp"
namespace advent_of_code_2023 {
namespace day_5 {
namespace almanac {
Almanac::Almanac(std::vector<std::string> raw_data)
: seeds_{},
seed_soil_map_{},
soil_fertilizer_map_{},
fertilizer_water_map_{},
water_light_map_{},
light_temper... | ALGO | 0.996845 | 5.000053 |
4fd73212-c675-467e-9268-708236c89153 | ou3slati/competitive-programming | Codeforces/Contests/Div2/Round655/B.cpp | /*
CF 655B - Omkar and Last Class of Math
https://codeforces.com/contest/1372/problem/B
Find a,b where lcm(a,b) = n minimal
n ≤ 1e9
Key: Use smallest divisor
*/
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int t; cin >> t;
while(... | ALGO | 0.999936 | 5.514601 |
2820e5e4-35ca-4dda-b7e4-8b343d622a3b | paulobruno/UFC-ArtificialIntelligence | 8puzzle/Node.cpp | /*
* 344083 ITALO PEREIRA DE SOUSA
* 354086 PAULO BRUNO DE SOUSA SERAFIM
* 333491 RAPHAELL DYEGO CRUZ VAZ
*
* October, 2015, Fortaleza - CE, Brasil
*/
#include "Node.h"
Node::Node()
{}
Node::Node(const Node& n)
{
for (unsigned int i = 0; i < NUM_OF_TILES; ++i)
{
tile[i] = n.tile[i];
}
... | ALGO | 0.999627 | 4.075287 |
05e8d974-23d3-40ec-a69f-f6881ccaee4b | VanZ1L/LR3_lab | LR3/Task4_3/Task4_3.cpp | #include <iostream>
using namespace std;
int findFirstElement(double eps)
{
double count = 0;
double i = 0;
do
{
count = pow(-1, i) * ((i + 1) / (pow(2, i - 1)));
i++;
if (abs(count) < eps)
{
break;
}
} while (true);
return i;
}
void main()
{
... | ALGO | 0.999733 | 3.169558 |
cfa91d0b-81c8-471b-8a23-51069ec5b1ff | avplayer/proxy | third_party/boost/libs/python/example/numpy/gaussian.cpp | #include <boost/python/numpy.hpp>
#include <cmath>
#include <memory>
#ifndef M_PI
#include <boost/math/constants/constants.hpp>
const double M_PI = boost::math::constants::pi<double>();
#endif
namespace bp = boost::python;
namespace bn = boost::python::numpy;
/**
* A 2x2 matrix class, purely for demonstration pur... | TOOL | 0.912741 | 7.68991 |
4774e916-47d2-403a-a5de-0acee6d04d64 | AndPer111/CS10C | Heap.cpp | // implementing Heap functions
#include "Heap.h"
#include <iostream>
using namespace std;
// constructor
Heap::Heap() : numItems(0) {
}
void Heap::enqueue(PrintJob* job) {
// if numItems does not equal max heap size declared in private and numItems is 0 then set array with numItems in it to job and increment n... | ALGO | 0.99895 | 4.953516 |
90dd329a-3b13-4aba-aca4-a8c0b347c255 | raincross7/code-similarity | codes/train_code/problem266/problem266_322.cpp | #include <bits/stdc++.h>
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)n; ++i)
const int INF = 1e9;
#define MOD 1000000000 + 7
#define MAX 51000
#define all(x) (x).begin(), (x).end()
#define MX(x) *max_element(all(x))
#define MN(x) *min_element(all(x))
using namespace std;
void solve()
{
int n, ... | ALGO | 0.999978 | 3.511637 |
b325c2c2-9de0-46ff-b808-5c00866af777 | habiburrahmantalha/UVA-online-Judge | 852_Deciding_victory_in_Go.cpp | #include<stdio.h>
#include<string.h>
bool B,W;
int cnt;
int visit[1001][1001];
char g[1001][1001];
int X[]={0,-1,0,1};
int Y[]={-1,0,1,0};
bool valid(int x,int y)
{
if(x<0 || y<0)
return false;
return true;
}
void dfs(int u,int v)
{
int x,y,i;
cnt++;
visit[u][v]=1;
for(i=0;i<4;i++)
{
... | ALGO | 0.999608 | 3.9526 |
d7796735-50cb-4039-a2cf-465c4803e219 | kmjp/procon | 2012-2016/2015/unk/unk7/a.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<to;x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(... | ALGO | 0.999657 | 3.385533 |
fb081ce4-7a99-4a75-85e1-e7c28534e238 | wowoto9772/Hungry-Algorithm | BOJ/2468/solution.cpp | #include <stdio.h>
#include <memory.h>
bool chk[102][102];
int e[102][102];
int n;
void dfs(int x, int y, int h) {
if (x > n || y > n || x < 1 || y < 1)return;
if (chk[x][y] == true)return;
if (e[x][y] <= h)return;
chk[x][y] = true;
dfs(x + 1, y, h);
dfs(x - 1, y, h);
dfs(x, y + 1, h);
dfs(x, y - 1, h);
... | ALGO | 0.999819 | 3.288951 |
7c24ec1d-f944-4581-bda9-359c646703a1 | jtj8412/problem-solving | Programmers/Level3/67259.cpp | //----------------------------------------------------------------------------------
// [ 경주로 건설 ] https://programmers.co.kr/learn/courses/30/lessons/67259
//
// cache에 도로 건설 위치(y,x), 현재 진행 방향(dir)에 따른 최소 비용(cost)을 담는다 (cache[y][x][dir])
// 1. bfs 방식으로 맵(board) 탐색한다. 만약 도로를 설치하려는 장소가 이미 설치가 되었던 장소라면
// cache에 저장되어있는... | ALGO | 0.999622 | 5.45285 |
651d4502-8798-4e37-82cb-2d02526847e6 | knuu/competitive-programming | codeforces/cdf403_2d.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
typedef vector<int> Vi;
//typedef tuple<int, int, int> T;
#define FOR(i,s,x) for(int i=s;i<(int)(x);i++)
#define REP(i,x) FOR(i,0,x)
#define ALL(c) c.begin(), c.end()
#define DUMP( x ) cerr << #x... | ALGO | 0.99999 | 3.673387 |
0350b01e-0f3f-4099-bf5a-29eba49125f6 | C0ldSmi1e/CompetitiveProgramming | Contests/Codeforces-EducationalCodeforcesRound112RatedforDiv.2/E.BoringSegments.cpp | /**
* Author: Daniel
* Created Time: 2021-09-22 00:29:33
**/
// time-limit: 3000
// problem-url: https://codeforces.com/contest/1555/problem/E
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define ER erase
#define IS insert
#define PI acos(-1)
#define PB pop_back
#define MP make_p... | ALGO | 0.999974 | 4.811213 |
b30356cb-281c-4360-9de0-e2ac1e68097c | AdvTrainEvalSrcDomain/adv-train-evaluation-source-code-domain | code-imitator/data/dataset_2017/dataset_2017_8_formatted/liymouse/3264486_5633382285312000_liymouse.cpp | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>
typedef long long i64d;
using namespace std;
int main() {
freo... | ALGO | 0.999918 | 4.253161 |
5e36717e-9356-4197-8bb2-81c2e4a80217 | Varlode/Code | CodeCpp/VNOJ/segtree/segtree_itez1.cpp | /*
_
______/ \-. _ _ __ _ _ _
.-/ ( o\_// / l..l \ / >--< \
l ___ \_/\---' \/ ll \/ \l \ l/
l_ll l_ll l_''_l l_ll_l
*/
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5+10;
int n, q, a[N];
struct SEQMENT {... | ALGO | 0.999991 | 5.44323 |
e2b8fc9e-575c-4ef6-985c-128c43ebe3e5 | BenQuickDeNN/LeetCodeSolutions | 排序性能对比/quick_sort_cache.cpp | #include <vector>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include "configure.hpp"
#include "timer.hpp"
using namespace std;
void qsort(vector<int>& arr, const int& low, const int& high)
{
if (low >= high) return;
int i = low;
int j = high + 1;
int key = arr[low];
while (true)
... | ALGO | 0.998923 | 4.989416 |
a4ab8d2d-4fb2-4312-b50a-2fe31243fa03 | emotionless/Programming-Problem-Solution | codeforces/213_B.cpp | #include <bits/stdc++.h>
/**********TYPE CASTING**********/
#define LL long long
#define L long
#define D double
#define LD long double
#define S string
#define I int
#define ULL unsigned long long
#define q queue<int>
#define vi vector<int>
#define vl vector<long>
/**********INPUT**********/
#define si(a) scanf("%d"... | ALGO | 0.999934 | 3.234829 |
a6105004-1c01-47e9-96af-6e4d7d966649 | ishandutta2007/codeforces | neal/normal/1208/G.cpp | #include <algorithm>
#include <cassert>
#include <iostream>
#include <vector>
using namespace std;
vector<int> smallest_factor;
vector<int> totient;
vector<bool> prime;
vector<int> primes;
// Note: This sieve is O(n), but the constant factor is worse than the O(n log log n) sieve due to the multiplication.
void sieve... | ALGO | 0.999974 | 4.546692 |
b03255d6-a6ce-4569-a081-0d43b014cc6c | zakriyamalik/DSA-Part-2 | 22L-7986 Q-1.cpp | //#include <iostream>
//using namespace std;
//class Node {
//public:
// int data;
// Node* left;
// Node* right;
// Node(int val)
// {
// data = val;
// left = nullptr;
// right = nullptr;
// }
//};
//class BST {
//public:
// Node* root;
// BST()
// {
// root = nu... | ALGO | 0.999796 | 5.152292 |
a3d32218-928b-4e8c-a8dc-ca109cf45545 | connorwang38/CodeForces-Solutions | CodeForces-A/709A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int n, b, d, cur = 0, count = 0;
cin >> n >> b >> d;
while (n--) {
int c; cin >> c;
if (c <= b) {
cur += c;
if (cur > d) {
cur = 0;
count++;
}... | ALGO | 0.999902 | 3.99472 |
09862568-ecca-4fa1-9900-1299b001240e | Hameezr/Cookie-Crush | hw0-windows/game-release.cpp | //#include <GL/gl.h>
//#include <GL/glut.h>
#include <iostream>
#include<string>
#include<cmath>
#include "util.h"
using namespace std;
#define MAX(A,B) ((A) > (B) ? (A):(B)) // defining single line functions....
#define MIN(A,B) ((A) < (B) ? (A):(B))
#define ABS(A) ((A) < (0) ? -(A):(A))
#define FPS 30
#define KEY_ES... | TOOL | 0.923372 | 4.724799 |
f55fd696-a87a-4a46-94f8-142980aaf4a7 | yudility/codetree-TILs | 240813/배열에서 원소의 특징/characteristics-of-elements-in-an-array.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
int a[10];
int main() {
for(int i=0; i<10;i++){
cin >> a[i];
if(a[i]%3==0){
cout << a[i-1];
break;
}
}
return 0;
} | ALGO | 0.999872 | 3.198992 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.