首页 > 其他分享 >A. Constructive Problems

A. Constructive Problems

时间:2023-12-18 10:58:31浏览次数:20  
标签:cout 格子 int Problems cin Constructive

原题链接

思路历程

1.一开始我不知道具体该怎么放,于是我按照样例2的顺序手画了一遍。
2.然后发现,对于一个n*n的矩形,再放一个格子最大能使其达到(n+1)*(n+1)
3.1*1时,放了1个格子,2*2时放了2个格子,由此可以推出放n个格子时最大能达到n*n
4.这道题就变成了,找出k使得k*k刚好能覆盖n*m,也就是\(k=max(n,m)\)

代码

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int x,y;
        cin>>x>>y;
        cout<<max(x,y)<<endl;
    }
    return 0;
}

标签:cout,格子,int,Problems,cin,Constructive
From: https://www.cnblogs.com/pure4knowledge/p/17910531.html

相关文章

  • POLIR-Management-TYPES of decisions{Structured(routine+familiar)Problems: Progra
    Inaverysimplesense,theproblemsmanagersencountercanbeclassifiedas:routineandfamiliar;newandunusual.Inresponse,managerswilluseoneoftwodifferenttypesofdecisions:StructuredProblemsandProgrammedDecisions;UnstructuredP......
  • [ARC111F] Do you like query problems?
    题意:给出三个数\(n,m,q\)。你有一个长度为\(n\)的序列\(a\),初始全为为\(0\),你有三种操作:操作\(1\):给出\(l,r,v\),让区间\([l,r]\)对\(v\)取\(\min\)。操作\(2\):给出\(l,r,v\),让区间\([l,r]\)对\(v\)取\(\max\)。操作\(3\),给出\(l,r\),求区间和,将其累加进......
  • A Pattern to Solve Backtracking Problems
    Thebacktrackingsolutionsofmostleetcode-problemshaveasimilarpattern.Let'stakealookonit.Subset1.Recursion(Backtrack)-TimecomplexityisO(2^n),andthedepthofrecursionisO(n).classSolution{public:vector<vector<in......
  • 关于解决vue报错"Problems loading reference 'https://schemastore.azurewebsites.ne
    打开setting时会看到有一条三角形的警告信息 看问题描述:无法从该网站加载解决方法:打开设置,找到扩展下的json项 设置之后可以在settings.json文件中看到新增加一项 "json.schemaDownload.enable":false可以直接在界面上设置: "json.schemaDownload.enable":false......
  • 论文:FEED-FORWARD NETWORKS WITH ATTENTION CAN SOLVE SOME LONG-TERM MEMORY PROBLEM
    题目:FEED-FORWARDNETWORKSWITHATTENTIONCANSOLVESOMELONG-TERMMEMORYPROBLEMS”(Raffel和Ellis,2016,p.1)“带有注意力的前馈网络可以解决一些长期记忆问题”(Raffel和Ellis,2016,p.1)(pdf)这篇论文提出了一种适用于前馈神经网络的简化注意力模型,并展示了......
  • The Design of Feedback Control Systems--Advanced Problems
    AP10.1Athree-axispick-and-placeapplicationrequirestheprecisemovementofaroboticarminthree-dimensionalspace,asshowninFigureAP10.1forjoint2.Thearmhasspecificlinearpathsitmustfollowtoavoidotherpiecesofmachinery.Theovers......
  • [ABC327G] Many Good Tuple Problems
    题目链接简化题意:有一个\(n\)个点的图,问有多少个长度为\(M\)的边序列,满足连边后图是二分图。\(n\le30,m\le10^9\)考虑先强制要求无重边。定义\(f_{i,j}\)为\(i\)个点,\(j\)条边的图的二分图染色数量(染色方式不同算多次)。这个是可以通过枚举黑色点的数量算出来。然......
  • Adding custom code to Local Reports in Visual Studio.NET 2005 (Problems & Soluti
    AddingcustomcodetoLocalReportsinVisualStudio.NET2005(Problems&Solutions)IfyouareoneofthepeoplewhousedandenjoyedSQLServerReportingServices(SSRS)inSQL2000andyouwantedtouseitinyourwindows/webapplicationswithou......
  • [ABC327G] Many Good Tuple Problems 题解
    题意对于一对长度均为\(M\)且元素值在\(\left[1,N\right]\)之间的序列\((S,T)\),定义其为好的当且仅当:存在一个长度为\(N\)的\(01\)序列\(X\),使得其满足如下条件:对于任意\(i\in\left[1,M\right]\),有\(X_{S_i}\neqX_{T_i}\)。给定\(N,M\),求在所有可......
  • Solution to OpenSSL Connection Problems With Github
    ProblemsUploadingFileswithGitSometimeswecanusegittooltosuccessfullyuploadprojectstoGithub,butinothertimeespeciallyafteraperiodofconfiguration,weoftenmeetthefollowingerror:OpenSSLSSL_read:Connectionwasreset,error10054......