text
stringlengths
59
71.4k
#include <bits/stdc++.h> using namespace std; long long s(0), p, k; int main() { cin >> k >> p; for (long long cz(1), i(0); i < k; ++i, ++cz) { string str = to_string(cz); string res(str); reverse(begin(str), end(str)); res += str; s += stoll(res) % p; } cout << s % p...
#include <bits/stdc++.h> using namespace std; const double PI = acos(-1); const int inf = 0x3fffffff; const int maxn = 200005; int n; unsigned long long m; struct P { int x, y; } p[maxn]; bool cmp(P a, P b) { if (a.x == b.x) return a.y < b.y; return a.x < b.x; } int main() { scanf(...
/** * 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 ll = long long; const int MV = 1e6; const int p10[] = {1, 10, 100, 1000, 10000, 100000}; int K, Q, F[6]; ll dp[MV]; ll val(int x) { ll f = 0; for (int i = 0; x; ++i, x /= 10) { int d = x % 10; if (d % 3 == 0) f += (ll)F[i] * d / 3; } return f; } ...
// ---------------------------------------------------------------------- // Copyright (c) 2015, The Regents of the University of California All // rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met:...
#include <bits/stdc++.h> using namespace std; map<int, int> mm; int mv[100000] = {0}; int bfs(int n, int m) { queue<int> mq; mq.push(n); mv[n] = 0; while (!mq.empty()) { int r = mq.front(); if (r == m) return mv[r]; mq.pop(); int x, y; x = r - 1; y = r * 2; ...
#include <bits/stdc++.h> using namespace std; int visit[210000]; int ans[210000]; queue<int> q; int a[210000]; int n; vector<int> g[210000]; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) scanf( %d , &a[i]); for (int i = 1; i <= n; i++) { if (a[i] & 1) { q.push(...
module original_gate (clk, ctrl, din, sel, dout); input clk; input [4:0] ctrl; input [1:0] din; input [0:0] sel; output reg [31:0] dout; always @(posedge clk) case (({(ctrl)*(sel)})+(0)) 0: dout[31:0] <= din; 1: dout[31:1] <= din; 2: dout[31:2] <= 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 la...
//Legal Notice: (C)2016 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 //simulation files), and any associated do...
#include <bits/stdc++.h> const int INF = 2147483647; const int MOD = 1000000007; const long long INF64 = 9223372036854775807; const long double EPS = 1e-7; using namespace std; vector<int> a; int getDist(int fr, int to) { int l = fr, r = to, mid = (a[to] + a[fr]) / 2; while (l < r - 1) { int...
#include <bits/stdc++.h> using namespace std; int n, A[5001], B[5001], S[5001], ma, man; int main() { cin >> n; for (int i = 1; i <= n; i++) cin >> A[i]; for (int i = 1; i <= n; i++) { for (int j = i; j <= n; j++) { S[A[j]]++; if (S[A[j]] > ma || (S[A[j]] == ma && A[j] < man)) { ...
// Accellera Standard V2.5 Open Verification Library (OVL). // Accellera Copyright (c) 2005-2010. All rights reserved. // Guarded parameter for num_cks < 1 (which is bad usage - see warning in top-level file) parameter NUM_CKS_1 = (num_cks > 0) ? (num_cks - 1) : 0; //---------------------------------------------...
/** * 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 MOD = 1e9 + 7; int n, S, L; int a[300005]; int dp[300005]; void solve() { deque<pair<int, int> > dqmin, dqmax, dqdp; int pos = 0; for (int i = 1; i <= n; i++) { if (i >= L) { while (dqdp.size() && dqdp.back().first >= dp[i - L...
#include <bits/stdc++.h> using namespace std; int main() { long long a, b, x, t = 1, y; cin >> a >> b; x = abs(a - b); if (x % 2 != 0) t = 0; x = (x / 2); y = (x * (x + 1)) / 2; y *= 2; if (!t) x++, y += x; cout << y << endl; return 0; }
#include <bits/stdc++.h> using namespace std; const long long maxn = 1e5 + 7; long long n, k, a; int32_t main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> n >> k; a = n / (2 * (k + 1)); cout << a << << a * k << << n - a * (k + 1); }
#include <bits/stdc++.h> using namespace std; const long double PI = 3.1415926535897932384626433832795; const long double EPS = 1e-11; pair<int, int> c1, c2, r1, r2; int ans = 0; long double dst(pair<int, int> a, pair<int, int> b) { return (a.first - b.first) * (a.first - b.first) + (a.second...
/* * 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; void scan(int &x) { bool neg = false; register int c; x = 0; c = getchar(); if (c == - ) { neg = true; c = getchar(); } for (; (c > 47 && c < 58); c = getchar()) x = (x << 1) + (x << 3) + c - 48; if (neg) x *= -1; } int m...
#include <bits/stdc++.h> using namespace std; const long long N = 2e3 + 3; long long n, mod = 1e9 + 7, dp[N][N][2]; long long f(long long idx, long long diff, long long stat) { long long &ret = dp[idx][diff][stat]; if (ret != -1) return ret; if (idx == n) { ret = 0; return ret; } ...
#include <bits/stdc++.h> using namespace std; bool cmp(long long a, long long b) { return (a > b); } long long ceil(const long long &a, const long long &b) { if (a % b == 0) return a / b; return a / b + 1; } long long mod = 1000000007; const long long N = 105; string s; long long n1; long long...
// (C) 2001-2011 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 simulation // files), and any associated doc...
#include <bits/stdc++.h> using namespace std; const int MOD = 1e9 + 7; const int N = 77; int n; char s[N]; vector<int> v, k, x; int dp[N][N][N][2]; int count(vector<int> &list, int from, int w) { int cnt = 0; for (int i = from; i < list.size(); i++) { if (list[i] < w) cnt++; } retu...
// Copyright 2020-2022 F4PGA 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 // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed...
#include <bits/stdc++.h> using namespace std; mt19937 mt_rand( chrono::high_resolution_clock::now().time_since_epoch().count()); const int INF = 2e9; const long long ML = 4e18; long long Pow(long long x, int p) { long long res = 1; while (p) { if (p & 1) res = (res * x) % 998244353; ...
#include <bits/stdc++.h> using namespace std; int main() { vector<int> b1, b2; int n; cin >> n; int a[n]; long long s1 = 0, s2 = 0; for (int i = 0; i < n; i++) { cin >> a[i]; if (a[i] > 0) { s1 += a[i]; b1.push_back(a[i]); } else { s2 -= a[i]; ...
////////////////////////////////////////////////////////////////////// //// //// //// can_register_asyn.v //// //// //// //// ...
#include <bits/stdc++.h> using namespace std; int main() { int t, g = 0; cin >> t; for (int i = 0; i < t; i++) { vector<int> p; int n, x; g = 0; cin >> n; if (n == 1) { cin >> x; cout << YES << endl; continue; } for (int l = 0; l < n; l...
/** * 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() { int n, m; cin >> n >> m; int k; cin >> k; int a[n][m]; for (int i = (0); i < (n); i++) { for (int j = (0); j < (m); j++) { cin >> a[i][j]; } } int ans = 0; int sum = 0, msum = 0, nans = 0, ones = 0, ts...
/** * 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...
//############################################################################# //# Function: Clock 'OR' gate # //############################################################################# //# Author: Andreas Olofsson # ...
// // Beeb816 Buffer board // module bufboard(); // Wires declared as supply* will default to wide routing // when parsed through netlister.py supply0 GND; supply1 VDD_5V; supply1 VDD_3V3; // Netlister.py doesn't yet support Verilog bus notation so all // busses have to be bit blasted. wire bbc_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...
/** * 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...
// DESCRIPTION: Verilator: Verilog Test module // // This file ONLY is placed into the Public Domain, for any use, // without warranty, 2003-2007 by Wilson Snyder. module t (/*AUTOARG*/ // Inputs clk ); input clk; integer cyc; initial cyc=1; reg [15:0] m_din; // OK reg [15:0] c_split_1, c_sp...
#include <bits/stdc++.h> using namespace std; const int maxn = 3e5 + 5; int a[maxn]; int n; int vis[maxn]; vector<int> ans; int main() { memset(vis, 0, sizeof(vis)); ans.clear(); scanf( %d , &n); for (int i = 1; i <= n; i++) { scanf( %d , &a[i]); } int cnt = 0; int ma = 0...
#include <bits/stdc++.h> using namespace std; const long long mod = 998244353; long long bin_pow(long long a, long long b) { if (b == 0) { return 1; } long long res = bin_pow(a, b / 2); res *= res; res %= mod; if (b % 2) { res *= a; res %= mod; } return res; } ...
/*+-------------------------------------------------------------------------- Copyright (c) 2015, Microsoft Corporation All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code ...
////////////////////////////////////////////////////////////////////////////// // // using `timescale, test rounding up to specified precision and // scaling to specified time unit // // run with // iverilog lrm_eg.v // vvp a.out // // (uncomment $display statements for help in debu...
#include <bits/stdc++.h> using namespace std; vector<long long> vis; vector<pair<long long, long long>> v; void dfs(long long x, long long y) { pair<long long, long long> p = v[x]; vis[x] = 1; if (x == y) return; for (long long i = 0; i < v.size(); i++) { if (vis[i]) continue; if (p....
#include <bits/stdc++.h> using namespace std; int ma[(300 + 10)][(300 + 10)], dp[(300 + 10)][(300 + 10)][(300 + 10) << 1]; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) cin >> ma[i][j]; for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) ...
////////////////////////////////////////////////////////////////////// //// //// //// OR1200's Data Cache top level wrapper //// //// //// //// This file is part of the OpenR...
module check (input unsigned [103:0] a, b, c); wire [103:0] int_AB; assign int_AB = a ^ b; always @(a, b, int_AB, c) begin #1; if (int_AB !== c) begin $display("ERROR"); $finish; end end endmodule module stimulus (output reg unsigned [103:0] A, B); parameter S = 2000; int unsigned i; ini...
/* * Milkymist SoC * Copyright (C) 2007, 2008, 2009, 2010 Sebastien Bourdeauducq * * 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, version 3 of the License. * * This program is distribut...
#include <bits/stdc++.h> using namespace std; int a[100010], diff[100010]; int main() { int i, j, k, n, neg1, neg2, pos, ans, mx = -1, df, d; cin >> n; for (i = 0; i < n; i++) cin >> a[i]; for (i = 0; i < n - 1; i++) { diff[i] = a[i] - a[i + 1]; } i = 0; while (i < n - 1) { ...
/* * 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...
/****************************************************************************** * License Agreement * * * * Copyright (c) 1991-2012 Altera Corporation, San Jose, California, USA. * ...
// ========== Copyright Header Begin ========================================== // // OpenSPARC T1 Processor File: ctu_clsp_dramgif.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 ...
#include <bits/stdc++.h> using namespace std; int main() { int k, a, b, v, ans; while (scanf( %d%d%d%d , &k, &a, &b, &v) != EOF) { ans = 0; while (a > 0) { if (b >= k - 1) { b -= (k - 1); a -= v * k; ans++; } else { b = b + 1; a -...
/** * 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 vector<int> dx = {-1, 0, 1, 0}; const vector<int> dy = {0, -1, 0, 1}; const int mod = (int)1e9 + 7; inline void add(int &x, int y) { x += y; if (x >= mod) x -= mod; } inline void sub(int &x, int y) { x -= y; if (x < 0) x += mod; } inl...
#include <bits/stdc++.h> inline int read() { char c; int x; for (c = getchar(); !isdigit(c); c = getchar()) ; for (x = 0; isdigit(c); c = getchar()) { x = x * 10 + c - 0 ; } return x; } int n; long long ans; std::priority_queue<int> que; int main() { n = read(); ...
`timescale 1ns/1ps module test(); reg clock, reset; sopc sopc( .clock(clock), .reset(reset) ); always #1 clock = ~clock; initial begin $dumpfile("dump.vcd"); $dumpvars; $dumpvars(0, sopc.cpu.register.storage[1]); $dumpvars(0, sopc.cpu.register.sto...
#include <bits/stdc++.h> using namespace std; const int N = 2005; int n; long long dp[N], a[N], ans, k, l[N], r[N]; int main() { scanf( %d%lld , &n, &k); for (int i = 1; i <= n; ++i) scanf( %lld%lld%lld , l + i, r + i, a + i); int flag = 0; for (int i = n; i >= 1; --i) { if (r[i] == l[i ...
#include <bits/stdc++.h> using namespace std; const int N = 105; int t, a[N], b[N], n, m; int st[N], cnta[N], cntb[N]; unordered_map<int, int> num; int main() { cin >> t; while (t--) { memset(st, 0, sizeof(st)); scanf( %d%d , &n, &m); for (int i = 1; i <= n; i++) scanf( %d , &a[i])...
#include <bits/stdc++.h> using namespace std; const int Maxn = ((int)1e5) + 100; int arr[Maxn], n; map<int, int> num, numL, numR; long long Solve(int a[]) { int l = 0, r = n - 1; while (a[l] == a[r] && l < r) ++l, --r; if (l >= r) return n * 1ll * (n + 1) / 2; for (int(i) = (l); (i) <= (r); ++...
// 16-Bit Carry Look Ahead adder, test design for Standard Cell/Custom Design // // Author: Ivan Castellanos // email: // VLSI Computer Architecture Research Group, // Oklahoma State University module cla16(sum, a, b); output [16:0] sum; input [15:0] a,b; wire [14:0] carry; wire [15:0] g, p; ...
#include <bits/stdc++.h> const int N = 1000010; const int inf = 0x3f3f3f3f; using namespace std; int n, m; int c[N]; int main() { scanf( %d%d , &n, &m); for (int i = 0; i < m; i++) { int a, b; scanf( %d%d , &a, &b); c[a]++; c[b]++; } if (n < 3) return puts( 0 ), 0; ...
#include <bits/stdc++.h> using namespace std; long long a, b, mod1 = 998244353, mod2 = 1000000007, mod3 = 1222827239; string s1, s2; struct ha { long long q1, q2, q3; bool operator==(const ha &aa) const { return (q1 == aa.q1 && q2 == aa.q2 && q3 == aa.q3); } } has[500001], gg[500001], base[5...
// // Copyright 2011 Ettus Research LLC // // 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 3 of the License, or // (at your option) any later version. // // This program is dis...
#include <bits/stdc++.h> using namespace std; const long long int mx = 70, Mod = 1e9 + 7, mxx = 350000; int n; int get(int x, int y, int z) { if (x > y) swap(x, y); if (x > z) swap(x, z); if (y > z) swap(y, z); return x * mx * mx + y * mx + z; } bool mark[mxx]; vector<int> e[mxx]; int dp...
#include <bits/stdc++.h> using namespace std; int n, m, d; int a[305]; long long t[305]; int dp[2][150005]; struct que { int i, num; que(int I, int NUM) { i = I, num = NUM; } friend bool operator<(struct que A, struct que B) { return A.num > B.num; } }; int compute() { int s0 = 0, s1 = 1...
#include <bits/stdc++.h> const double EPS = 1e-9; const int MAX_REPS = 2000; double bx, by, h, r; void solve(double x, double& y1, double& y2, double& y3) { double A1, A2, B1, B2, C1, C2, dy1, dy2, dx, dy; dx = -(x - bx); dy = ((h - r) - by); A1 = -dy; B1 = dx; C1 = A1 * x + B1 * (h - r)...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> s(n, 0); vector<int> m(n, 0); map<int, int> freq, freq2; string sher, mori; cin >> sher; cin >> mori; for (int i = 0; i < n; i++) { s[i] = sher[i] - 0 ; } for (int i = 0; i < n;...
module dALU ( input clk, input [15:0] a, input [15:0] b, input [7:0] op, input cf, output reg c_flag, output reg z_flag, output reg o_flag, output reg [15:0] acc, output reg [15:0] c); parameter xADD = 8'h1; parameter xADC = 8'h2; parameter xSUB = 8'h3; parameter xSUC = 8'h4; parameter xMUL8 = 8'h5; p...
/* * 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; double dist(double x1, double y1, double x2, double y2) { return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)); } bool have(long long x1, long long y1, long long x2, long long y2, long long x, long long y) { long long A = y1 - y2; long ...
#include <bits/stdc++.h> using namespace std; long long fast_pow(long long x, long long y, long long p); void solve() { long long a, b, c; cin >> a >> b >> c; long long ans = INT_MAX; long long ansA = -1, ansB = -1, ansC = -1; for (long long ta = 1; ta <= 2 * a; ta++) { for (long long tb...
#include <bits/stdc++.h> using namespace std; const int N = 100005; const double inf = 1e10; int n, m, q, Eu[N], Ev[N], all[N], vis[N]; vector<int> V; map<pair<int, int>, int> F, S; struct P { double x, y; } p[N]; inline P operator+(const P& a, const P& b) { return (P){a.x + b.x, a.y + b.y}; } i...
#include <bits/stdc++.h> using namespace std; int n; char ch[100]; int main() { scanf( %d , &n); int l = 0, r = 1e9; for (int i = 1; i <= min(29, n); i++) { int mid = (l + r) >> 1; printf( %d %d n , mid, 1); fflush(stdout); scanf( %s , ch); if (ch[0] == b ) l =...
/* * 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 cnt[30000]; int main() { int n; cin >> n; cnt[0] = 1; for (long long i = 0; i < n; ++i) { int a; cin >> a; for (long long q = 0; q < 30000 - a; ++q) { if (cnt[q] == 1) { cnt[q + a] = 1; } } } ...
module de4_pcie_top( input OSC_50_BANK2, input PCIE_PREST_n, input PCIE_REFCLK_p, input [3:0] PCIE_RX_p, output [3:0] PCIE_TX_p, output [7:0] LED, output [35:0] GPIO1_D ); wire [16:0] pcie_reconfig_fromgxb_0_data; wire [ 3:0] pcie_reconfig_togxb_data; ...
/* * 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 (C) 1991-2013 Altera Corporation //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 from any of the foregoing //(including device programming or simulation files), and any //associated documentatio...
module hdmimatrix ( input wire rst_n, //The pink reset button input wire [3:0] HDMI_RX0_tmds_p, input wire [3:0] HDMI_RX0_tmds_n, input wire [3:0] HDMI_RX1_tmds_p, input wire [3:0] HDMI_RX1_tmds_n, output wire [3:0] HDMI_TX0_tmds_p, output wire [3:0] HDMI_TX0_tmds_n, output wire [3:0] HDMI_TX1_...
/* * lzw - Simple, Logarithmic Left Shift Unit Test * Copyright (C) 2015 Sean Ryan Moore * * 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 3 of the License, or *...
`timescale 1ns/1ns // TX // Copyright 2010 University of Washington // License: http://creativecommons.org/licenses/by/3.0/ // 2008 Dan Yeager // TX module converts a binary serial data stream to // a time domain EPC Class 1 Gen 2 modulated waveform. // This is intended to connect to the tag modulator. // The clki...
#include <bits/stdc++.h> using namespace std; vector<long long> A; long long B[1000000] = {0}; bool cmp(long long x, long long y) { return x > y; } int main() { A.clear(); string S1, S2; cin >> S1; for (long long i = 0; i < S1.size(); i++) A.push_back(S1[i] - 0 ); cin >> S2; for (long...
/* * In The Name Of God * ======================================== * [] File Name : cache_t.v * * [] Creation Date : 04-03-2015 * * [] Last Modified : Tue, Mar 31, 2015 9:35:56 AM * * [] Created By : Parham Alvani () * ======================================= */ `timescale 1 ns/100 ps module cache_t; reg [0...
`timescale 1ns/10ps module hps_design_pll_0( // interface 'refclk' input wire refclk, // interface 'reset' input wire rst, // interface 'outclk0' output wire outclk_0, // interface 'outclk1' output wire outclk_1, // interface 'outclk2' output wire outclk_2, // interface 'locked' output wire locked );...
`default_nettype none //--------------------------------------------------------------------- //-- -- //-- Company: University of Bonn -- //-- Engineer: John Bieling -- //-- ...
#include <bits/stdc++.h> using namespace std; const double PI = acos(-1.0); const double eps = 1e-6; const int INF = 0x3f3f3f3f; const int MAXN = 2e3 + 10; int ans[MAXN * 3], vis[MAXN][MAXN]; int dp[MAXN][MAXN], n, kk, dir[4][2] = {1, 0, 0, 1}; char mp[MAXN][MAXN]; struct Node { int x, y, s; N...
// DESCRIPTION: Verilator: Verilog Test module // // This file ONLY is placed under the Creative Commons Public Domain, for // any use, without warranty, 2015 by Wilson Snyder. // SPDX-License-Identifier: CC0-1.0 module t (/*AUTOARG*/ // Inputs clk ); input clk; integer cyc; initial cyc=1; parameter...
/** * 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 nxt() { int res; scanf( %d , &res); return res; } bool is_perm(int *p, int n) { char used[n]; memset(used, 0, sizeof(used)); for (int i = 0; i < n; ++i) { used[p[i]] = 1; } for (int i = 0; i < n; ++i) { if (!used[i]) {...
#include <iostream> #include <cstdio> #include <cmath> #include <ctime> #include <cstdlib> #include <cassert> #include <vector> #include <list> #include <stack> #include <queue> #include <deque> #include <map> #include <set> #include <bitset> #include <string> #include <algorithm> #inclu...
/** * 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> const double PI = 3.1415926535897932384626433832795; using namespace std; long long mod = 1e9 + 7; bool visited[3005]; vector<vector<int> > G; bool cycle[3005]; int dp[3005], P[3005]; void dfs(int u, int v) { visited[u] = true; int sz = G[u].size(); for (int i = 0; i...
#include <bits/stdc++.h> using namespace std; long long size, seg1[2 * 200005], seg2[2 * 200005], a[200005], b[200005], seg3[2 * 200005], seg4[2 * 200005]; long long temp = 0; long long f(long long u, long long v) { return min(u, v); } long long query(long long l, long long r, long long u, long long v, ...
// *************************************************************************** // *************************************************************************** // Copyright 2011(c) Analog Devices, Inc. // // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, // are...
// Copyright 1986-2016 Xilinx, Inc. All Rights Reserved. // -------------------------------------------------------------------------------- // Tool Version: Vivado v.2016.4 (win64) Build Wed Dec 14 22:35:39 MST 2016 // Date : Mon May 29 21:36:04 2017 // Host : GILAMONSTER running 64-bit major release (...
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 15; int a[N], dp[N][2]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; for (int i = 1; i <= n; i += 1) { cin >> a[i]; } int ans = 0; for (int i = n; i >= 1; i -= 1) { dp[i][0] =...
/** * 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; using ll = long long; using uint = unsigned int; template <class T> using V = vector<T>; template <class T> using VV = vector<vector<T>>; template <class T, class U> void chmax(T& x, U y) { if (x < y) x = y; } template <class T, class U> void chm...
module motor_dummy_control #(parameter BASE_ADR = 10'h0, parameter CLOCK_FREQUENCY = 16000000, parameter MAX_SPEED = 100, parameter PWM_FREQ = 100, parameter SOFT_START_LENGTH = 5000, ...
#include <bits/stdc++.h> using namespace std; inline long long add(long long a, long long b) { return (a % 1000000007 + b % 1000000007) % 1000000007; } inline long long mul(long long a, long long b) { return (a % 1000000007 * b % 1000000007) % 1000000007; } long long pwr(long long a, long long b) { ...
// (C) 2001-2015 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 simulation // files), and any associated doc...