YOLO11改進加入ResNet網絡

文章目錄

    • 1.改進目的
    • 2.demo引入
      • 2.1代碼
      • 2.2 結果展示
      • 2.3 BottleNeck詳解

1.改進目的

原始YOLO11模型訓練好以后,檢測結果mAP結果很低,視頻檢測結果很差,于是想到改進網絡,這里介紹改進主干網絡。

2.demo引入

2.1代碼

# @File: 21.YOLO11修改主干網絡.py
# @Author: chen_song
# @Time: 2025-02-28 21:29
import torch
import torch.nn as nn
import torchvision.models as modelsclass YOLO11Backbone(nn.Module):def __init__(self, num_classes=80):super(YOLO11Backbone, self).__init__()# 使用預訓練的ResNet50作為主干網絡self.backbone = models.resnet50(pretrained=True)# 修改最后一層全連接層以適應YOLO的輸出self.backbone.fc = nn.Linear(self.backbone.fc.in_features, num_classes)def forward(self, x):x = self.backbone(x)return x# 一個簡單的測試用例
if __name__ == "__main__":model = YOLO11Backbone(num_classes=80)print(model)# 創建一個隨機輸入張量input_tensor = torch.randn(1, 3, 224, 224)output = model(input_tensor)print(output.shape)

2.2 結果展示

