text stringlengths 59 71.4k |
|---|
// ========== Copyright Header Begin ==========================================
//
// OpenSPARC T1 Processor File: swrvr_dlib.v
// Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
//
// The above named program is free software; you can redistribute it and/or... |
module sineTable_tb ();
///////////////////////////////////////////////////////////////////////////
// PARAMETER AND SIGNAL DECLARATIONS
///////////////////////////////////////////////////////////////////////////
wire signed [17:0] sine;
reg signed [17:0] expectedSine;
reg [11:0] angle;
reg [11:0] angleD1;
reg clk;
... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; long long pw[20][120], p[120], V, B, fA, fB, fC, ans; int num[120], n, T, i, j; void dfs_B(int l, long long x) { if ((double)x * x > V) return; if (l == n + 1) { B = max(B, x); return; } for (int i = 0; i <= num[l]; ++i) dfs_B(l + 1, x * ... |
#include <bits/stdc++.h> using namespace std; long long t, n, m; long long pre[405][405], a[405][405], sum[405]; long long get(long long a, long long b, long long c) { return pre[b][c] - pre[a - 1][c]; } signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin... |
#include <bits/stdc++.h> using namespace std; const long long INF = 1e9; const long long MOD = 1e9 + 7; const long long maxn = 2e5 + 7; const long long maxm = 2e5 + 7; int n; bool isPrime(int a) { for (int i = 2; i <= sqrt(a); i++) { if (a % i == 0) { return 0; } } return 1... |
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2014 by Wilson Snyder.
`define checkh(gotv,expv) do if ((gotv) !== (expv)) begin $write("%%Error: %s:%0d: got='h%x exp='h%x\n", `__FILE__,`__LINE__, (gotv), (expv)); fail='1; end whi... |
#include <bits/stdc++.h> using namespace std; struct node { int a, b; node(int a = 0, int b = 1e9) : a(a), b(b) {} int get(int x) { return a * x + b; } }; struct Eins { vector<node> st; int n; Eins(int n) : n(n) { st.resize(n << 2 | 1); } void modify(int id, int l, int r, node v) { ... |
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c, d; cin >> a >> b >> c >> d; int m = max((3 * a) / 10, a - (a * c) / 250); int v = max((3 * b) / 10, b - (b * d) / 250); if (m > v) cout << Misha << endl; else if (v > m) cout << Vasya << endl; else ... |
#include <bits/stdc++.h> using namespace std; template <class T> inline T BMOD(T p, T e, T m) { T ret = 1; while (e) { if (e & 1) ret = (ret * p) % m; p = (p * p) % m; e >>= 1; } return (T)ret; } template <class T> inline T MODINV(T a, T m) { return BMOD(a, m - 2, m); ... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
// -*- verilog -*-
//
// USRP - Universal Software Radio Peripheral
//
// Copyright (C) 2008 Matt Ettus
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License... |
//
// usb 3.0 tx scrambling and elastic buffer padding
//
// Copyright (c) 2013 Marshall H.
// All rights reserved.
// This code is released under the terms of the simplified BSD license.
// See LICENSE.TXT for details.
//
module usb3_scramble (
input wire clock,
input wire local_clk,
input wire reset_n,
inp... |
/*
* Copyright 2020 The SkyWater PDK Authors
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
#include <bits/stdc++.h> using namespace std; int main() { int64_t a, b, x, y, z; scanf( %I64d%I64d%I64d%I64d%I64d , &a, &b, &x, &y, &z); int64_t addA, addB; if (2LL * x + y - a > 0) addA = 2LL * x + y - a; else int64_t addA = 0; if (3LL * z + y - b > 0) addB = 3LL * z + y ... |
#include <bits/stdc++.h> using namespace std; const int Maxn = 200005; int n, m; long long ans[Maxn]; struct Segment { long long l, r; int pos; } A[Maxn], land[Maxn]; bool cmp(const Segment &a, const Segment &b) { return a.l < b.l || a.l == b.l && a.r < b.r; } struct node { int pos; ... |
#include <bits/stdc++.h> using namespace std; int n, v[100002], nr; int main() { cin >> n; for (int i = 1; i <= n; i++) { cin >> v[i]; } sort(v + 1, v + n + 1); for (int i = 1; i <= n - 2; i++) { if (v[i] + v[i + 1] > v[i + 2]) nr++; } if (nr == 0) cout << NO n ; ... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; const int MN = 52; const long long mod = 1e9 + 7; int N; long long dp[2][MN][MN][MN][MN]; vector<int> d; int main() { ios::sync_with_stdio(0); cin.tie(0); cin >> N; d.resize(N); for (int i = 0; i < N; i++) { cin >> d[i]; } int... |
#include <bits/stdc++.h> using namespace std; template <typename T> T POW(T b, T p) { T r = 1; while (p) { if (p & 1) r = (r * b); b = (b * b); p >>= 1; } return r; } template <typename T> T BigMod(T b, T p, T m) { T r = 1; while (p) { if (p & 1) r = (r * b) %... |
#include <bits/stdc++.h> using namespace std; vector<int> tree[100005]; int bad[100005]; vector<int> result; int SubTree[100005]; int dfs(int v, int pv) { SubTree[v] = (int)(bad[v] == 1); for (auto u : tree[v]) { if (u == pv) continue; SubTree[v] += dfs(u, v); } if (SubTree[v] ==... |
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using ull = unsigned long long; using db = double; using str = string; using pi = pair<int, int>; using pl = pair<ll, ll>; using pd = pair<db, db>; using vi = vector<int>; using vb = vector<bool>; using v... |
// (C) 1992-2012 Altera Corporation. All rights reserved.
// Your use of Altera Corporation's design tools, logic functions and other
// software and tools, and its AMPP partner logic functions, and any output
// files any of the foregoing (including device programming or simulati... |
#include <bits/stdc++.h> using namespace std; const long long INF = 1000 * 1000 * 1000; struct rib { long long b, u, c, f; size_t back; }; void add_rib(vector<vector<rib> >& g, long long a, long long b, long long u, long long c) { rib r1 = {b, u, c, 0, g[b].size()}; rib r2 = {a,... |
#include <bits/stdc++.h> using namespace std; template <typename T, typename C> class mcmf { public: static constexpr T eps = (T)1e-9; struct edge { int from; int to; T c; T f; C cost; }; vector<vector<int> > g; vector<edge> edges; vector<C> d; vector<i... |
#include <bits/stdc++.h> using namespace std; const double eps = 1e-6; const int inf = 0x3f3f3f3f; const long long int INF = 1e15; const int mod = 1e9 + 7; const int maxn = 2e3 + 5; int cas = 1; int sum[maxn]; vector<int> v; map<int, int> mp; void solve() { int n, k; while (~scanf( %d%d , ... |
/*
* Copyright 2020 The SkyWater PDK Authors
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
#include <bits/stdc++.h> int DEBUG = 1; using namespace std; const int N = 100 * 1000 + 5; const long long INF = 1e17; long long gcd(long long a, long long b) { if (b == 0) return a; else return gcd(b, a % b); } long long n, k; long long a, b; long long x; long long MIN = +INF; ... |
// ========== Copyright Header Begin ==========================================
//
// OpenSPARC T1 Processor File: cluster_header_sync.v
// Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
//
// The above named program is free software; you can redistribute ... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; long long a, b; vector<long long> A, B, C; int main() { scanf( %lld %lld , &a, &b); for (long long i = 1; i <= sqrt(a); i++) if (a % i == 0) A.push_back(i); for (long long i = 1; i <= sqrt(b); i++) if (b % i == 0) B.push_back(i); for (lon... |
#include <bits/stdc++.h> const int MAX_N = 20; int n, k, t; int e[MAX_N + 1][MAX_N + 1]; int choosen[MAX_N + 1]; int mid; int cnt; void dfs(int x, int now_cost_sum) { if (x > n) { cnt++; return; } dfs(x + 1, now_cost_sum); for (int y = 1; y <= n && cnt < t; y++) { if (!ch... |
/*
* Copyright 2020 The SkyWater PDK Authors
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
#include <bits/stdc++.h> using namespace std; int tree[(1 << 20)]; void add(int x, int val) { for (int i = x; i < (1 << 20); i = ((i) | (i + 1))) tree[i] += val; } int sum(int x) { int ans = 0; for (int i = x; i > 0; i = ((i) & (i - 1))) ans += tree[i - 1]; return ans; } int N, Q; map<in... |
#include <bits/stdc++.h> using namespace std; bool cmp(pair<long long int, long long int> a, pair<long long int, long long int> b) { return a.first < b.first; } bool check(int a) { int sum = 0; while (a > 0) { sum += (a % 10); a /= 10; } if (sum == 10) return true; ... |
////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2014, University of British Columbia (UBC); All rights reserved. //
// //
// Redistribution and use in source and binary forms, w... |
#include <bits/stdc++.h> using namespace std; long long a[150500]; int main() { ios_base::sync_with_stdio(false); int t; cin >> t; vector<long long> ans; for (int f = 0; f < t; f++) { long long n, m; cin >> n >> m; vector<long long> l; l.push_back(m % 10); for (lo... |
#include <bits/stdc++.h> using namespace std; long long int binpowmod(long long int a, long long int b, long long int m) { a %= m; long long int res = 1; while (b > 0) { if (b & 1) res = res * a % m; a = a * a % m; b >>= 1; } return res; } unsigned long long modInverse(unsi... |
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; if (k > n) { cout << -1 ; return 0; } if (n == 1) { cout << a ; return 0; } if (n > 1 && k == 1) { cout << -1 ; return 0; } string str; char c1 = a , c2... |
#include <bits/stdc++.h> using namespace std; inline long long read() { long long num = 0, neg = 1; char c = getchar(); while (!isdigit(c)) { if (c == - ) neg = -1; c = getchar(); } while (isdigit(c)) { num = (num << 3) + (num << 1) + c - 0 ; c = getchar(); } re... |
#include <bits/stdc++.h> using namespace std; string st[30] = { zero , one , two , three , four , five , six , seven , eight , nine , ten , eleven , twelve , thirteen , fourteen , fifteen , sixteen , seve... |
// Copyright 1986-2017 Xilinx, Inc. All Rights Reserved.
// --------------------------------------------------------------------------------
// Tool Version: Vivado v.2017.2 (win64) Build Thu Jun 15 18:39:09 MDT 2017
// Date : Tue Sep 19 09:39:14 2017
// Host : DarkCube running 64-bit major release ... |
// $Header: /devl/xcs/repo/env/Databases/CAEInterfaces/verunilibs/data/unisims/MUXF8.v,v 1.11 2007/08/23 23:00:26 yanx Exp $
///////////////////////////////////////////////////////////////////////////////
// Copyright (c) 1995/2009 Xilinx, Inc.
// All Right Reserved.
////////////////////////////////////////////////////... |
/*
Copyright 2018 Nuclei System Technology, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except i... |
#include <bits/stdc++.h> using namespace std; char A[1005][1005]; int P[1000005], MinX[1000005], MinY[1000005], MaxX[1000005], MaxY[1000005], M[1005][1005]; int xr[] = {-1, 1, 0, 0}; int xc[] = {0, 0, -1, 1}; int n, m; void dfs(int x, int y, int i) { if ((x < 0) || (x >= n) || (y < 0) || (y >= m... |
#include <bits/stdc++.h> using namespace std; struct vect { int h, p1, p2; }; struct point { int p1, p2; }; int n, mod, nr, t; long long solf; int viz[200005]; point poz[200005]; map<int, vect> h; vector<int> aib[200005]; void precalc() { int i, j, x; for (i = 0; i < n; i++) ... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer: chrisky hu
//
// Create Date: 19:25:03 10/15/2015
// Design Name:
// Module Name: dht11_decode
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Depen... |
Require Import Arith.
Require Import List.
Require Import Setoid.
Require Import Program.
Set Transparent Obligations.
(** {1 Type Algebra} *)
(** To simplify the technicalities, we focus on first-order types
whose syntax is:
τ := ι ∣ ι → τ
They correspond to arities, i.e. natural numbers. Thus, we can
... |
#include <bits/stdc++.h> using namespace std; int main() { int n, a, b; cin >> n >> a >> b; int ans = a; if (b < 0) { int t = abs(b); while (t--) { --a; if (a == 0) a = n; } } else { while (b--) { ++a; if (a == n + 1) a = 1; } } ... |
#include <bits/stdc++.h> using namespace std; int arr[1000000]; int main() { int n, x, counter = 0; cin >> n >> x; for (int i = 0; i < n; i++) scanf( %d , &arr[i]); sort(arr, arr + n); while (arr[((n + 1) / 2 - 1)] != x) { arr[n++] = x; sort(arr, arr + n); counter++; } ... |
#include <bits/stdc++.h> using namespace std; template <typename T> istream& operator>>(istream& is, vector<T>& v) { for (auto& i : v) is >> i; return is; } template <typename T> ostream& operator<<(ostream& os, vector<T>& v) { for (auto& i : v) os << i << ; return os; } template <typ... |
#include <bits/stdc++.h> using namespace std; template <class T1> void deb(T1 e) { cout << e << endl; } template <class T1, class T2> void deb(T1 e1, T2 e2) { cout << e1 << << e2 << endl; } template <class T1, class T2, class T3> void deb(T1 e1, T2 e2, T3 e3) { cout << e1 << << e2 ... |
#include <bits/stdc++.h> using namespace std; long double pi = 3.14159265358979323; int main() { int n, m, k; scanf( %d%d%d , &n, &m, &k); vector<int> a(100000, 0); vector<int> ans; for (int i = 0; i < (int)n + m; ++i) { if (a[i] < k) { for (int j = 0; j < (int)k - a[i]; ++j) ans... |
#include <bits/stdc++.h> using namespace std; inline int read() { int x = 0, f = 1; char ch = getchar(); while (ch < 0 || ch > 9 ) { if (ch == - ) f = -1; ch = getchar(); } while (ch >= 0 && ch <= 9 ) { x = (x << 1) + (x << 3) + (ch ^ 48); ch = getchar(); } ... |
#include <bits/stdc++.h> using namespace std; int main() { int n, x = 0, y = 0, x0 = 0, y0 = 0, k = 1, ans = 1; string s; cin >> n >> s; for (int i = 0; i < n; i++) { if (s[i] == L ) x--; if (s[i] == R ) x++; if (s[i] == D ) y--; if (s[i] == U ) y++; if (abs(x - x0)... |
#include <bits/stdc++.h> using namespace std; vector<long long> X; map<long long, pair<int, long long> > M; pair<int, long long> go(long long x) { if (x <= 1) return {x, x}; if (M.find(x) != M.end()) return M[x]; int i = upper_bound(X.begin(), X.end(), x) - X.begin() - 1; int p1, p2; long lo... |
#include <bits/stdc++.h> using namespace std; int n, a, b, d[500], s; int main() { scanf( %d , &n); for (int i = 1; i <= 2 * n; i++) scanf( %d , &d[i]); for (int i = 1; i <= 2 * n; i++) for (int j = 1; j <= 2 * n; j++) if (d[i] == d[i + (2 * j - 1)]) s++; printf( %d , s); scanf( ... |
// DEFINES
`define BITS 32 // Bit width of the operands
module fir(clock,
reset,
x,
k0,
k1,
k2,
k3,
out
);
// SIGNAL DECLARATIONS
input clock;
input reset;
input [`BITS-1:0] x;
input [`BITS-1:0] k0;
input [`BITS-1:0] k1;
input [`BITS-1:0] k2;
input [`BITS-1:0] k3;
output [`BITS-1:0] out;... |
#include <bits/stdc++.h> using namespace std; using LL = long long; using LD = long double; const int MX = 1 << 18 | 3; int N, a[MX], Q; LL sum; int main() { ios::sync_with_stdio(0); cout << fixed << setprecision(10); cin >> N >> Q; for (int i = 0; i < (1 << N); i++) cin >> a[i], sum += a[... |
`timescale 1ns/1ns
// Fast Multisource Pulse Registration System
// Module:
// Flexible, 3-fifo multidirectional FX2 USB-2 interface
// (c) Sergey V. Polyakov 2006-forever
module fx2_bidir(
fx2_clk, fx2_fd, fx2_slrd, fx2_slwr, fx2_flags,
fx2_sloe, fx2_wu2, fx2_fifoadr, fx2_pktend,
sample, sample_rdy, sample_ack,
... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); int main() { ios::sync_with_stdio(false); cin.tie(0); int t; cin >> t; while (t--) { int n; cin >> n; string s; cin >> s; string a(n, 0 ); str... |
#include <bits/stdc++.h> using namespace std; char s[100005]; char b[100005]; int main() { cin >> s; int cnt = 0; char x = a ; for (int i = strlen(s); i >= 0; --i) { if (s[i] >= x) { x = s[i]; b[cnt++] = x; } } while (cnt--) { printf( %c , b[cnt]); ... |
#include <bits/stdc++.h> using namespace std; int cnt[1000000 + 10]; int a[1000000 + 10]; int main() { int n, m; cin >> n >> m; for (int i = 0; i < n; i++) { cin >> a[i]; if (a[i] <= m) { cnt[a[i]]++; } } for (int i = m; i >= 1; i--) { for (int j = i; (j += i)... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; int main() { string p; getline(cin, p); bool f = 0; for (int i = 0; i < p.size(); i++) { if (p[i] >= a && p[i] <= z ) { if (p[i] == a || p[i] == i || p[i] == u || p[i] == e || p[i] == o || p[i] == y ) f =... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> #pragma GCC optimize( Ofast ) using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(NULL); int n; cin >> n; vector<int> a(n); for (int i = 0; i < n; ++i) { cin >> a[i]; } set<int> vals; set<int> cur; for (int i = 0; i < n; ++i... |
#include <bits/stdc++.h> using namespace std; double dp[15][15]; int n, t, i, j, ans = 0; void work() { double t; dp[1][1] += 1; for (i = 1; i <= n; i++) { for (j = 1; j <= i; j++) { if (dp[i][j] > 1) { t = dp[i][j] - 1; dp[i][j] = 1; dp[i + 1][j] += t / 2... |
`timescale 1ns / 1ps
module lights(
input clk,
input rx,
output tx,
output [2*12-1:0] leds
);
wire clk_uart;
uart_clk uart_clk_i(.CLKIN_IN(clk),
.CLKFX_OUT(clk_uart),
.CLKIN_IBUFG_OUT(),
.CLK0_OUT());
wire r... |
#include <bits/stdc++.h> using namespace std; long long mod = 1000000009; long long A[200000]; long long root(long long a) { long long i = a; if (A[i] != i) { A[i] = root(A[i]); } return A[a]; } void unio(long long a, long long b) { long long ra = root(a); long long rb = root(b... |
#include <bits/stdc++.h> using namespace std; const int nmax = 100005; int n, cnt, one, two1, two2, p[nmax]; vector<int> v[nmax]; bitset<nmax> viz; int main() { cin.sync_with_stdio(false); cin >> n; for (int i = 1; i <= n; i++) cin >> p[i]; for (int i = 1; i <= n; i++) if (!viz[i]) { ... |
#include <bits/stdc++.h> const double eps = 1e-15; const int N = 10000 + 10; struct node { double x, y, z; node() {} node(double _x, double _y, double _z) { x = _x; y = _y; z = _z; } }; node a[N], st; int n; double Time[N], len[N], v1, v2; double sqr(double x) { return ... |
#include <bits/stdc++.h> using namespace std; const int maxn = 5e2; pair<pair<int, int>, bool> pr[maxn][maxn][2]; queue<pair<pair<int, int>, bool> > q; vector<int> neighbor[maxn]; void bfs(int s, int t) { for (int i = 0; i < maxn; i++) for (int j = 0; j < maxn; j++) for (int k = 0; k < 2; ... |
#include <bits/stdc++.h> using namespace std; const int size = 300000001; bitset<size> gut; int main() { int l, r; cin >> l >> r; gut.set(); for (int i = 3; i * i <= r; i += 2) { if (gut[i]) for (int j = i * i; j <= r; j += (i << 1)) { gut[j] = false; } } ... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 30.06.2017 15:34:25
// Design Name:
// Module Name: t_if
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision... |
/*
* Copyright (C)2014-2015 AQUAXIS TECHNOLOGY.
* Don't remove this header.
* When you use this source, there is a need to inherit this header.
*
* This software is released under the MIT License.
* http://opensource.org/licenses/mit-license.php
*
* For further information please contact.
* URI: http://ww... |
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; long long x, q = k - 1, flag, a[k], i, j; for (i = 0; i < n; i++) { cin >> x; if (!i) a[q--] = x; else { flag = 0; for (j = k - 1; j > q; j--) { if (a[j] == x) { ... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company: franp.com
// Engineer: Fran Pregernik <>
//
// Create Date: 12/29/2016 07:26:09 PM
// Design Name:
// Module Name: clk_divider
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// D... |
`timescale 1 ns/1 ps
module someTwoPortVendorMem_4096_32_8 (QA,
CLKA,
CENA,
WENA,
AA,
DA,
OENA,
QB,
CLKB,
CENB,
WENB,
AB,
DB,
OENB);
output [31:0] QA;... |
#include <bits/stdc++.h> using namespace std; void solve() { long long n, m; cin >> n >> m; string a, b; cin >> a >> b; reverse(a.begin(), a.end()); reverse(b.begin(), b.end()); vector<long long> v(n, 0), u(m, 0); for (long long i = 0; i < n; i++) { if (a[i] == 1 ) { v... |
#include <bits/stdc++.h> using namespace std; int n, ar[3100], cur; vector<int> v; bool valid, used[10000]; pair<int, string> tab[3100]; int main() { cin >> n; for (int i = 0; i < n; i++) { cin >> tab[i].second >> tab[i].first; } sort(tab, tab + n); valid = true; for (int i = 0... |
// Copyright 1986-2016 Xilinx, Inc. All Rights Reserved.
// --------------------------------------------------------------------------------
// Tool Version: Vivado v.2016.4 (win64) Build Mon Jan 23 19:11:23 MST 2017
// Date : Tue Apr 18 23:15:18 2017
// Host : DESKTOP-I9J3TQJ running 64-bit major re... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
/*
* VGA top level file
* Copyright (C) 2010 Zeus Gomez Marmolejo <>
*
* This file is part of the Zet processor. This processor is free
* hardware; you can redistribute it and/or modify it under the terms of
* the GNU General Public License as published by the Free Software
* Foundation; either version 3,... |
/*
* Copyright 2020 The SkyWater PDK Authors
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
/*
* Copyright 2020 The SkyWater PDK Authors
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
#include <bits/stdc++.h> using namespace std; const int N = (int)1e6 + 7; const long long INF = (long long)1e9 + 7; char st[N]; map<long long, long long> s[200]; long long c[N]; int main() { int n; long long t, ans = 0, x = 0; for (char i = a ; i <= z ; i++) cin >> c[i]; gets(st); ge... |
#include <bits/stdc++.h> using namespace std; int x[4], y[4], a[4], b[4]; vector<int> v[2]; void yes() { puts( YES ); exit(0); } void add(bool is, int at, int to) { if (is) v[is].push_back(y[at]), v[is].push_back(y[to]); else v[is].push_back(x[at]), v[is].push_back(x[to]); } ... |
#include <bits/stdc++.h> using namespace std; const int dx[4] = {0, 0, -1, 1}; const int dy[4] = {-1, 1, 0, 0}; int main() { int i, j, k, n; long int mx, mn, sm = 0; int t; cin >> t; while (t--) { int f = 0; cin >> n; vector<pair<int, int>> v(n); for (i = 0; i < n; i+... |
/*
* Copyright 2020 The SkyWater PDK Authors
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
#include <bits/stdc++.h> using namespace std; const int maxn = 2e5 + 5; const int Mod = 1000000007; const int INF = 0x3f3f3f3f; const long long LL_INF = 0x3f3f3f3f3f3f3f3f; const double e = exp(1); const double PI = acos(-1); const double ERR = 1e-10; int head[maxn], cnt, n, tot, mstnum; int dfn[max... |
#include <bits/stdc++.h> using namespace std; template <class T> ostream& operator<<(ostream& os, vector<T> V) { os << [ ; for (auto v : V) os << v << ; return os << ] ; } template <class T> ostream& operator<<(ostream& os, set<T> S) { os << { ; for (auto s : S) os << s << ; ... |
#include <bits/stdc++.h> using namespace std; const int MXN = 2e5 + 5; int x[MXN]; int y[MXN]; int d[MXN]; int xr[MXN]; int par[MXN]; int siz[MXN]; int sol[MXN]; int type[MXN]; int basis[30]; stack<pair<int *, int>> stk; vector<array<int, 3>> st[2 << 18]; void change(int &ref, int val) { ... |
#include <bits/stdc++.h> using namespace std; int u[1005], v[1005], fa[1005], n, m, k; bool zt[1005][1005]; int getv(int x) { if (x == fa[x]) return x; fa[x] = getv(fa[x]); return fa[x]; } void merge(int x, int y) { x = getv(x); y = getv(y); if (x == y) return; if (x < y) { ... |
// bsg_clk_gen_osc
//
// new settings are delivered via bsg_tag_i
//
// the clock is designed to be atomically updated
// between any of its values without glitching.
//
// the order of components is:
//
// ADT, CDT, FDT --> feedback (and buffer to outside world)
//
// All three stages invert their outputs.
//
// All ... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; const int N = 5e3 + 7; long long M = 1e9 + 7; long long dp[N]; long long g[N][30]; int n; vector<int> a; int ch[N][N]; int main() { ch[0][0] = 1; cin >> n; for (int i = 1; i <= n; i++) { for (int j = 0; j <= i; j++) { if (j == 0) ... |
/*****************************************************************************
* *
* Module: Altera_UP_Audio_Bit_Counter *
* Description: *
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.