Search is not available for this dataset
name
stringlengths
2
112
description
stringlengths
29
13k
source
int64
1
7
difficulty
int64
0
25
solution
stringlengths
7
983k
language
stringclasses
4 values
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <iostream> #include <utility> #include <vector> #include <algorithm> using namespace std; int main(void){ int n, a,f; vector<pair<int, int> > v; cin >> n; for (int i=0; i<n; i++){ cin >> a >> f; v.push_back(make_pair(-f, a)); } sort(v.begin(), v.end()); cout << v[0].second << " " << -...
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; int main() { cin.tie(0); ios_base::sync_with_stdio(false); cout << fixed << setprecision(10); int n; while (cin >> n) { vector<int> d(n); for (int i = 0; i < n; i++) { int a, v; cin >> a >>...
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <iostream> #include <algorithm> #include <vector> using namespace std; int main() { int n; cin >> n; vector<int> a[101]; int max=0; for(int i=0; i<n; i++) { int x,y; cin >> x >> y; a[y].push_back(x); if(max<y) max=y; } sort(a[max].begin(),a[max].end()); cout << a[max][0] << " "...
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
import java.util.*; public class Main { public static void main(String[] args) { Scanner in=new Scanner(System.in); while(in.hasNext()) { int n=in.nextInt(); int max=-1; int ind=-1; for(int i=0;i<n;i++) { int id=in.nextInt(); int cnt=in.nextInt(); if(cnt>=max) { if(cnt==max)...
JAVA
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <iostream> #include <queue> #include <algorithm> using namespace std; typedef pair<int,int> P; int main(){ int n,a,v; priority_queue<P,vector<P> > que; cin>>n; while(n--){ cin>>a>>v; que.push(P(v,a)); } v=que.top().first; a=que.top().second; que.pop(); ...
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
n = int(input()) data = [0] * n for _ in range(n): a, v = [int(el) for el in input().split()] data[a-1] += v result = max(data) print(data.index(result)+1, result)
PYTHON3
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Scanner; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String s = ""; int[] top = new int[] {...
JAVA
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include<iostream> #include<math.h> #include<vector> #include<algorithm> #include<cstdio> using namespace std; int main(){ int n; int num=1,max=0; int tmpnum,tmp; cin>>n; while(n){ cin>>tmpnum>>tmp; if(max==tmp){ if(num>tmpnum){ num=tmpnum; --n;...
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
x=[map(int,raw_input().split()) for i in range(input())] a,v=sorted(x,key=lambda x:(-x[1],x[0]))[0] print a,v
PYTHON
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
import java.io.*; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.Deque; import java.util.HashMap; import java.util.List; import java.util.NoSuchElementException; import java.util.Scanner; public class Main { ...
JAVA
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
n=int(input()) l=[] for i in range(n): x,y=map(int,input().split()) l.append((y,x)) l.sort(key=lambda x:(x[0],x[1]),reverse=True) maximum=l[0][0] young=l[0][1] for i in l: if maximum==i[0]: young=i[1] else: break print(young,maximum)
PYTHON3
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include<stdio.h> int main(){ int n,i,a[20]={},v[20]={}; int tmp; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d%d",&a[i],&v[i]); } int j,h; for(j=0;j<n-1;j++){ for(h=n-1;h>j;h--){ if(v[h]>v[h-1]){ tmp=v[h]; v[h]=v[h-1]; v[h-1]=tmp; tmp=a[h]; a[h]=a[h-1]; a[h-1]=tmp; } ...
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
n = int(input()) result = [] for i in range(n): result.append(list(map(int, input().split()))) result.sort(key=lambda x: (-x[1], x[0])) print(*result[0])
PYTHON3
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <bits/stdc++.h> using namespace std; int main(){ int al=99999,vl=0,n; cin>>n; int a,v; for(int i=0;i<n;i++){ cin>>a>>v; if(v>vl){ vl=v; al=a; }else if(v==vl){ if(al>a)al=a; } } cout<<al<<" "<<vl<<endl; }
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
public class Main{ public void run(java.io.InputStream in, java.io.PrintStream out){ java.util.Scanner sc = new java.util.Scanner(in); /*answer*/ int n, i, v, max, m, mmin; n = sc.nextInt(); max = -1; mmin = -1; for(i = 0;i < n;i++){ m = sc.nextInt(); v = sc.nextInt(); if(max < v || (...
JAVA
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <cstdio> #include <queue> typedef std::pair<int, int> P; int n; int main(){ scanf("%d", &n); std::priority_queue<P> que; for(int i = 0; i < n; i++){ int a, b; scanf("%d %d", &a, &b); que.push(P(b, a)); } P p = que.top(); que.pop(); while(!que.empty()){ ...
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include<iostream> using namespace std; int main() { int n; cin>>n; int a=1000,v=0; for(int i = 0; i < n; ++i) { int aa,vv; cin>>aa>>vv; if(v<vv) { a=aa; v=vv; } else { if(v==vv&&aa<a) { a=aa; } } } cout<<a<<" "<<v<<endl; return 0; }
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include<cstdio> int n; int a[21],v[21]; int main(void){ scanf("%d",&n); for(int i=0;i<n;i++)scanf("%d%d",&a[i],&v[i]); int mid=a[0],m=v[0]; for(int i=1;i<n;i++){ if(m<v[i]){ mid=a[i]; m=v[i]; } if(m==v[i] && mid>a[i])mid=a[i]; } printf("%d %d\n",mid,m); return 0; }
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <stdio.h> int main(void) { int i; int n; int a; int v; int ma; int mv; scanf("%d", &n); mv = 0; for (i = 0; i < n; i++){ scanf("%d %d", &a, &v); if (v > mv || v >= mv && a < ma){ mv = v; ma = a; } } printf("%d %d\n", ma, mv); return (0); }
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <cstdio> #include <utility> #include <algorithm> using namespace std; typedef pair<int, int> Pair; int n; int a, v; Pair ans(-1, -1); int main() { scanf("%d", &n); for (int i=0; i<n; i++) { scanf("%d%d", &a, &v); ans = max(ans, Pair(v, -a)); } printf("%2$d %1$d\n", ans.first, -ans.second); ...
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include<iostream> using namespace std; int main(){ int n,a[20],v[20],b=0; cin >>n; for(int i=0 ; i < n ; i++){ cin >>a[i]>>v[i]; } for(int i=0 ; i < n ; i++){ if(v[b] < v[i]){ b=i; }else if(v[b] == v[i] && a[b] > a[i]){ b=i; } } cout <<a[b]<<" "<<v[b]<<endl; ret...
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <iostream> #include <map> #include <vector> #include <algorithm> #include <functional> using namespace std; int main () { int n; cin >> n; vector <pair<int,int> > V; for (int i = 0; i <= n; i++) { V.push_back(pair<int,int>(0,i)); } for (int i = 0; i < n; i++) { int a, b...
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
n = int(raw_input()) mxs, minm = 0, 21 for i in range(n): m, s = map(int, raw_input().split()) if s > mxs: mxs = s minm = m elif s == mxs: if m < minm: minm = m print minm, mxs
PYTHON
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include<iostream> using namespace std; int main() { int n; int g[20] = {}, p[20] = {}; cin >> n; for( int i = 0; i < n; i++ ) cin >> g[i] >> p[i]; int max = -1; for( int i = 0; i < n; i++ ) { if( max < p[i] ) max = p[i]; } int min = 1000; for...
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
import java.util.Scanner; public class Main { private Scanner sc; public static void main(String[] args) { new Main(); } public Main() { sc = new Scanner(System.in); int num = 21; int max = -1; int nico = Integer.parseInt(sc.nextLine()); for (int i = 0; i < nico; i++) { String[] data = sc.ne...
JAVA
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <iostream> #include <utility> #include <algorithm> #include <vector> using namespace std; typedef pair<int, int> P; int main(){ int n; cin >> n; int m_a , m_v = 0, a, v; for(int i = 0; i < n; i++){ cin >> a >> v; if( v > m_v || (v == m_v && a < m_a )){ m_v = v; ...
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <iostream> using namespace std; int main() { int n, a, v, a_res=21, v_res=0; while(cin>>n) { while(n--) { cin >> a >> v; if ((v_res == v && a_res > a) || (v_res < v)) { a_res = a; v_res = v; } } cout << a_res...
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include<iostream> #include<string.h> #include<cstdio> #include<algorithm> #include<stack> #include<queue> #include<vector> #include<cmath> #include<utility> #define ll long long int #define ld long double #define INF 1000000000 #define EPS 0.0000000001 #define rep(i,n) for(i=0;i<n;i++) using namespace std; typedef pai...
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include<stdio.h> int main() { int n; int a,v[20],r[20],max=0; scanf("%d",&n); for(int i=0;i<n;i++){ scanf("%d %d",&a,&v[i]); r[a-1]=v[i]; } for(int i=0;i<n;i++){ if(r[i]>max){ max=r[i]; } } for(int i=0;i<n;i++){ if(max==r[i]){ printf("%d %d\n",i+1,r[i]); break; } } return 0; }
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); while(scan.hasNext()){ int n = scan.nextInt(); int p = scan.nextInt(); int f = scan.nextInt(); for(int i = 1;i < n;i++){ int a = scan.nextInt(); int b = scan.nextInt(); ...
JAVA
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include<iostream> using namespace std; int main(){ int n,a,v,max=0,maxn=999; cin >>n; for(int i=0;i<n;++i){ cin >>a >>v; if(v>max){ max=v; maxn=a; } else if(v==max) if(a<maxn) maxn=a; } cout <<maxn <<" " <<max <<'\n'; return 0; }
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int input = scan.nextInt(); int n = 0; if(input >= 1 && input <= 20)n = input; int a = Integer.MAX_VALUE; int v = Integer.MIN_VALUE; for(int i = 0 ; i < n ; i++) { int num...
JAVA
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
n = input() pat = [0] * n for i in range(n): a, v = map(int, raw_input().split()) pat[a-1] = v m = max(pat) print pat.index(m)+1, m
PYTHON
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <iostream> #include <cmath> using namespace std; int main() { int n; int max[2]; int a, b; cin >> n; cin >> max[0] >> max[1]; for (int i = 1; i < n; i++) { cin >> a >> b; if (b > max[1]) { max[1] = b; max[0] = a; } else if (b == max[1]) { max[0] = min(max[0], a); } } cout << max[0] <<...
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include<stdio.h> int fish[21]={0}; int n; int a,b; int memo[2]={0}; int date=100; int main() { scanf("%d",&n); for(int i=0;i<n;i++) { scanf("%d%d",&a,&b); if(a<date)date=a; memo[0]=date; fish[a] +=b; } for(int i=0;i<21;i++) { if(fish[i]>memo[1]) ...
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include<stdio.h> int main(void) { int n,a,b,c,i,max,min; max=-1; min=101; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d %d",&a,&b); if(max==b&&min>a){ min=a; } if(max<b){ max=b; min=a; } } printf("%d %d\n",min,max); return 0; }
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
# Aizu Problem 0095: Surf Smelt Fishing Contest # import sys, math, os # read input: PYDEV = os.environ.get('PYDEV') if PYDEV=="True": sys.stdin = open("sample-input.txt", "rt") N = int(input()) A = sorted([[int(_) for _ in input().split()] for __ in range(N)], key=lambda x: (-x[1], x[0])) print(A[0][0], A[0][1]...
PYTHON3
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <iostream> using namespace std; int main() { int n, a, v, maxa, maxv; cin >> n >> maxa >> maxv; for (int i=0; i<n-1; i++) { cin >> a >> v; if(v == maxv){ if(a < maxa){ maxa = a; maxv = v; } } else if(v > maxv){ maxa = a; maxv = v; } } cout << maxa << ' ' << maxv << e...
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <iostream> using namespace std; int main(){ long long int n,a,b,max = -1,ans; cin >> n; while(n--){ cin >> a >> b; if(max < b ){ max = b; ans = a; }else if(max == b && ans > a ){ ans = a; } } cout << ans << " " << max << endl; }
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <cstdio> #include <utility> #include <algorithm> #include <vector> using namespace std; int main(){ int n, a, b; scanf("%d", &n); vector<pair<int,int> > v(n); for(int i = 0; i < n; ++i){ scanf("%d%d", &a, &b); v[i].first = b; v[i].second = -a; } const pair<int,int> &p = *max_element(v.begin(), v....
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <iostream> using namespace std; int main(){ for(int n,a,v=-1;cin>>n;cout<<a<<' '<<v<<endl) for(int i=0;i<n;i++){ int x,y; cin>>x>>y; if(v<y||v==y&&a>x) a=x,v=y; } return 0; }
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int ra = 101, rb = -1; while(n--!=0){ int a = sc.nextInt(), b = sc.nextInt(); if(rb < b || rb==b && a < ra){ ...
JAVA
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
//Surf Smelt Fishing Contest #include<bits/stdc++.h> using namespace std; vector<pair<int, int> > v; bool comp(const pair<int, int> &a, const pair<int, int> &b){ if(a.second==b.second)return a.first<b.first; return a.second>b.second; } int main(){ int n; cin>>n; for(int i=0; i<n; i++){ int a, b; ci...
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <iostream> using namespace std; int main() { int n, index, w, idx = 0, mx = -1; cin >> n; for(int i=0;i < n; ++i) { cin >> index >> w; if (mx < w || (mx == w && idx > index)) idx = index, mx = w; } cout << idx << " " << mx << endl; return 0; }
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <cstdio> #include <vector> #include <algorithm> using namespace std; int main(){ int n,a,b; vector<pair<int,int> >v; for(scanf("%d",&n);n--;v.push_back(make_pair(-b,a)))scanf("%d%d",&a,&b); sort(v.begin(),v.end()); printf("%d %d\n",v[0].second,-v[0].first); }
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include<iostream> #include<algorithm> #include<functional> using namespace std; int main(){ int n; int person[22], fish[22]; int array[22]; int fisherMan[22]; int fisher = 0; cin >> n; for(int i=0; i < n; i++){ cin >> person[i] >> fish[i]; array[i] = fish[i]; } sort(array, array+n, greater<int>()); fo...
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int a,v; int maxPtr=0; int max=-1; for(int i=0;i<n;i++){ a=sc.nextInt(); v=sc.nextInt(); if(v>max||max==v&&a<maxPtr){ max=v; maxPtr=a; } } Sys...
JAVA
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <cstdio> using namespace std; int main() { int n, a, b, max_a, max_b; scanf("%d", &n); max_a = max_b = -1; for (int i=0; i<n; i++) { scanf("%d %d", &a, &b); if (max_b<b) { max_b = b; max_a = a; } else if (max_b==b && max_a>a) { max_a = a; } } printf("%d %d\n", max...
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
num = 1000 val = 0 n = int(input()) for i in range(n): a, b = map(int, input().split()) if b > val or (b == val and a < num): val = b num = a print(num, val)
PYTHON3
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include<iostream> #include<string> using namespace std; int main(){ int n,a[21],b,c,d=0; cin>>n; for(int i=0;i<n;i++){ cin>>b>>c; a[b]=c; if(d<c) d=c; } int i=1; while(true){ if(a[i]==d){ cout<<i<<" "<<a[i]<<endl; break; } i++; } return 0; }
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include<algorithm> #include<iostream> #include<vector> #include<utility> typedef std::pair<int,int> P; bool compare( const P& lhs, const P& rhs ) { if( lhs.first != rhs.first ) return lhs.first > rhs.first; return lhs.second < rhs.second; } int main() { int n; std::cin >> n; std::vector<P> vec; while( n-...
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
print " ".join(map(str,sorted([map(int,raw_input().split()) for u in xrange(input())],cmp=lambda a,b:cmp(a[0],b[0]) if a[1] == b[1] else cmp(b[1],a[1]))[0]))
PYTHON
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
import java.util.Scanner; /** * AOJのVolume0の0095を解くクラス * @author たっちゃん * */ public class Main { /** * mainメソッド。 * @param args 使用せず */ public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int minA = Integer.MAX_VALUE, maxV = Integer.MIN_VALUE; for(i...
JAVA
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
//24 #include<iostream> using namespace std; int main(){ int n; cin>>n; int x,m=-1; while(n--){ int a,v; cin>>a>>v; if(v>m||v==m&&a<x){ m=v; x=a; } } cout<<x<<' '<<m<<endl; return 0; }
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
import java.util.*; import java.io.*; public class Main { public void solve() throws IOException { int n = nextInt(); int[] v = new int[n+1]; for(int i = 0; i < n; i++){ int a = nextInt(); int x = nextInt(); v[a] += x; } int ans = 1; for(int i = 1; i <= n; i++){ if( v[i] > v[ans] ){ ans = ...
JAVA
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int a,v; int maxPtr=0; int max=-1; for(int i=0;i<n;i++){ a=sc.nextInt(); v=sc.nextInt(); if(v>max){ max=v; maxPtr=a; }else if(max==v&&a<maxPtr){ ...
JAVA
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include<iostream> using namespace std; int main(){ long n,i,a,b,aa,bb=0; cin>>n; for(i=0;i<n;i++){ cin>>a>>b; if(bb<b){aa=a;bb=b;} else if(bb==b&&a<aa){aa=a;bb=b;} } cout<<aa<<" "<<bb<<endl; return 0; }
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <iostream> #include <map> #include <algorithm> using namespace std; #define loop(i,a,b) for(int i=(a); i<(int)(b); i++) #define rep(i,b) loop(i,0,b) typedef pair<int,int> P; int main(){ int n;cin>>n; P arr[20]; rep(i,n){ int a,v;cin>>a>>v; arr[i]=make_pair(a,v); } partial...
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
a={} for i in range(int(input())): b,c=map(int,input().split()) a[b]=c d=max(a.items(),key=lambda x:x[1]) print(*d)
PYTHON3
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <iostream> int main(void){ int n,a,b,max=0,c=21; std::cin>>n; for(int i=0;i<n;i++){ std::cin>>a>>b; if(max<=b){ if(max==b){ if(c>a)c=a; continue; } max=b; c=a; } } std::cout<<c<<" "<<max<<'\n'; return 0; }
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <bits/stdc++.h> using namespace std; int main() { int n, num, w; pair<int, int> p[20]; cin >> n; for (int i = 0; i < n; i++) { cin >> num >> w; p[i] = make_pair(-w, num); } sort(p, p+n); cout << p[0].second << ' ' << (-1) * p[0].first << endl; return 0; }
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <cstdio> #include <algorithm> #include <map> using namespace std; int main(void){ int n; scanf("%d",&n); pair<int,int> best = make_pair(0,-100); for(int i = 0; i < n; i++){ pair<int,int> p; scanf("%d %d",&p.second,&p.first); p.second *= -1; if(p > best) best = p; } printf("%d %d\n",...
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
# -*- coding: utf-8 -*- import sys import os import math N = int(input()) A = [None] * N for i in range(N): id, num = map(int, input().split()) id -= 1 A[id] = num max_value = max(A) max_index = A.index(max_value) print(max_index + 1, max_value)
PYTHON3
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <iostream> using namespace std; int main() { int n, nf, num, mnf, mnum; cin >> n; cin >> mnum >> mnf; n--; while (n--) { cin >> num >> nf; if (nf > mnf) { mnf = nf; mnum = num; } if (nf == mnf && num < mnum) mnum = num; } cout << mnum << " " << mnf << endl; return 0; }
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <iostream> #include <algorithm> using namespace std; int main() { int n; int max_ = -1, id; int a, v; cin >> n; for(int i = 0; i < n; ++i) { cin >> a >> v; if(max_ < v){ max_ = v; id = a; } else if(max_ == v && id > a){ id = a; ...
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
import java.util.Scanner; public class Main { void run(){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int ra = 101, rb = -1; while(n--!=0){ int a = sc.nextInt(), b = sc.nextInt(); if(rb < b || rb==b && a < ra){ ra = a; rb = b; } } System.out.println(ra+" "+rb); } publi...
JAVA
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include<iostream> using namespace std; int main(){ int A,B=-1; int n; cin >> n; while(n--){ int a,b; cin >> a >> b; if(B < b || B == b && A > a){ A = a; B = b; } } cout << A << " " << B << endl; return 0; }
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
n=int(input()) d={} for _ in range(n): a,v=list(map(int,input().split())) if not v in d: d[v]=[a] else: d[v].append(a) m=max(d.keys()) print(sorted(d[m])[0],m)
PYTHON3
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <bits/stdc++.h> #define rep(i,l,n) for(int i=l;i<n;i++) #define rer(i,l,n) for(int i=l;i<=n;i++) #define all(a) a.begin(),a.end() #define o(a) cout<<a<<endl #define fi first #define se second using namespace std; typedef long long ll; typedef vector<int> vint; typedef pair<int,int> pii; int main(){ int n,a,v...
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
import java.util.ArrayList; import java.util.Scanner; class Score { private int id; private int pt; Score(int id, int pt){ this.id = id; this.pt = pt; } public int getId() { return id; } public void setId(int id) { this.id = id; } public int getPt() { return pt; } public void setPt(int pt) { t...
JAVA
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <iostream> using namespace std; int main(){ int n; int fish[20]={0}; cin>>n; for(int i=0;i<n;i++){ int a,v; cin>>a>>v; fish[a-1]=v; } int max=fish[0],b=0; for(int j=1;j<20;j++){ if(max<fish[j]){ max=fish[j]; b=j; } } cout<<b+1<<" "<<max<<endl; return 0; }
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
n=input() x=[map(int,raw_input().split()) for i in range(n)] a,v=sorted(x,key=lambda x:(-x[1],x[0]))[0] print a,v
PYTHON
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#!/usr/bin/env python from __future__ import division, print_function from sys import stdin, exit, maxsize def main(readline=stdin.readline): value = -1 number = maxsize for _ in range(int(readline())): a, v = (int(s) for s in readline().split()) if v > value or v == value and a < number: ...
PYTHON
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include<iostream> #include<algorithm> using namespace std; int main() { int n; cin >> n; int maxn, maxs; cin >> maxn >> maxs; for (int i = 0; i < n - 1; i++){ int a, b; cin >> a >> b; if (maxs < b){ maxn = a; maxs = b; } else if (maxs == b){ maxn = min(maxn, a); } } cout << maxn <<' '<< maxs ...
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
/** * */ import java.util.*; /** * @author akira * */ class Main { /** * @param args */ public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner scan = new Scanner(System.in); int n; n = scan.nextInt(); ArrayList<fisher> alf = new ArrayList<fisher>(); for(int i = 0;i < n;i++){ ...
JAVA
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <iostream> using namespace std; int main() { int n; cin >> n; int maxv = -1, maxa = -1; for (int i = 0; i < n; i++) { int a, v; cin >> a >> v; if (v > maxv) { maxv = v; maxa = a; } else if (v == maxv && a < maxa) { maxa = a; } } cout << maxa << " " << maxv << endl; }
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Scanner; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String s = ""; int[] top = new int[] {...
JAVA
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
# AOJ 0095 Surf Smelt Fishing Contest # Python3 2018.6.21 bal4u n = int(input()) tbl = [0]*(n+1) vmax = 0 for i in range(n): a, v = list(map(int, input().split())) tbl[a] += v if tbl[a] > vmax: vmax = tbl[a] for i in range(1, n+1): if tbl[i] == vmax: print(i, vmax) break
PYTHON3
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
N = int(input()) maxA = -1 maxV = -1 for l in range(N): a,v = [int(i) for i in input().split()] if v > maxV: maxV = v maxA = a elif v == maxV: maxA = min(a, maxA) print(maxA, maxV)
PYTHON3
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <algorithm> #include <vector> #include <map> #include <iostream> using namespace std; int main() { int n, max = 0; cin >> n; vector<pair<int, int> > pairs(n); for (int i = 0; i < n; i++) { int a, v; cin >> a >> v; pairs[i] = make_pair(a, v); } sort(pairs.begin(), pairs.end()); for (int i = 0; i...
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include<iostream> #include<cstdio> #include<algorithm> #include<climits> #include<string> using namespace std; struct Data{ int A,B; bool operator<(const Data &a)const{ if(B!=a.B) return B>a.B; else return A<a.A; } }; int main(){ int N; Data H[20]; cin>>N; for(int i=0;i<N;i++){ cin>>H[i].A>>H[i].B; } ...
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include<iostream> using namespace std; int main(){ int n; //参加者数 cin >> n; int* a; //参加者番号 int* v; //匹数 a = new int[n]; v = new int[n]; for (int i = 0; i < n; i++){ cin >> a[i] >> v[i]; } int winner = a[0]; int max = v[0]; for (int i = 1; i < n; i++){ if (v[i]>max){ winner = a[i]; max = v[i]; ...
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
num = int(input()) L = [] for i in range(num): p, v = [int(x) for x in input().split()] L.append([p, v]) L.sort(key=lambda x: (-x[1],x[0])) print(L[0][0],L[0][1])
PYTHON3
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <iostream> #include <utility> #include <algorithm> #include <vector> using namespace std; bool compare(pair<int,int> a, pair<int,int> b) { if(a.second == b.second ) return a.first < b.first; else return a.second > b.second; } int main() { vector<pair<int,int> > in; int n; cin >> n; for(int i = 0...
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <iostream> using namespace std; int main(){ int a,b,n; int x[2]={21,0}; cin>>n; while(n--){ cin>>a>>b; if(x[1]<=b){ x[0]=(x[1]==b)?(x[0]>a)?a:x[0]:a;x[1]=b; } } cout<<x[0]<<' '<<x[1]<<endl; return 0; }
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
n = int(input()) fish = [] for i in range(n) : a, v = map(int, input().split()) fish.append([a, v]) fish.sort(key = lambda val: val[0]) fish.sort(reverse = True, key = lambda val: val[1]) print(*fish[0])
PYTHON3
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include "bits/stdc++.h" using namespace std; int a,b,c; int n; int main(){ cin>>n; pair<int,int> p[n]; for (int i = 0; i < n; ++i) { cin>>a>>b; p[i].second=a;p[i].first=-b; } sort(p,p+n); cout<<p[0].second<<" "<<-p[0].first<<endl; //cout<<p[n-1].second<<" "<<-p[n-1].first<<endl; }
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <iostream> using namespace std; int main() { int n; int w1, max = 0; cin >> n; for (int i = 0; i < n; i++){ int a, v; cin >> a >> v; if (max < v){ max = v; w1 = a; } else if (max == v){ if (w1 > a){ w1 = a; } } } cout << w1 << ' ' << max << ...
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include<iostream> #include<map> #include<algorithm> using namespace std; typedef pair < int , int > Pi; int main(){ int n; Pi a[20]; cin >> n; for(int i = 0 ; i < n ; i++ ){ cin >> a[i].second >> a[i].first; a[i].second = -a[i].second; } sort( a, a + n); Pi *itr = max_element(a, a + n); cout <<...
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
n=input() x=[0]*n for i in range(n): a,v=map(int,raw_input().split()) x[a-1]=v m=max(x) print x.index(m)+1,m
PYTHON
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <iostream> #include <algorithm> #include <vector> using namespace std; int main(){ int n,p,w; cin >> n; int max = 0; int maxp = 100; for(int i=0;i<n;i++){ cin >> p; cin >> w; if(max < w){ maxp = p; max = w; }else if(max == w){ if(maxp > p){ maxp = p; } } } cout << maxp << " " ...
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); final int dataCount = Integer.va...
JAVA
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <iostream> using namespace std; int main() { int n; cin >> n; int amin = 0; int vmax = -1; for (int i = 0; i < n; ++i) { int a, v; cin >> a >> v; if (v < vmax || (v == vmax && amin < a)) continue; amin = a; vmax = v; } cout << amin << " " << vmax << endl; }
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); int[] scor...
JAVA
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <iostream> #include <vector> #include <cstdlib> #include <algorithm> #include <time.h> #include <cstdio> using namespace std; int main(){ int n; cin >> n; vector< pair<int,int> > v; for(int i = 0 ; i < n ; i++){ int a,b; cin >> a >> b; v.push_back(make_pair(-b,a)); } sort(v.begin(),v.end()); cout ...
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include<stdio.h> #include<algorithm> using namespace std; pair<int,int> v[20]; int main(){ int a;scanf("%d",&a); for(int i=0;i<a;i++){ int b,c; scanf("%d%d",&b,&c); v[i]=make_pair(-c,b); }std::sort(v,v+a); printf("%d %d\n",v[0].second,-v[0].first); }
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <cstdio> using namespace std; int main(){ int n, a, b, maxv, maxi; scanf("%d", &n); maxv = -1, maxi = 0; for (int i = 0; i < n; i++) { scanf("%d %d", &a, &b); if (b > maxv) { maxv = b; maxi = a; } if (b == maxv && maxi > a) maxi = a; } printf("%d %d\n", maxi, max...
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
import java.util.Scanner; class Main{ public static void main(String[] a){ Scanner scan = new Scanner(System.in); while (scan.hasNext()){ int n = 0; n = scan.nextInt(); int bigkekka = -1; int bigsen = -1; for(int i = 0; i < n; i++){ int num = scan.nextInt(); int resul...
JAVA
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include <iostream> #include <vector> #include <algorithm> #include <stack> #include <string> #include <map> #include <functional> #include <cmath> #include <cstdio> using namespace std; int main(){ int n; cin >> n; map<int, int> point; vector<int> tmp(n); for(int i = 0; i < n; i++){ int a, v; cin >>...
CPP
p00095 Surf Smelt Fishing Contest
A smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt. Create a program that reads the list of participant numbers and the number of fish caught and outputs the number of winners and the number of fish caught. If there are multiple winners, output the one with the lowest par...
7
0
#include<stdio.h> int main(){ int x,y,n; int X=0,Y=0; scanf("%d",&n); for(int i=0;i<n;i++) { scanf("%d %d",&x,&y); if(i==0){Y=y;X=x;} if(Y==y&&x<X){X=x;Y=y;} else if(Y<y){X=x;Y=y;} } printf("%d %d\n",X,Y); return 0; }
CPP