D:\anaconda3\envs\yolov5_cuda12.4\python.exe E:\PROJ\yolo11\ultralytics\ultralytics\demo\21.YOLO11修改主干網絡.py
D:\anaconda3\envs\yolov5_cuda12.4\lib\site-packages\torchvision\models_utils.py:208: UserWarning: The parameter ‘pretrained’ is deprecated since 0.13 and may be removed in the future, please use ‘weights’ instead.
warnings.warn(
D:\anaconda3\envs\yolov5_cuda12.4\lib\site-packages\torchvision\models_utils.py:223: UserWarning: Arguments other than a weight enum or None for ‘weights’ are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing weights=ResNet50_Weights.IMAGENET1K_V1. You can also use weights=ResNet50_Weights.DEFAULT to get the most up-to-date weights.
warnings.warn(msg)
Downloading: “https://download.pytorch.org/models/resnet50-0676ba61.pth” to C:\Users\PC/.cache\torch\hub\checkpoints\resnet50-0676ba61.pth
100%|██████████| 97.8M/97.8M [02:45<00:00, 619kB/s]
YOLO11Backbone(
(backbone): ResNet(
(conv1): Conv2d(3, 64, kernel_size=(7, 7), stride=(2, 2), padding=(3, 3), bias=False)
(bn1): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu): ReLU(inplace=True)
(maxpool): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)
(layer1): Sequential(
(0): Bottleneck(
(conv1): Conv2d(64, 64, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn1): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv2): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv3): Conv2d(64, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn3): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu): ReLU(inplace=True)
(downsample): Sequential(
(0): Conv2d(64, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)
(1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
)
(1): Bottleneck(
(conv1): Conv2d(256, 64, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn1): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv2): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv3): Conv2d(64, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn3): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu): ReLU(inplace=True)
)
(2): Bottleneck(
(conv1): Conv2d(256, 64, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn1): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv2): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv3): Conv2d(64, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn3): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu): ReLU(inplace=True)
)
)
(layer2): Sequential(
(0): Bottleneck(
(conv1): Conv2d(256, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv2): Conv2d(128, 128, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), bias=False)
(bn2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv3): Conv2d(128, 512, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn3): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu): ReLU(inplace=True)
(downsample): Sequential(
(0): Conv2d(256, 512, kernel_size=(1, 1), stride=(2, 2), bias=False)
(1): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
)
(1): Bottleneck(
(conv1): Conv2d(512, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv2): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv3): Conv2d(128, 512, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn3): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu): ReLU(inplace=True)
)
(2): Bottleneck(
(conv1): Conv2d(512, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv2): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv3): Conv2d(128, 512, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn3): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu): ReLU(inplace=True)
)
(3): Bottleneck(
(conv1): Conv2d(512, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv2): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv3): Conv2d(128, 512, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn3): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu): ReLU(inplace=True)
)
)
(layer3): Sequential(
(0): Bottleneck(
(conv1): Conv2d(512, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv2): Conv2d(256, 256, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), bias=False)
(bn2): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv3): Conv2d(256, 1024, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn3): BatchNorm2d(1024, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu): ReLU(inplace=True)
(downsample): Sequential(
(0): Conv2d(512, 1024, kernel_size=(1, 1), stride=(2, 2), bias=False)
(1): BatchNorm2d(1024, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
)
(1): Bottleneck(
(conv1): Conv2d(1024, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv2): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv3): Conv2d(256, 1024, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn3): BatchNorm2d(1024, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu): ReLU(inplace=True)
)
(2): Bottleneck(
(conv1): Conv2d(1024, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv2): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv3): Conv2d(256, 1024, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn3): BatchNorm2d(1024, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu): ReLU(inplace=True)
)
(3): Bottleneck(
(conv1): Conv2d(1024, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv2): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv3): Conv2d(256, 1024, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn3): BatchNorm2d(1024, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu): ReLU(inplace=True)
)
(4): Bottleneck(
(conv1): Conv2d(1024, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv2): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv3): Conv2d(256, 1024, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn3): BatchNorm2d(1024, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu): ReLU(inplace=True)
)
(5): Bottleneck(
(conv1): Conv2d(1024, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv2): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv3): Conv2d(256, 1024, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn3): BatchNorm2d(1024, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu): ReLU(inplace=True)
)
)
(layer4): Sequential(
(0): Bottleneck(
(conv1): Conv2d(1024, 512, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn1): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv2): Conv2d(512, 512, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), bias=False)
(bn2): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv3): Conv2d(512, 2048, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn3): BatchNorm2d(2048, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu): ReLU(inplace=True)
(downsample): Sequential(
(0): Conv2d(1024, 2048, kernel_size=(1, 1), stride=(2, 2), bias=False)
(1): BatchNorm2d(2048, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
)
(1): Bottleneck(
(conv1): Conv2d(2048, 512, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn1): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv2): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv3): Conv2d(512, 2048, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn3): BatchNorm2d(2048, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu): ReLU(inplace=True)
)
(2): Bottleneck(
(conv1): Conv2d(2048, 512, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn1): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv2): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv3): Conv2d(512, 2048, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn3): BatchNorm2d(2048, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu): ReLU(inplace=True)
)
)
(avgpool): AdaptiveAvgPool2d(output_size=(1, 1))
(fc): Linear(in_features=2048, out_features=80, bias=True)
)
)
torch.Size([1, 80])

Process finished with exit code 0

2.3 BottleNeck詳解

在這里插入圖片描述由于ResNet可以構建更深的網絡,所以最后對特征的提取必定比原始YOLO11強。

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/bicheng/72117.shtml
繁體地址,請注明出處:http://hk.pswp.cn/bicheng/72117.shtml
英文地址,請注明出處:http://en.pswp.cn/bicheng/72117.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

Spring MVC流程

SpringMVC啟動流程 啟動流程父子容器請求處理MultipartFile 解析參數傳遞返回值處理HandlerInterceptor 啟動流程 啟動Tomcat解析web.xml創建DispatcherServlet調用DIspatcherServlet的init方法 4.1 創建Spring容器 4.2 發布ContextRefresheEvent 4.3 在OnRefreshed方法中觸發…

【大數據】ClickHouse常見的錯誤及解決方式

ClickHouse 是一款高性能的列式數據庫&#xff0c;但在使用過程中難免會遇到一些錯誤。本文將介紹一些 ClickHouse 常見的錯誤及其解決方式&#xff0c;幫助您更好地使用 ClickHouse。 1、錯誤&#xff1a;DB::Exception 錯誤信息 DB::Exception:Table engine Distributed d…

