text stringlengths 59 71.4k |
|---|
#include <bits/stdc++.h> using namespace std; const int maxn = 2000; const int INF = 1e9 + 7; int le, ri, tot, cpt[60][60], fir[maxn], sec[maxn]; struct MCMF { struct Edge { int from, to, cap, cost; Edge() {} Edge(int from, int to, int cap, int cost) : from(from), to(to), cap(c... |
//-----------------------------------------------------------------------------
// The FPGA is responsible for interfacing between the A/D, the coil drivers,
// and the ARM. In the low-frequency modes it passes the data straight
// through, so that the ARM gets raw A/D samples over the SSP. In the high-
// frequency mo... |
module uniphy_status
#(
parameter WIDTH=32,
parameter NUM_UNIPHYS=2
)
(
input clk,
input resetn,
// Slave port
input slave_read,
output [WIDTH-1:0] slave_readdata,
// hw.tcl won't let me index into a bit vector :(
input mem0_local_cal_success,
input mem0_local_cal_fail,
input mem0_l... |
/**************************************************************************************************/
/* Many-core processor project Arch Lab. TOKYO TECH */
/**************************************************************************************************/
`default_nettype ... |
#include <bits/stdc++.h> using namespace std; const long long mod = 1000000007; const long double pi = acos(-1); const long long maxn = 200001; template <class T> ostream &operator<<(ostream &out, vector<T> &A) { for (auto x : A) out << x << ; return out; } template <class T1, class T2> T1 ... |
#include <bits/stdc++.h> using namespace std; const int maxn = 1e6 + 5; double a[maxn], st[maxn]; int len[maxn]; int main() { int n, x; scanf( %d , &n); for (int i = 1; i <= n; i++) { scanf( %d , &x); a[i] = x; } int p = 0; for (int i = 1; i <= n; i++) { st[++p] = a[i... |
#include <bits/stdc++.h> using namespace std; const long long mod = 1000000007LL; const long long mod2 = 998244353LL; int n; int a[100005], b[100005]; int main() { cin >> n; for (int i = 1; i <= n; ++i) { scanf( %d , &a[i]); } for (int i = 1; i <= n; ++i) { scanf( %d , &b[i]); ... |
#include <bits/stdc++.h> using namespace std; const long long inf = 1e18; const long long N = 100001; long long mod = 1000000007; long long min(long long a, long long b) { if (a < b) return a; else return b; } long long max(long long a, long long b) { if (a > b) return a; ... |
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; const int MAXN = 2e5 + 7; long long a[MAXN]; int dis[233][233]; int val[233][233]; int main(int argc, char const *argv[]) { int n; scanf( %d , &n); for (int i = (1); i <= (n); ++i) { scanf( %lld , &a[i]); if (a[... |
/*
* .--------------. .----------------. .------------.
* | .------------. | .--------------. | .----------. |
* | | ____ ____ | | | ____ ____ | | | ______ | |
* | ||_ || _|| | ||_ \ / _||... |
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 7; const long long mod = 1e9 + 7; long long mpow(long long a, long long b) { long long res = 1; while (b) { if (b % 2 == 1) { res = res * a; } b = b / 2; a = a * a; } return res; } long long pow... |
#include <bits/stdc++.h> using namespace std; const int inf = (int)1e9; const double INF = 1e12, EPS = 1e-9; const int B = 2000; const int dy[] = {-1, 0, 1, 0}, dx[] = {0, -1, 0, 1}; int h, w, q; int qs[100000][4]; char in[100010][12], dir[256]; int dp[100010 * 12], vis[100010][12]; inline int to(in... |
#include <bits/stdc++.h> using namespace std; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); const int N = 88; const int M = 100100; int dp[N][M][2]; pair<int, int> a[N]; int n, m; int main() { scanf( %d%d , &n, &m); for (int i = 0; i < n; i++) scanf( %d%d , &a[i].first, &a... |
#include <bits/stdc++.h> using namespace std; const int N = (int)1e5 + 9; long long power(long long x, long long y) { if (y == 0) return 1; long long temp = power(x, y / 2); if (y % 2 == 1) return temp * temp * x; else return temp * temp; } bool check(string a, string b) { sort... |
#include <bits/stdc++.h> using namespace std; int main() { int i, j, w, h; string temp; vector<string> img; cin >> w >> h; for (i = 0; i < h; i++) { cin >> temp; img.push_back(temp); } for (j = 0; j < w; j++) { for (i = 0; i < h; i++) cout << img[i][j] << img[i][j]; ... |
#include <bits/stdc++.h> using namespace std; const int INF = 1e9 + 7; const int mod = 1e9 + 7; long long int powmod(long long int a, long long int b) { long long int res = 1; a %= mod; assert(b >= 0); for (; b; b >>= 1) { if (b & 1) res = res * a % mod; a = a * a % mod; } re... |
#include <bits/stdc++.h> int main() { long long a, sum, l, i, b; char ch[10]; while (scanf( %I64d , &a) != EOF) { getchar(); scanf( %s , ch); l = strlen(ch); b = 0; for (i = l - 1; i > 0; i--) b = (ch[i] - 0 + b) * 10; b = ch[0] - 0 + b; sum = a + b; pri... |
/*
* 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... |
#include <bits/stdc++.h> using namespace std; int used[100]; vector<vector<int>> g; int cmp = 0; vector<int> parent, rank1; void make_set(int v) { parent[v] = v; rank1[v] = 0; } int find_set(int v) { if (v == parent[v]) return v; return parent[v] = find_set(parent[v]); } void union_s... |
#include <bits/stdc++.h> using namespace std; long long int dp[2002][2002]; vector<long long int> col, row; long long int sol(long int p, long int q, int n, int m, int jk) { if (p == 0 || q == 0) { return 0; } vector<long long int>::iterator it; if (p <= 2 * n && q <= 2 * m) { if (jk... |
// RS-232 TX module
// (c) fpga4fun.com KNJN LLC - 2003, 2004, 2005, 2006
//`define DEBUG // in DEBUG mode, we output one bit per clock cycle (useful for faster simulations)
`include "includes.v"
module async_transmitter(clk, TxD_start, TxD_data, TxD, TxD_busy);
input clk, TxD_start;
input [7:0] TxD_data;
output T... |
/*
* 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... |
/*
* yosys -- Yosys Open SYnthesis Suite
*
* Copyright (C) 2012 Claire Xenia Wolf <>
* Copyright (C) 2018 gatecat <>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permissio... |
#include <bits/stdc++.h> using namespace std; const int MXX = 3e5 + 5; int n, m; int a[MXX], ans[MXX]; bool ok(int x) { int mx = m - 1; for (int i = n - 1; i >= 0; i--) { if (a[i] <= mx) { if (a[i] + x >= mx) { ans[i] = mx; } else { ans[i] = a[i] + x; ... |
/*
* Copyright 2017 Google 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/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... |
//Copyright 1986-2014 Xilinx, Inc. All Rights Reserved.
//--------------------------------------------------------------------------------
//Tool Version: Vivado v.2014.4 (lin64) Build Tue Nov 18 16:48:31 MST 2014
//Date : Wed Sep 30 15:12:45 2015
//Host : rcswrka27 running 64-bit Ubuntu 10.04.4 LTS
//Co... |
#include <bits/stdc++.h> using namespace std; const int maxn = 100005; const int maxm = 300005; int n, m, cnt1, cnt2, ans; int head[maxn], Head[maxn]; int dis1[maxn], vis1[maxn]; int use1[maxn], use2[maxn]; int num[maxn], ok[maxn]; struct nood { int nex, to, w; int fr; }; nood e[maxm], E[m... |
#include <bits/stdc++.h> using namespace std; const signed long long Infinity = 1000000001; const long double Epsilon = 1e-9; template <typename T, typename U> ostream& operator<<(ostream& os, const pair<T, U>& p) { return os << ( << p.first << , << p.second << ) ; } template <typename T> ostre... |
#include <bits/stdc++.h> using namespace std; const int N = 0; int n, k, x; string s; vector<int> v; int main() { int a, b, c, d, e, f; int cnt = 0; scanf( %d%d%d%d%d%d , &a, &b, &c, &d, &e, &f); if (a == d) cnt++; if (b == e) cnt++; if (c == f) cnt++; if (cnt >= 1) { print... |
/**
* 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 n, men = 0, pluss = 0, nol = 0; long long a, ans = 0; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin >> n; for (int i = 1; i <= n; i++) { cin >> a; if (a < 0) { ans += (-1 - a); m... |
module VgaRenderer
(
input RENDERER_CLK ,
// --------- FROM VGA SYNC GENERATOR ---------
input wire [10:0] RENDERER_POS_X ,
input wire [9:0] RENDERER_POS_Y ,
input wire RENDERER_ENABLE,
input wire RENDERER_SEL_BUFF,
// -------------------------------------------
// ---... |
#include <bits/stdc++.h> using namespace std; inline int read(int f = 1, int x = 0, char ch = ) { while (!isdigit(ch = getchar())) if (ch == - ) f = -1; while (isdigit(ch)) x = x * 10 + ch - 0 , ch = getchar(); return f * x; } const int N = 1e2 + 5; int n, c[2], p[N], q[N], f[2][N][N][N... |
#include <bits/stdc++.h> using namespace std; long long arr[200005], lazy[4 * 200005], seg[4 * 200005]; void build(int node, int start, int end) { int mid = (start + end) / 2; if (start == end) { lazy[node] = 0; seg[node] = arr[start]; return; } build(2 * node, start, mid); b... |
#include <bits/stdc++.h> using namespace std; int const MAXN = 5e5 + 10; int n, a[MAXN], ans; int main() { scanf( %d , &n); for (int i = 1; i <= n; i++) scanf( %d , &a[i]); for (int i = 1; i < n; i++) { if (a[i] != a[i + 1]) { int pt = i + 1, tam = 1; while (a[pt] != a[pt + 1] ... |
#include <bits/stdc++.h> using namespace std; const int M = 1000000007; int n, m, t; long long dp[61][31][31]; int arr[61]; long long solve(int ind, int x, int y) { if (x > 3 && y > 0 && x + y == t) return 1; if (ind == n + m + 1) return 0; long long &ret = dp[ind][x][y]; if (ret != -1) retu... |
/**
* 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 MAX = 2e5 + 3; string s, p; int F[MAX][2]; void solve() { cin >> s >> p; F[0][0] = F[0][1] = 0; for (int i = 1; i <= p.size(); ++i) { for (int j = 0; j < 2; ++j) { F[i][j] = F[i - 1][j]; } ++F[i][p[i - 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; namespace math { template <typename T> T gcd(T a, T b) { if (a < 0) a = -a; if (b < 0) b = -b; while (b > 0) { T r = a % b; a = b; b = r; } return a; } } // namespace math template <typename C> int SZ(const C& c) { ... |
# include <bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(false); int t; cin>>t; while(t--){ int n,m; cin>>n>>m; int ans=0; int a[101]={0}; for(int i=0; i<n;i++){ int x; cin>>x; a[x]=1; } for(int i=0;i<m;i++){ int x; cin... |
`timescale 1ns / 1ps
////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 22:13:59 12/01/2015
// Design Name: spi_master
// Module Name: /home/jorge/Documentos/SPI_SD/spi_master_testbench.v
// Project Name: SPI_SD
// Target Device:
// To... |
#include <bits/stdc++.h> using namespace std; int f[100010], g[100010]; int _Max(int x, int y) { return x > y ? x : y; } void upd(int x, int ans, int k) { if (f[x] < ans) f[x] = ans, g[x] = k; else if (f[x] == ans && k < g[x]) g[x] = k; } int main() { int n, L, p, t, i, j, l = 1, r =... |
`timescale 1us/100ns
module top;
reg pass = 1'b1;
real ra = 1.0, rb = 2.0;
wire real rpow;
/* Real Power. */
assign #1 rpow = ra ** rb;
initial begin
#0.9;
if (rpow == 1.0) begin
pass = 1'b0;
$display("Real: power value not delayed.");
end
#0.1;
#0;
if (rpow != 1.0) ... |
// Accellera Standard V2.3 Open Verification Library (OVL).
// Accellera Copyright (c) 2005-2008. All rights reserved.
`include "std_ovl_defines.h"
`module ovl_delta (clock, reset, enable, test_expr, fire);
parameter severity_level = `OVL_SEVERITY_DEFAULT;
parameter width = 1;
parameter min ... |
#include <bits/stdc++.h> using namespace std; int main() { int x, y; cin >> x >> y; if (x > y) { int t = x; x = y; y = t; } cout << x << << (y - x) / 2 << endl; } |
#include <bits/stdc++.h> using namespace std; const long long BINF = 1e18 + 10; signed main() { ios_base::sync_with_stdio(false); long long T; cin >> T; while (T--) { long long n, a, b; cin >> n >> a >> b; vector<long long> c(n); for (auto &it : c) { char kek; ... |
#include <bits/stdc++.h> using namespace std; queue<int> q[300005]; set<int> all; int main() { int n, quer; scanf( %d%d , &n, &quer); int t, x, v; int in = 1; for (int i = 1; i <= quer; i++) { scanf( %d%d , &t, &x); if (t == 1) { q[x].push(in); all.insert(in); ... |
#include <bits/stdc++.h> using namespace std; void solve() { string s; cin >> s; int n = s.size(); if (s[0] == b && s[n - 1] == a ) { s[0] = a ; } else if (s[0] == a && s[n - 1] == b ) { s[n - 1] = a ; } cout << s << n ; } int main() { int t; cin >> t; ... |
// spw_light_mm_interconnect_0_avalon_st_adapter.v
// This file was auto-generated from altera_avalon_st_adapter_hw.tcl. If you edit it your changes
// will probably be lost.
//
// Generated using ACDS version 17.1 593
`timescale 1 ps / 1 ps
module spw_light_mm_interconnect_0_avalon_st_adapter #(
parameter inBits... |
`include "bsg_defines.v"
module bsg_reduce_segmented #(parameter `BSG_INV_PARAM(segments_p )
,parameter `BSG_INV_PARAM(segment_width_p )
, parameter xor_p = 0
, parameter and_p = 0
, parameter or_p = 0
, parameter no... |
#include <bits/stdc++.h> using namespace std; long long h[1000010], dp[1000010][2]; int n; int main() { int i, j; while (scanf( %d , &n) != EOF) { for (i = 1; i <= n; i++) scanf( %lld , &h[i]), h[i]--; for (i = 1; i <= n; i++) { dp[i][0] = (dp[i - 1][0] + dp[i - 1][1] * min(h[i], h[i... |
#include <bits/stdc++.h> using namespace std; int main() { int arr[101]; int n; cin >> n; for (int i = 0; i < n; i++) { cin >> arr[i]; } sort(arr, arr + n); for (int i = 0; i < n; i++) { cout << arr[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; long long const M = 2e5 + 10, M2 = 1e7 + 10, mod = 1e9 + 7, inf = 1e9 + 10, sq = 450; long long a[M], cnt[M], t1, t2, t0, x1; pair<long long, long long> good, ans; bool check(long long ind, long long sum) { if (sum - ind > x1) return 0; 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; const int kN = 2e5 + 10; const long long kInf = 1e18 + 10; int n, q; long long a[kN], b[kN]; vector<int> g[kN]; int in[kN], out[kN], dfs_clock; pair<long long, long long> p1[kN], p2[kN]; void dfs(int u) { in[u] = ++dfs_clock; for (int v : g[u]) { ... |
/*
* 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... |
`timescale 1ns / 1ps
////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 00:45:52 11/03/2011
// Design Name: MGIA
// Module Name: /Users/kc5tja/tmp/kestrel/2/nexys2/uxa/mgia/T_uxa_mgia.v
// Project Name: mgia
// Target Device:
// Tool v... |
// Copyright 1986-2014 Xilinx, Inc. All Rights Reserved.
// --------------------------------------------------------------------------------
// Tool Version: Vivado v.2014.4 (win64) Build Tue Nov 18 18:29:27 MST 2014
// Date : Tue Jun 30 15:23:38 2015
// Host : Vangelis-PC running 64-bit major release (... |
// -------------------------------------------------------------
//
// Generated Architecture Declaration for rtl of inst_ea_e
//
// Generated
// by: wig
// on: Mon Jun 26 08:25:04 2006
// cmd: /cygdrive/h/work/eclipse/MIX/mix_0.pl ../../generic.xls
//
// !!! Do not edit this file! Autogenerated by MIX !!!
// $Aut... |
// Copyright (C) 2013 Simon Que
//
// This file is part of DuinoCube.
//
// DuinoCube is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later ... |
#include <bits/stdc++.h> const int N = (1 << 19) - 1; using namespace std; int n; double dp[N + 1], a[20][20]; int main() { scanf( %d , &n); for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) scanf( %lf , &a[i][j]); } dp[(1 << n) - 1] = 1; for (int s = ((1 << n) - 1); s > 0; s... |
#include <bits/stdc++.h> const long long max9 = 10 + 1e9, max6 = 10 + 1e6, max12 = 10 + 1e12, max15 = 10 + 1e15; const long long min6 = -1 * max6, min9 = -1 * max9, min12 = -1 * max12, min15 = -1 * max15; const long long R = 7 + 1e9, NN = 10 + 1e5; using namespace std; int ... |
#include <bits/stdc++.h> using namespace std; constexpr int mod = 998244353; int x[5], y[5]; int px[32], nx[32], py[32], ny[32]; int dp[32][20][20][20][20][2][2]; void add(int& x, const int& y) { x += y; if (x >= mod) x -= mod; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr)... |
#include <bits/stdc++.h> using namespace std; int N, M; pair<pair<long long, long long>, int> range[200000 - 1]; pair<long long, int> bridge[200000]; priority_queue<pair<long long, int>, vector<pair<long long, int> >, greater<pair<long long, int> > > rends; int ans[200000 - 1]; int ... |
//*****************************************************************************
// (c) Copyright 2008-2010 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
// ... |
#include <bits/stdc++.h> using namespace std; long long powmod(long long a, long long b, long long MOD) { long long res = 1; a %= MOD; for (; b; b >>= 1) { if (b & 1) res = res * a % MOD; a = a * a % MOD; } return res; } const int N = 1e5 + 5; double pos[N]; double getExpe(in... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 20:52:12 01/24/2016
// Design Name:
// Module Name: latch_IF_ID
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
/... |
/*
* 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 = 1086; const int MAXT = 1586; const long long R = 1000000; struct query { long long ts, tl; long double ss, sl, p; query() {} query(long double _ss, long double _sl, long long _ts, long long _tl, long double _p) : ... |
/*
* Copyright (c) 2015, Arch Laboratory
* 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. Redistributions of source code must retain the above copyright notice,
* this list of con... |
#include <bits/stdc++.h> using namespace std; const int inf = (1 << 30) - 1; const long long linf = (1ll << 62) - 1; const int N = 1e6 + 100; int n, m; int u[N], v[N]; set<int> g[N]; bool used[N]; int ts[N], tsLen = 0; void topSort(int v) { if (used[v]) { return; } used[v] = true; ... |
#include <bits/stdc++.h> using namespace std; const int max_n = 100111, inf = 1000111222; const int max_lev = 18; int n, m, q, parent[max_lev][max_n], best_h[max_n], used[max_n], h[max_n]; int real_p[max_lev][max_n]; int tin[max_n], tout[max_n], cur; vector<int> g[max_n]; void dfs(int v, int p) { ti... |
#include <bits/stdc++.h> using namespace std; const int MAXN = 300010; pair<pair<int, int>, pair<int, int> > allNums[MAXN * 2]; set<pair<int, int> > startTimes; pair<int, int> v[MAXN]; int main() { int N; scanf( %d , &N); for (int i = 0; i < N; ++i) { scanf( %d%d , &v[i].first, &v[i].secon... |
`timescale 1ns/10ps
module spw_light_pll_0(
// interface 'refclk'
input wire refclk,
// interface 'reset'
input wire rst,
// interface 'outclk0'
output wire outclk_0,
// interface 'locked'
output wire locked
);
altera_pll #(
.fractional_vco_multiplier("false"),
.reference_clock_frequency("50.0 MHz"),... |
#include <bits/stdc++.h> using namespace std; int main() { long long n; cin >> n; int v = 3 - n % 3, ans = 0; for (int i = v;; i += 3) { if (1LL * i * (i + 1) / 2 > (n + i) / 3) break; ++ans; } cout << ans; return 0; } |
`timescale 1ns / 1ps
///////////////// ** ctrl_reg_readback ** //////////////////////////////////////////
//
// This module contains the control registers for the font5 9 channel daq firmware
// Clocked at 40MHz
//
// It consists of 7-bit registers, 5-bit addresses
// Data, data strobe and address to be written are al... |
#include <bits/stdc++.h> using namespace std; bool is_right(complex<long long> p1, complex<long long> p2, complex<long long> p3) { return (conj(p2 - p1) * (p3 - p1)).imag() < 0; } const int N = 1e5 + 5; vector<complex<long long> > U; complex<long long> a[N]; int n; void read_input() ... |
module artemis_clkgen (
(* KEEP = "TRUE" *) input clk,
input rst,
output locked,
(* KEEP = "TRUE" *) output ddr3_clk
);
//Local Parameters
//Registers/Wires
wire clk_100mhz_buf;
wire clk_fbout;
wire clk_fbout_buf;
wire clk_100mhz_out;
//wire ddr3_clk_pre;
//wire ... |
#include<cstdio> #include<iostream> #include<algorithm> int main() { int n; char a[100000]; bool x = 1; while (~scanf( %d , &n)) { while (n--) { x = 1; scanf( %s , a); for (int i = 0; a[i] != 0 ; i++) { if (x) { if (a[i] != a ) a[i] = a ; else ... |
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int a[n]; for (int i = 0; i < n; i++) cin >> a[i]; int b[n]; b[0] = 0; for (int i = 1; i < n; i++) b[i] = abs(a[i] - a[i - 1]); long long int dp[n], dd[n]; dp[0] = 0; dd[0] = 0; for (int i = 1; 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... |
`timescale 1ns/1ps
//-----------------------------------------------------------------------------
// Title : ALU
// Project : KPU
//-----------------------------------------------------------------------------
// File : alu.v
// Author : acorallo <>
// Created : 17.12.2016
//------... |
#include <bits/stdc++.h> #pragma comment(linker, /stack:20000000 ) using namespace std; template <typename T1, typename T2, typename T3> struct triple { T1 a; T2 b; T3 c; triple(){}; triple(T1 _a, T2 _b, T3 _c) : a(_a), b(_b), c(_c) {} }; template <typename T1, typename T2, typename T3>... |
#include <bits/stdc++.h> using namespace std; signed main() { long long int n, k; cin >> n >> k; long long int arr1[n], arr2[n]; for (long long int i = 0; i < n; i++) cin >> arr1[i]; for (long long int i = 0; i < n; i++) cin >> arr2[i]; multiset<pair<long long int, pair<long long int, long 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... |
`timescale 1ns / 1ns
module fake_mii
(input mdc,
inout mdio);
reg [15:0] regs[0:31];
reg [15:0] save;
reg mdo;
reg mdo_en;
reg mdio_del;
reg di;
reg [1:0] op;
reg [4:0] phyad;
reg [4:0] regad;
integer count;
always @(mdio) #10 mdio_del <= mdio;
assign mdi... |
/**
* 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; inline int read() { int d = 0; char c = getchar(); while (c < 0 || c > 9 ) c = getchar(); while (c >= 0 && c <= 9 ) { d = (d << 3) + (d << 1) + c - 0 ; c = getchar(); } return d; } const int N = 1e5 + 5; const long long I... |
// ==============================================================
// File generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC
// Version: 2014.4
// Copyright (C) 2014 Xilinx Inc. All rights reserved.
//
// ==============================================================
`timescale 1 ns / 1 ps
m... |
/*
* cpu_tv.v
* Testbench for cpu.v
*
* Copyright (C) 2013 James Cowgill
*
* 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 lat... |
#include <bits/stdc++.h> using namespace std; int main() { long long n, p, q, a; cin >> p >> q >> n; for (int i = 1; i <= n; i++) { cin >> a; if (q == 0 || a > p / q) return cout << NO , 0; p -= q * a; swap(p, q); } cout << ((q) ? NO : YES ); } |
/**
* 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... |
//SIMPLE TESTBENCH TO VERIFY THAT THINGS ARE ALIVE AND KICKING
`timescale 1 ns/1 ps
module tb_one_port_mem;
parameter addresses = 32;
parameter width = 8;
parameter muxFactor = 0;
//Auto-calculated, user dont touch
localparam addressWidth =$clog2(addresses);
... |
#include <bits/stdc++.h> using namespace std; int n, m; int a[205], b[205]; int main() { cin >> n >> m; for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 0; i < m; i++) cin >> b[i]; for (int i = 0; i < 512; i++) { int cnt = 0; for (int j = 0; j < n; j++) { for (int k = 0;... |
#include <bits/stdc++.h> using namespace std; long long dp[300005]; int main() { long long n, k; cin >> n >> k; for (int i = 1; i <= n; i++) for (int j = i + i; j <= n; j += i) dp[j]++; long long sum = 0, m = 0; for (int i = 1; i <= n; i++) { sum += dp[i]; if (sum >= k) { ... |
#include <bits/stdc++.h> #pragma optimization_level 3 #pragma GCC optimize( Ofast,no-stack-protector,unroll-loops,fast-math,O3 ) #pragma GCC target( avx,avx2,fma ) using namespace std; mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count()); int a, k, nc = 0, isz = 0; vector<unordered_set<int>... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.