POJ 3090 Visible Lattice Points(欧拉函数)

香橙派rk3588的rknn多线程推理RTSP流服务性能优化与资源分配策略 本文深入探讨了香橙派RK3588平台上的RKNN多线程推理在RTSP流服务中的性能优化与资源分配策略。通过分析硬件架构、设计多线程推理流水线、实现NPU核心负载均衡及优化RGA内存管理,显著提升了RTSP视频流的处理帧率和降低了延迟,为边缘计算视频分析应用提供了实用的优化方案。 阅读详情

题目链接:
POJ 3090 Visible Lattice Points
题意:
给你一个方格,问从最左下角最多能看到多少点?
分析:
其实还是欧拉函数~

#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <algorithm>
#include <climits>
#include <cmath>
#include <ctime>
#include <cassert>
#define IOS ios_base::sync_with_stdio(0); cin.tie(0);
using namespace std;
typedef long long ll;
const int MAX_N = 1010;

int T, n, cases = 0;
ll euler[MAX_N];

void GetEuler()
{
    euler[1] = 1;
    for(int i = 2; i < MAX_N; i++){
        if(euler[i] == 0){
            for(int j = i; j < MAX_N; j += i){
                if(euler[j] == 0) euler[j] = j;
                euler[j] = euler[j] / i * (i - 1);
            }
        }
    }
}

int main()
{
    GetEuler();
    scanf("%d", &T);
    while(T--){
        scanf("%d", &n);
        ll sum = 0;
        for(int i = 1; i <= n; i++){
            sum += euler[i];
        }
        sum = sum * 2 + 1;
        printf("%d %d %lld\n", ++cases, n, sum);
    }
    return 0;
}
升级最新IDEA版本(2022.1.1) 阅读详情

相关推荐

VSCode连接SAP ABAP开发环境

本文介绍了使用VSCode连接ABAP开发环境的详细步骤。首先通过SICF或SMICM事务码获取ABAP连接地址,然后安装ABAP remote filesystem插件。提供了两种创建连接的方法:通过命令面板逐步配置(输入服务器地址、账号、系统标识等)或直接编辑JSON配置文件。最后通过命令面板选择已创建的连接即可完成连接,连接成功后可在VSCode左侧工作区查看ABAP系统内容进行开发。JSON配置方式更为简便推荐。整个流程帮助开发者摆脱复杂的Eclipse配置,实现快速便捷的ABAP开发环境搭建。

weixin_45293769的博客 2232

POJ——3090 Visible Lattice Points(欧拉函数)

题目传送门:POJ——3090 Visible Lattice Points Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 10420 Accepted: 6304 Description A lattice point (x, y) in the first quadrant (x and y are ...

HANGANG的博客 275

Python实现飞书机器人定时发送文本、图片等群消息

python实现飞书群自动发送告警消息

tyh_keephunger的博客 2万+

POJ - 3090 Visible Lattice Points(欧拉函数)

POJ - 3090 Visible Lattice Points 分析这道题目,我们发现除了(1,0),(0,1),(1,1)三个钉子,其他钉子被看到,只有满足了分析这道题目,我们发现除了(1,0),(0,1),(1,1)三个钉子,其他钉子被看到,只有满足了分析这道题目,我们发现除了(1,0),(0,1),(1,1)三个钉子,其他钉子被看到,只有满足了 1≤x,y≤N,x≠y1≤x,y≤N,x≠y而且gcd(x,y)=11≤x,y≤N,x≠y1≤x,y≤N,x≠y 而且gcd(x,y)=11≤x,y≤N

00后的博客 183

6.4 构网型储能的需求与配置

摘要: 构网型储能是新型电力系统的关键支撑技术,通过提供电压/频率形成、惯性和稳定控制能力,解决同步机退出导致的系统稳定性问题。其配置需遵循三大原则:1)容量配置以支撑需求为主导,兼顾能量服务;2)优先布局于电网薄弱点、稳定问题突出区域;3)采用自适应控制策略实现全工况优化。核心应用场景包括新能源送出通道稳定、负荷中心调频、黑启动电源等。规划方法需结合系统分析、量化指标和成本效益评估,实现技术经济最优。未来需重点关注构网/跟网混合系统的临界容量占比及自适应控制技术发展。

技术工作者 1146

SPWM波调制度原理

SPWM波调制度原理

qq_43557686的博客 1万+

POJ3090 Visible Lattice Points 欧拉函数