物理競賽中的線性代數

線性代數 1 行列式 1.1 n n n 階行列式 定義 1.1.1&#xff1a;稱以下的式子為一個 n n n 階行列式&#xff1a; ∣ A ∣ ∣ a 11 a 12 ? a 1 n a 21 a 22 ? a 2 n ? ? ? ? a n 1 a n 2 ? a n n ∣ \begin{vmatrix}\mathbf A\end{vmatrix} \begin{vmatrix} a_{11…

IP-----動態路由OSPF

這只是IP的其中一塊內容&#xff0c;IP還有更多內容可以查看IP專欄&#xff0c;前一章內容為GRE和MGRE &#xff0c;可通過以下路徑查看IP-------GRE和MGRE-CSDN博客,歡迎指正 注意&#xff01;&#xff01;&#xff01;本部分內容較多所以分成了兩部分在下一章 5.動態路由OS…

數字內容體驗未來趨勢:交互升級與用戶深耕

智能技術重塑內容交互 隨著數字內容體驗進入深度智能化階段&#xff0c;AI驅動的內容生成與智能推薦算法正在重構用戶與信息的交互范式。基于自然語言處理技術的內容創作工具&#xff0c;已實現從文本自動生成到多模態內容適配的跨越&#xff0c;企業能夠以分鐘級速度產出符合…

2025年2月21日優雅草內測分發站全新升級-測試運營-優雅草內測分發站新用戶提供免費100下載點-2月28日正式運營并且提供私有化部署版本

2025年2月21日優雅草內測分發站全新升級-測試運營-優雅草內測分發站新用戶提供免費100下載點-2月28日正式運營并且提供私有化部署版本 說明 優雅草內測分發站新用戶提供免費100下載點&#xff0c;優雅草分運營站和demo測試站 運營站&#xff1a;www.youyacao.cn 提供免費100…

動態內存池設計與環形緩沖區實現詳解

一、動態內存池設計 在嵌入式系統中&#xff0c;頻繁使用 malloc 和 free 會導致內存碎片和性能問題。動態內存池通過預分配固定大小的內存塊&#xff0c;并統一管理分配與釋放&#xff0c;顯著提高內存使用效率和實時性。 1. 核心設計思路 預分配內存&#xff1a;將內存劃分…

015--基于STM32F103ZET6的智能風扇設計

1.實物視頻演示 智能風扇演示視頻 2.程序代碼講解 STM32F103ZET6智能風扇_嗶哩嗶哩_bilibili 3源代碼獲取 https://download.csdn.net/download/weixin_41011452/90440545

【洛谷貪心算法】P1106刪數問題

這道題可以使用貪心算法來解決&#xff0c;核心思路是盡量讓高位的數字盡可能小。當我們逐步刪除數字時&#xff0c;會優先刪除高位中相對較大的數字。具體做法是從左到右遍歷數字序列&#xff0c;當發現當前數字比它后面的數字大時&#xff0c;就刪除當前數字&#xff0c;直到…

開源PDF解析工具olmOCR

olmOCR 是由 Allen Institute for Artificial Intelligence (AI2) 的 AllenNLP 團隊開發的一款開源工具&#xff0c;旨在將PDF文件和其他文檔高效地轉換為純文本&#xff0c;同時保留自然的閱讀順序。它支持表格、公式、手寫內容等。 olmOCR 經過學術論文、技術文檔和其他文檔…

基因型—環境兩向表數據分析——品種生態區劃分

參考資料&#xff1a;農作物品種試驗數據管理與分析 用于品種生態區劃分的GGE雙標圖有兩種功能圖&#xff1a;試點向量功能圖和“誰贏在哪里”功能圖。雙標圖的具體模型基于SD定標和h加權和試點中心化的數據。本例中籽粒產量的GGE雙標圖僅解釋了G和GE總變異的53.6%&#xff0c;…

