- 【2023年省赛B组】试题C: 冶炼金属
改了一天也没改对,自我感觉良好,一提交全报错
- @ 2024-4-12 16:46:18
不想说话了,直接放一下我写的低级代码
#include<bits/stdc++.h>
using namespace std;
const int n = 1e4+10;
int main()
{
int N,V;
cin>>N;
int A[n],B[n],nums[3]={0,0,0},k=0;
for(int i=0;i<N;i++)
{
cin>>A[i]>>B[i];
}
for(V=20;V<=25;V++)
{
for(int j=0;j<=N;j++)
{
if(A[j]/V==B[j])
{
nums[k]=V;
}
else
{
nums[k]=0;
break;
}
if(nums[0]>=20)
{
if(k<2)
{
k++;
}
if(nums[2]!=0&&nums[1]<nums[2])
{
nums[1]=nums[2];
nums[2]=0;
}
}
}
}
cout<<nums[0]<<" "<<nums[1]<<endl;
return 0;
}
0 條評論
目前還沒有評論...
資訊
- ID
- 988
- 時間
- ms
- 記憶體
- MiB
- 難度
- 3
- 標籤
- 遞交數
- 156
- 已透過
- 46
- 上傳者