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
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());int p = 0;String s = ""; String[] a = new String[n]; for(int i = 0; i < n; i++) { s = sc.next();p = 1100 - Integer.parseInt...
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); ArrayList<Restaurant> list = new ArrayList<Restaurant>(); int N = sc.nextInt(); for (int i = 1; i <= N; i++) { String name = sc.next(); int point = 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
N = int(input()) lst = [] for i in range(N): s,p = input().split() p=int(p) lst.append((s,-p,i+1)) lst.sort() for e in lst: print(e[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
for x in [j[0] for j in sorted([[i+1,*input().split()] for i in range(int(input()))],key=lambda x: (x[1], -int(x[2])))]: print(x)
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>> p(n); for(int i=0;i<n;i++){ string S; int P; cin>>S>>P; p[i] = make_tuple(S,-P,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
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]; int[] p = new int[n]; ArrayList<String> list = new ArrayList<String>(); HashMap<Integer, Integer> map = new HashMap<Integer, ...
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
print(*[_[0] for _ in sorted([[i+1] + input().split() for i in range(int(input()))], key=lambda x:(x[1], -int(x[2])))], 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
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for(int i = 0;i < (int)(n);i++) int main() { int n, p; string s; cin >> n; map<string, map<int, int>> m; rep(i, n) { cin >> s >> p; m[s][100-p] = i+1; } for(auto pr : m) for(auto x : pr.second) cout << x.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
N = int(input()) L = [] for i in range(N): s,p = input().split() L.append([s, 100-int(p), i+1]) L.sort() for j in L: print(j[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>> K; for(int i=0;i<N;i++){ string S; int P; cin >> S >> P; K.push_back(make_tuple(S,100-P,i+1)); } sort(K.begin(),K.end()); for(int i=0;i<N;i++){ cout << get<2>(K.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()) a = [] for i in range(1,n+1): s, p = input().split() a.append((s, -1*int(p), i)) a.sort() for i in 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(){ int n; cin >> n; vector<tuple<string,int,int>>a; for(int i=1; i<n+1; i++){ string s; int p; cin >> s >> p; p*=-1; a.emplace_back(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
#include<bits/stdc++.h> using namespace std; int main(){ int N; cin>>N; vector<tuple<string,int,int>> A(N); for(int i=0;i<N;i++){ string s; int j; cin>>s>>j; A[i]=make_tuple(s,100-j,i+1); } sort(A.begin(),A.end()); for(int i=0;i<N;i++){ int j=(get<2>(A[i])); cout<<j<<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()) f = lambda i,x: (x[0], -int(x[1]), i) R = sorted(f(i,input().split()) for i in range(N)) for _,_,i in R: 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.*; import java.util.stream.Collectors; public class Main{ public static void main(String[] args) { Scanner in =new Scanner(System.in); int n = in.nextInt(); in.nextLine(); Restrant[] rest=new Restrant[n]; Restrantrating rating=new Restrantrating()...
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>> restaurants = new TreeMap<>(); int N=sc.nextInt(); for(int i=0;i<N;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
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 l: 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
def nig (x,y): if x[0] == y[0]: return -1 if x[1]>y[1] else 1 return -1 if x[0] < y[0] else 1 cuc_fuk = [] for x in range(input()): a,b = raw_input().split() cuc_fuk.append((a,int(b),x+1)) for piss in sorted(cuc_fuk, cmp = nig ): print piss[2]
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(make_tuple(s,p,i)); } sort(a.begin(),a.end()); for(int i=0;i<n;i++) { cout<<get<2>(a[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
import java.util.Scanner; import java.util.stream.Collectors; import java.util.stream.IntStream; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); String[] S = new String[N]; int[] P = new int[N]; for (in...
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): a,b=input().split() b=-(int(b)) l.append([a,b,i+1]) l=sorted(l) for i in l: 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.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num = sc.nextInt(); String array[][] = new String[num][3]; for(int i = 0; i < num; i ++) { array[i][0] = sc.next(); array[i][1] = sc.next(); array[i][2] = String.valueOf(i + 1); ...
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; 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[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()) L = [] for i in range(N): N, K = input().split() K = int(K) L.append([N, -K, i+1]) L.sort() for i in L: 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.*; class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); int n=sc.nextInt(); List<Rest> l=new ArrayList<>(n); for(int i=1;i<=n;i++){ l.add(new Rest(i,sc.next(),sc.nextInt())); } Collections.sort(l); for(int i=0;i<n;i++){ System....
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; cin>>N; vector<tuple<string,int,int>> res; for(int i=1;i<=N;i++){ string S; int P; cin>>S>>P; res.push_back(make_tuple(S,100-P,i)); } sort(res.begin(),res.end()); for(int i=0;i<N;i++){ cout<<get<2>(res.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 <iostream> #include <bits/stdc++.h> using namespace std; char in[120]; pair<pair<string,int>,int> p[110]; int main(){ int a; cin>>a; for(int i=0;i<a;i++){ int t; cin>>in>>t; string tmp=in; p[i]=make_pair(make_pair(in,-t),i); } std::sort(p,p+a); for(int i=0;i<a;i++) cout<<p[i].second+1<<"\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; vector<tuple<string,int,int>> vec(N); for(int i=0; i<N; i++){ string a; int b; cin>>a; cin>>b; vec.at(i)=make_tuple(a,-b,i+1); } sort(vec.begin(), vec.end()); for(auto x:vec){ cout << get<2>(x) << endl; } return 0; }
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
print('\n'.join([str(s[2])for s in sorted([input().split()+[i+1]for i in range(int(input()))],key=lambda x:(x[0],-int(x[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() { int N; cin >> N; string s; int p; vector<tuple<string,int,int>> vec; for(int i=0;i<N;i++){ cin >> s >> p; vec.push_back(make_tuple(s,100-p,i+1)); } sort(vec.begin(),vec.end()); for(int i=0;i<N;i++){ int rank; cout << get<2>(vec.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
import java.util.*; class Restaurant { public int index; public String city; public int point; public Restaurant(int index, String city, int point) { this.index = index; this.city = city; this.point = point; } } class CityComparator implements Comparator<Restaurant> { @Override public int compare(Restau...
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): a,b = input().split() L.append([a,100-int(b),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
import java.util.*; public class Main { public static void main(String[] args) throws Exception { // Your code here! Scanner sc = new Scanner(System.in); int n = sc.nextInt(); String[][] ab = new String[n][3]; for (int i = 0; i < n; i++) { ab[i][0] = sc.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.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[] book = new String[n]; for(int i = 1; i <= n; i++) { String s = sc.next(); int temp = sc.nextInt(); s = s + " " + 1/(...
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) { Scanner scan = new Scanner(System.in); int number = scan.nextInt(); String[] info = new String[number]; for (int i = 0; i < number; i++) { // 都市名、スコア、番号 info[i] = scan.next() + "," + (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
from operator import itemgetter N = input() t = [] for i in range(N): s,p = raw_input().split() p2 = int(p) t.append([s,p2,i+1]) t2 = sorted(t,key = itemgetter(1), reverse = True) t3 = sorted(t2,key = itemgetter(0)) for c in t3: print(c[2])
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=[list(input().split()) for _ in range(n)] a=sorted(l,key=lambda x:(x[0],-int(x[1]))) for x in a: print(l.index(x)+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; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); Map<String, Integer> data = new TreeMap<>(); for (int i = 0; i < n; i++) { String city = sc.next(); int point = sc.n...
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; cin >> N; pair<pair<string, int>, int> S[100]; for(int i=0; i<N; i++){ string s; int p; cin >> s >> p; S[i] = make_pair(make_pair(s, -p), i); } sort(S,S+N); for(int i=0; i<N; i++){ cout << S[i].second+1 << endl; } return 0;...
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.Comparator; import java.util.Scanner; import java.util.TreeMap; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); TreeMap<String, TreeMap<Integer, Integer>> map = new TreeMap<String, TreeMap<Integer, Integer>>(); ...
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 static java.lang.System.*; class Guidebook implements Comparable<Guidebook>{ public String city; public int score; public int number; public int compareTo(Guidebook obj){ if(this.city.equals(obj.city)){ return obj.score - this.score; }else{ return this.city.com...
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 s_ = sc.next(); int n_ = sc.nextInt(); int distance = 100 - n_; 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; int main() { int n; cin >> n; map<pair<string, int>, int> kek; for (int i = 1; i <= n; ++i) { string a; int score; cin >> a >> score; kek[{a, -score}] = i; } for (auto &tmp : kek) cout << tmp.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
n=int(input()) l=[input().split() + [i+1] for i in range(n)] l=sorted(l,key=lambda x:(x[0],-int(x[1]))) print(*[s[2] for s 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
import java.util.ArrayList; import java.util.Comparator; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner $ = new Scanner(System.in); int N = $.nextInt(); int id =1; List<Town> ts = new ArrayList<>(); while(N-- != 0){ ...
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> #include <string> using namespace std; char in[120]; pair<pair<string,int>,int> p[110]; int main(){ int a;scanf("%d",&a); for(int i=0;i<a;i++){ int t;scanf("%s%d",in,&t); string tmp=in; p[i]=make_pair(make_pair(in,-t),i); } std::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
n=int(input()) d=sorted(list(list(input().split())+[i+1] for i in range(n)),key=lambda x:(x[0],-int(x[1]))) for v in d:print(v[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> #include<iostream> #include<algorithm> using namespace std; int main() { int n; cin>> n; vector<tuple<string,int, int>> asp; for(int i=0;i<n;i++){ string s; int p; cin>>s>>p; asp.emplace_back(s, 100-p, i+1 ); } sort(begin(asp),end(asp)); for(int i=0;i<n;i++){ cout<< get<2>(asp...
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.*; class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); int n=sc.nextInt(); String[] s=new String[n]; int[] p=new int[n]; String[] sp=new String[n]; for(int i=0;i<n;i++){ s[i]=sc.next(); p[i]=sc.nextInt(); sp[i]=s[i]+"_"+(1100-p[i])+"_"+(i+1); }...
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()) ans = [] for i in range(N): s, p = input().split() ans += [[s, -int(p), i+1]] ans.sort() for a in ans: 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
#include<bits/stdc++.h> using namespace std; int main(){ int A; cin >> A; vector<pair<pair<string,int>,int>>P(A); for(int i=0;i<A;i++){ cin >> P[i].first.first >> P[i].first.second; P[i].second=i+1; P[i].first.second*=-1; } sort(P.begin(),P.end()); for(int i=0;i<A;i++)cout << P[i].second << ...
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.*; import static java.util.Comparator.*; class Main{ public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); int n = stdIn.nextInt(); String[] s = new String[n]; for(int i = 0; i < n ; i++) s[i] = (stdIn.next() + "_" + (11...
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 {//atcoder ABC128B - public static void main(String[] args) { Scanner seer = new Scanner(System.in); int n = seer.nextInt(); Res[] rs = new Res[n]; for(int i = 0; i < n; i++){ String name = seer.next(); int p = seer.nextInt(); rs[i] = new Res(name, p, i+1); } ...
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.io.BufferedReader; import java.io.InputStreamReader; import java.io.IOException; import java.util.Arrays; import java.util.Comparator; import java.util.TreeMap; import java.util.Map; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader...
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; char in[120]; pair<pair<string,int>,int> p[110]; int main(){ int a;scanf("%d",&a); for(int i=0;i<a;i++){ int t;scanf("%s%d",in,&t); string tmp=in; p[i]=make_pair(make_pair(in,-t),i); } std::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
n=int(input()) a=[list(input().split())+[i] for i in range(n)] for i in range(n): a[i][1]=-int(a[i][1]) a.sort() for _,_,i in a: 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
#include <bits/stdc++.h> using namespace std; int main() { int n; cin>>n; vector<tuple<string,int,int>>a(n); for(int i=0;i<n;i++){ string s; int k; cin>>s>>k; a.at(i)=make_tuple(s,100-k,i+1); } 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()) ans = [] for i in range(0, n): s, p = raw_input().split(" ") p = int(p) ans.append((s, p * -1, i + 1)) sort = sorted(ans) for i in range(0, len(sort)): city, point, index = sort[i] print(index)
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
import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); Map<String, Map<Integer,Integer>> map = new TreeMap<>(); for(int i = 0; i < N; 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
N=input() L=[] for i in range(N): s,p=raw_input().split() L.append( [s , int(p),i+1] ) L.sort(key=lambda x:(x[0],-x[1]) ) for x,y,z in L: print z
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
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]; int[] P = new int[N]; String[] T = new String[N]; for(int i = 0; i < N; i++) { S[i] = sc.next(); P[i] = sc.nextInt(); T[i] = 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
n = int(input()) r = [input().split() + [i+1] for i in range(n)] o = sorted(r,key=lambda x:(x[0],-int(x[1]))) [print(o[i][2]) for i in range(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
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.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int N=sc.nextInt(); Restaurant[] r=new Restaurant[N]; for(int i=0;i<N;i++) r[i]=new Restaurant(sc.next(),sc.nextInt(),i+1); Arrays.sort(r); for(int i=0...
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; cin >> n; vector<tuple<string, int, int>>a; for (int i = 1; i <= n; i++) { string s; int p; cin >> s >> p; a.emplace_back(s, -p, i); } sort(a.begin(), a.end()); for (int i = 0; i < n; i++) { cout << get<2>(a[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=[] for i in range(n): s,p=map(str,input().split()) L.append((s,int(p)*-1,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.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = Integer.valueOf(sc.nextLine()); String sArray[] = new String[N]; 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
n=int(input()) L=[] for i in range(n): a,b=input().split() L+=[[a,-int(b),i+1]] L.sort() for i in L: 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() + [i] for i in range(N)] SP.sort(key = lambda x: (x[0], -int(x[1]))) for _,_,i in SP: 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.HashSet; import java.util.Scanner; import java.util.Set; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); String S[] = new String[N]; int P[] = new int[N]; for (int i=0; i<N; i++){ S[i] = sc.next(); P[i] = sc.n...
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.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Scanner; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); List<String> s = new ArrayList<>(); String[][] sp = new String[N][2]; sc.nextLine();...
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; cin >> N; vector<tuple<string, int, int>> p(N); string S; int P; for (int i = 0; i < N; i++) { cin >> S >> P; p.at(i) = make_tuple(S, -P, i + 1); } sort(p.begin(), p.end()); for (auto elem : p) { cout << get<2>(elem) << 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
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 ary[][] = new String[N][3]; for(int i = 0; i < N; i++) { ary[i][0] = sc.next(); ary[i][1] = sc.next(); ary[i][2] = i + ""; } Arrays.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
// B - Guidebook #include <bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; vector<tuple<string,int,int>> sp; for(int i=0; i<n; ++i){ string s; int p; cin>>s>>p; sp.push_back(make_tuple(s, -p, i+1)); } sort(sp.begin(), sp.end()); for(auto e:sp) cout<< get<2>(e) <<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()) arr=[(0,0,0)]*N for i in range(N): S,P = input().split() arr[i] = (S,-int(P),i+1) arr.sort() for _,_,i in arr: 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
#include"bits/stdc++.h" #include"math.h" using namespace std; int main(){ int n; cin >> n; vector<tuple<string , int , int>> S; for(int i=0; i<n; i++){ string s; int p; cin >> s >> p; S.push_back(make_tuple(s , 100-p , i+1));} sort(S.begin(),S.end()); for(auto x:S) {cout << get<2>(x) << 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
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<tuple<string,int,int>> t; for(int i=0;i<N;i++){ string s; int a; cin >> s >> a; t.push_back(make_tuple(s,-1*a,i+1)); } sort(t.begin(),t.end()); for(int i=0;i<N;i++){ cout << get<2>(t.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()) a=[] for i in range(N): s, p = input().split() a.append((s,-int(p),i+1)) a.sort() for i in range(N): print(a[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()) SPN = [] for i in range(n): s,p = input().split() SPN.append([s,-int(p),i+1]) SPN.sort() for s,p,n in SPN: print(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
N=int(input()) L=[] for i in range(N): a,p=input().split() L.append([a,-int(p),i]) L.sort() for i in range(N): print(L[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
print(*sorted(range(1,int(input())+1),key=lambda _:[(s,-int(p))for s,p in[input().split()]]))
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(raw_input()) S =[] P =[] for i in range(N): s,p=map(str,raw_input().split()) S.append(s) P.append(int(p)) ss=sorted(list(set(S))) for sss in ss: a =[] b =[] for j in range(N): if sss==S[j]: a.append(j) b.append(P[j]) if len(b)>0: c = sorted(b,re...
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
for*_,i in sorted((t.split()[0],-int(t.split()[-1]),i)for i,t in enumerate(open(0)))[1:]: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()) SP = [] for i in range(N): S,P = input().split() P = int(P) SP.append((S,-P,i+1)) SP.sort() for a,b,c in SP: 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()) l=[] for i in range(n): x,y=input().split() y=int(y) l.append([x,-y,i+1]) l.sort() for i in l: 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
lst = [input().split()+[str(i+1)] for i in range(int(input()))] print("\n".join([i[2] for i in sorted(lst, key=lambda x:(x[0], -1*int(x[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(){ int n;cin >> n; pair<pair<string, int>, int> p[110]; for(int i=0;i<n;++i){ string s;int score; cin >> s >> score; p[i] = make_pair(make_pair(s, -score), i); } sort(p, p+n); for(int i=0;i<n;++i)cout << p[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
N=int(input()) X=[] for i in range(1,N+1): S,P=input().split() X.append((S,-int(P),i)) X.sort() for (_,_,c) in X: 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()) a = [] for i in range(n): s, p = input().split() a.append([s, -int(p),i+1]) b=sorted(a) for i in range(n): print(b[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>> R(N); for (int i=0; i<N; i++){ string S; int P; cin >> S >> P; R.at(i) = make_tuple(S,100-P,i+1); } sort(R.begin(),R.end()); for (int i=0; i<N; i++){ cout << get<2>(R.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; string s;int p; vector<pair<string,pair<int,int>>> vec; for(int i=0;i<N;i++){ cin>>s>>p; vec.push_back(make_pair(s,make_pair(-p,i))); }sort(vec.begin(),vec.end()); for(int i=0;i<N;i++){ cout<<vec[i].second.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
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 k in range(n): print(l[k][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[] $$) throws Exception { Scanner $ = new Scanner(System.in); int N = $.nextInt(), pmax = 100; String[] P = new String [N]; for (int i = 0; i < N; i++){ P[i] = $.next() + "_" + (pmax * 11 - $.nextInt()) + "_" + (i + 1); } Arrays.sort...
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,i; cin>>n; vector<tuple<string,int,int>> t(n); for(i=0;i<n;i++) { cin>>get<0>(t.at(i))>>get<1>(t.at(i)); get<1>(t.at(i))=-get<1>(t.at(i)); get<2>(t.at(i))=i; } sort(t.begin(),t.end()); for(i=0;i<n;i++) cout<<get<2>(t.at(i))+1<<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
#include <bits/stdc++.h> using namespace std; vector< pair< pair<string, int>, int> >cook; int main(){ int n; cin>>n; for(int i=0;i<n;i++){ string s; cin>>s; int p; cin>>p; cook.push_back(make_pair(make_pair(s,-p), i+1)); } sort(cook.begin(), cook.end()); for(int j=0;j<n;j++){ cout<<cook[j].second<<...
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>>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()) data=[] for i in range(N): S,P=input().split() P=int(P) data.append((S,-P,i+1)) data.sort() for _,_,i in data: 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
print(*[s[2]for s in sorted([input().split()+[i+1]for i in range(int(input()))],key=lambda x:(x[0],-int(x[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
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); Map<String, Integer> data = new TreeMap<String, Integer>(); for(int i=1; i<n+1; i++){ String town = sc.next(); 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
import java.util.Arrays; 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()); restaurant[] res = new restaurant[n]; for(int i = 0; i < n; i++) { res[i] = new restaurant(sc.n...
JAVA