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
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
#include<bits/stdc++.h> using namespace std; char in[11]; pair<pair<string,int>,int> p[101]; int main(){ int a;scanf("%d",&a); for(int i=0;i<a;i++){ int t;scanf("%s%d",in,&t); p[i]=make_pair(make_pair(in,-t),i); } sort(p,p+a); for(int i=0;i<a;i++) printf("%d\n",p[i].second+1); }
CPP
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
import sys range = xrange input = raw_input n = int(input()) pairs = [] for _ in range(n): a,b = input().split() b = -int(b) pairs.append((a,b)) order = sorted(range(n), key = lambda i:pairs[i]) print '\n'.join(str(x+1) for x in order)
PYTHON
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
#include<bits/stdc++.h> using namespace std; int i,j,n,m,c,p; string s; int main(){ vector<tuple<string,int,int>> r; for(cin>>n,i=1;i<=n;i++){ cin>>s>>p; r.push_back(make_tuple(s,-1*p,i)); } sort(r.begin(),r.end()); for(auto x:r)cout<<get<2>(x)<<endl; }
CPP
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
#!/usr/bin/env python def guide(): n = int(raw_input()) d = {} j = [] for _ in range(n): a, b = raw_input().split(' ') j.append(int(b)) d[int(b)] = a c = {} f = [] for a in d: e = d[a] f.append(e) if c.has_key(e): c[e].append(a) ...
PYTHON
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
N = int(input()) R = [] for i in range(N): s, p = input().split() R.append((s, -int(p), i)) R.sort() for i in R: print(i[2] + 1)
PYTHON3
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
#include <bits/stdc++.h> using namespace std; int main() { pair<pair<string,int>,int>p[1000]; int n; cin>>n; for(int i=0;i<n;i++){ string s; int t; cin>>s>>t; p[i]=make_pair(make_pair(s,-t),i+1); } sort(p,p+n); for(int i=0;i<n;i++){ cout<<p[i].second<< endl; } }
CPP
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); String[] r = new String[n]; for (int i = 0; i < n; i++) { String s = sc.next(); int p = sc.nextInt(); r[i] = s + "_" + (1100 - ...
JAVA
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
N=int(input()) List=[[i+1]+input().split() for i in range(N)] List.sort(key=lambda x:(x[1],-int(x[2]))) for s,r,t in List: print(s)
PYTHON3
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
n = int(input()) r = [] for i in range(n): s, p = input().split() r.append([s, -int(p), i]) r.sort() for i in range(n): print(r[i][2]+1)
PYTHON3
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
N = int(input()) L = [] for i in range(N): S, P = input().split() L.append((S, -int(P), i + 1)) L.sort() for _, _, i in L: print(i)
PYTHON3
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); Map<String, Map<Integer, Integer>> m = new HashMap<>(); String[] ...
JAVA
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
#include<bits/stdc++.h> using namespace std; int main(){ int N,b; cin >> N; vector<pair<pair<string ,int>,int>> data; string a; for(int i=0; i<N; i++){ cin >> a >>b; data.push_back(make_pair(make_pair(a,-b),i+1)); } sort(data.begin(),data.end()); for(int i=0; i<N; i++) cout << data.at(i).s...
CPP
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = Integer.parseInt(sc.next()); Restaurant[] r = new Restaurant[n]; for (int i = 0; i < n; i++) { r[i] = new Restaura...
JAVA
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); String[] s = new String[n]; for (int i = 0;i<n;i++){ String city = sc.next(); int point = sc.nextInt(); int num = i + 1; s[i] = city...
JAVA
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
n=int(input()) l=[] for i in range(n): s,p=input().split() p=int(p) l.append((s,-p,i+1)) l.sort() for i in range(n): print(l[i][2])
PYTHON3
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
N = int(input()) SP = [] for i in range(N): s, p = input().split() SP.append([s, -int(p), i+1]) SP.sort() for s, p, i in SP: print(i)
PYTHON3
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
n = int(input()) a = [input().split() for _ in range(n)] for i in sorted(range(n), key=lambda i: (a[i][0], -int(a[i][1]))): print(i + 1)
PYTHON3
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
n = int(input()) x = [] for i in range(n): s,p = (i for i in input().split()) x.append((s,-int(p),i+1)) x.sort() for i in x: print(i[2])
PYTHON3
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<tuple<string, int, int>> a; for(int i = 1; i <= N; i++){ string s; int p; cin >> s >> p; p = -p; a.push_back(tie(s, p, i)); sort(a.begin(), a.end()); } for(int i = 0; i < N; i++){ cout << get<2>(a.at(i)) << endl; ...
CPP
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
n=int(input()) ans=[] for i in range(n): s,p=map(str,input().split()) ans.append((s,int(p)*-1,i+1)) ans.sort() for i in ans: print(i[2])
PYTHON3
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
n=int(input()) t=[] for i in range(n): S,P=input().split() b=[S,-int(P),i+1] t.append(b) t.sort() for i in t: print(i[2])
PYTHON3
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
import java.util.Arrays; import java.util.Scanner; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); String[] sp = new String[n]; for (int i = 0; i < n; i++) { String city = sc.next(); int point = sc.nextInt(); sp[i] = city + "_" + (1100...
JAVA
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
#include <bits/stdc++.h> using namespace std; int n,x; string s; vector<pair<string,pair<int,int>>>v; int main(){ cin>>n; for(int i=0;i<n;i++){ cin>>s>>x; v.push_back({s,{-x,i+1}}); } sort(v.begin(), v.end()); for(auto i:v){ cout<<i.second.second<<'\n'; } }
CPP
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
#include<bits/stdc++.h> using namespace std; //// char in[11]; pair<pair<string,int>,int> p[101]; int main(){ int a;scanf("%d",&a); for(int i=0;i<a;i++){ int t;scanf("%s%d",in,&t); p[i]=make_pair(make_pair(in,-t),i); } sort(p,p+a); for(int i=0;i<a;i++) printf("%d\n",p[i].second+1); }
CPP
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
#include<bits/stdc++.h> using namespace std; int main(){ int n; set<pair<pair<string, int>, int>> S; cin >> n; for(int i = 0; i < n; i++){ string s; int r; cin >> s >> r; S.insert({{s, -r}, i+1}); } for(auto r:S) cout << r.second << "\n"; }
CPP
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
#include <bits/stdc++.h> using namespace std; vector<tuple<string, int, int>> r; int main() { int n; cin >> n; for (int i = 0; i < n; i++) { string s; int p; cin >> s >> p; r.emplace_back(s, 100 - p, i); } sort(r.begin(), r.end()); for (int i = 0; i < n; i++) { cout << get<2>(r[i]) + 1 << endl; } }
CPP
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
N=int(input()) S={} for i in range(N): p,q=input().split() S[i+1]=(p,int(q)) S=sorted(S,key=lambda x:(S[x][0],-S[x][1])) print(*S,sep="\n")
PYTHON3
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = Integer.parseInt(sc.next()); ArrayList<Pair> list = new ArrayList<>(); for (int i = 0; i...
JAVA
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); Obj[] arr = new Obj[n]; for (int i = 0; i < n; i++) { Obj o = new Obj(); o.i = i + 1; o.s = sc.next(); o.p = s...
JAVA
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
import java.util.Comparator; import java.util.Map; import java.util.Scanner; import java.util.TreeMap; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); Map<String,Map<Integer,Integer>> map = new TreeMap<>(); int N=sc.nextInt(); for(int i=0;i<N;i++) { String...
JAVA
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
#!/usr/bin/env python from collections import deque import itertools as ite import sys import math sys.setrecursionlimit(1000000) INF = 10 ** 18 MOD = 10 ** 9 + 7 N = input() ls = [] for i in range(N): S1, p = raw_input().split() p = int(p) ls += [(S1, -p, i)] ls.sort() ans = [0] * N for i in range(N): ...
PYTHON
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
N = int(raw_input()) sp_list = [] for i in range(N): sp_list.append(map(str, raw_input().split())) sp_list[i][1] = int(sp_list[i][1]) sp_list[i].append(i+1) sp_list.sort() check_set = set() for i in range(N): check_set.add(sp_list[i][0]) for i in check_set: idx_list = [] num_list = [] for...
PYTHON
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
n=int(input()) d = [input().split() + [i + 1] for i in range(n)] d.sort(key=lambda x: (x[0], -int(x[1]))) for i in d: print(i[2])
PYTHON3
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
N = int(input()) l = [] for i in range(N): s,p = input().split(" ") l.append([s,-int(p),i+1]) l.sort() for s,p,i in l: print(i)
PYTHON3
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
N = input() S = [""]*N P = [0]*N for i in range(N): S[i], P[i] = raw_input().split() P[i] = int(P[i]) for _, _, i in sorted((S[i], -P[i], i) for i in range(N)): print i+1
PYTHON
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
#include <bits/stdc++.h> using namespace std; int main() { int N; cin>>N; vector<tuple<string,int,int>> v(N); int s[N]; for(int i=0;i<N;i++){ cin>>get<0>(v.at(i))>>s[i]; get<1>(v.at(i))=100-s[i]; get<2>(v.at(i))=i+1; } sort(v.begin(),v.end()); for(int i=0;i<N;i++){ cout<<get<2>(v.at(i))<<endl; } }...
CPP
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; vector<tuple<string,int,int>> p(n); for(int i=0;i<n;i++){ string a; int b; cin>>a>>b; p[i]=make_tuple(a,-b,i+1); } sort(p.begin(),p.end()); for(int i=0;i<n;i++){ cout<<get<2>(p[i])<<endl; } }
CPP
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
#include <bits/stdc++.h> #define _GRIBCXX_DEBUG using namespace std; int main(){ int N;cin>>N; pair<pair<string,int>,int> M[N]; for(int i=0;i<N;i++){ string S;int P;cin>>S>>P; M[i]=make_pair(make_pair(S,-P),i+1); } //auto m=M.begin(); sort(M,M+N); for(int i=0;i<N;i++) cout<<M[i].second<<endl; ...
CPP
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); String[] sp = new String[n]; for (int i = 0; i < n; i++) { String city = scan.next(); int point = scan.nextInt(); s...
JAVA
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
import java.util.*; import java.math.*; import java.io.*; public class Main { static Scanner sc = new Scanner(System.in); public static void main(String args[]) { int n = sc.nextInt(); Data[] d = new Data[n]; for(int i = 0; i < n; i++) { d[i] = new Data(sc.next(), sc.nextIn...
JAVA
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
N = int(input()) a = [] for i in range(N): S,P = input().split() P = int(P) a.append([S,-P,i]) a.sort() for aa in a: print(aa[2]+1)
PYTHON3
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
n=[[i+1,input().split()] for i in range(int(input()))] [print(i[0]) for i in sorted(n,key=lambda x:(x[1][0],-int(x[1][1])))]
PYTHON3
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
import java.util.Map; import java.util.Scanner; import java.util.TreeMap; public class Main { public Main() { // TODO 自動生成されたコンストラクター・スタブ } public static void main(String[] args){ Scanner sc = new Scanner(System.in); // 整数の入力 int n,a,b,p,p2; int index,result; String s,s2; n = sc.nextInt(); ...
JAVA
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
n=int(input()) sp=[] for i in range(n): s,p=input().split() sp.append((s,-int(p),i+1)) sp.sort() for i in sp: print(i[2])
PYTHON3
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
n = int(input()) sp = [input().split() for _ in range(n)] for i in sorted(range(n), key=lambda i: (sp[i][0], -int(sp[i][1]))): print(i + 1)
PYTHON3
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
import java.util.Scanner; import java.util.HashMap; import java.util.List; import java.util.Arrays; import java.util.ArrayList; import java.lang.Math; public class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { int n = sc.nextInt(); Sp[] sp = new S...
JAVA
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
import java.util.*; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); Map<Integer, String> map1 = new TreeMap<Integer, String>(Comparator.reverseOrder()); Map<Integer, Integer> map2 = new HashMap<>(); ...
JAVA
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
#include <bits/stdc++.h> using namespace std; int main() { pair<pair<string,int>,int>p[1000]; int n; cin>>n; for(int i=0;i<n;i++){ string s; int P; cin>>s>>P; p[i]=make_pair(make_pair(s,-P),i+1); } sort(p,p+n); for(int i=0;i<n;i++){ cout<<p[i].second<< endl; } }
CPP
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); Rest[] arr = new Rest[n]; for (int i = 0; i < n; i++) { Rest r = new Rest(); r.s = sc.next(); r.p = sc.nextInt();...
JAVA
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
#include <bits/stdc++.h> using namespace std; int main(){ int N,p; string s; scanf("%d",&N); vector<tuple<string,int,int>>T(N); for(int i =0;i < N; i++){ cin >> s >> p; p *= -1; T[i] = make_tuple(s,p,i+1); } sort(T.begin(), T.end()); for(int i = 0; i < N; i++){ cout <<get<2>(T[i])...
CPP
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
N = int(input()) L = [input().split() + [i+1] for i in range(N)] L.sort(key=lambda x: (x[0], -int(x[1]))) print(*[n[2] for n in L], sep='\n')
PYTHON3
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
l = [] for i in range(int(input())): s,p = map(str, input().split()) l.append((s,100-int(p),i+1)) m = sorted(l) for i in m: print(i[2])
PYTHON3
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); Restaurant[] rs = new Restaurant[n]; for(int i=0; i<n; i++) { Restaurant r = new Restaurant(); ...
JAVA
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
n = int(input()) L=[] for i in range(n): s,p=input().split() L.append([s,-int(p),i+1]) list.sort(L) for i in range(n): print(L[i][2])
PYTHON3
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
n=int(input()) a=[] for i in range(n): s,p=input().split() a+=[(s,-int(p),i+1)] for i in sorted(a): print(i[2])
PYTHON3
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
#include <bits/stdc++.h> using namespace std; int main() { using pp=tuple<string,int,int>; int N,i; cin>>N; vector<pp> a(N); for(i=0;i<N;i++){ cin>>get<0>(a[i])>>get<1>(a[i]); get<1>(a[i])=100-get<1>(a[i]); get<2>(a[i])=i+1; } sort(a.begin(),a.end()); for(i=0;i<N;i++)cout<<get<2>(a[i])<<end...
CPP
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
n = int(input()) L = [(i+1,input().split()) for i in range(n)] L.sort(key=lambda x:(x[1][0],-int(x[1][1]))) for s in L: print(s[0])
PYTHON3
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
N=int(input()) P=[0]*N for i in range(N): s,p=input().split() P[i]=[s,-int(p),i+1] P.sort() for i in range(N): print(P[i][2])
PYTHON3
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
import java.util.Arrays; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scn = new Scanner(System.in); int N = scn.nextInt(); String[] name = new String[N]; String[] test = new String[N]; for(int i = 0;i<N;i++) { name[i]= scn.next(); ...
JAVA
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
import java.util.*; public class Main { private static class SP { int id; String S; int P; SP(int id, String S, int P) { this.id = id; this.S = S; this.P = P; } } public static void main(String[] args) { Scanner sc = new...
JAVA
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
n = int(input()) r = [] for i in range(n): s, v = input().split() r.append([s, -int(v), i + 1]) for s, v, c in sorted(r): print(c)
PYTHON3
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan=new Scanner(System.in); int a=scan.nextInt(); String str[]=new String[a]; int x[]=new int[a]; for(int i=0;i<a;i++) { str[i]=scan.next(); x[i]=scan.nextInt(); } int b[][]=new ...
JAVA
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
import java.util.Scanner; import java.util.Arrays; public class Main { static class Restaurant implements Comparable<Restaurant> { public int id; public String city; public int rating; public Restaurant(int id, String city, int rating) { this.id = id; this.city = city; this.rating...
JAVA
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
#include <iostream> using namespace std; int main() { int n, i, j; string s; int p; pair<pair<string, int>, int> a[100]; cin >> n; for (i = 0; i < n; i++) { cin >> s >> p; p *= -1; a[i] = make_pair(make_pair(s, p), i+1); } sort(a, a+n); for (i = 0; i < n; i++) cout << a[i].second<< e...
CPP
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
#include<bits/stdc++.h> using namespace std; vector<tuple<string,int,int>> S; int main(){ int n,t,i; cin>>n; for(i=0;i<n;i++){ string s; cin>>s>>t; S.emplace_back(s,-t,i); } sort(S.begin(),S.end()); for(auto x: S) cout<<get<2>(x)+1<<endl; }
CPP
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
N = int(input()) L = [] for i in range(N): S, P = input().split() L.append((S, -int(P), i + 1)) L.sort() for l in L: print(l[2])
PYTHON3
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner scan = new Scanner(System.in); int n = scan.nextInt(); String[] ss = new String[n]; String[] t = new String[n]; int[] ps = new int[n]; for(int i=0; i<n; i++) { String s = scan.next()...
JAVA
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc=new Scanner(System.in); int n=sc.nextInt(); ArrayList<String>po=new ArrayList<>(); for(int i=0;i<n;i++){ String s=sc.next(); while(s.length()<10)s+="0"; int...
JAVA
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
r = [[i+1] + raw_input().split(' ') for i in range(int(raw_input()))] r.sort(key = lambda x: (x[1], -int(x[2]))) for u in r: print u[0]
PYTHON
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
#include<bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<tuple<string, int, int>>a; for (int i = 1;i <= n;++i) { string s; int p; cin >> s >> p; p = -p; a.push_back(tie(s, p, i)); } sort(a.begin(), a.end()); for (int i = 0;i < n;++i) { cout << get<2>(a[i]) << endl; } }
CPP
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
n = int(input()) sp = [list(map(str, input().split()))+[i] for i in range(n)] sp.sort(key=lambda x:(x[0],-int(x[1]))) for i in sp: print(i[2]+1)
PYTHON3
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
#include <bits/stdc++.h> using namespace std; int main(){ pair<string,pair<int,int>> s[123]; int n,p[123]; cin>>n; for(int i=0;i<n;i++){ cin>>s[i].first>>p[i]; s[i].second.first=(p[i]-(2*p[i])); s[i].second.second=(i+1); } sort(s,s+n); for(int i=0;i<n;i++){ cout<<s[i].second.second<<endl; } }
CPP
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
for l in sorted([s,-int(p),i+1] for s,p,i in [list(input().split())+[i] for i in range(int(input()))]): print(l[2])
PYTHON3
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<tuple<string, int, int>> a; for(int i=1;i<=n;i++){ string s; int p; cin >> s >> p; p = -p; a.emplace_back(s, p, i); } sort(a.begin(), a.end()); for(int i=0;i<n;i++) cout << get<2>(a.at(i)) << endl; }
CPP
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
N = int(raw_input()) Restaurant = {} for i in xrange(N): city, score = raw_input().split() if city in Restaurant.keys(): Restaurant[city].append((int(score), i+1)) else: Restaurant[city] = [(int(score), i+1)] city_sort = sorted(Restaurant.keys()) for city in city_sort: score_sort = so...
PYTHON
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
n = int(input()) l = [] for i in range(1,n+1): s,p = input().split() l.append((s,-int(p),i)) l.sort() for x in l: print(x[2])
PYTHON3
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
import java.util.*; public class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); String[] d = new String[n]; for (int i = 0; i < n; i++) { String s = sc.next(); int p = sc.nextInt(); d[i] = s + ":" + (1100 - p) + ":"...
JAVA
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
#include <bits/stdc++.h> using namespace std; int main() { int N, P; string S; cin >> N; vector<pair<pair<string, int>, int>> V(N); for (int i = 0; cin >> S >> P; i++) V.at(i) = {{S, -P}, i + 1}; sort(V.begin(), V.end()); for (auto v : V) cout << v.second << "\n"; }
CPP
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
#include<bits/stdc++.h> using namespace std; int main(){ int N; cin>>N; char a[120]; pair<pair<string,int>,int> b[110]; for(int i=0;i<N;i++){ int t; cin>>a>>t; string A=a; b[i]=make_pair(make_pair(a,-t),i); } sort(b,b+N); for(int i=0;i<N;i++){ cout<<b[i].second+1<<endl; } ...
CPP
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); Map<String, List<int[]>> map = new HashMap<>(); for(int i = 1; i <= n; i++) { String city = sc.next(); if(!map.containsKey(city)) ...
JAVA
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
ll=[] for i in range(int(input())): s,p=input().split() ll.append([s,-int(p),i+1]) for l in sorted(ll): print(l[2])
PYTHON3
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
N=int(input()) SP=sorted([input().split()+[i+1] for i in range(N)],key=lambda x:(x[0],-int(x[1]))) for s,p,i in SP:print(i)
PYTHON3
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
N = int(input()) A = [] for i in range(N): s,p = input().split() p = -int(p) A.append((s,p,i+1)) A.sort() for a in A: print(a[2])
PYTHON3
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
import java.util.*; class Shop implements Comparable<Shop>{ String s; int p, n; public Shop( String str, int i , int j){ s = str; p = i; n = j; } @Override public int compareTo( Shop t ){ if(this.s.compareTo(t.s) > 0) return - 1; else if(this.s.compareTo(t.s) < 0) return 1; else re...
JAVA
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
l=[] for i in range(int(input())): a,b=input().split() l.append([a,-int(b),i+1]) l.sort(key=lambda x:x[1]) l.sort() for a,b,c in l:print(c)
PYTHON3
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
N = int(input()) SP = [] for i in range(N): s,p = input().split() SP.append((s,-int(p),i+1)) SP.sort() for s,p,i in SP: print(i)
PYTHON3
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
n = int(input()) r = [] for i in range(n): c,p = input().split() r.append([c,-int(p),i]) r.sort() for j in range(n): print(r[j][2]+1)
PYTHON3
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
import java.util.*; public class Main { public static void main(String args[]) { // 入力 Scanner sc = new Scanner(System.in); int n = Integer.parseInt(sc.next()); String[] s = new String[n]; int[] p = new int[n]; for (int i = 0; i < n; i++) { s[i] = sc.ne...
JAVA
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) int main() { int n;cin >>n;pair<pair<string,int>,int> p[n]; rep(i,n){ string s; int k; cin >>s>>k; p[i] = make_pair(make_pair(s,-k),i+1); } sort(p,p+n); rep(i,n){ cout<< p[i].second << endl; ...
CPP
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
import java.util.*; public class Main { public static void main(String args[]) throws Exception { Scanner sc = new Scanner(System.in); int cnt = sc.nextInt(); Map<Restaulant, Integer> map = new TreeMap<>(); for (int i = 0; i < cnt; i++) { String name = sc.next(); int score = sc.nextInt(); map.put(ne...
JAVA
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
import java.util.Scanner; import java.util.ArrayList; import java.util.Collections; class Shop implements Comparable<Shop>{ String s; int p; int n; public Shop(String s, int p, int n){ this.s = s; this.p = p; this.n = n; } @Override public int compareTo(Shop m){ int ...
JAVA
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
#include<bits/stdc++.h> using namespace std; int main() { string str; int n,t; vector< pair<pair<string,int>, int> > v; cin>>n; for(int i=0; i<n; i++) { cin>>str>>t; v.push_back( make_pair(make_pair(str, -t) , i) ); } sort(v.begin(), v.end()); for(int i=0; i<n; i++) { cout<<v[i].second+1<<endl; } retu...
CPP
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
n=int(input()) l=[] for i in range(n): s,P=input().split() p=int(P) l.append([s,-p,i+1]) L=sorted(l) for i in range(n): print(L[i][2])
PYTHON3
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<pair<string,int>,int> P; P a[105]; string s; int d; int n; int main() { cin>>n; for(int i=1;i<=n;i++) { cin>>s>>d; a[i].first=make_pair(s,-d); a[i].second=i; } sort(a+1,a+1+n); for(int i=1;i<=n;i++) { cout<<a[i].second<<endl;...
CPP
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
import java.io.FileNotFoundException; import java.util.Scanner; public class Main { public static void main(String[] args) throws FileNotFoundException { // File file = new File("src/in.txt"); // Scanner sc = new Scanner(file); Scanner sc = new Scanner(System.in); int N = sc.nextInt(); String[] S...
JAVA
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i=0;i<n;i++) pair<pair<string, int>, int> pr[110]; int main() { int n; cin>>n; rep(i, n) { string s; int t; cin>>s>>t; pr[i] = make_pair(make_pair(s,-t),i); } sort(pr,pr+n); rep(i,n) { cout<<pr[i].second+1<<endl; } }
CPP
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out); final int N = Integer.parseInt(sc.next()); String[] ss = new String[N]; for (int i ...
JAVA
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); Entry[] entryArray = new Entry[N]; for (int i = 0; i < N; i++) { String city = sc.next(); int point = sc.nextInt(); entryArray[i] = new Ent...
JAVA
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
n = int(input()) r = [input().split() for _ in range(n)] print(*sorted(range(1, n + 1), key=lambda i: (r[i-1][0], -int(r[i-1][1]))), sep='\n')
PYTHON3
p03030 AtCoder Beginner Contest 128 - Guidebook
You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score. You want to in...
6
0
def comp_rest(a,b): if a[0] > b[0]: return True elif a[0] < b[0]: return False elif a[0] == b[0]: return a[1] < b[1] def solve(): N = int(raw_input()) SP = [] for i in range(N): SiPi = raw_input().split() Si = SiPi[0] Pi = int(SiPi[1]) SP...
PYTHON