HTTP~文件 MIME 類型

MIME&#xff08;Multipurpose Internet Mail Extensions&#xff09;類型&#xff0c;即多用途互聯網郵件擴展類型&#xff0c;是一種標準&#xff0c;用來表示文檔、文件或字節流的性質和格式。最初是為了在電子郵件系統中支持非 ASCII 字符文本、二進制文件附件等而設計的&a…

降維攻擊!PCA與隨機投影優化高維KNN

引言&#xff1a;高維數據的“冰山困境” 假設你正在處理一個電商平臺的商品圖片分類任務&#xff1a;每張圖片被提取為1000維的特征向量&#xff0c;100萬條數據的距離計算讓KNN模型陷入“維度地獄”——計算耗時長達數小時&#xff0c;且內存占用超過10GB。 破局關鍵&#…

Rust 是什么

Rust 是什么 Rust 是一種由 Mozilla 開發的系統級編程語言,它于 2010 年首次亮相,在 2015 年發布 1.0 版本,此后迅速發展并受到廣泛關注。 內存安全:Rust 最大的亮點之一是它在編譯階段就能夠避免常見的內存錯誤,如空指針引用、數據競爭和內存泄漏等。它通過所有權(Owne…

網絡變壓器的主要電性參數與測試方法(2)

Hqst盈盛&#xff08;華強盛&#xff09;電子導讀&#xff1a;網絡變壓器的主要電性參數與測試方法&#xff08;2&#xff09;.. 今天我們繼續來看看網絡變壓器的2個主要電性參數與它的測試方法&#xff1a; 1. 線圈間分布電容Cp:線圈間雜散靜電容 測試條件:100KHz/0.1…

UniApp 中封裝 HTTP 請求與 Token 管理(附Demo)

目錄 1. 基本知識2. Demo3. 拓展 1. 基本知識 從實戰代碼中學習&#xff0c;上述實戰代碼來源&#xff1a;芋道源碼/yudao-mall-uniapp 該代碼中&#xff0c;通過自定義 request 函數對 HTTP 請求進行了統一管理&#xff0c;并且結合了 Token 認證機制 請求封裝原理&#xff…

初階數據結構習題【3】(1時間和空間復雜度)——203移除鏈表元素

1. 題目描述 力扣在線OJ——移除鏈表元素 給你一個鏈表的頭節點 head 和一個整數 val &#xff0c;請你刪除鏈表中所有滿足 Node.val val 的節點&#xff0c;并返回 新的頭節點 。 示例1&#xff1a; 輸入&#xff1a;head [1,2,6,3,4,5,6], val 6 輸出&#xff1a;[1,2,3…

互聯網+房產中介+裝修設計+物料市場+智能家居一體化平臺需求書

一、項目概述 1.1 項目背景 隨著互聯網技術的飛速發展以及人們生活品質的顯著提升&#xff0c;傳統房產交易、裝修設計、家居購物等領域暴露出諸多問題。信息不對稱使得用戶難以獲取全面準確的信息&#xff0c;在房產交易中可能高價買入或低價賣出&#xff0c;裝修時可能遭遇…

15.13 AdaLoRA自適應權重矩陣微調:動態秩調整的智能革命

AdaLoRA自適應權重矩陣微調:動態秩調整的智能革命 一、技術架構解析 #mermaid-svg-u3TfE3YrkeWSjem2 {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-u3TfE3YrkeWSjem2 .error-icon{fill:#552222;}#mermaid-svg-u3…

P9231 [藍橋杯 2023 省 A] 平方差

P9231 [藍橋杯 2023 省 A] 平方差 - 洛谷 題目描述 給定 L,R&#xff0c;問 L≤x≤R 中有多少個數 x 滿足存在整數 y,z 使得 xy2?z2。 輸入格式 輸入一行包含兩個整數 L,R&#xff0c;用一個空格分隔。 輸出格式 輸出一行包含一個整數滿足題目給定條件的 x 的數量。 輸…