Visible Lattice Points Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 9734 Accepted: 5920 Description A lattice point (x, y) in the first quadrant (x and y are integers greater than or e...

DouglasConnor的博客 353

在VSCode中使用LaTex+(grammarly语法检测,chatgpt翻译,Sumatra PDF 轻量级pdf阅读器)

整个文章分为以下几个内容,打 * 的是必须要安装的。

u011895157的博客 2万+

欧拉函数 - Visible Lattice Points - POJ 3090

欧拉函数 - Visible Lattice Points - POJ 3090 在一个平面直角坐标系的第一象限内,如果一个点(x,y)与原点(0,0)的连线中没有通过其他任何点,则称该点在原点处是可见的。 例如,点(4,2)就是不可见的,因为它与原点的连线会通过点(2,1)。 部分可见点与原点的连线如下图所示: 编写一个程序,计算给定整数N的情况下,满足0≤x,y≤N的可见点(x,y)的数量(可见点不包括原点)。 输入格式 第一行包含整数C,表示共有C组测试数据。 每组测试数据占一行,包含一个整数N。

njuptACMcxk的博客 2761

YOLOv11 改进 - C2PSA | C2PSA融合TSSA(Token Statistics Self-Attention)令牌统计自注意力,优化遮挡目标感知

本文介绍了Token Statistics Self-Attention(TSSA)机制,并将其集成到YOLOv11中。传统自注意力计算复杂度高,TSSA进行了范式转变,基于token统计特征实现高效注意力交互。它通过“算法展开”推导得出,以“最大编码率降低”为目标,实现特征学习。TSSA包含动态分组和低秩投影优化两步创新,具备线性复杂度。我们将TSSA代码集成到YOLOv11的C2PSA模块中。实验表明,改进后的YOLOv11在目标检测任务中表现良好,验证了TSSA机制的有效性。

魔改工程师的博客 674

PDAF相位对焦原理

pdaf光路图

camerall 1万+

[欧拉函数]Visible Lattice Points POJ3090

A lattice point (x,y) in the first quadrant (xandyare integers greater than or equal to 0), other than the origin, is visible from the origin if the line from (0, 0) to (x,y) does not pass through any other lattice point. For example, the point (4, 2)...

Cloth的博客 607

解决Gradle中NPM命令失效问题

摘要:本文分析了IntelliJ IDEA中Gradle执行npm命令失败的问题,报错显示"npm"文件不存在。通过确认npm安装路径、检查系统PATH与Gradle环境的差异,提出两种解决方案:1) 在build.gradle中使用npm绝对路径;2) 通过launchctl修改用户PATH。实例展示了如何修改Gradle脚本或系统配置来解决该问题,指出跨平台开发中环境变量配置的重要性。文章为开发者提供了处理类似问题的实用方法。

2501_90323865的博客 91

POJ3090 Visible Lattice Points(欧拉函数)

