repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
Xi-Plus/OJ-Code
TOJ/toj 549.cpp
#include <bits/stdc++.h> #define endl '\n' using namespace std; long long mypow(long long a, long long b){ if(b<0)return 0; long long ans=1; while(b--){ ans*=a; } return ans; } int main() { // ios::sync_with_stdio(false); // cin.tie(0); long long m, e, n, sum=0, cnt=0; vector<int> plist; bool isp[10000]={}; ...
Xi-Plus/OJ-Code
UVa/uva 11709.cpp
// By KRT girl xiplus #include <bits/stdc++.h> #define endl '\n' using namespace std; struct Node{ bool visit; vector<int> side1,side2; }node[1010]; stack<int> stamp; void dfs_stamp(int now){ node[now].visit=true; for(auto next:node[now].side2){ if(!node[next].visit){ dfs_stamp(next); } } stamp.push(now); ...
Xi-Plus/OJ-Code
ZJ/zj a740.cpp
// By KRT girl xiplus #include <bits/stdc++.h> #define endl '\n' using namespace std; bool nisp[46341]={false}; int p[10000]; int main(){ // ios::sync_with_stdio(false); // cin.tie(0); nisp[0]=nisp[1]=true; int i=2,j,k=0; while(i<46341){ if(!nisp[i]){ p[k++]=i; j=i*2; while(j<46341){ nisp[j]=true; ...
Xi-Plus/OJ-Code
TOJ/toj 607.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; for (int q = n; q >= 1; q--) { for (int w = 1; w <= n - q; w++) { cout << " "; } for (int w = 1; w <= q * 2 - 1; w++) { cout << "*"; } cout << endl; } }
Xi-Plus/OJ-Code
UVa/uva 10038.cpp
#include <bits/stdc++.h> #define endl '\n' using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int arr[3005]; int n; while(cin>>n) { for(int q=0; q<n; q++){ cin>>arr[q]; } for(int q=0; q<n-1; q++){ arr[q]=abs(arr[q]-arr[q+1]); } sort(arr, arr+n-1); bool ans=true; for(int ...
Xi-Plus/OJ-Code
TIOJ/tioj 1510.cpp
// By KRT girl xiplus #include <bits/stdc++.h> #define endl '\n' using namespace std; struct Color{; int c[3]={0,0,0},cnt=0; }; int main(){ // ios::sync_with_stdio(false); // cin.tie(0); int n,x1,y1,x2,y2; int input[100][7]; vector<int> xlist,ylist; vector<int>::iterator it; cin>>n; for(int q=0;q<n;q++){ for(i...
Xi-Plus/OJ-Code
UVa/uva 108.cpp
#include <bits/stdc++.h> #define endl '\n' using namespace std; int v[105][105], v2[105]; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin>>n; for(int q=1; q<=n; q++) { for(int w=1; w<=n; w++) { cin>>v[q][w]; } } for(int w=1; w<=n; w++) { v[0][w]=0; for(int q=2; q<=n; q++) { v[q][w...
Xi-Plus/OJ-Code
UVa/uva 490.cpp
<gh_stars>0 #include <bits/stdc++.h> #define endl '\n' using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); char c[105][105]; memset(c, ' ', sizeof(c)); int row=0, col=0; string s; while(getline(cin, s)){ col=max(col, (int)s.size()); for(int q=0; q<s.size(); q++){ c[row][q]=s[q]; }...
Xi-Plus/OJ-Code
paiza-poh-ando/ando5/C++.cpp
<reponame>Xi-Plus/OJ-Code #include <iostream> using namespace std; int main(){ string s; int yes=0,no=0; for(int i=0;i<5;i++){ cin>>s; if(s=="yes")yes++; else no++; } if(yes>no)cout<<"yes"; else cout<<"no"; }
Xi-Plus/OJ-Code
UVa/uva 315.cpp
<reponame>Xi-Plus/OJ-Code // By KRT girl xiplus #include <bits/stdc++.h> #define endl '\n' using namespace std; struct Node{ int visit,low; vector<int> son; }node[110]; int ans; void dfs(int i,int p,int d){ node[i].visit=node[i].low=d; bool ap=false; int child=0; for(int s:node[i].son){ if(s==p)continue; if(n...
Xi-Plus/OJ-Code
TIOJ/tioj 1196.cpp
<reponame>Xi-Plus/OJ-Code<filename>TIOJ/tioj 1196.cpp // By KRT girl xiplus #include <bits/stdc++.h> #define endl '\n' using namespace std; int main(){ // ios::sync_with_stdio(false); // cin.tie(0); int n; cin>>n; int v[n+1][n+1],dp[n+1][n+1]; char c; for(int q=1;q<=n;q++){ for(int w=1;w<=n;w++){ cin>>c; s...
Xi-Plus/OJ-Code
TOJ/toj 472.cpp
<reponame>Xi-Plus/OJ-Code #include <bits/stdc++.h> #define endl '\n' using namespace std; int lowbit(int n){ return n&-n; } struct BIT{ long long v[1000005]; void add(int n){ for(;n<1000005;n+=lowbit(n)){ v[n]++; } } long long sum(int n){ long long a=0; for(;n>0;n-=lowbit(n)){ a+=v[n]; } return a...
Xi-Plus/OJ-Code
UVa/uva 10199/uva 10199.cpp
// By KRT girl xiplus #include <bits/stdc++.h> #define endl '\n' using namespace std; struct Node{ int visit,low; vector<int> son; }node[110]; vector<int> ans; void dfs(int i,int p,int d){ node[i].visit=node[i].low=d; bool ap=false; int child=0; for(int s:node[i].son){ if(s==p)continue; if(node[s].visit){ ...
Xi-Plus/OJ-Code
UVa/uva 10895.cpp
<filename>UVa/uva 10895.cpp // By KRT girl xiplus #include <bits/stdc++.h> #define endl '\n' using namespace std; int main(){ // ios::sync_with_stdio(false); // cin.tie(0); int n,m,k,t; while(cin>>n>>m){ int v[n][m]; memset(v,0,sizeof(v)); for(int q=0;q<n;q++){ cin>>k; vector<int> key; for(int w=0;w<k;...
Xi-Plus/OJ-Code
UVa/uva 10004.cpp
<gh_stars>0 #include <bits/stdc++.h> #define endl '\n' using namespace std; int color[205]; vector<int> edges[205]; bool ans; void dfs(int p, int nowc){ for(int n:edges[p]){ if(color[n]==0){ color[n]=3-nowc; dfs(n, 3-nowc); }else{ if(color[n]+nowc!=3){ ans=false; } } } } int main() { ios::sync_...
Xi-Plus/OJ-Code
TOJ/toj 629.cpp
// By xiplus #include <bits/stdc++.h> #define endl '\n' using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); int Q, act, k, i; int a[2] = {1, 1}; int b[2] = {0, 0}; char c; cin >> Q; while (Q--) { cin >> act; switch (act) { case 1: cin >> k; cout << max(a[0] * k + b[0], a[1] *...
Xi-Plus/OJ-Code
TIOJ/tioj 1811.cpp
<filename>TIOJ/tioj 1811.cpp // By KRT girl xiplus #include <bits/stdc++.h> #define endl '\n' using namespace std; int N,L; int H[100010],W[100010],dp[100010]; int solve(){ dp[0]=0; for(int q=1;q<=N;q++){ dp[q]=2147483647; for(int w=0;w<q;w++){ int widsum=0,maxh=0; for(int e=w+1;e<=q;e++){ widsum+=W[e];...
Xi-Plus/OJ-Code
TOJ/toj 142.cpp
<reponame>Xi-Plus/OJ-Code #include <iostream> using namespace std; int main(){ char v[3][3]; while(cin>>v[0][0]>>v[0][1]>>v[0][2]){ for(int q=1;q<=2;q++)for(int w=0;w<=2;w++)cin>>v[q][w]; bool x=0; for(int q=0;q<=2;q++)for(int w=0;w<=2;w++)if(v[q][w]=='#')x=1; char c=0; i...
Xi-Plus/OJ-Code
UVa/uva 11220.cpp
<filename>UVa/uva 11220.cpp #include <bits/stdc++.h> #define endl '\n' using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int T; cin>>T; cin.ignore(); cin.ignore(); string s; for(int t=1; t<=T; t++) { cout<<"Case #"<<t<<":"<<endl; while(true){ int i=0; getline(cin, s); if(s=...
Xi-Plus/OJ-Code
TOJ/toj 5.cpp
#include <iostream> using namespace std; int main(){ string s; getline(cin,s); cout<<"Hello ,"<<s<<" !"<<endl; }
Xi-Plus/OJ-Code
TOJ/toj 171.cpp
#include <iostream> int main(){ int n; while(std::cin>>n){ n*=0.8; std::cout<<n<<'\n'; } }
Xi-Plus/OJ-Code
UVa/uva 11417.cpp
<reponame>Xi-Plus/OJ-Code<gh_stars>0 #include <bits/stdc++.h> #define endl '\n' using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int arr[505][505]; for(int q=1; q<505; q++){ for(int w=q+1; w<505; w++){ arr[q][w]=__gcd(q, w); } } int n; while(cin>>n, n){ long long ans=0; for(i...
Xi-Plus/OJ-Code
TOJ/toj 316.cpp
#include <bits/stdc++.h> #define endl '\n' #define double long double using namespace std; double eps=pow(2,0.0001); bool check(double a,double b){ a=abs(a); b=abs(b); if(max(a,b)<=min(a,b)*eps)return true; return false; } int main(){ ios::sync_with_stdio(false); cin.tie(0); int t;cin>>t; ...
Xi-Plus/OJ-Code
TOJ/toj 551.cpp
#include <bits/stdc++.h> #define endl '\n' using namespace std; int main() { // ios::sync_with_stdio(false); // cin.tie(0); long long t, n, k; cin>>t; while(t--){ cin>>n>>k; int c2=0, c3=0; while(n%2==0){ c2++; n/=2; } while(n%3==0){ c3++; n/=3; } if(n==1){ if(c3>=c2&&c3<=c2+k){ cout...
Xi-Plus/OJ-Code
UVa/uva 10189.cpp
#include <bits/stdc++.h> #define endl '\n' using namespace std; char arr[105][105]; int main() { ios::sync_with_stdio(false); cin.tie(0); int n, m, cnt=1; while(cin>>n>>m, n&&m){ if(cnt>1){ cout<<endl; } memset(arr, ' ', sizeof(arr)); for(int q=1; q<=n; q++){ for(int w=1; w<=m; w++){ cin>>arr[q][w...
Xi-Plus/OJ-Code
HDU/hdu 1754.cpp
// By KRT girl xiplus #include <bits/stdc++.h> #define endl '\n' using namespace std; int n; struct T{ int l,r; int maxg; }v[800000]; void init(int p,int l,int r){ v[p].l=l; v[p].r=r; v[p].maxg=-2147483647; if(l==r) return ; int mid=(l+r)/2; init(p*2,l,mid); init(p*2+1,mid+1,r); } int get_index(int p,int find)...
Xi-Plus/OJ-Code
TIOJ/tioj 1001.cpp
<filename>TIOJ/tioj 1001.cpp<gh_stars>0 #include<cstdio> main(){puts("Hello Tmt World XD!");}
Xi-Plus/OJ-Code
TOJ/toj 68.cpp
// By KRT girl xiplus #include <bits/stdc++.h> #define endl '\n' using namespace std; int main(){ // ios::sync_with_stdio(false); // cin.tie(0); string s; while(getline(cin,s)){ long long ansa=1,ansb=1; string a; stringstream t(s); while(t>>a){ if(a.find("/")==string::npos){ ...
Xi-Plus/OJ-Code
UVa/uva 10019.cpp
<gh_stars>0 #include <bits/stdc++.h> #define endl '\n' using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int t, n, x, x2, ans; cin>>t; while(t--){ cin>>n; x=n; ans=0; while(x){ ans+=x%2; x/=2; } cout<<ans<<" "; ans=0; x=n; while(x){ x2=x%10; while(x2){ ans...
Xi-Plus/OJ-Code
TOJ/toj 107.cpp
#include <iostream> using namespace std; int main(){ long long int a=30; for(int q=1;q<=30;q++){ a+=(q+q*q*(q+1)/2); } cout<<a<<endl; }
Xi-Plus/OJ-Code
TOJ/toj 623.cpp
#include <bits/stdc++.h> using namespace std; int main() { int t, q, l, r; string s; cin >> t; while (t--) { cin >> s; cin >> q; while (q--) { cin >> l >> r; for (int i = l; i <= r; i++) { cout << s[i - 1]; } } cout << endl; } }
Xi-Plus/OJ-Code
paiza-poh-ando/ando9/C++.cpp
#include <iostream> using namespace std; int main(){ int n; string s; cin>>n; while(n--){ cin>>s; cout<<s; if(n)cout<<"_"; } }
Xi-Plus/OJ-Code
UVa/uva 11636.cpp
#include <bits/stdc++.h> #define endl '\n' using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int n, t=1; while(cin>>n, n>0){ if(n==1){ cout<<"Case "<<t++<<": 0"<<endl; }else{ cout<<"Case "<<t++<<": "<<(int)log2(n-1)+1<<endl; } } }
Xi-Plus/OJ-Code
paiza-poh-ando/ando6/C++.cpp
<gh_stars>0 #include <iostream> using namespace std; int main(){ int n; cin>>n; while(n)cout<<n--<<endl; cout<<"0!!"<<endl; }
Xi-Plus/OJ-Code
UVa/uva 118.cpp
#include <bits/stdc++.h> #define endl '\n' using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int n, m, x, y, dx, dy; char dir; string s; cin>>n>>m; bool danger[n+1][m+1]; memset(danger, false, sizeof(danger)); while(cin>>x>>y>>dir){ switch(dir){ case 'N': dx=0; dy=1; break; cas...
Xi-Plus/OJ-Code
CF/cf 625B.cpp
// By KRT girl xiplus #include <bits/stdc++.h> #define endl '\n' using namespace std; int main(){ // ios::sync_with_stdio(false); // cin.tie(0); string a,b; cin>>a>>b; int sa=a.size(),sb=b.size(),ans=0,l=sa-sb+1; for(int q=0;q<l;q++){ // cout<<q<<endl; bool x=1; for(int w=0;w<sb;w++){ if(a[q+w]!=b[w]){ ...
Xi-Plus/OJ-Code
template/rand - mt19937_64.cpp
// By KRT girl xiplus #include <bits/stdc++.h> #define endl '\n' using namespace std; int main(){ // ios::sync_with_stdio(false); // cin.tie(0); mt19937_64 rng; rng.seed(time(NULL)); uniform_int_distribution<unsigned long long> dis; cout<<dis(rng)<<endl; mt19937 mt(time(NULL)); cout<<mt()<<endl; }
Xi-Plus/OJ-Code
UVa/uva 10252.cpp
#include <bits/stdc++.h> #define endl '\n' using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); string s1, s2; while(getline(cin, s1)){ getline(cin, s2); map<char, int> cnt1; map<char, int> cnt2; for(char c:s1) { cnt1[c]++; } for(char c:s2) { cnt2[c]++; } vector<char> v; ...
Xi-Plus/OJ-Code
ZJ/zj a121.cpp
#include <bits/stdc++.h> #define endl '\n' using namespace std; bool nisp[10010]={false}; int p[10000],k=0; bool checkp(int n){ if(n==2||n==3)return 1; else if((n-1)%6&&(n+1)%6)return 0; else if(n<=10010){ if(binary_search(p,p+k,n))return 1; else return 0; }else{ bool x=0; for(int q=0;q<k&&p[q]*p[q]<=n;q++)...
Xi-Plus/OJ-Code
TOJ/toj 323.cpp
// By KRT girl xiplus #include <bits/stdc++.h> #define endl '\n' using namespace std; int n; int v[100010]; int LIS(){ vector<int> lis; lis.push_back(v[0]); for(int q=1;q<n;q++){ if(v[q]>lis.back()){ lis.push_back(v[q]); }else { lis[lower_bound(lis.begin(),lis.end(),v[q])-lis.begin()]=v[q]; } } return ...
Xi-Plus/OJ-Code
UVa/uva 11461.cpp
#include <bits/stdc++.h> #define endl '\n' using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); vector<int> v; for(int q=0; q<=317; q++){ v.push_back(q*q); } int a, b; while(cin>>a>>b, a||b){ cout<<upper_bound(v.begin(), v.end(), b)-lower_bound(v.begin(), v.end(), a)<<endl; } }
Xi-Plus/OJ-Code
UVa/uva 459.cpp
// By KRT girl xiplus #include <bits/stdc++.h> #define endl '\n' using namespace std; struct Node{ bool visit; vector<char> son; }node[128]; void dfs(char c){ node[c].visit=true; for(auto i:node[c].son){ if(!node[i].visit)dfs(i); } } int main(){ // ios::sync_with_stdio(false); // cin.tie(0); int t; cin>>t; ch...
Xi-Plus/OJ-Code
UVa/uva 11678.cpp
#include <bits/stdc++.h> #define endl '\n' using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int a, b, t, c1, c2; while(cin>>a>>b, a||b){ set<int> v1, v2; for(int q=0; q<a; q++){ cin>>t; v1.insert(t); } for(int q=0; q<b; q++){ cin>>t; v2.insert(t); } c1=0; for(int ...
Xi-Plus/OJ-Code
UVa/uva 200.cpp
<reponame>Xi-Plus/OJ-Code // By KRT girl xiplus #include <bits/stdc++.h> #define endl '\n' using namespace std; vector<string> v; struct Ship{ vector<char> son; int index; bool top; bool visit; }ship[128]; struct Ans{ char c; int index; }; vector<Ans> ans; bool cmp(Ans a,Ans b){ return a.index<b.index; } int dfs...
Xi-Plus/OJ-Code
UVa/uva 11159.cpp
<reponame>Xi-Plus/OJ-Code // By KRT girl xiplus #include <bits/stdc++.h> #define endl '\n' using namespace std; struct T{ int a,b; bool visit; }; int main(){ // ios::sync_with_stdio(false); // cin.tie(0); int t,n; cin>>t; int lsz,rsz; for(int cas=1;cas<=t;cas++){ cin>>lsz; vector<int> l; for(int q=0;q<lsz;q...
Xi-Plus/OJ-Code
CF/cf 625C.cpp
<reponame>Xi-Plus/OJ-Code<gh_stars>0 // By KRT girl xiplus #include <bits/stdc++.h> #define endl '\n' using namespace std; int main(){ // ios::sync_with_stdio(false); // cin.tie(0); long long n,k; cin>>n>>k; cout<<(n*(k-1)+1)*n+n*(n-1)/2*(n-k+1)<<endl; for(int q=0;q<n;q++){ for(int w=0;w<k-1;w++){ cout<<q*(k-1...
Xi-Plus/OJ-Code
TOJ/toj 183.cpp
<reponame>Xi-Plus/OJ-Code #include <algorithm> #include <iostream> const int K=10000000; bool nisp[K]={false}; int p[664580]={0}; using namespace std; int main(){ nisp[0] = nisp[1] = true; int i = 2, j, k = 1; while (i < K){ if (!nisp[i]){ p[k++] = i; j = i * 2; w...
Xi-Plus/OJ-Code
UVa/uva 11332.cpp
#include <bits/stdc++.h> #define endl '\n' using namespace std; int calc(int n){ if(n<10) { return n; } int temp=0; while(n){ temp+=n%10; n/=10; } return calc(temp); } int main() { ios::sync_with_stdio(false); cin.tie(0); int n; while(cin>>n, n){ cout<<calc(n)<<endl; } }
Xi-Plus/OJ-Code
paiza-poh-ando/ando16/C++.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ int m,t; cin>>m>>m; vector<int> x; while(m--){ cin>>t; x.push_back(t); } sort(x.begin(),x.end()); cin>>m; vector<int> y; while(m--){ cin>>t; if(!binary_search(x.begin(),x.end(),t)){ y.push_back(t); } } so...
Xi-Plus/OJ-Code
UVa/uva 1056.cpp
<reponame>Xi-Plus/OJ-Code #include <bits/stdc++.h> #define endl '\n' using namespace std; const int BIGDIS = INT_MAX/2; int dis[55][55]; int main() { ios::sync_with_stdio(false); cin.tie(0); int P, R; string s1, s2; int t=1; while(cin>>P>>R, P||R){ map<string, int> pid; int pidcnt=0; for(int q=0; q<P; q++){...
Xi-Plus/OJ-Code
UVa/uva 12347.cpp
// By KRT girl xiplus #include <bits/stdc++.h> #define endl '\n' using namespace std; struct Node{ int parent,left,right,value; }; vector<Node>node; void dfs(int index){ if(node[index].left!=-1)dfs(node[index].left); if(node[index].right!=-1)dfs(node[index].right); cout<<node[index].value<<endl; } int main(){ //...
Xi-Plus/OJ-Code
LeetCode/leetcode 1436.cpp
<filename>LeetCode/leetcode 1436.cpp #include <bits/stdc++.h> class Solution { public: string destCity(vector<vector<string>>& paths) { unordered_map<string, int> count; for (auto&& path : paths) { count[path[0]]++; count[path[1]]--; } for (auto&& v : count) { if (v.second == -1) { return v.fir...
Xi-Plus/OJ-Code
TOJ/toj 41.cpp
<reponame>Xi-Plus/OJ-Code<gh_stars>0 // By KRT girl xiplus #include <bits/stdc++.h> #define endl '\n' using namespace std; int v[1010]; int find(int p){ if(v[p]==p)return p; return v[p]=find(v[p]); } bool check(int a,int b){ int ta=find(a),tb=find(b); if(ta==tb)return false; v[ta]=tb; return tru...
Xi-Plus/OJ-Code
TOJ/toj 306.cpp
<filename>TOJ/toj 306.cpp // By KRT girl xiplus #include <bits/stdc++.h> #define endl '\n' using namespace std; const int MAX_V=100010; struct line{ int a,b; double cost; }; vector<line> l; struct edge{ int to; double cost; }; vector<edge> g[MAX_V]; void insert_edge(int from,int to,double cost){ g[f...
jamesgregson/easy_image_io
easy_image_io.cpp
<reponame>jamesgregson/easy_image_io #include <string> #include <iostream> #include <Python.h> #include <numpy/arrayobject.h> #define cimg_verbosity 0 #define cimg_display 0 #include "CImg.h" namespace cl = cimg_library; static char module_docstring[] = "easy_image_io: read/write 8/16 bit png files"; static char erro...
XapaJIaMnu/gemmBench
bench.cpp
<reponame>XapaJIaMnu/gemmBench #include <array> #include <vector> #include "Eigen/Dense" #include <iostream> #include "dnnl.h" #include <chrono> #include "intgemm/intgemm.h" #include "aligned.h" #include <unordered_map> #include "fbgemm_tests.h" #ifdef WITH_MKL # include <mkl.h> #endif void printDNNLStatus(dnnl_sta...
graetz23/hashcc
source/hashcc/hashccTest.cpp
/** * @file hashccTest.cpp * @author Christian (<EMAIL>) * * HASHCC is distributed under the MIT License (MIT); this file is part of. * * Copyright (c) 2008-2018 Christian (<EMAIL>) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation...
graetz23/hashcc
source/hashcc/hashccTypKeyConv.cpp
/** * @file hashccTypKeyConv.cpp * @author Christian (<EMAIL>) * * HASHCC is distributed under the MIT License (MIT); this file is part of. * * Copyright (c) 2008-2018 Christian (<EMAIL>) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documen...
graetz23/hashcc
source/main.cpp
/** * @file main.cpp * @author Christian (<EMAIL>) * * HASHCC is distributed under the MIT License (MIT); this file is part of. * * Copyright (c) 2008-2018 Christian (<EMAIL>) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files ...
graetz23/hashcc
source/hashcc/hashccFncHash.cpp
/** * @file hashccFncHash.cpp * @author Christian (<EMAIL>) * * HASHCC is distributed under the MIT License (MIT); this file is part of. * * Copyright (c) 2008-2018 Christian (<EMAIL>) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentat...
graetz23/hashcc
source/hashcc/hashccStc.cpp
/** * @file hashccStc.cpp * @author Christian (<EMAIL>) * * HASHCC is distributed under the MIT License (MIT); this file is part of. * * Copyright (c) 2008-2018 Christian (<EMAIL>) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation ...
graetz23/hashcc
source/hashcc/hashccJnk.cpp
/** * @file hashccJnk.cpp * @author Christian (<EMAIL>) * * HASHCC is distributed under the MIT License (MIT); this file is part of. * * Copyright (c) 2008-2018 Christian (<EMAIL>) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation ...
farcaller/arm-demos
03-linker-tests/module_c.cpp
<reponame>farcaller/arm-demos<filename>03-linker-tests/module_c.cpp void function_b(); extern "C" int public_function() { function_b(); }
farcaller/arm-demos
03-linker-tests/module_b.cpp
<filename>03-linker-tests/module_b.cpp int external_counter; extern "C" int public_function(); void function_b() { external_counter += public_function(); } void function_c() { } void function_d() { }
farcaller/arm-demos
03-linker-tests/module_d.cpp
class A { public: A(); virtual void b(); }; A::A() {}; void A::b() {};
palortoff/wclip
src/Clipboard.cpp
#include "Clipboard.h" #include <iostream> namespace { void clear(){ EmptyClipboard(); } } Clipboard::Clipboard(const Options& options, HWND owner) : _open(!!OpenClipboard(owner)) , _options(options) { } Clipboard::~Clipboard() { if (_open) CloseClipboard(); } bool Clipboard::isOpen() c...
palortoff/wclip
src/main.cpp
#include <iostream> #include <fstream> #include <sstream> #include <string> #include <vector> #include <cstdlib> #include <algorithm> #include "version.h" #include "Clipboard.h" #include "Options.h" namespace{ int success(bool s){ return s ? EXIT_SUCCESS : EXIT_FAILURE; } int version() { ...
palortoff/wclip
src/Options.cpp
#include "Options.h" #include <vector> #include <algorithm> #include <iostream> namespace { bool matches( const std::string& param, const std::string& longName, const std::string& shortName){ if (param == "--" + longName) return true; if (param.c_str()[0] == '-' &...
petr-ujezdsky/PWMReceiver
PWMReceiver.cpp
/* PWMReceiver.cpp - Library for asynchronous PWM signal processing on the most of the arduino pins. It is: * Quick - uses interrupts and event driven style of coding for the best performance and straightforward usage * Thread safe - the values accessed from within events are thread safe so you can use them wi...
iraqigeek/RadixSpline
test/radix_spline_test.cc
<filename>test/radix_spline_test.cc<gh_stars>10-100 #include "include/rs/radix_spline.h" #include <random> #include <unordered_set> #include "gtest/gtest.h" #include "include/rs/builder.h" #include "include/rs/serializer.h" const size_t kNumKeys = 1000; // Number of iterations (seeds) of random positive and negative...
iraqigeek/RadixSpline
test/multi_map_test.cc
<gh_stars>10-100 #include "include/rs/multi_map.h" #include <random> #include <unordered_set> #include "gtest/gtest.h" namespace { TEST(MultiMapTest, SimpleFind) { std::vector<std::pair<uint64_t, char>> data = {{1ull, 'a'}, {12ull, 'c'}, ...
nlitsme/idaperl
perlinterp.cpp
/* vim:set ts=4 sw=4: * * (C) 2008 <NAME> <EMAIL> * * IdcPerl - a perl scripting plugin for the Interactive Disassembler by hex-rays. * see http://www.xs4all.nl/~itsme/projects/idcperl * * this file contains the code to init, and call the perl interpreter * */ // perl includes #include "extern.h"...
nlitsme/idaperl
langreg.cpp
/* vim:set ts=4 sw=4: * * (C) 2008 <NAME> <EMAIL> * * IdcPerl - a perl scripting plugin for the Interactive Disassembler by hex-rays. * see http://www.xs4all.nl/~itsme/projects/idcperl * */ #include <string> // ida includes #include <pro.h> // for basic types. #include <ida.hpp> // for ida co...
nlitsme/idaperl
pluginreg.cpp
<filename>pluginreg.cpp /* vim:set ts=4 sw=4: * * (C) 2008 <NAME> <EMAIL> * * IdcPerl - a perl scripting plugin for the Interactive Disassembler by hex-rays. * see http://www.xs4all.nl/~itsme/projects/idcperl * * this file contains the code to register the plugin with ida, * */ #include <string> #include <vec...
nlitsme/idaperl
iolayer.cpp
/* vim:set ts=4 sw=4: * * (C) 2008 <NAME> <EMAIL> * * IdcPerl - a perl scripting plugin for the Interactive Disassembler by hex-rays. * see http://www.xs4all.nl/~itsme/projects/idcperl * */ #include <EXTERN.h> #include <perl.h> #include <perlio.h> #include <perliol.h> #undef do_open #undef do_close...
nlitsme/idaperl
idchotkey.cpp
/* vim:set ts=4 sw=4: * * (C) 2008 <NAME> <EMAIL> * * IdcPerl - a perl scripting plugin for the Interactive Disassembler by hex-rays. * see http://www.xs4all.nl/~itsme/projects/idcperl * */ #include <string> // ida includes #include <pro.h> // for basic types. #include <ida.hpp> // for ida ...
nlitsme/idaperl
clireg.cpp
/* vim:set ts=4 sw=4: * * (C) 2008 <NAME> <EMAIL> * * IdcPerl - a perl scripting plugin for the Interactive Disassembler by hex-rays. * see http://www.xs4all.nl/~itsme/projects/idcperl * */ #include <string> // ida includes #include <pro.h> // for basic types. #include <ida.hpp> // for ida co...
nlitsme/idaperl
cv_sv2idc.cpp
/* vim:set ts=4 sw=4: * * (C) 2008 <NAME> <EMAIL> * * IdcPerl - a perl scripting plugin for the Interactive Disassembler by hex-rays. * see http://www.xs4all.nl/~itsme/projects/idcperl * */ // ida includes #include <pro.h> // for basic types. #include <ida.hpp> // for ida constants and types. #...
nlitsme/idaperl
perl_magic.cpp
/* vim:set ts=4 sw=4: * * (C) 2008 <NAME> <EMAIL> * * IdcPerl - a perl scripting plugin for the Interactive Disassembler by hex-rays. * see http://www.xs4all.nl/~itsme/projects/idcperl * * this file contains code handling magic 'uvar's * that is a perl scalar with a 'set' and 'get' function. * ...
nlitsme/idaperl
perldll.cpp
/* vim:set ts=4 sw=4: * * (C) 2008 <NAME> <EMAIL> * * IdcPerl - a perl scripting plugin for the Interactive Disassembler by hex-rays. * see http://www.xs4all.nl/~itsme/projects/idcperl * * this module contains code that dynamically imports all functions from DYNAMIC_PERL_DLL * */ #include <string>...
oliverob/quantum
tensorflow_quantum/core/qsim/unitary_space.cc
<reponame>oliverob/quantum /* Copyright 2020 The TensorFlow Quantum Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unl...
oliverob/quantum
tensorflow_quantum/core/qsim/util_test.cc
/* Copyright 2020 The TensorFlow Quantum Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable ...
oliverob/quantum
tensorflow_quantum/core/src/util_qsim_test.cc
<gh_stars>1-10 /* Copyright 2020 The TensorFlow Quantum Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required...
oliverob/quantum
tensorflow_quantum/core/ops/tfq_calculate_unitary_op.cc
/* Copyright 2020 The TensorFlow Quantum Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable ...
oliverob/quantum
tensorflow_quantum/core/qsim/unitary_space_test.cc
/* Copyright 2020 The TensorFlow Quantum Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable ...
oliverob/quantum
tensorflow_quantum/core/qsim/state_space_test.cc
<gh_stars>1-10 /* Copyright 2020 The TensorFlow Quantum Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required...
JackBryce/Artificial-Intelligence
Core.cpp
<reponame>JackBryce/Artificial-Intelligence #include "Core.h"; //This constructor runs the Core AI. Core::Core(int count) { //Variables KeyGenerator kg = new KeyGenerator(); AIs.push_back(new ArtificialIntelligence()); key = kg.generateKey(binary(count)); updatedKey = key; //Processes while (updated...
JackBryce/Artificial-Intelligence
Network.cpp
#include "Network.h"; //This constructor adds a node to a network and adds an AI to that node. Network::Network() { Node *n = new Node(); n->id = bitset<16>(0).to_string(); n->AI_ID.push_back(n->id + bitset<2>(0).to_string()); n->AIs.push_back(new ArtificialIntelligence(0)); nodes.push_back(n); } //Th...
JackBryce/Artificial-Intelligence
artificialintelligence.cpp
#include "ArtificialIntelligence.h"; #include <random>; #include <bitset>; #include <string>; #include <iostream>; #include <fstream>; #include <windows.h>; #include <thread>; using namespace std; //This constructor runs the Artificial Intelligence. ArtificialIntelligence::ArtificialIntelligence(int count...
JackBryce/Artificial-Intelligence
ANN.cpp
#include "ANN.h"; ANNBlock::ANNBlock(int nextLayerSize) { if (nextLayerSize != 0) { for (int i = 0; i < nextLayerSize; i++) { weightsFoward.push_back(Connection()); weightsFoward.back().weight = rand()/RAND_MAX; } } else { weightsFoward.push_back(Connection()); weightsFoward.back().weight = 1...
JackBryce/Artificial-Intelligence
Block.cpp
<reponame>JackBryce/Artificial-Intelligence #include "Block.h"; //This sub-program feeds the previous layer into the next layer. void Block::feedFoward(const vector<double> &prevLayer) { double sum = 0.0; for (unsigned i = 0; i < prevLayer.size(); i++) { sum += prevLayer[i]*weightsFoward[m_myIndex].weight;...
JackBryce/Artificial-Intelligence
DynamicNetworkGenerator.cpp
#include "DynamicNetworkGenerator.h";
JackBryce/Artificial-Intelligence
BIASBlock.cpp
#include "BIASBlock.h"; BIASBlock::BIASBlock(int nextLayerSize) { if (nextLayerSize == 0) { for (int i = 0; i < nextLayerSize; i++) { weightsFoward.push_back(Connection()); weightsFoward.back().weight = rand() / RAND_MAX; } } else { weightsFoward.push_back(Connection()); weightsFoward.back()....
JackBryce/Artificial-Intelligence
LSTM.cpp
<gh_stars>1-10 #include "LSTM.h"; LSTMBlock::LSTMBlock(int nextLayerSize) { for (int i = 0; i < 4; i++) { lstmBiases.push_back(Connection()); lstmBiases.back().weight = rand()/RAND_MAX; weightsRecurrent.push_back(Connection()); weightsRecurrent.back().weight = rand()/RAND_MAX; } for (int i = 0; i...
JackBryce/Artificial-Intelligence
RNN.cpp
<filename>RNN.cpp #include "Block.cpp"; #include "RNN.h"; RNNBlock::RNNBlock(int nextLayerSize) { if (nextLayerSize != 0) { for (int i = 0; i < nextLayerSize; i++) { weightsFoward.push_back(Connection()); weightsFoward.back().weight = rand()/RAND_MAX; } } else { weightsFoward.push_back(Connecti...
JackBryce/Artificial-Intelligence
KeyGenerator.cpp
#include "KeyGenerator.h"; //This constructor generates the keypad. KeyGenerator::KeyGenerator() { for (int i = 0; i < 16; i++) { vector<int> row; for (int j = 0; i < 16; j++) { row.push_back(rand() % 16); } keypad.push_back(row); } for (int i = 0; i < 16; i++) { shiftKey.push_back(rand()...
JackBryce/Artificial-Intelligence
ConsoleApplication1.cpp
// ConsoleApplication1.cpp : main project file. #include "stdafx.h"; #include "Network.cpp"; #include <iostream>; using namespace std; class Core { public: Core(); private: vector<Network*> networks; int Key; }; Core::Core() { bool running = true; networks.push_back(new Network()); ...
LuaDist/aruco
utils/aruco_test.cpp
<gh_stars>1-10 /***************************************************************************************** Copyright 2011 <NAME>. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributio...
cBioLab/helloSealing
Enclave/Enclave.cpp
<gh_stars>0 #include "Enclave_t.h" #include <sgx_trts.h> #include <sgx_tseal.h> #include <sgx_attributes.h> #include <string.h> #define MRENCLAVE 0 #define MRSIGNER 1 int calc_sealed_len(int message_len) { return sgx_calc_sealed_data_size(0, message_len); } void do_sealing(uint8_t *message, int message_le...
cBioLab/helloSealing
App/App.cpp
<reponame>cBioLab/helloSealing #include <cstdio> #include <cstring> #include <iostream> #include <iomanip> #include <fstream> #include <sstream> #include <string> #include "Enclave_u.h" #include <sgx_urts.h> #include "error_print.h" #define MRENCLAVE 0 #define MRSIGNER 1 sgx_enclave_id_t global_eid = 0; /* OCALL...