URI 1515 Solution Hello Galaxy - Solution in C++ | Ad Hoc
URI Online Judge Solution 1515 Solution Hello Galaxy | Ad Hoc
URI Main Problem Link - https://www.urionlinejudge.com.br/judge/en/problems/view/1515
Problem Name: URI Problem 1515 Solution Hello Galaxy
Problem Number : URI Problem 1515 Solution Hello Galaxy
Online Judge : URI Online Judge Solution
Level: Ad Hoc
Solution Language : C plus plus
URI Solution 1515 Code in CPP:
#include <iostream> #include <cstring> using namespace std; int main(int argc, char const *argv[]) { int n, a, t, min; string p, tmp; while(cin >> n && n) { min = 10000000; for (int i = 0; i < n; ++i) { cin >> p >> a >> t; if((a - t) < min){ min = (a - t); tmp = p; } } cout << tmp << '\n'; } return 0; }
No comments:
Write commentsTo know more about the problem, give us your valuable commment. We'll try to help you. Thanks