text stringlengths 59 71.4k |
|---|
`define SMV
`include "ovl_always_on_edge_wrapped.v"
`include "ovl_ported/ovl_always_on_edge.v"
/*
* File: ovl_always_on_edge_wrapped_tb.v
* Test bench for ovl_always_on_edge_wrapped.v
* Includes assertions for verification
* Created: 2013-10-10
*
*
*/
module main();
// Inputs to DUT
reg clk;
reg r... |
/**
* 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... |
//-----------------------------------------------------------------------------
//
// (c) Copyright 2012-2012 Xilinx, Inc. All rights reserved.
//
// This file contains confidential and proprietary information
// of Xilinx, Inc. and is protected under U.S. and
// international copyright and other intellectual property
... |
// Check that implicit cast works for expressions in assignment patterns. The
// result should be the same as assigning the expression to a variable with the
// same type as the base type of the assignment pattern target.
module test;
int dv[];
real dr[];
int tmpv;
real tmpr;
bit failed = 1'b0;
`define... |
/*
Copyright (c) 2014-2018 Alex Forencich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distri... |
#include <bits/stdc++.h> using namespace std; int n, a[2 * 2005], pos[2 * 2005], dp[2 * 2005][2 * 2005]; int call(int p, int len) { if (p > 2 * n) return len == n; if (len < n) return 0; int &ret = dp[p][len]; if (~ret) return ret; ret = call(p + pos[p], len); ret += call(p + pos[p], len -... |
// megafunction wizard: %ROM: 1-PORT%
// GENERATION: STANDARD
// VERSION: WM1.0
// MODULE: altsyncram
// ============================================================
// File Name: ninja1.v
// Megafunction Name(s):
// altsyncram
//
// Simulation Library Files(s):
// altera_mf
// =================================... |
#include <bits/stdc++.h> using namespace std; int n, a[22][1 << 18], b[22][1 << 18], c[1 << 18], ans[1 << 18]; int M1, M2, M3, M4, N1, N2; int add(int x, int y) { return (x + y) & M1; } int mult(int x, int y) { int z = 0; int xx = x & N1; xx |= xx << 1; z = xx & y; xx = x & N2; xx |= x... |
#include <bits/stdc++.h> using namespace std; const int MAXN = 112345; long long l[MAXN], r[MAXN]; int main() { int n; cin >> n; for (int i = 0; i < n; ++i) scanf( %lld %lld , l + i, r + i); sort(l, l + n); sort(r, r + n); long long ans = n; for (int i = 0; i < n; ++i) ans += max(l[i... |
#include <bits/stdc++.h> using namespace std; int n, K; int CtoI(int x) { if (x == R ) return 1; if (x == Y ) return 2; if (x == B ) return 3; if (x == W ) return 0; } int ItoC(int x) { if (x == 1) return R ; if (x == 2) return Y ; if (x == 3) return B ; if (x == 0) retu... |
#include <bits/stdc++.h> using namespace std; const long long mod = 1e9 + 7; template <class T> void out(T x) { if (x < 0) { putchar( - ); x = -x; } if (x > 9) out(x / 10); putchar(x % 10 + 0 ); } long long dp[2005]; struct node { int x, y; } a[2005]; bool cmp(node a, ... |
// -------------------------------------------------------------
//
// File Name: hdl_prj\hdlsrc\controllerPeripheralHdlAdi\controllerHdl\controllerHdl_Phase_Voltages_To_Compare_Values.v
// Created: 2014-09-08 14:12:04
//
// Generated by MATLAB 8.2 and HDL Coder 3.3
//
// --------------------------------------------... |
// 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 : Sat Sep 23 13:26:00 2017
// Host : DarkCube running 64-bit major release ... |
`timescale 1ns / 1ps
/*
* Simple Brainfuck CPU in Verilog.
* Copyright (C) 2011 Sergey Gridasov <>
*
* 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
*... |
/**
* 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... |
// Accellera Standard V2.5 Open Verification Library (OVL).
// Accellera Copyright (c) 2005-2010. All rights reserved.
`include "std_ovl_defines.h"
`module ovl_no_underflow (clock, reset, enable, test_expr, fire);
parameter severity_level = `OVL_SEVERITY_DEFAULT;
parameter width = 1;
parameter min ... |
#include <bits/stdc++.h> #pragma GCC optimize( O3 ) using namespace std; using ll = long long; using pii = pair<int, int>; using vi = vector<int>; using ld = long double; struct Node { vi to; int lk; ll w; Node() : to(14), lk(0), w(0) {} }; vector<Node> au(1); int sz = 1; void add(... |
//-----------------------------------------------------
// Design Name : Test Bench
// File Name : TestBench.v
// Function : Test bench design
// Coder : hydai
//-----------------------------------------------------
module TestBench;
reg in;
reg clk, rst_n;
wire out;
DesignName DesignInstance(
out,
in,
... |
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int a1, a2, b1, b2; cin >> a1 >> a2; cin >> b1 >> b2; if ((a2 == b2 && (a1 + b1 == a2)) || (a1 == b1 && (a2 + b2 == a1)) || (a2 == b1 && (a1 + b2 == a2)) || (a1 == b2 && (a2 + b1 =... |
/**
* 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 la... |
#include <bits/stdc++.h> const double PI = acos(-1.0); using namespace std; const int MAXN = 200117, MAXM = 1200117, C = 5, MAXX = 1000000120; int n, k, a[MAXN], b, c, m, p[MAXM]; long long ans, s[C]; priority_queue<long long> q[C]; inline void add(int x) { int rx = ((x % C) + C) % C; for (int i =... |
#include <bits/stdc++.h> using namespace std; const long long INF = 1e18; void self_max(long long& a, const long long& b) { a = max(a, b); } void self_min(long long& a, const long long& b) { a = min(a, b); } inline void preprocessing() {} inline void solve() { long long n; cin >> n; if (n == 1) ... |
#include <bits/stdc++.h> using namespace std; int main() { cout << INTERCAL << n ; return 0; } |
#include <bits/stdc++.h> using namespace std; inline int gi() { int x; scanf( %d , &x); return x; } struct Segment_Tree { int dep, f, tag; } t[200005 << 2]; struct Qry { int x, tm, id; } q[200005]; struct _Edge { int to, next; } Edge[200005 << 1]; int head[200005], CNT; int... |
#include <bits/stdc++.h> using namespace std; int main() { int n; set<int> keyboards; scanf( %d , &n); for (int i = 0; i < n; i++) { int a; scanf( %d , &a); keyboards.insert(a); } int prev = 0; int result = 0; for (auto keyboard : keyboards) { if (prev != 0) r... |
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n, m, k; cin >> n >> m >> k; vector<int> val(n); for (int i = 0; i < n; i++) { cin >> val[i]; } if (m == 1) { cout << max(val[0], val[n - 1]) << endl; ... |
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; const int maxn = 1e4 + 5; class Matrix { public: long long a[3][3]; int n; void Init(int key) { memset(a, 0, sizeof a); if (key) for (int i = 0; i < n; i++) a[i][i] = 1; } Matrix operator*(const Mat... |
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n, m; cin >> n >> m; string s; cin >> s; vector<int> v(m); for (int i = 0; i < m; i++) { cin >> v[i]; } sort(v.begin(), v.end()); vector<int> ans(26... |
#include <bits/stdc++.h> using namespace std; int main() { int n, sum = 0, i; cin >> n; string s; cin >> s; int k = 1; for (i = 0; i < n; i++) { if (s[i] == 1 && k == 1) { sum++; } else if (s[i] == 0 && k == 1) { sum++; k = 0; } } cout <<... |
//*******************************************************************************************************************************************************/
// Module Name: reg_array_single
// Module Type: Synchronous Single Port Memory Array
// Author: Shreyas Vinod
// Purpose: Random Access Memory (RAM) for Neptune... |
#include <bits/stdc++.h> using namespace std; int a[100005]; int main() { int n, i; long long sum = 0, x = 0; cin >> n; for (i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } sort(a, a + n); for (i = 0; i < (n / 2); i++) { x += a[i]; } cout << x * x + (sum - x)... |
/*
* 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) All rights reserved
* SiLab, Institute of Physics, University of Bonn
* ------------------------------------------------------------
*/
`timescale 1ps/1ps
`default_nettype none
module pulse_gen640_core
#(
parameter ABUSWIDTH =... |
#include <bits/stdc++.h> using namespace std; mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count()); mt19937 rnf(2106); const int N = 200005, INF = 1000000009; struct ban { int x, y; }; bool operator<(const ban& a, const ban& b) { return make_pair(a.x, a.y) < make_pair(b.x, b.y); }... |
/**
* 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 la... |
#include <bits/stdc++.h> using namespace std; const int maxn = 20000; struct node { int flow; int ff[5]; int ru; } mat[maxn]; int n, m; int kk[500]; int now; int getup(int id) { int ret = -1; int k = id - m; while (k >= 1) { if (mat[k].flow != -1) { ret = k; ... |
#include <bits/stdc++.h> char str[260][260]; int main(void) { int t, n, m; scanf( %d , &t); while (t--) { int ans = 0; scanf( %d%d , &n, &m); getchar(); for (int i = 0; i < n; i++) gets(str[i]); for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { i... |
#include <bits/stdc++.h> using namespace std; const int N = 3e5 + 5; long long fac[N], infac[N]; int n, m; long long poww(long long b, long long p) { if (p == 0) return 1; if (p & 1) return (b * poww(b, p - 1)) % m; return poww((b * b) % m, p / 2); } long long npk(int n, int k) { return (fac[n... |
#include <bits/stdc++.h> using namespace std; struct edge { int u, v; long long c; bool operator<(const edge& other) const { return c < other.c; } }; vector<int> parent; vector<int> size; int get(int v) { if (parent[v] == v) { return v; } return parent[v] = get(parent[v]); } ... |
#include <bits/stdc++.h> using namespace std; long long solve(vector<long long> arr, int index, int currIndex) { if (currIndex == index) { return 1; } else { return 1 + solve(arr, index, arr[currIndex] - 1); } } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); lo... |
#include <bits/stdc++.h> using namespace std; vector<long long> adj[100001]; long long vis[100001] = {0}; long long n; long long nodecolor[100001]; long long treecolor[100001]; long long cc[100001]; map<long long, long long> colorcnt; long long dfs(long long root, long long col) { long long cnt = ... |
//Reg_access每隔0.1s,完整读一次四个电口是否link,并把link状态给port_link输出。其中,clk为12.5MHZ。
//功能描述:Reg_access模块把reg_enb置为高,reg_op[1:0] 置为10,phy_addr[4:0]
//置为00000,reg_addr[4:0] 置为00001,
//说明为从phy里面读1号寄存器里面的0号端口的link状态信息,并把信息给Port_link[3:0]。读完之后reg_enb置为低。
module reg_access (
input clk,
input reset,
input work_bit,
//给出的操作... |
#include <bits/stdc++.h> using namespace std; const int inf = 1e9; const int MOD = 1e9 + 7; const int N = 0; string s; long long solve(string s) { int n = s.length(); long long ans = 1988; for (auto i = (n - 1); i >= (4); i--) { long long mul = 1, add = 0; for (auto j = (i); j < (n);... |
#include <bits/stdc++.h> template <class T> void read(T &x) { x = 0; int f = 0; char ch = getchar(); while (ch < 0 || ch > 9 ) f |= (ch == - ), ch = getchar(); while (ch <= 9 && ch >= 0 ) x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar(); x = f ? -x : x; return; } cons... |
#include <bits/stdc++.h> using namespace std; int main() { int p, x, y; cin >> p >> x >> y; for (int i = x; i >= y; i -= 50) { int t = ((i / 50) % 475); set<int> tr; for (int j = 0; j < 25; j++) { t = (t * 96 + 42) % 475; tr.insert(26 + t); } if (tr.find(p) ... |
#include <bits/stdc++.h> using namespace std; const int N = 2E5 + 10; long long jc[15]; int main() { jc[0] = 1; for (int i = 1; i <= 14; ++i) jc[i] = jc[i - 1] * i; int n, m; cin >> n >> m; int z = max(n - 13, 1); long long ad = 0, p = jc[n - z + 1]; while (m--) { int k; ... |
#include <bits/stdc++.h> using namespace std; const int N = 2010; int n, a[N], m; double f[N][N], p, ans; inline int read() { int x = 0; char ch = getchar(); while (!isdigit(ch)) ch = getchar(); while (isdigit(ch)) x = (x << 3) + (x << 1) + ch - 48, ch = getchar(); return x; } int main... |
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; int N; char s[105]; int dp[105][2605]; void pre() { dp[0][0] = 1; for (int i = 1; i <= 100; i++) for (int j = 0; j <= 25 * i; j++) for (int c = 0; c < 26; c++) if (j - c >= 0) (dp[i][j] += dp[i - 1][j - c]... |
#include <bits/stdc++.h> using namespace std; const int N = 1 << 20; long long fac[20]; vector<long long> lst; vector<long long> lucky; void prepare(int cnt, int all, long long now) { if (cnt == all) { lucky.push_back(now); return; } prepare(cnt + 1, all, now * 10 + 4); prepare(c... |
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; int a[n], e = 0, s = 0; for (int i = 0; i < n; i++) { cin >> a[i]; if (a[i] == 1) e++; else s++; } int ans = 0; for (int b = 0; b < k; b++) { int c = b, ee = e, sec... |
#include <bits/stdc++.h> using namespace std; int main() { int n, diff = 0; bool flag = 1; scanf( %d , &n); int a[n]; for (int i = 0; i < n; i++) { scanf( %d , &a[i]); if (i == 1) diff = a[i] - a[i - 1]; } for (int i = 1; i < n; i++) { if (a[i] - a[i - 1] != diff) { ... |
#include <bits/stdc++.h> using namespace std; const int maxn = 55; const int M = 1000000007; int n, p, c[maxn]; long long ans = 0, pw[maxn], od[maxn], ev[maxn], f[maxn][maxn][maxn][maxn]; void init() { f[0][0][0][0] = 1; pw[0] = 1; for (int i = 1; i < maxn; i++) pw[i] = pw[i - 1] * 2 % M; ev... |
/**
* 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... |
/*
* A D-type flip-flop to check synchronous logic works
* correctly.
*/
module testbench;
reg d, clk, rst, enable;
wire q, q_bar;
dff uut(q, q_bar, d, clk, rst);
initial clk <= 0;
always @(clk)
if (enable)
#1 clk <= !clk;
initial begin
enable <= 1;
rst <= 1;
d <= 1'bx;
#2;... |
#include <bits/stdc++.h> using namespace std; const int N = 1000005; const int M = 1000005; int go[M][4], fa[M], sum[M], val[M], lzy[M], hsc[M], tsz; void pull(int x) { if (!x) return; sum[x] = val[x] + sum[go[x][0]] + sum[go[x][1]]; if (go[x][2]) sum[x] += min(sum[go[x][2]], sum[go[x][3]]); h... |
/*
* 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) 2009 Xilinx Inc.
//
// 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... |
/*
* 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... |
module lcd_bridge (
input clock,
input reset,
input insert,
input [31:0] new_record,
input clear,
output busy,
// LCD interface
output [7:0] lcd_data,
output [4:0] lcd_ctrl
);
/*
* Internal wires and registers.
*/
reg [2:0] state;
reg [17:0] counter;
... |
// Copyright 1986-2014 Xilinx, Inc. All Rights Reserved.
// --------------------------------------------------------------------------------
// Tool Version: Vivado v.2014.1 (lin64) Build 881834 Fri Apr 4 14:00:25 MDT 2014
// Date : Mon May 26 11:16:06 2014
// Host : macbook running 64-bit Arch Linux
// ... |
//////////////////////////////////////////////////////////////////////
//// ////
//// TDM slave controller, high speed version ////
//// ////
//// This file is part of the OR1K ... |
#include <bits/stdc++.h> using namespace std; int t, n, m, cur; int nxt[200200][26], link[200200], dp[200200], cnt[200200], ord[200200], occur[200200]; char s[200200]; void extend(int c) { int x = cur, y = cur = ++m; dp[y] = dp[x] + 1; occur[y] = 1; while (x && !nxt[x][c]) nxt[x][c] = y,... |
#include <bits/stdc++.h> using namespace std; typedef pair<long long, long long> pii; typedef vector<long long> vi; typedef vector<pii> vpii; typedef vector<vi> vvi; double prob[20][20]; double dp[(1 << 19)]; double pmove(long long prev_mask, long long j, long long n) { long long k = __builtin_popco... |
#include <bits/stdc++.h> using namespace std; const long long int N = 100005; bool powertwo(long long int n) { return (n and !(n & (n - 1))); } int32_t main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); long long int t; cin >> t; while (t--) { long long int n; cin >> ... |
#include <bits/stdc++.h> using namespace std; struct debugger { static void call(const char* it) {} template <typename T, typename... aT> static void call(const char* it, T a, aT... rest) { string b; for (; *it && *it != , ; ++it) if (*it != ) b += *it; cerr << b << = << ... |
#include <bits/stdc++.h> using namespace std; struct Pnt { int x, y; Pnt() {} Pnt(int _x, int _y) { x = _x; y = _y; } bool operator<(const Pnt& o) const { if (x != o.x) return x < o.x; return y < o.y; } void show() { printf( Pnt %d %d n , x, y); } }; const int... |
#include <bits/stdc++.h> using namespace std; long long a, b, r, x; int main() { cin >> a; b = 45 * 17 * 10000000000000000LL; r = 100000000000000000LL - 1; x = b % a; cout << a - x << << a - x + r; return 0; } |
#include <bits/stdc++.h> using namespace std; void sol() { int n, m, k; cin >> n >> m >> k; int a[n + 1][m + 1]; for (int i = 1; i <= n; i++) for (int ii = 1; ii <= m; ii++) cin >> a[i][ii]; for (int i = 1; i <= k; i++) { int x, y; cin >> y; x = 1; while (x != n + 1... |
`timescale 1ns / 1ps
////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 20:42:00 06/18/2014
// Design Name: timer_counter
// Module Name: F:/ISE/work/final_exp/washing_machine/timer_counter_test.v
// Project Name: washing_machine
// Targ... |
#include <bits/stdc++.h> using namespace std; string s; const int MAXN = 100005; int tz[4 * MAXN], tx[4 * MAXN], ty[4 * MAXN]; int cntz(int v, int tl, int tr, int l, int r) { if (l > r) return 0; if (tl == l && r == tr) return tz[v]; int tm = (tl + tr) / 2; return cntz(2 * v, tl, tm, l, min(tm... |
#include <bits/stdc++.h> using namespace ::std; const long long maxn = 1e5 + 500; const long long mod = 1e9 + 7; const long long inf = 1e9 + 500; const long long rad = 330; long long a[maxn]; long long t[maxn]; bool cmp(pair<long long, long long> a, pair<long long, long long> b) { if (a.first / rad ... |
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n, a, x, b, y; cin >> n >> a >> x >> b >> y; while (1) { if (a == b) { cout << YES n ; return 0; } if (a == x || b == y) { break; } if (... |
// file: ClockDivider.v
//
// (c) Copyright 2008 - 2013 Xilinx, Inc. All rights reserved.
//
// This file contains confidential and proprietary information
// of Xilinx, Inc. and is protected under U.S. and
// international copyright and other intellectual property
// laws.
//
// DISCLAIMER
// This disclaimer is not... |
#include <bits/stdc++.h> #pragma GCC optimize( O3 ) const double PI = acos(-1.0); using namespace std; const double EPS = 1e-9; const int N = 2e5 + 9; int a[N], n, p, k; long long sum[N], v[N]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int t; cin >> t; while (t--) { ... |
#include <bits/stdc++.h> using namespace std; const int maxn = 300010; struct Segment { int l, r; int id; bool operator<(const Segment &o) const { return l < o.l; } } a[maxn]; int main() { int n, k; cin >> n >> k; for (int i = 0; i < n; i++) { scanf( %d %d , &a[i].l, &a[i].r); ... |
// $Id: rtr_flags_mux.v 5188 2012-08-30 00:31:31Z dub $
/*
Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Redistribution... |
#include <bits/stdc++.h> namespace ZDY { #pragma GCC optimize(3) template <class T> __inline__ __attribute__((always_inline)) T ABS(T x) { return x > 0 ? x : -x; } template <class T> __inline__ __attribute__((always_inline)) T MAX(T x, T y) { return x > y ? x : y; } template <class T> __inli... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 01/09/2017 08:42:46 PM
// Design Name:
// Module Name: pulse_synchronise_tb
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencie... |
/**
* 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; template <class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cerr << *i << ; cerr << endl; } const int MAX_N = 100000; vector<int> primes; bool isPrime[MAX_N]; void MakePrimes() { for (int i = 0; i < (int)(MAX_N); ++i) isPrime[i] = true; ... |
#include <bits/stdc++.h> using namespace std; int a, b, c, d, e, f; void read() { cin >> a >> b >> c >> d >> e >> f; } void solve() { int res = 0; res += (a + b + f) * (a + b + f); res -= f * f; res -= b * b; res -= d * d; cout << res << endl; } int main() { read(); solve(); ... |
#include <bits/stdc++.h> using namespace std; int blocksize; int msmo7; struct query { int start, en, idxofquery, blockidx, mincolor; query() {} query(int l, int r, int i, int adeh) { start = l; en = r; idxofquery = i; blockidx = l / blocksize; mincolor = adeh; } ... |
// oversampling.v
module oversampling
(
input [7:0]sclk,
input res,
input enable,
input sdata,
output [7:0]samples,
output reg [7:0]trans
);
reg [7:0]s1; // fixed position in FPGA
always @(posedge sclk[0]) s1[0] <= sdata;
always @(posedge sclk[1]) s1[1] <= sdata;
always @(posedge sclk[2]... |
/**
* 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 (c) 2014-2018 Alex Forencich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distri... |
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int n = s.size(); int a = 0, b = 0, c = 0, d = 0; for (int i = 0; i < n; i++) { if (s[i] >= A && s[i] <= Z ) a = 1; else if (s[i] >= a && s[i] <= z ) b = 1; else if (s[i] >= 0 ... |
#include <bits/stdc++.h> using namespace std; int main() { int n, t; cin >> n >> t; n--; t--; int arr[n]; for (int i = 0; i < n; i++) { cin >> arr[i]; } for (int i = 0; i <= n; i) { if (i == t) { cout << YES n ; return 0; } else { if (i < n)... |
/*
* Copyright (c) 2005 Stephen Williams ()
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* ... |
#include <bits/stdc++.h> #pragma comment(linker, /STACK:102400000,102400000 ) using namespace std; const int maxn = 100086; const double PI = atan(1.0) * 4.0; const double eps = 1e-9; const long long mod = 1000000007; const int maxe = 10086 * 2; long long quick_pow(long long a, long long n) { long ... |
#include<bits/stdc++.h> using namespace std; int n; inline int lst(int i){return i==1?n:i-1;} inline int nxt(int i){return i==n?1:i+1;} inline int lst(int i,int d){return (((i-d-1)%n+n)%n+1);} inline int nxt(int i,int d){return ((i+d-1)%n+1);} inline int getval(){ fflush(stdout); int val; s... |
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; const int MAXN = 500005; struct seg { int typ; int s, e; bool operator<(const seg &x) const { return s < x.s; } bool operator!=(const seg &x) const { return typ != x.typ || s != x.s || e != x.e; } }; int n, a[MA... |
#include <bits/stdc++.h> using namespace std; int a[111111]; map<int, int> cnt; map<int, int> m; int main() { int n; scanf( %d , &n); m.clear(); cnt.clear(); for (int i = 0; i < n; i++) scanf( %d , &a[i]); sort(a, a + n); int ma = INT_MIN; for (int i = 0; i < n; i++) { m[... |
#include <bits/stdc++.h> using namespace std; const int N = 8e5 + 10; struct Node { int sum; int free; int carry; Node() { sum = 0; free = 1; carry = 0; } Node(int x) { sum = x; if (x == 0) { free = 1; carry = 0; } else { free = 0... |
#include <bits/stdc++.h> using namespace std; template <typename T> inline void checkmin(T &a, T b) { if (a > b) a = b; } const int N = 1001; char buf[N][N], bf[N][N] = {0}; int n, m, cnt = 0; short mx[N * N], my[N * N]; int msz = 0; bool isab(int a, int b) { if (a == n - 1 || b == m - 1) re... |
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2011 by Wilson Snyder.
module t_embed1_wrap (/*AUTOARG*/
// Outputs
bit_out, vec_out, wide_out, did_init_out,
// Inputs
clk, bit_in, vec_in, wide_in, is_ref
);
/*AU... |
/**
* 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; priority_queue<long long int> dif; vector<long long int> vec; long long int a[1000000], b[1000000]; int main() { long long int x, d, contador = 0, i; long long int pot, exp; cin >> x >> d; while (x > 0) { x++; pot = 1; exp = 0; ... |
#include <bits/stdc++.h> #pragma comment(linker, /stack:200000000 ) #pragma GCC optimize( Ofast ) #pragma GCC optimize( unroll-loops ) #pragma GCC target( sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native ) using namespace std; const long long INF = 1000LL * 1000 * 1000 * 1000 * 1000 * 1000; const ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.