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;
int main() {
int n;
cin >> n;
pair< pair<string, int>, int> P[n];
for (int i = 0; i < n; i++) {
cin >> P[i].first.first >> P[i].first.second;
P[i].first.second *= -1;
P[i].second = i + 1;
}
sort(P, P + n);
for (auto e : P) cout << e.second << 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.*;
import java.lang.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
List<Pair> list = new ArrayList<>();
for (int i = 0; i < n; i++) {
list.add(new Pair(i + 1, sc.next(), sc.nextInt()));
}
Collections.sort(list,... | 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<tuple<string, int, int>> V(N);
for (int i = 0; cin >> S >> P; i++) V.at(i) = make_tuple(S, -P, i + 1);
sort(V.begin(), V.end());
for (auto v : V) cout << get<2>(v) << "\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<iostream>
#include<string>
#include<algorithm>
using namespace std;
char P[105];
pair<pair<string,int>,int> p[105];
int main(){
int N , t;
cin>>N;
for(int i=0;i<N;i++){
scanf("%s%d",P,&t);
p[i] = make_pair(make_pair(P,-t),i);
}
sort(p,p+N);
for(int k=0;k<N;k++) cout<<p[k].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())
A = []
for i in range(N):
S, P = input().split()
A.append((S,-int(P), i))
A.sort()
print(*list(i+1 for _, _, i in A)) | 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 pair<string,int> p;
int n;
int main(void){
string x;
int y;
cin >> n;
map<p,int> sp;
for(int i=0;i<n;i++){
cin >> x >> y;
sp[p(x,y*-1)] = i+1;
}
for(pair<p,int> itr: sp){
cout << itr.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())
d = list(list(input().split())+[i+1] for i in range(n))
a = sorted(d, key=lambda x:(x[0],-int(x[1])))
for v in a:
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 | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
int N = keyboard.nextInt();
Map<String, Integer> rest = new TreeMap<String, Integer>();
for(int i=1; i< N+1; i++){
String s = keyboard.next();
int k = keyboard.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 | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
pair<pair<string,int>,int> p[110];
for (int i; i<N; i++){
string S;int P;
cin >> S >> P;
P=P*(-1);
p[i]=make_pair(make_pair(S,P),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 | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
vector<tuple<string,int,int>> vec;
for (int i = 0; i < n; i++)
{
string s;
int p;
cin >> s >> p;
vec.push_back(make_tuple(s,-p,i+1));
}
sort(vec.begin(),vec.end());
for(auto v:vec){
cout << get<2>(v) <... | 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 | _,*l=open(0).read().split()
[print(i + 1)for i in sorted(range(len(l)//2),key=lambda i:(l[i*2],-int(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 | #include<bits/stdc++.h>
using namespace std;
int main(){
pair<pair<string,int>,int> p[110];
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);
}
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 | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
List<Restaurant> list = new ArrayList<>();
for(int i = 1; i <= n; i++){
String city = sc.next();
int score = 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(){
string a;
int N,b;
cin>>N;
vector<tuple<string,int,int>>X(N);
for(int i=0;i<N;i++){
cin>>a>>b;
X.at(i)=make_tuple(a,100-b,i+1);
}
sort(X.begin(),X.end());
for(int i=0;i<N;i++){
tie(ignore,ignore,b)=X.at(i);
cout<<b<<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<utility>
#include<string>
#include<algorithm>
using namespace std;
char in[120];
pair<pair<string,int>,int> p[101];
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);
}
sort(p,p+a);
for(int i=0;i<a;i++)printf("%d\n",p[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 | #include <bits/stdc++.h>
using namespace std;
int main()
{
int N;
cin >> N;
string Si;
int Pi;
set<tuple<string, int, int>> s;
for(int i=0;i<N;i++){
cin >> Si >> Pi;
s.insert(make_tuple(Si, -Pi, i+1));
}
for(auto x : s){
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 | N = int(raw_input())
SP = [raw_input().split() + [i + 1] for i in range(N)]
for i in range(N):
SP[i][1] = -int(SP[i][1])
SP.sort()
for i in range(N):
print SP[i][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 |
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, Integer> store = new TreeMap <String, Integer>();
for (int i = 0; i<N; i++){
String Si=sc.next();
int 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 | import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
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[]> list = new ArrayList<>();
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.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[] sort = new String[n];
for(int i = 0 ; i < n ; i++) {
String name = sc.next();
int point = sc.nextInt();
point = 100 - 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;
cin >> N;
vector<tuple<string, int, int>>R(N);
for (int i = 0;i < N;i++){
string S;
int P;
cin >> S >> P;
R[i] = make_tuple(S, -P,i+1);
}
sort(R.begin(),R.end());
for(int i = 0;i < N; i++){
cout << get<2>(R[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 static java.util.Comparator.*;
import java.util.ArrayList;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
ArrayList<SI> list = new ArrayList<SI>();
Scanner sc = new Scanner(System.in);
int n = Integer.parseInt(sc.next());
for(int i = 1; i <= n; i++) {
SI si ... | 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;
int j,k;
string S;
for(int i=0;i<N;i++){
cin>>S>>k;
p.push_back(make_tuple(S, -k, i));
}
sort(p.begin(),p.end());
for(int i=0;i<N;i++){
tie(S,k,j)=p[i];
cout<<j+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.Arrays;
import java.util.Scanner;
public class Main {
/* ABC128 B
*
*/
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
String[] strs = new String[n];
for (int i = 0; i < n; i++) {
strs[i] = sc.next() + "_" + (1100-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 | 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[] rs = new Restaurant[N];
for (int i = 0; i < N; i++) {
rs[i] = 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 | #include <bits/stdc++.h>
using namespace std;
int main(){
int N,a;
string s;
cin >>N;
tuple<string,int,int>p[110];
for(long long int i=0;i<N;i++){
cin >> s >>a;
p[i]=make_tuple(s,-a,i);
}
sort(p,p+N);
for(long long int i=0;i<N;i++){
cout << get<2>(p[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())
a = sorted([input().split() + [i+1] for i in range(n)], key=lambda x:(x[0], -int(x[1])))
for n, s, i in a:
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())
l=[input().split()+[i+1] for i in range(N)]
l=sorted(l,key=lambda x:(x[0],-int(x[1])))
print(*[a[2] for a 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 | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<tuple<string,int,int>> R;
for (int i=0; i<N; i++) {
string s;
int p;
cin >> s >> p;
R.push_back(make_tuple( s, 100 - p, i + 1));
}
sort(R.begin(), R.end());
for (auto x: R) {
cout << get<2>(x) << en... | 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(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 num = sc.nextInt();
Map<String, Map<Integer, Integer>> gidebook = new TreeMap<>();
for (int i = 1; i <= num; i++) {
String inCity = 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 | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
pair<pair<string,int>,int> a[105];
for(int i = 1; i<=n; i++){
cin>>a[i].first.first>>a[i].first.second;
a[i].first.second *= -1;
a[i].second = i;
}
sort(a,a+n+1);
for(int i = 1; i<=n; i++){
cout<<a[i].second<<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 | #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 p;
cin >> s >> p;
a.at(i) = make_tuple(s,-p,i);
}
sort(a.begin(),a.end());
for(int i=0; i<N; i++){
cout << get<2>(a.at(i))+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.*;
public class Main {
public static void main (String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
Rest[] rests = new Rest[n];
for (int i = 0; i < n; i++) {
rests[i] = new Rest(i + 1, sc.next(), sc.nextInt());
}
Arrays.sort(rests, new Comparator<Rest>() {
pub... | 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 = raw_input().split()
N = int(l[0])
S = []
P = []
for i in range(N):
l = raw_input().split()
S.append(l[0])
P.append(int(l[1]))
S1 = []
for i in range(N):
S1.append([i + 1, S[i], P[i]])
#print(N, S, P, S1)
S1.sort(key = lambda x: -x[2])
S1.sort(key = lambda x: x[1])
#print(S1)
for s in S1:
pri... | 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;
typedef long long ll;
int main(){
int n; cin >> n;
map<pair<string, int>, int> v;
for(int i=0; i<n; i++){
string a; int b; cin >> a >> b;
v[{a, -b}]= i;
}
for(auto x:v)
cout << x.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()
L.append([s,-int(p),i])
for i in range(n):
print((sorted(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 | n = int(input())
ls = []
for i in range(n):
s, p = input().split()
ls.append((s, -int(p), i+1))
ls.sort()
for v in ls:
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 | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n=sc.nextInt();
int[] arrayv=new int[n];
String[] arrayc=new String[n];
int[] arrayj=new int[n];
int sum=0;
for(int i=0;i<n;i++) {
arrayc[i]=sc.next();
arrayv[i]=sc.nex... | 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());
Pair[] score = new Pair[n];
for(int i=0;i<n;i++){
score[... | 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(N);
for (int i; i<N; i++){
string S;
int P;
cin >> S >> P;
P=P*(-1);
a[i]=make_tuple(S,P,i);
}
sort (a.begin(),a.end());
for(auto b : a){
cout << get<2>(b)+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 | #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;
}
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 | n = int(input())
lst = []
for i in range(n):
s,p = input().split()
lst.append((s,-int(p),i+1))
lst.sort()
for s,p,k in lst:
print(k)
| 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 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;
typedef long long ll;
int main(){
int N;
cin>>N;
pair<pair<string, int>,int> p[110];
for(int i = 0; i < N; i++){
string s;
int t;
cin >> s>>t;
p[i]=make_pair(make_pair(s,-t),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 | print('\n'.join(map(str, (x[2]+1 for x in sorted((s, -int(p), i) for i, (s, p) in enumerate(zip(*[iter(open(0).read().split()[1:])]*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>
#define REP(i,n) for(int i=0;i<n;i++)
using namespace std;
int main(){
int N;
cin>>N;
vector<tuple<string,int,int>> a;
REP(i,N){
string s;
int p;
cin>>s>>p;
a.emplace_back(s,p*-1,i);
}
sort(a.begin(),a.end());
REP(i,N)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 = input()
l = []
for _ in xrange(n):
s, p = raw_input().strip().split()
p = int(p)
l.append([s, -p, _ + 1])
l.sort()
for i in xrange(n):
print l[i][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,i,p;string s;cin >> n;
pair<pair<string,int>,int> ans[n];
for(i=0;i<n;i++){
cin >> s >> p;
ans[i] = make_pair(make_pair(s,-p),i+1);
}
sort(ans,ans+n);
for(auto x:ans) 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())
A = []
for i in range(n):
a,b = input().split()
A.append([a,-int(b), i+1])
A.sort()
for s,t,i in A:
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.util.*;
class Res {
String s;
int index;
int p;
public Res(int index, String s, int p) {
this.index = index;
this.s = s;
this.p = p;
}
}
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = Integer.parseInt(sc.next());
Res[] res = 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.Arrays;
import java.util.Scanner;
import java.util.stream.IntStream;
public class Main {
public static void main(String[] args) {
try (Scanner scanner = new Scanner(System.in)) {
int n = scanner.nextInt();
Data[] datas = IntStream.range(0, n).mapToObj(i -> new Data(scanner.next(), scanner.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 | n=int(input())
l=[]
for i in range(n):
s,p=input().split()
p=int(p)*-1
l.append([s,p,i+1])
l.sort()
for i in l:
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.Arrays;
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
String[] spi = new String[n];
for (int i = 0; i < spi.length; i++) {
String s = sc.next();
int p = sc.nextInt();
spi[i] = s + "_" + (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 | N=int(input())
S=[]
for i in range(N):
s,p=input().split()
S.append((s,-int(p),i+1))
S.sort()
for s,p,i in S:
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.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
public class Main {
static class shop implements Comparable<shop>{
shop(String name,int point,int number){
this.name=name;
this.point=point;
this.number=number;
}
String name;
int point;
int number;
public int co... | 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 = Integer.parseInt(sc.next());
Map<String,Integer> map = new TreeMap<>();
for(int i = 0;i<n;i++){
StringBuffer tmp = new StringBuffer();
... | 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 copy
n=input()
mylist=[]
for i in range(n):
mylist.append(raw_input().split())
mylistn=[]
for i in range(n):
mylistn.append([i+1, mylist[i][0],int(mylist[i][1])])
mylistnn=sorted(mylistn,key=lambda x:(x[1],-x[2]))
for i in range(n):
print(mylistnn[i][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 | 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())
S = [[i + 1] + list(input().split()) for i in range(N)]
for s in sorted(S, key=lambda x: (x[1], -int(x[2]))):
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())
X = []
for i in range(1, N+1):
S, P = input().split()
X.append((S, -int(P), i))
X.sort()
for S, P, i in X:
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>
using namespace std;
int main(void){
int N;
cin >> N;
vector<tuple<string,int,int>> a;
for(int i=0;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])+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 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.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
Map<String, List<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 | # -*- coding:utf-8 -*-
n = int(raw_input())
lst = []
for i in xrange(n):
name,p=map(str,raw_input().split())
lst.append([i+1,name,int(p)])
lst.sort(key=lambda x:(x[1],-x[2]))
for i in xrange(n):
print lst[i][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;
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);
}
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())
SP = []
for i in range(N):
s, p = input().split()
SP.append((s, -int(p), i))
SP.sort()
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 | 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 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>> v(n);
for (int i=0;i<n;++i) {
string a;
int b;
cin >> a >> b;
v[i] = make_tuple(a, -b, i);
}
sort(v.begin(), v.end());
for (int i=0;i<n;++i) {
int a = get<2>(v[i]);
cout << a+... | 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];
HashMap<String,Integer> hashMap = new HashMap<String, Integer>();
for(int i=0;i<N;i++){
s[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()
l.append([s,-int(p),i+1])
l.sort()
for lis in l:
print(lis[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.Scanner;
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];
int[] o = new int[n];
for (int i = 0; i < n; i++) {
s[i] = sc.next();
p[i] = sc.nextInt();
o[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 | #include <bits/stdc++.h>
using namespace std;
int main(){
int N,P;
cin >> N;
string s;
pair<pair<string,int>,int> p[110];
for(int i=0;i<N;i++){
cin>>s>>P;
p[i]=make_pair(make_pair(s,-P),i);
}
sort(p,p+N);
for(int i=0;i<N;i++){
printf("%d\n",p[i].second+1);
}
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 | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >>N;
vector< pair<pair<string,int>,int>> s(N);
for(int i=0;i<N;i++) {
string S;
int P;
cin >>S >>P;
s[i] = make_pair( make_pair(S,-P),i+1);
}
sort(s.begin(),s.end());
for(int i=0;i<N;i++){
cout << s[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 | n = int(input())
S = []
for i in range(n):
s,p = input().split()
S.append((s,-int(p),i+1))
S.sort()
for s,p,i in S:
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.util.ArrayList;
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 = sc.nextInt();
ArrayList<Person> al = new ArrayList<>();
for (int i=1; 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())
d = [input().split() + [i] for i in range(1,n+1)]
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())
arr = []
for i in range(n):
a,b = map(str, input().split())
arr.append([a,-int(b),i+1])
arr.sort()
for a,b,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>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
int main(){
int n; cin>>n;
tuple<string,int,int> r[100];
rep(i,n) cin>>get<0>(r[i])>>get<1>(r[i]), get<1>(r[i])*=-1, get<2>(r[i])=i;
sort(r,r+n);
rep(i,n) cout<<get<2>(r[i])+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 | #include<bits/stdc++.h>
using namespace std;
int main()
{
pair<pair<string,int>,int> p[120];
int n;
cin>>n;
for (int i = 0; i < n; ++i)
{
string s;
cin>>s;
int m;
cin>>m;
p[i] = make_pair(make_pair(s,-m),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 | #include<bits/stdc++.h>
#include<utility>
using namespace std;
int main(){
int n; cin>>n;
pair<pair<string,int>,int> rest[110];
for(int i=0;i<n;i++){
string s;
int p;
cin>>s >>p;
rest[i]=make_pair(make_pair(s,-p),i);
}
sort(rest,rest+n);
for(int i=0;i<n;i++)cout<<rest[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())
l = [[i] + input().split() for i in range(n)]
#print(SP)
l.sort(key=lambda x:(x[1], -int(x[2])))
for i,s,p in l:
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.*;
public class Main {
public static void main(String[] args) {
Main main = new Main();
main.run();
}
class R implements Comparable<R>{
int n;
String s;
int p;
R(int n, String s, int p){
this.n=n;
this.s=s;
this.p=p;
}
@Override
public int compareTo(R arg0) {
if(this... | 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.*;
class Main{
public static void main(String args[]) {
Scanner sc=new Scanner(System.in);
long MOD=1000000007L;
int n=sc.nextInt();
String s[]=new String[n];
int p[]=new int[n];
long sum[]= new long[n];
Map<Long,Integer> map = new HashMap<>();
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 | import java.util.*;
class Main {
public static void main(String[] args) {
new Solver().run();
}
}
class Item implements Comparable<Item> {
public String S;
public int P;
public int idx;
public Item (int idx, String name, int point) {
this.idx = idx;
this.S = name;
... | 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.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 | #include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n;
cin >> n;
pair<pair<string, int>, int> v[100];
string s;
int t;
for (int i = 0; i < n; i++) {
cin >> s >> t;
v[i] = make_pair(make_pair(s, -t), i + 1);
}
sort(v, v + n);
for (int i = 0; i < n; i++)
cout << v[i].second << en... | 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>> S;
for(int i = 0; i < n; i++){
string s;
int r;
cin >> s >> r;
S.emplace_back(s, -r, i+1);
}
sort(begin(S),end(S));
for( auto x : S )
{
cout << get<2>( x ) << endl;
}
return ... | 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(N):
s, p = input().split()
X.append((s, -int(p), i+1))
X = sorted(X)
for x in X:
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 | # -*- coding: utf-8 -*-
n = input()
l = []
for i in range(n):
inpt = raw_input().split()
l.append((inpt[0], int(inpt[1]), i + 1))
l.sort(key=lambda x:(x[0], -x[1]))
for i in l:
print (i[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<algorithm>
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
int n,p;
cin>>n;
string s;
pair<pair<string,int>,int>a[114];
for(int i=0;i<n;i++)
{
cin>>s>>p;
a[i].first.first=s;
a[i].first.second=-p;
a[i].second=i+1;
}
sort(a,a+n);
for(int i=0;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.util.*;
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 c=0;c<n;c++){
s[c]=sc.next()+"_"+(1100-sc.nextInt())+"_"+(c+1);
}
Arrays.sort(s);
for(String s1: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())
a = []
for i in range(n):
s, p = input().split()
p = int(p)
a.append((s,-p,i+1))
a.sort()
for x in a:
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 | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
vector< tuple< string,int,int > > d;
for(int i=0;i<n;++i){
string s;
int a;
cin >> s >> a;
d.push_back(make_tuple(s,-a,i+1));
}
sort(d.begin(),d.end());
for(auto x:d){
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 | n = int(input())
a = []
for i in range(n):
s, k = input().split()
a.append([s, -int(k), i+1])
a.sort()
for ans in a:
print(ans[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[] p = new String[n];
for (int i = 0; i < n; i++) {
p[i] = sc.next();
int price = sc.nextInt();
p[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 | #include<bits/stdc++.h>
#define rep(i,n) for(int i = 0;i<n;i++)
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());
rep(i,n)
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=sorted([(s,-int(p),i+1) for i,(s,p) in enumerate([tuple(input().split()) for _ in range(n)])])
a,s,d=zip(*l)
print(*d,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;
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=100-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())
l=[]
for i in range(n):
s,p=input().split()
p=int(p)
l.append([s,-p,i+1])
l.sort()
for name, p, inx in l:
print(inx) | PYTHON3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.