欧拉函数欧拉函数的定义:1~N中与N互质的数的个数被称为欧拉函数,我们用phi[i]来记录与i互质的数的个数。根据算数基本定理(唯一分解定理),即N可以分解成N=p1^c1*p2^c2*…pm^cm,其中pi为质数可以推出phi[N]=N * (p1 - 1) / p1 * (p2 - 1) / p2*…(pm - 1) / pm。欧拉函数的部分性质:phi[n] = phi[n / p] * (...

Dillonh的博客 315

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

POJ 3090 Visible Lattice Points (欧拉函数)

题目链接:POJ 3090 Description A lattice point \((x, y)\) in the first quadrant (\(x\) and \(y\) are integers greater than or equal to \(0\)), other than the origin, is visible from the origin if the...

G19850917的博客 175

贝叶斯统计 [韦来生编]

贝叶斯(Bayes)统计是近几十年来迅速发展起来的数理统计的一个重要分支。贝叶斯方法与经典统计方法的主要不同之处是进行统计推断时除了利用样本信息外,还要利用参数的先验信息,因此可以提高统计推断或统计决策的效果。它在经济、金融、生物、医学、自然科学和社会科学等许多领域具有广泛的应用。贝叶斯方法的研究已渗透到了统计学的几乎所有领域。作者在给中国科学技术大学概率论与数理统计专业本科生开设的“数理统计”课程中有一章专门讲授“贝叶斯方法和统计决策理论”,近十年来也给中国科学技术大学概率统计专业研究生开设过几次“贝叶斯分析”课。本书是在对过去讲稿的内容作了适当的增减和调整的基础上完成的。  本书共分六章。第1章是绪论,介绍了贝叶斯统计的若干基本概念,同时对必要的数理统计的基础知识有重点地作了回顾。第二章介绍了确定先验分布的若干可供选择的方法。第三章介绍了几类常见统计模型参数的后验分布的主要结果和计算方法。第四章和第五章分别介绍了“贝叶斯统计推断”和“贝叶斯统计决策”的内容。第六章介绍了贝叶斯统计计算的若干方法,包括蒙特卡洛方法和马尔可夫链蒙特卡洛(MCMC)方法以及相关统计软件的简介。本书的每一章附右大量的例题和习题,书末附有常用的几个表格和部分习题解答供读者查用。  大约可在54学时内讲授本书的第1章至第六章的主要内容,教师可根据学时需要选讲本书第1章至第六章的部分内容。书中标“*”号的章节可略去不讲,留给读者作为阅读材料。第六章例题中的R代码和部分例题的数据文件等可从作者个人主页下载。  作者在编写本书的过程中参考了J.O.Berger教授的《统计决策论及贝叶斯分析》和茆诗松教授编写的《贝叶斯统计》等书中的一些内容,以及《贝叶斯分析》一书中由张伟平博士编写的有关贝叶斯统计计算的一些内容。在此表示衷心感谢。  本书编写准备过程中,中国科学技术大学统计与金融系的几个研究生帮助完成了本书部分中文的录入和排版,作者对他们的辛勤工作表示真诚的感谢。高等教育出版社为本书的出版给予了大力支持。在此一并致谢。

POJ 3090 Visible Lattice Points【欧拉函数】

题目: A lattice point (x,y) in the first quadrant (xandyare integers greater than or equal to 0), other than the origin, is visible from the origin if the line from (0, 0) to (x,y) does not pass ...

二喵君的博客 260

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

[欧拉函数】 POJ 3090 Visible Lattice Points 详解

题目链接:https://vjudge.net/problem/POJ-3090 题目大意: A lattice point (x,y) in the first quadrant (xandyare integers greater than or equal to 0), other than the origin, is visible from the origin if the line from (0, 0) to (x,y) does not pass through any ...

Qiuker_jl的博客 369

POJ - 3090 Visible Lattice Points 欧拉函数

题目链接: https://vjudge.net/problem/POJ-3090 题意: 输入一个n,问从(0,0)点能看到多少个点,坐标范围 0<=i,j<=n; 题解: 通过观察我们能够发现,除了(0,1)(1,1)(1,0)这三个点,其它能看到的点满足:横坐标x和纵坐标y互质,并且经过直线y=x对称。然后我们只要算出y=x直线下的点,乘2就是答案,y=x直线下...

lt的博客 233

POJ 3090-Visible Lattice Points(筛选法求欧拉函数)

Visible Lattice Points Time Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Submit Status Practice POJ 3090 Appoint description:  System Crawler  (2015-04-01)

Rocky0429 1736

POJ 3090 Visible Lattice Points 【欧拉函数】

<题目链接> 题目大意: 给出范围为(0, 0)到(n, n)的整点,你站在(0,0)处,问能够看见几个点。 解题分析:很明显,因为 N(1 ≤N≤ 1000) ,所以无论 N 为多大,(0,1),(1,1),(1,0)这三个点一定能够看到,除这三个点以外,我们根据图像分析可得,设一个点的坐标为(x,y) ,那么只有符合gcd(x,y)=1的点才能被看到。又因为 (0...

weixin_30563319的博客 95

Visible Lattice Points(Poj3090)(欧拉函数运用)

Visible Lattice Points Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 6167   Accepted: 3674 Description A lattice point (x, y) in the first quadrant (x an

My Castle 627

Poj3090 Visible Lattice Points(欧拉函数)

欧拉函数 欧拉函数的定义:1~N中与N互质的数的个数被称为欧拉函数,我们用phi[i]来记录与i互质的数的个数。 根据算数基本定理(唯一分解定理),即N可以分解成N=p1^c1*p2^c2*…pm^cm,其中pi为质数可以推出phi[N]=N * (p1 - 1) / p1 * (p2 - 1) / p2*…(pm - 1) / pm。 欧拉函数的部分性质:phi[n] = phi...

di6499的博客 200

POJ-3090-Visible Lattice Points(欧拉函数)

Visible Lattice Points A lattice point (x, y) in the first quadrant (x and y are integers greater than or equal to 0), other than the origin, is visible from the origin if the line from (0, 0) to (x, y) does not pass through any other lattice point. For ex

qq_43461168的博客 241

poj3090 Visible Lattice Points [欧拉函数]

Description A lattice point (x,y) in the first quadrant (xandyare integers greater than or equal to 0), other than the origin, is visible from the origin if the line from (0, 0) to (x,y) ...

dirushi6322的博客 93

POJ3090 Visible Lattice Points 【欧拉函数+欧式筛法】

在一个平面直角坐标系的第一象限内,如果一个点(x,y)与原点(0,0)的连线中没有通过其他任何点,则称该点在原点处是可见的。 例如,点(4,2)就是不可见的,因为它与原点的连线会通过点(2,1)。 部分可见点与原点的连线如下图所示: 编写一个程序,计算给定整数N的情况下,满足0≤x,y≤N的可见点(x,y)的数量(可见点不包括原点)。 输入格式 第一行包含整数C,表示共有C组测试数据。 每组测试...

zhaohaibo的博客 580

poj 3090 Visible Lattice Points 欧拉函数打表求和

Visible Lattice Points Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 6329   Accepted: 3774 Description A lattice point (x, y) in the first quadrant (x an

ctrss的博客 419
上一篇: UVA 10820 Send a Table(欧拉函数)
下一篇: URAL 1226 Little Chu(最大原根)
ramay7
博客等级 码龄11年 64粉丝 464原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值