1 solutions

  • 0
    @ 2025-3-10 18:48:40

    题解

    按照题意模拟一遍就行了,用不到任何算法

    ac code

    #include<bits/stdc++.h>
    typedef long long LL;
    using namespace std;
    const int N = 1e5 + 10;
    int summ,t,n;
    int main ()
    {
    	cin >> t; 
    	for(int i = 1;i <= t;++ i)
    	{
    		int tmp;
    		cin >> tmp;
    		n += 500 - tmp;
    		if(n < 0){
    			cout << 0 - i << "\n";
    			return 0;
    		}
    		if(n >= 100){
    			int tmp1 = n/100;
    			n -= 100 * tmp1;
    			summ += tmp1 * 100;
    		}
    	}
    	cout << 1.2 * summ + n << "\n";
    	
    
    	return 0;
    }
    
    
    • 1

    Information

    ID
    7014
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    7
    Tags
    # Submissions
    81
    Accepted
    20
    Uploaded By