1 条题解

  • 0
    @ 2025-12-15 20:04:39
    #include<bits/stdc++.h>
    using namespace std;
    #define int long long
    const int N=2e5+10;
    int h[N];
    signed main()
    {
    	int n;scanf("%lld",&n);
    	for(int i=1;i<=n;i++)scanf("%lld",&h[i]);
    	int t=0;
    	for(int i=1;i<=n;i++)
    	{
    		int k=h[i]/5;
    		t+=3*k;h[i]-=5*k;
    		if(h[i]==0)continue;
    		while(h[i]>0)
    		{
    			t++;h[i]--;
    			if(t%3==0)h[i]-=2;
    		}
    	}
    	printf("%lld\n",t);
    	return 0;
    }
    
    • 1

    信息

    ID
    7972
    时间
    2000ms
    内存
    1024MiB
    难度
    6
    标签
    递交数
    21
    已通过
    10
    上传者