2 solutions

  • 6
    @ 2025-7-12 9:05:29
    #include <bits/stdc++.h>
    using namespace std;
    #define int long long
    int n, id;
    double maxx;
    
    signed main() {
    	cin >> n;
    	for (int i = 1; i <= n; i++) {
    		double x, y;
    		cin >> x >> y;
    		if (y / x > maxx) {
    			maxx = y / x;
    			id = i;
    		}
    	}
    	cout << id;
    	return 0;
    }
    
    • @ 2025-7-18 10:39:25

      给本龙点些赞吧 别点差评了

  • 0
    @ 2025-7-17 16:04:00

    #include <bits/stdc++.h> using namespace std;

    int main() { double m, n, a, b, s; cin >> n; m = 0; for (int i = 1; i <= n; i++) { cin >> a >> b; if (m < b / a||(m==b/a&&i<s)) { m = b / a; s = i; } } cout << s; return 0; }

    • 1

    Information

    ID
    355
    Time
    1000ms
    Memory
    64MiB
    Difficulty
    4
    Tags
    # Submissions
    107
    Accepted
    47
    Uploaded By