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<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; int a[2]={-1,-1}; for(int i=0;i<n;i++){ int b,c; cin>>b>>c; if(c==a[1]) a[0]=min(a[0],b); if(c>a[1]){ a[0]=b; a[1]=c; } } cout<<a[0]<<" "<<a[1]<<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
n=int(raw_input()) p=[] w=0 for i in range(n): a,v=map(int,raw_input().split()) p.append((a,v)) w=max(w,v) p.sort() for i in p: if i[1]==w: print i[0],w exit()
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 <cstdio> int main(){ int n,a,v,ta = -1,tv = -1; scanf("%d",&n); for(int i = 0; i < n; i++){ scanf("%d%d",&a,&v); if(v > tv || (v == tv && a < ta)){ tv = v; ta = a; } } printf("%d %d\n",ta,tv); 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 static java.util.Arrays.*; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class Main { static void tr(Object... os) { System.err.println(deepToString(os)); } voi...
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 }; int ans1 = -1; int ans2; int num; cin >> n; for (int i = 0; i < n; i++){ cin >> num; cin >> fish[num - 1]; } for (int i = 0; i < n; i++){ if (fish[i] > ans1){ ans2 = 0; ans1 = fish[i]; ans2 = i + 1; } } cou...
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, 1000 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
# coding: utf-8 n = input() A = [] for i in xrange(n): A.append( map(int, raw_input().split()) ) Max = -1 Maxidx = -1 for i in xrange(n): if Max < A[i][1]: Max = A[i][1] Maxidx = i elif Max == A[i][1] and A[Maxidx][0] > A[i][0]: Maxidx = i print A[Maxidx][0], A[Maxidx][1]
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; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int max = Integer.MIN_VALUE; int e = Integer.MAX_VALUE; for (int i = 1; i <= n; i++) { int c = scanner.nextInt(); int d = scanner.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
L = [] for i in range(input()): L.append(map(int, raw_input().split())) print ' '.join(map(str, sorted(L, key=lambda a:(-a[1], a[0]))[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
#include<iostream> #include<set> using namespace std; int main(){ int n; int a, b; int maxv = -1; int id = 21; set<int> I; cin >> n; for ( int i = 0; i < n; i++ ){ cin >> a >> b; I.insert(a); if ( maxv == b ){ if ( id > a ){ maxv = b; id = a; } } else if ( maxv < 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> #include <climits> int main() { int n; int max, argmax; int a, v; std::cin >> n; std::cin >> a >> v; argmax = a; max = v; for (int i=1; i<n; i++) { std::cin >> a >> v; if (v > max) { max = v; argmax = a; } else if ( v == max && a < argmax ) { argmax = a; } } std::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
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(), a, v, max = Integer.MIN_VALUE, maxNum = Integer.MAX_VALUE; for(int i = 0; i < n; i++) { a = sc.nextInt(); v = sc.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
import java.util.Scanner; class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int x = sc.nextInt(), y = sc.nextInt(); for(int i = 0; i < n - 1; i++){ int a = sc.nextInt(); int b = sc.nextInt(); if(y < b){ x = a; y = b; } 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> #include<algorithm> using namespace std; int main(){ int n, a, b; cin >> n; int ra = 1 << 29; int rb = -100; for(int i = 0;i < n;i++){ cin >> a >> b; if(rb < b || rb == b && ra > a){ ra = a; rb = b; } } cout << ra << " " << rb << 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<stdio.h> int main(void) { int n,a[21],b[101],i,z,zz,max; max=-1; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d %d",&a[i],&b[i]); if(b[i]>max){ max=b[i]; z=a[i]; } if(max==b[i]){ if(z<a[i]){ z=z; } else if(z>a[i]){ z=a[i]; } } } printf("%d %d\n",z,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
#include <iostream> using namespace std; int main(void){ int n,a[21],v[21],max=0,num=21; cin>>n; for(int i=0;i<n;++i){ cin>>a[i]>>v[i]; if(v[i]>=max){ if(max!=v[i]) num=a[i]; else if(num>a[i]) num=a[i]; max=v[i]; } } cout<<num<<" "<<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
#include<iostream> #include<algorithm> using namespace std; int main(){ int n,a[50],v[50]; cin >> n; for(int i=0;i<n;i++)cin >> a[i] >> v[i]; for(int i=0;i<n;i++){ for(int j=i+1;j<n;j++){ if(v[i] < v[j]){ swap(a[i],a[j]); swap(v[i],v[j]); }else if(v[i] == v[j] && a[i] > a[j]){ swap(a[i],a[j...
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.*; 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.PriorityQueue; import java.ut...
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 <string> using namespace std; int main() { int n; int p[20]={}; int a,v; int max=0; cin>>n; for(int i=0;i<n;++i){ cin>>a>>v; p[a-1] = v; if(v>max)max=v; } for(int i=0;i<n;++i){ if(p[i]==max){ cout<<i+1<<" "<<p[i]<<endl; 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
#include<iostream> #include<cmath> #define loop(i,a,b) for(int i=a;i<b;i++) #define rep(i,a) loop(i,0,a) using namespace std; int main(){ int n; cin>>n; int num; int fish; int ansnum; int ansfish=-1; rep(i,n){ cin>>num>>fish; if(ansfish<fish){ ansfish=fish; ansnum=num; }else if(ansfish==fish){ if...
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.*; class Main { public static void main(String[] args) { final Scanner stdin = new Scanner(System.in); final int n = stdin.nextInt(); int maxNum = 0; int maxIndex = Integer.MAX_VALUE; for ( int i = 0; i < n; i++ ){ final int index = stdin.nextInt(); final int nu...
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,c,max=0,maxh;; cin>>a; for(int i=0;i<a;i++){ cin>>b>>c; if(c>max){ max=c; maxh=b; }else if(max==c&&maxh>b){ max=c; maxh=b; } } cout<<maxh<<" "<<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 = int(input()) x, y = 20, 0 for _ in range(n): a, b = map(int, input().split()) if y < b: x, y = a, b elif y == b and x >= a: x, y = a, b print(x, y)
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.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int max = -1; int c = 0; while (n-- > 0) { int m = sc.nextInt(); int w = sc.nextInt(); if (ma...
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<algorithm> using namespace std; int main() { int n; int x[20]; int y[20] = {}; cin >> n; for (int i = 0;i < n;i++) { int a, v; cin >> a >> v; x[a - 1] = v; y[a - 1] = x[a - 1]; } sort(y, y + n); for (int i = 0;i < 20;i++) { if (y[n-1] == x[i]) { cout << (i + 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
n = input() a = [map(int, raw_input().split()) for i in range(n)] for i in range(n): (a[i][0], a[i][1]) = (-a[i][1], a[i][0]) a.sort() print a[0][1], -a[0][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
#include <iostream> using namespace std; int main() { int n; cin >> n; int most_fish = -1, most_people = 0; for(int i = 0; i < n; i++) { int a, v; cin >> a >> v; if (most_fish < v) { most_fish = v; most_people = a; } else if (most_fish == v && most_p...
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.io.PrintWriter; import java.util.Scanner; class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int max = 0; int temp[] = new int[21]; for(int 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
// 2014/05/30 Tazoe #include <iostream> using namespace std; int main() { int n; cin >> n; int a_max = 0; int v_max = -1; for(int i=0; i<n; i++){ int a, v; cin >> a >> v; if(v>v_max || (v==v_max && a<a_max)){ a_max = a; v_max = v; } } cout << a_max << ' ' << v_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
#include <iostream> #include <algorithm> using namespace std; int main(void){ 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 <iostream> using namespace std; int main(){ int n,max=-1,num=-1,a[20],v[20]; cin>>n; for(int i=0;i<n;i++){ cin>>a[i]>>v[i]; if(max<v[i] && max!=v[i]){ num=a[i]; max=v[i]; }else if(max==v[i] && num>a[i]){ num=a[i]; } } cout<<num<<" "<<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
#include <iostream> #include <algorithm> #define P pair<int,int> using namespace std; bool cmp(const P& p, const P& q){ if(p.first!=q.first) return p.first>q.first; return p.second<q.second; } int main() { int n ; cin >> n ; P a[20]; for(int i=0;i<n;i++) cin >> a[i].second >> a[i].first ; sort(a,a+n,cmp); 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
x=[] for i in range(int(raw_input())): x.append(map(int,raw_input().split())) 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.util.Arrays; import java.util.Scanner; public class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { //?????°??????????????? int people = sc.nextInt(); int max = 0; int[] wakasagi = new int[people+1]; Arrays.fill(wakasagi, 0); for(int $ = 1; $ <= ...
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
p = [] n = input() for i in xrange(n): p.append(map(int,raw_input().split())) p.sort(cmp=lambda x,y:x[0]-y[0] if x[1]==y[1] else y[1]-x[1]) print p[0][0],p[0][1]
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; struct wakasagi { int a, v; wakasagi(int A, int V) : a(A), v(V) {}; }; bool operator <(wakasagi A, wakasagi B) { if (A.v != B.v) return A.v < B.v; else return A.a > B.a; } int main() { int n, a, v; cin >> n; 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 <bits/stdc++.h> using namespace std; int main() { typedef pair<int, int> P; int n; cin >> n; vector<P> av(n); for(P &p : av) cin >> p.second >> p.first, p.first *= -1; sort(av.begin(), av.end()); cout << av[0].second << " " << -av[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
import operator v = {} n = int(input().strip()) for _ in range(n): i,ip = map(int,input().strip().split()) v[i] = ip w = sorted(v.items(),key=operator.itemgetter(1),reverse=True) print("%d %d" % w[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<stdio.h> int main(void) { int n,a[21],b[101],i,z,zz,max; max=-1; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d %d",&a[n],&b[n]); if(b[n]>max){ max=b[n]; z=a[n]; } if(max==b[n]){ if(z<a[n]){ z=z; } else if(z>a[n]){ z=a[n]; } } } printf("%d %d\n",z,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
#include<iostream> using namespace std; int main(void){ int n; cin>>n; int a[30]={0}; for(int i=1;i<=n;i++){ int x,y; cin>>x>>y; a[x] = y; } int m =0 ,M = 1; for(int i = 1;i <= n;i++)if(m < a[i])M = i,m = a[i]; cout<<M<<" "<<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
#include<iostream> #include<algorithm> using namespace std; int a[1000000], b[1000000], maxid, maxn, n; int main() { cin >> n; maxn = 0; maxid = 100000; for (int i = 0; i < n; i++) { cin >> a[i] >> b[i]; if (maxn < b[i]) { maxn = b[i]; maxid = a[i]; } else if (maxn == b[i]) { maxid = min(maxid, a[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 <vector> #include <algorithm> #define rep(i,n) for(int i=0;i<n;i++) using namespace std; int main() { int n; cin >> n; vector< pair<int,int> > res; rep(i,n) { int a,v; cin >> a >> v; res.push_back(pair<int,int>(v,a)); } sort(res.begin(),res.end(),greater<pair<int,int> >());...
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; //import java.io.*; //import java.util.Arrays; public class Main { public static void main(String[] args) throws java.io.IOException { Scanner scan = new Scanner(System.in); //InputStreamReader is = new InputStreamReader(System.in); //BufferedReader br = new BufferedReader(is); //Stri...
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
from sys import stdin n = int(input()) book = [0]*(n+1) for _ in stdin.readlines() : if 0 not in book : break a, v = map(int, _.split()) book[a] = v+1 max_val = max(book) print(book.index(max_val), max_val-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; cin >> n; int num = 0; int fish = -1; for (int i = 0; i < n; ++i) { int a, v; cin >> a >> v; if (fish < v) { num = a; fish = v; } else if (fish == v && num > a) { num = a; } } cout << num << ' ' << fish << 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> using namespace std; int main(){ int n[20],num,a[20],z,max=0; cin>>num; for(int i=0;i<num;i++){ cin>>a[i]>>n[i]; if(max<n[i]){ max=n[i]; z=i; }else if(max==n[i]){ if(a[z]>a[i])z=i; } } cout<<a[z]<<" "<<n[z]<<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> using namespace std; int main(){ int n; long a, b; long v[110] = {0}, v2[110] = {0}; scanf("%d", &n); for (int i = 1; i <= n; i++){ scanf("%ld %ld", &a, &b); v[a] += b; v2[a] += b; } sort(v, v + n + 1); reverse(v, v + n + 1); for (int i = 1; i <= n; 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 <string> #include <algorithm> #include <vector> #include <utility> #include <cstring> using namespace std; #define rep(i,n) for(int i=0; i<n; i++) typedef long long ll; int main() { int n; cin >> n; int fish[n+1]; rep(i,n) { int a, v; cin >> a >> v; fish[a] = v; } int mi = 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 <iostream> #include <algorithm> #include <vector> using namespace std; struct node { int id; int score; node(int i, int s) : id(i), score(s) { } bool operator <(const node &x) const { if(this->score != x.score) return this->score > x.score; return this->id < x.id; } }; int...
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
#define _USE_MATH_DEFINES #include <iostream> #include <algorithm> #include <functional> #include <vector> #include <cstdio> #include <cstring> #include <cmath> #include <cfloat> #include <map> #include <queue> #include <stack> #include <list> using namespace std; int main(){ int n; cin>>n; int maxa,maxb; int 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.*; import java.io.*; import java.awt.geom.*; import java.math.*; public class Main { static final Scanner in = new Scanner(System.in); static final PrintWriter out = new PrintWriter(System.out,false); static void solve() { int n = in.nextInt(); int ma = -1, max = -1; 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
d={} for _ in[0]*int(input()): a,v=map(int,input().split()) d[v]=d[v]if v in d and a>d[v]else a m=max(d) print(d[m],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
import java.util.*; public class Main{ public static void main(String[] args){ new Main().run(); } Scanner sc = new Scanner(System.in); Player[] p; int n; void run(){ while(sc.hasNext()){ n = sc.nextInt(); p = new Player[n]; for(int i=0; i<n; i++) p[i] = new Player(sc.nextIn...
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 <map> using namespace std; typedef pair<int, int> P; int n; int fish[1000001]; int main() { cin >> n; priority_queue<P> pq; for(int i = 0; i < n; i++) { int a, v; cin >> a >> v; fish[a] += v; pq.push(P(fish[a], a * (-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 <iostream> using namespace std; int main(){ int n, A, V; cin >> n; for(int i = 0; i < n; i++){ int a, v; cin >> a >> v; if( i == 0 ){ A = a; V = v; }else{ if( V < v || ( V == v && a < A) ){ V = v; A = a; } } } cout << A << " " << V << 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> #include<map> #include<utility> #include<vector> using namespace std; int main() { int n; cin >> n; vector<pair<int ,int> > a(n); for(int i = 0; i < n; i++) { cin >> a[i].first >> a[i].second; } int max = -1; int min_num = 9999; for(int i = 0; i < n; i++) { if(max < a[i].se...
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 { static void solve (FastScanner in, PrintWriter out, Methods ms) { int n = in.nextInt(); Fisher[] fishers = new Fisher[n]; for (int i=0; i<n; i++) { fishers[i] = new Fisher(in.nextInt(), in.nextInt()); } Arrays.sort(fishers, Comparator.co...
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; int ansa=1000,ansv=0; cin >> n; for(int i=0;i<n;i++){ cin >> a >> v; if(ansv<v){ ansa = a; ansv = v; } else if(ansv==v&&ansa>a){ ansa = a; ansv = v; } } cout << ansa << ' ' << ansv << 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 <cstdlib> #include <climits> using namespace std; int main () { int n; cin >> n; int maxv = INT_MIN; int winner = INT_MAX; for( int i = 0; i < n; i++ ) { int a, v; cin >> a >> v; if( maxv < v ) { winner = a; maxv = v; } else if( maxv == v ) { w...
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
// // main.cpp // ggggggggggggggggggggggggggggggggggggg // // Created by h3037175 on 2017/08/01. // Copyright ?? 2017??´ h3037175. All rights reserved. // #include <iostream> using namespace std; int main() { int n,a,v,max=-100000,num; cin>>n; for(int i=0;i<n;i++){ cin>>a>>v; if(max<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> #include <queue> #include <algorithm> using namespace std; int main() { using player = pair<int, int>; int n; priority_queue<player> score; cin >> n; for(int i = 0; i < n; i++) { int sc, num; cin >> num >> sc; score.push(make_pair(sc,...
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<vector> #include<string> #include<map> #include<algorithm> using namespace std; int main() { map<int, int>s; int a; cin >> a; for (int b = 0; b < a; b++) { int c, d; cin >> c >> d; if (s[d] > c||s[d]==0)s[d] = c; } auto e = s.end(); e--; cout << e->second << " " << e->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> using namespace std; int main(){ int n; int a,b; int z[1000][1000] = {0}; cin >> n; for(int i=0;i<n;i++){ cin >> a >> b; z[b][a] = 1; } for(int i=100;i>=0;i--){ for(int j=1;j<=20;j++){ if(z[i][j] == 1){ cout << j << " " << i << 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 <stdio.h> int main(){ int n,l,r,a[100],top=1; scanf("%d",&n); for(int i=1;i<=n;i++)a[i]=0; for(int i=1;i<=n;i++){ scanf("%d%d",&l,&r); a[l]+=r; } for(int i=1;i<=n;i++)if(a[i]>a[top])top=i; printf("%d %d\n",top,a[top]); }
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.*; class Main { public static void main (String[] args) { Scanner scanner = new Scanner(System.in); String out = ""; int n = scanner.nextInt(); scanner.nextLine(); List<String> a = new ArrayList<String>(); for (int ii = 0; ii < n; ii++) { String line = scanner.nextLine(...
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<stdio.h> int main(void) { int n,a,b,i,m,z; m=-1; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d %d",&a,&b); if(m<b){ m=b; z=a; } else if(m==b){ if(a<z){ z=a; } } } printf("%d %d\n",z,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<iostream> #include<string> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; int main(void){ int n; cin>>n; int a[30]={0}; for(int i=1;i<=n;i++){ int x,y; cin>>x>>y; a[x] = y; } int m=0,M=1; for(int i=1;i<=n;i++){ if(m < a[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 <algorithm> #include <cstdlib> #include <cstring> #include <vector> #include <cstdio> using namespace std; int main() { int n; cin>>n; int id,val=-1; for(int i=0;i<n;i++) { int a,v; cin>>a>>v; if(val<v) { id=a; val=v; } else if(val==v) { id=min(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
#include<iostream> using namespace std; int main() { int n,a,v,maxa=-1,maxv=-1; cin>>n; for(int i=0;i<n;i++){ cin>>a>>v; if(maxv<v){ maxa=a; maxv=v; } else if(maxv==v && a<maxa){ maxa=a; maxv=v; } } cout<<maxa<<" "<<maxv<<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> 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-1, mx = w; } cout << idx+1 << " " << 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 <iostream> #include <utility> using namespace std; int main() { pair<int, int> perf[20], max; int i, n; cin >> n; for (i = 0; i < n; i++) { cin >> perf[i].first >> perf[i].second; } max = perf[0]; for (i = 1; i < n; i++) { if ((max.second < perf[i].second) || (max.second == perf...
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 <vector> #include <algorithm> using namespace std; struct Entrant { int num; int wakasagi; bool operator<(const Entrant& right) const { return wakasagi == right.wakasagi ? num > right.num : wakasagi < right.wakasagi; } }; int main(void) { int n; cin >> n; vector<Entra...
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=new int[n]; int[] v=new int[n]; for(int i=0;i<n;i++){ a[i]=sc.nextInt(); v[i]=sc.nextInt(); } for(int i=0;i<n-1;i++){ for(int j=n-1;j>i;j--){ 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> #include<algorithm> #include<utility> using namespace std; int main(){ int n; int i,num,w; pair<int,int> fish[100] ; cin >> n; for(i=0;i<n;i++){ cin >> num >> w; fish[i] = make_pair(-w,num); } sort(fish,fish+n); cout << fish[0].second << " " << (-1)*fish[0].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 <vector> #include <iostream> #include <algorithm> using namespace std; int main() { int n, a, v; cin >> n; vector<int> c(n, 0); for(int i = 0; i < n; i++) { cin >> a >> v; c[a - 1] += v; } int ptr = -1, cnt = -1; 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<cstdio> #include<iostream> #include<utility> using namespace std; int main(void){ int n; pair<int,int> inp; pair<int,int> max; cin>>n; cin>>max.first>>max.second; for(int i=1;i<n;i++){ cin>>inp.first>>inp.second; if(inp.second>max.second||(inp.second==max.second&&inp.first<max.first)) max=inp; ...
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 n,a,v,cnt[21],maxcnt; int main(){ cin>>n; for(int i=0;i<n;i++){ cin>>a>>v; cnt[a-1]+=v; maxcnt=max(maxcnt,cnt[a-1]); } for(int i=0;i<n;i++){ if(maxcnt==cnt[i]){ cout<<i+1<<' '<<maxcnt<<endl; 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
#include<iostream> #include<vector> #include<algorithm> #include<cstdio> #include<map> using namespace std; struct data{ int n,m; data(int a,int b){ n=a;m=b; } data(){} bool operator<(const data &d)const{ if(m!=d.m)return (m<d.m); else return (n>d.n); } }; int main(){ ...
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=new int[n]; int[] v=new int[n]; for(int i=0;i<n;i++){ a[i]=sc.nextInt(); v[i]=sc.nextInt(); } for(int i=0;i<n-1;i++){ for(int j=n-1;j>i;j--){ 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
import java.util.Arrays; import java.util.Scanner; public class Main { static class Player implements Comparable<Player>{ int number; int fish; Player(int number, int fish) { this.number = number; this.fish = fish; } public int compareTo(Player o) { return this.fish == o.fish ? this.number - o....
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 number,score,n; int winnerNumber,winnerScore = -1; cin >> n; for(int i=0; i<n; i++){ cin >> number >> score; if(score > winnerScore ){ winnerScore = score; winnerNumber = number; continue; ...
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(void){ int n,num,w,takata,vic = 0; int p[20] = {0}; cin >> n; for(int i = 0 ; i < n ; i++){ cin >> num >> w; p[num-1] = w; } takata = p[0]; for(int i = 1 ; i < n ; i++){ if(takata < p[i]){ takata = p[i]; vic = i; } } 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, m_a, m_v; cin >> n; m_v = 0; for(int i=0; i<n; i++){ cin >> a >> v; if(v >= m_v){ if(v != m_v || v == m_v && a < m_a){ m_a = a; m_v = v; } } } cout << m_a << " " << m_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 <iostream> using namespace std; int main() { int n; int a, b; int maxv = -1; int id = 21; cin >> n; for(int i = 0; i < n; i++) { cin >> a >> b; if ( maxv == b ) { if( id > a ) { maxv = b; id = a; } } else if ( maxv < b ) { maxv = b; id = a; } } cou...
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> #define rep(i,n) for(int i=0;i<(n);i++) using namespace std; int main(){ int n; scanf("%d",&n); int a0,v0=-1; rep(i,n){ int a,v; scanf("%d%d",&a,&v); if(v0<v || v0==v && a0>a) a0=a, v0=v; } printf("%d %d\n",a0,v0); 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; //Surf Smelt Fishing Contest 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.pri...
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.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while(sc.hasNext()){ int n = sc.nextInt(); int[] a = new int[n]; int[] v = new int[n]; int[] w = new int[n]; for(int i=0;i<n;i++){ a[i] = sc.nextInt(); v[i] = sc.nextIn...
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 stdIn = new Scanner(System.in); int n = stdIn.nextInt(); int max_idx = -1; int max = -1; for(int i=0;i<n;i++){ int a = stdIn.nextInt(); int b = stdIn.nextInt(); if(max<b){ max_idx = a; max = b; ...
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()) number={} for i in range(N): a,b=map(int,input().split()) number[a] = b number_max = max(number.values()) answer = [] for v,m in number.items(): if m==number_max: answer.append(v) print(min(answer),number_max)
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; int a,b; cin >> n ; cin >> a >> b ; int max=b,num=a; for( int i=1 ; i<n ; i++ ){ cin >> a >> b ; if( max < b ){ max=b; num=a; } else if( max == b && num > a ) num=a; } cout << num << " " << 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
#include <iostream> using namespace std; #define N 20 int main(void) { int n; int p[N + 1]; //添え字が参加者番号、値は釣った匹数 int a, v; int ans; cin >> n; for(int i = 0; i < n; ++i) { cin >> a >> v; p[a] = v; } ans = 1; for(int i = 1; i <= n; ++i) { if(p[ans] < p[i]) ans = i; } cout << ans << ' ' << p[ans]...
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 <string> #include <vector> #include <map> #include <iomanip> #include <iostream> using namespace std; /** Problem0095 : Surf Fishing Contest **/ int main() { map<int, vector<int> > list; int n, a, v, maxV=0; cin >> n; for (int i=0; i<n; i++) { cin >> a >> v; list[v].push_back(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.Arrays; import java.util.Scanner; public class Main { public static class Fisher implements Comparable<Fisher>{ int number, fished; public Fisher(int number, int fished) { super(); this.number = number; this.fished = fished; } @Override public int compareTo(Fisher arg0) { re...
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, ma, mv = -1; cin >> n; for(int i = 0; i < n; i++) { cin >> a >> v; if(v > mv) { ma = a; mv = v; } else if(v == mv && ma > a) { ma = a; } } cout << ma << ' ' << mv << 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(void) { int n, max_player,a,b,max=-1; cin >> n; while (n) { cin >> a >> b; if (b > max) { max_player = a; max = b; } else if (b == max) { if (max_player > a)max_player = a; } n--; } cout << max_player << " " << 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 <iostream> #include <stdio.h> using namespace std; int main() { int n,a,v,ma=999,mv=-1; cin >> n; for (n;n>0;n--) { cin >> a >> v; if (mv<=v) { if (mv==v) ma=min(ma,a); else ma=a; mv=v; } } cout << ma << ' ' << mv << 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()) ans=[-1]*21 for _ in range(n): a, b = map(int, input().split()) ans[a] = b print(ans.index(max(ans)), max(ans))
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; #define rep(i, n) for (int i = 0; i < int(n); ++i) int main() { int n; cin >> n; int ra = 1000, rb = -1; rep (i, n) { int a, b; cin >> a >> b; if (rb < b || (rb == b && ra > a)) { ra = a; rb = b; } } cout << ra << " " << rb << endl; re...
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()) alist = [] vlist = [] for _ in range(n): a, v = map(int, input().split()) alist.append(a) vlist.append(v) max = 0 num = 10**9 for a, v in zip(alist, vlist): if v > max: num = a max = v elif v == max: if a < num: num = a print(num, max)
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 <algorithm> #include <vector> using namespace std; typedef pair<int, int> P; bool compare(P v1, P v2){ if(v1.second > v2.second) return true; else if(v1.second < v2.second) return false; else{ if(v1.first < v2.first) return true; else return false; } } int main(){ vec...
CPP