text stringlengths 59 71.4k |
|---|
#include <bits/stdc++.h> using namespace std; template <typename T> void rd(T &t) { t = 0; int f = 1; char p = getchar(); while (p < 48 || p > 57) { if (p == 45) f = -1; p = getchar(); } do { (t *= 10) += p - 48; p = getchar(); } while (p > 47 && p < 58); t ... |
#include <bits/stdc++.h> using namespace std; const int Max_N = 2e3, Mod = 998244353; int n, d[Max_N + 5], D[Max_N + 5], opt[Max_N + 5]; char a[Max_N + 5][Max_N + 5]; inline bool Chck() { sort(D + 1, D + n + 1); int sum = 0; for (int i = 1; i < n; i++) { sum += D[i]; if (sum == i * (i ... |
#include <bits/stdc++.h> using namespace std; inline long long read() { register long long data = 0, w = 1; char ch = 0; while (ch != - && (ch < 0 || ch > 9 )) ch = getchar(); if (ch == - ) w = -1, ch = getchar(); while (ch >= 0 && ch <= 9 ) data = (data << 1) + (data << 3) + (ch ... |
// (c) Copyright 1995-2017 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 a license and does not grant ... |
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n, c = 0; cin >> n; int w = 1; int a[n]; for (int i = 0; i < n; i++) cin >> a[i]; if (n == 1) cout << First << endl; else { for (int i = 0; i < n; i++... |
#include <bits/stdc++.h> using namespace std; const int maxn = 300000; const long long INF = 1e18; const int sqrtConst = 550; const int alphabet = 26; const long long mod = 998244353; void solve() { string s; cin >> s; bool has1 = false; for (int i = 1; i < s.size(); i++) { if (s[i] ... |
#include <bits/stdc++.h> using namespace std; const int N = 1000009; const int SGZ = 26; const int M = 10009; int n, m, nxt[N][SGZ], crt[N][SGZ], q[M], ans[M]; vector<int> val; char s[N], qy[SGZ]; inline int read() { char c = getchar(); int ret = 0, f = 1; while (c < 0 || c > 9 ) { ... |
//======================================================================
//
// fltfpga.v
// ---------
// Top level wrapper for the fltfpga design.
// The fltfpga (FairLight FPGA) is an attempt at implementing a
// demo system om the TerasIC C5G development board using the
// board HDMI and AC97 interfaces for graphics ... |
// Accellera Standard V2.3 Open Verification Library (OVL).
// Accellera Copyright (c) 2005-2008. All rights reserved.
`include "std_ovl_defines.h"
`module ovl_always (clock, reset, enable, test_expr, fire);
parameter severity_level = `OVL_SEVERITY_DEFAULT;
parameter property_type = `OVL_PROPERTY_DEFAULT;
par... |
// megafunction wizard: %FIFO%VBB%
// GENERATION: STANDARD
// VERSION: WM1.0
// MODULE: dcfifo
// ============================================================
// File Name: fifo_267x128.v
// Megafunction Name(s):
// dcfifo
//
// Simulation Library Files(s):
// altera_mf
// ==========================... |
/**
* 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() { ios_base::sync_with_stdio(false); cin.tie(NULL); int t; cin >> t; int n, m, k; while (t--) { cin >> n >> m >> k; if (n % 2 == 0 && k % 2 == 1) { cout << NO n ; continue; } if (n % 2 == 0 && k ... |
module gen_test1(clk, a, b, y);
input clk;
input [7:0] a, b;
output reg [7:0] y;
genvar i, j;
wire [15:0] tmp1;
generate
for (i = 0; i < 8; i = i + 1) begin:gen1
wire and_wire, or_wire;
assign and_wire = a[i] & b[i];
assign or_wire = a[i] | b[i];
if (i % 2 == 0) begin:gen2true
assign tmp1[i] = and_wire... |
/*
* 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; long long f[5005][5005]; long long mod = 1000000007, ans = 0; char s1[5005], s2[5005]; int main() { scanf( %s n %s , s1 + 1, s2 + 1); int len1 = strlen(s1 + 1); int len2 = strlen(s2 + 1); for (int i = 1; i <= len1; ++i) for (int j = 1; j <= ... |
#include <bits/stdc++.h> using namespace std; int main() { long long n, m; long long inf = 1000000005; cin >> n >> m; long long i, j, k; bool a[n + 1][n + 1]; long long deg[n + 1]; for (i = 0; i < n + 1; i++) { deg[i] = 0; for (j = 0; j < n + 1; j++) a[i][j] = false; } ... |
#include <bits/stdc++.h> using namespace std; const double PI = acos(-1); const int inf = 99999999; int n; char c[20]; int r[20]; int b[20]; int dp[1 << 16][123]; int main() { int n; cin >> n; int maxi = 0; int ans1 = 0; int ans2 = 0; for (int i = 0; i < n; i++) { cin >> ... |
#include <bits/stdc++.h> using namespace std; long long n, m; long long a[510]; long long dp[510][510]; long long stt[510]; long long mod = 998244353; long long solve(long long st, long long en) { if (st >= en) { return 1; } if (dp[st][en] != -1) return dp[st][en]; long long c = 1e9;... |
#include <bits/stdc++.h> using namespace std; int n, m; vector<pair<int, int>> flowers; vector<int> first_flowers; vector<long long> pref_sum; long long answer; void In() { flowers.clear(); pref_sum.clear(); first_flowers.clear(); answer = LLONG_MIN; cin >> n >> m; flowers.resize(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... |
/*
This file was generated automatically by the Mojo IDE version B1.3.6.
Do not edit this file directly. Instead edit the original Lucid source.
This is a temporary file and any changes made to it will be destroyed.
*/
/*
Parameters:
LATENCY = 2
PCLK_DIV = 1
Y_RES = 480
X_RES = 640
... |
#include <bits/stdc++.h> using namespace std; int N, type[100005]; int Tm, in[100005], out[100005]; int par[100005][20]; bool comp[100005][20][2]; vector<int> G[100005]; void dfs(int nd) { in[nd] = ++Tm; for (int i = 0; i < G[nd].size(); i++) { int ch = G[nd][i]; if (ch == par[nd][0]) ... |
#include <bits/stdc++.h> using namespace std; void solve() { string a, b; cin >> a >> b; if (a.size() < b.size()) a = string(b.size() - a.size(), 0 ) + a; if (a.size() > b.size()) b = string(a.size() - b.size(), 0 ) + b; if (a < b) cout << < << endl; else if (a > b) cout << ... |
#include <bits/stdc++.h> using namespace std; int main() { string s, t, ss, tt; int bc; vector<int> res; cin >> bc >> s >> t; ss = s; tt = t; sort(ss.begin(), ss.end()); sort(tt.begin(), tt.end()); if (ss != tt) { cout << -1; return 0; } if (!is_permutation(s.... |
#include <bits/stdc++.h> using namespace std; int n, cnt = 0; int main() { ios::sync_with_stdio(false); cin >> n; if (n <= 3) { cout << NO ; return 0; } cout << YES << n ; if (n % 2) { cout << 5 - 3 = 2 << n ; cout << 2 + 1 = 3 << n ; cout << 3 *... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer: Montvydas Klumbys
//
// Create Date:
// Design Name:
// Module Name: Counter
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// R... |
module Computer_ControlUnit(
output [WORD_WIDTH-1:0] CONST_bus_out,
output [CNTRL_WIDTH-1:0] CNTRL_bus_out,
output [WORD_WIDTH-1:0] COUNTER_bus_out,
input [WORD_WIDTH-1:0] ADDR_bus_in,
input [WORD_WIDTH-1:0] INSTR_bus_in,
input [ULA_FLAG_WIDTH-1:0] ULA_FLAG_bus_in,
input CLK,
input RST
);
parameter WORD_WID... |
#include <bits/stdc++.h> const int maxn = 2e5 + 1; int fa[maxn], flg[maxn], n, m, cnt, ans; struct Edge { int u, v, w; } e[maxn]; inline bool cmp(Edge a, Edge b) { return a.w > b.w; } inline int find(int x) { return (fa[x] == x) ? x : fa[x] = find(fa[x]); } int main() { scanf( %d %d , &n, &m); ... |
/*
Copyright (c) 2015 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, distribute,... |
#include <bits/stdc++.h> const int N = 500000; int n, k; char s[N + 1], t[N + 1]; int main() { scanf( %d%d%s%s , &n, &k, s, t); int r = 0; long long ans = 0; for (int i = 0; i < n; ++i) { if (r < k) { r *= 2; r += t[i] - s[i]; } r = std::min(r, k); ans += ... |
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n, a, b; string s = ; cin >> n >> a >> b; s += a ; for (int i = 1; i < b; i++) { s += s[i - 1] + 1; } string s2 = s; for (int i = 0; i < n / b - 1; i++... |
// ----------------------------------------------------------------------
// 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:... |
/**
* 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... |
module fir_scu_rtl_restructured_for_cmm_exp (clk, reset, sample, result);
input clk, reset;
input [7:0] sample;
output [9:0] result;
reg [9:0] result;
reg [7:0] samp_latch;
reg [16:0] pro;
reg [18:0] acc;
reg [19:0] clk_cnt;
reg [7:0] shift_0,shift_1,shift_2,shift_3,shift_4,shift_5,shift_6,shift_7,shift_8,shi... |
module bts ( z , a , e);
inout z ; wire z ;
input a ; wire a ;
input e ; wire e ;
assign #4 z= ( (e==1'b1)? a : 1'bz );
endmodule
module test();
reg [1:0] aa;
wire [1:0] zz;
reg [1:0] ee;
bts sub1 (.z(zz[1]), .a(aa[1]), .e(ee[1]));
bts sub0 (.z(zz[0]), .a(aa[0]), .e(ee[0]));
initial begin... |
#include <bits/stdc++.h> using namespace std; int n, m, q[1000010], a[1000010], del[1000010], sz[1000010], p[1000010]; stack<int> res; int main() { scanf( %d%d , &n, &m); for (int i = 1; i <= m; i++) scanf( %d , &a[i]); if (a[m] <= n) a[m + 1] = n + 1; for (int i = 1; i <= m; i++) for (int... |
// ==============================================================
// File generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC
// Version: 2017.4
// Copyright (C) 1986-2017 Xilinx, Inc. All Rights Reserved.
//
// ==============================================================
`timescale 1 ns / 1... |
#include <bits/stdc++.h> using namespace std; int a[40] = {0, 4, 22, 27, 58, 85, 94, 121, 166, 202, 265, 274, 319, 346, 355, 378, 382, 391, 438, 454, 483, 517, 526, 535, 562, 576, 588, 627, 634, 636, 645, 648}; int main() { int t; cin >> t; cout << a[t] << endl; ... |
//-------------------------------------------------------------------
//
// COPYRIGHT (C) 2011, VIPcore Group, Fudan University
//
// THIS FILE MAY NOT BE MODIFIED OR REDISTRIBUTED WI... |
// 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 00:30:00 2017
// Host : DarkCube running 64-bit major release ... |
/*
* 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 "defines.v"
`include "connectRouter_2SNoBuffer.v"
`timescale 1ns/1ps
module tb_connectRouters(
);
reg clk, rst;
reg `control_w port_in, inj;
reg bfull;
wire `control_w port_out, eject;
wire accept, push;
connectRouter_nobuffer r(
.clk(clk),
.rst(rst),
... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2013, David M. Lloyd
//
// This file is part of the PBIBox suite.
//
// PBIBox is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as publ... |
#include <bits/stdc++.h> using namespace std; char str[100020]; int len[3] = {0}; int num[100020]; void zhuanhuan(int x) { if (x >= 3) { len[2]++; } else if (x == 2) { len[1]++; } else { len[0]++; } } int main() { int n, kuan = 1; scanf( %d , &n); scanf( %*c )... |
#include <bits/stdc++.h> char s[100001]; int a[100000]; int b[100000]; void func() { int n = strlen(s), i, ans = 1 << 29; if (isupper(s[0])) { a[0] = 0; } else { a[0] = 1; } for (i = 1; i < n; i++) { if (isupper(s[i])) { a[i] = a[i - 1]; } else { a[i] ... |
`timescale 1ns / 1ps
// @module
// counting time
// @input
// clk_normal: normal clock source
// clk_change_time: manually changing time clock source
// power: electronic power
// enable: pause switch
// reset: reset switch
// add_time: add time manually
// sub_time: sub time manually
// @output
// count: current coun... |
/**
* 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 = 1e6 + 5; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long t; cin >> t; while (t--) { long long n; cin >> n; long long a[n], b[n]; long long m = INT_MAX; for (int i = 0; i < n; i++) ... |
#include <bits/stdc++.h> using namespace std; vector<int> vec[200010]; int a[200010], b[200010], color[200010]; bool flag = false; void dfs(int now, int pre, int col) { color[now] = col; for (int i = 0; i < vec[now].size(); i++) { int v = vec[now][i]; if (v == pre) continue; if (colo... |
// ========== Copyright Header Begin ==========================================
//
// OpenSPARC T1 Processor File: ctu_clsp_clkgn_syncp.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... |
#include <bits/stdc++.h> using namespace std; int n; vector<pair<int, int> > A; int F(int i, int j) { return (A[i].first - A[j].first) * (A[i].first - A[j].first) + (A[i].second - A[j].second) * (A[i].second - A[j].second); } bool F1(vector<int> I) { for (int(i) = (0); (i) < (4); ++(i)) ... |
// ==============================================================
// File generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC
// Version: 2017.4
// Copyright (C) 1986-2017 Xilinx, Inc. All Rights Reserved.
//
// ==============================================================
`timescale 1 ns / 1 ... |
#include <bits/stdc++.h> int comp(const void *a, const void *b) { return *(int *)a - *(int *)b; } int min(int a, int b) { return a < b ? a : b; } int max(int a, int b) { return a > b ? a : b; } int rev(int n) { int r = 0; for (int i = 0; i < 8; i++) r = r | (((n >> i) & 1) << (7 - i)); return r; }... |
// ***************************************************************************
// ***************************************************************************
// Copyright 2011(c) Analog Devices, Inc.
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// a... |
#include <bits/stdc++.h> using namespace std; int main() { long long x, y, i, j, sum = 0, k; cin >> x >> y; for (i = 1; i <= x; i++) { j = i % 5; k = y + j; sum = sum + (k / 5); } cout << sum << endl; return 0; } |
/* Copyright (c) 2015 Convey Computer Corporation
*
* This file is part of the OpenHT toolset located at:
*
* https://github.com/TonyBrewer/OpenHT
*
* Use and distribution licensed under the BSD 3-clause license.
* See the LICENSE file for the complete license text.
*/
module dispatch #(parameter
FREQ = 0,
... |
#include <bits/stdc++.h> using namespace std; int n, m, k; const int maxn = 2e5 + 10; template <class T> inline T read() { int f = 1; T ret = 0; char ch = getchar(); while (!isdigit(ch)) { if (ch == - ) f = -1; ch = getchar(); } while (isdigit(ch)) { ret = (ret << 1)... |
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 5; pair<long double, long double> st[4 * N]; int n, q; template <typename T> pair<T, T> operator+(const pair<T, T> &a, const pair<T, T> &b) { pair<T, T> res; res.first = a.first + b.first * a.second; res.second = a.second * b.seco... |
// 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; int main() { int n; long long p; cin >> n >> p; vector<pair<long long, int> > ar; vector<long long> ans(n); for (int i = 0; i < n; i++) { long long x; cin >> x; ar.push_back(make_pair(x, i)); } sort(ar.begin(), ar.end())... |
/*
* This tests the latching of an output that isn't really an output,
* but an intermediate symbol that is only used in some clauses.
*/
module main;
reg [15:0] out, a;
reg [7:0] b;
reg cy;
reg with_carry;
(* ivl_combinational *)
always @(with_carry, a, b, cy)
case (with_carry)... |
/**
* 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 maxm = 20010, maxn = 10010, maxk = 1110; const int inf = 1e7; int to1[maxm], begin1[maxn], next1[maxm], w[maxm][maxk], cur[maxn], e = 1, W[maxm]; int d[maxn], q[maxn], g[maxk], ans[max... |
`timescale 1ns / 1ps
// Documented Verilog UART
// Copyright (C) 2010 Timothy Goddard ()
// Distributed under the MIT licence.
//
// 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 re... |
#include<bits/stdc++.h> #define L(i, j, k) for(int i = j, i##E = k; i <= i##E; i++) #define R(i, j, k) for(int i = j, i##E = k; i >= i##E; i--) #define ll long long #define pii pair<int, int> #define db double #define x first #define y second #define ull unsigned long long #define sz(a) ((int) (a).siz... |
#include <bits/stdc++.h> using namespace std; long long n, tmp1, tmp2, q; string s, t; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> q; for (int rr = 0; rr < q; rr++) { cin >> n >> s; tmp1 = 0, t = ; while (s[tmp1] == 0 && tmp1 < n) { ... |
#include <bits/stdc++.h> using namespace std; int main() { long long int n, t; cin >> n >> t; long long int A[n]; for (long long int i = 0; i < n; i++) { cin >> A[i]; } long long int cnt = 0; long long int sum = 0; long long int i = 0; long long int j = 0; for (i = 0; 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... |
// Accellera Standard V2.3 Open Verification Library (OVL).
// Accellera Copyright (c) 2005-2008. All rights reserved.
`ifdef OVL_ASSERT_ON
wire xzcheck_enable;
`ifdef OVL_XCHECK_OFF
assign xzcheck_enable = 1'b0;
`else
`ifdef OVL_IMPLICIT_XCHECK_OFF
assign xzcheck_enable = 1'b0;
`else
assign xzcheck... |
#include <bits/stdc++.h> using namespace std; #pragma comment(linker, /STACK:1024000000,1024000000 ) int _MAX(int a, int b) { return a > b ? a : b; } int _MIN(int a, int b) { return a > b ? b : a; } int Scan() { int res = 0, flag = 0; char ch; if ((ch = getchar()) == - ) flag = 1; else... |
// ***************************************************************************
// ***************************************************************************
// Copyright 2011(c) Analog Devices, Inc.
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// 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 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... |
`timescale 1ns / 1ps
////////////////////////////////////////////////////////////////////////////////
// Company: California State University San Bernardino
// Engineer: Bogdan Kravtsov
// Tyler Clayton
//
// Create Date: 11:28:25 10/17/2016
// Module Name: REG
// Project Name: MIPS
// D... |
#include <bits/stdc++.h> using namespace std; const long long M = 1e6 + 5; const long long mod = 1e9 + 7; void solve() { long long n; cin >> n; long long a = n / 10; long long b = n % 10; long long ans = a + (b == 9); cout << ans; } signed main() { ios::sync_with_stdio(false); ... |
#include <bits/stdc++.h> using namespace std; int a[10], b[10]; int main() { int m, n; cin >> m >> n; for (int i = 0; i < m; i++) cin >> a[i]; for (int j = 0; j < n; j++) cin >> b[j]; sort(a, a + m); sort(b, b + n); int flag = 0, ans; for (int i = 0, j = 0; i < m && j < n;) { ... |
//////////////////////////////////////////////////////////////////////
//// ////
//// uart_log.v ////
//// ////
//// This file is part of the "uart... |
#include <bits/stdc++.h> using namespace std; #define rep(i, a) for(int i=0;i<a;i++) #define repA(i,a,b)for(int i=a;i<b;i++) #define l list #define v vector #define u_m unordered_map typedef long long ll; const int mxN=101,MOD=1e9+7; void solve(){ int n,m,count=1,r=0; cin>>n>>m; string s; ... |
#include <bits/stdc++.h> using namespace std; template <typename T> struct number_iterator : iterator<random_access_iterator_tag, T> { T v; number_iterator(T _v) : v(_v) {} operator T &() { return v; } T operator*() const { return v; } }; template <typename T> struct number_range { T b, ... |
#include <bits/stdc++.h> using namespace std; inline int read() { static char buf[1 << 21], *p1, *p2; int f = 0, c = 1; char ch = (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 21, stdin), p1 == p2) ? EOF : *p1++); while (ch < 0 || ch > 9 ) { if (ch == ... |
#include <bits/stdc++.h> using namespace std; const int maxn = 250000 + 5; long long dp[maxn]; int main() { long long n, m; scanf( %lld %lld , &n, &m); dp[0] = dp[1] = 1; for (long long i = 2; i <= n; i++) { dp[i] = ((dp[i - 1] % m) * (i % m)) % m; } long long sum = 0; for (lon... |
#include <bits/stdc++.h> using namespace std; vector<int> alz(string a) { int n = a.size(); vector<int> res(n); int left = 0, right = 0; for (int k = 1; k < n; k++) { if (right < k) { right = left = k; while (right < n && a[right] == a[right - left]) right++; res[k] = r... |
#include <bits/stdc++.h> using namespace std; int m; long long n; long long deg[1001001], result; vector<vector<int> > e; int main() { scanf( %d%d , &n, &m); for (int i = 0; i < m; i++) { int a, b; scanf( %d%d , &a, &b); deg[a]++; deg[b]++; } result = 0; for (int ... |
#include <bits/stdc++.h> using namespace std; void show() {} template <typename T, typename... V> void show(T t, V... v) { cerr << t; if (sizeof...(v)) cerr << , ; show(v...); } template <class X> bool mini(X& a, const X& b) { if (a > b) { a = b; return true; } return... |
/******************************************************************************
* License Agreement *
* *
* Copyright (c) 1991-2012 Altera Corporation, San Jose, California, USA. *
... |
/**
* 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 = 1e3 + 5; vector<int> mp[maxn]; vector<int> R[maxn]; vector<int> L[maxn]; int ans = 0; bool vis[maxn]; int n, m; struct node { int last_L; int last_R; } last[maxn]; void dfs(int now, int l, int r) { if (now == n) { ans... |
#include <bits/stdc++.h> using namespace std; const int maxn = 100 + 5; struct node { long long x, y; int id; bool operator<(const node &ope) const { return y < ope.y; } } a[maxn]; bool vis[maxn][maxn]; long long dp[maxn][maxn]; bool vis2[maxn]; inline void init() { memset(dp, -1, sizeof... |
module Display
#(parameter CLOCK_DIVISOR = 800,
parameter CLK_BITS = 16)
(
input wire clk,
input wire [15:0] data,
output reg [6:0] segments,
output wire [3:0] anodes
);
reg [3:0] multiplexState = 4'b0111;
assign anodes = multiplexState;
wire [3:0] display[0:3];
assign d... |
////////////////////////////////////////////////////////////////////////////////
// //
// This file is placed into the Public Domain, for any use, without warranty. //
// 2012 by Iztok Jeras ... |
// DESCRIPTION: Verilator: Verilog Test module
//
// Copyright 2011 by Wilson Snyder. This program is free software; you can
// redistribute it and/or modify it under the terms of either the GNU
// Lesser General Public License Version 3 or the Perl Artistic License
// Version 2.0.
`define is_near_real(a,b) (( ((a)<(... |
From elpi.apps Require Import NES.
(* Namespaces are like modules, since they let you organize your notions
and avoid name collisions.
Namespaces are unlinke modules, since you can always add a notion to
a namespace, even if the namespace was ended before. *)
NES.Begin This.Is.A.Long.Namespace.
Definition ... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company: Rose-Hulman Institute of Technology
// Engineer: Adam and Mohammad
// Create Date: 20:04:56 10/24/2015
// Design Name: Phase 1 Top Level Module
// Module Name: lab6phase1I2C2015fall
// Summary: ... |
#include <bits/stdc++.h> using namespace std; long long n, m, u, cnt = 1, ch[4000005][4], dp[4000005][4], dpp[60][4][4]; long long rev[2][4], nw = 0, ans = 0; char s[100005]; const long long inf = 2e18; void dfs(int p) { for (int i = 0; i < 4; i++) dp[p][i] = inf; for (int i = 0; i < 4; i++) { ... |
#include <bits/stdc++.h> using namespace std; struct ton { vector<pair<long long, long long> > v[1919810 + 3]; long long& operator()(long long a, int b, int c, int d) { a = ((a * 4000ll + b) * 4000ll + c) * 3ll + (d == 1); int k = a % 1919810; for (auto u = v[k].begin(); u != v[k].end(); u... |
#include <bits/stdc++.h> using namespace std; const int N = 1010; const int MAXK = 1000010; int n, m, k, p, a[N][N], row[N], col[N]; long long ans1[MAXK], ans2[MAXK]; multiset<long long> Unis; void solve(long long *ans, int n, int *a, int dta) { Unis.clear(); for (int i = 1; i <= n; ++i) { U... |
// nios_dut_nios2_gen2_0.v
// This file was auto-generated from altera_nios2_hw.tcl. If you edit it your changes
// will probably be lost.
//
// Generated using ACDS version 15.1 185
`timescale 1 ps / 1 ps
module nios_dut_nios2_gen2_0 (
input wire clk, // ... |
// 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 : Sun Apr 09 07:03:52 2017
// Host : GILAMONSTER running 64-bit major release (... |
module ComWithCC3200(
input CC3200_SPI_CLK,
input CC3200_SPI_CS,
output reg CC3200_SPI_DIN,
input CC3200_SPI_DOUT,
input Envelop,
output reg [7:0] Line_Num, //Current Sample Line
output reg Enable,
output reg [1:0] Zoom,
output reg [5:0] Gain,
input [7:0] Trans_Data,
output reg [8:0] Trans_Addr
... |
`include "../network_params.h"
module fm_coord_sr (
input clock,
input reset,
input [`X_COORD_BITWIDTH:0] x_coord, // from mult adder ctrl
input [`Y_COORD_BITWIDTH:0] y_coord, // from mult adder ctrl
output [`X_COORD_BITWIDTH:0] fm_x_coord, // from mult adder ctrl
output [`Y_COORD_BITWIDTH:0] fm_y_coord ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.