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 | n=int(input())
l=[]
for i in range(n):
a,b=input().split()
b=-1*int(b)
l.append([a,b,i+1])
l=sorted(l)
for i in range(n):
print(l[i][2]) | PYTHON3 |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin>>N;
vector<tuple<string,int,int>> res;
for(int i=0;i<N;i++){
string S;
int P;
cin>>S>>P;
res.push_back(make_tuple(S,100-P,i+1));
}
sort(res.begin(),res.end());
for(tuple<string,int,int> t:res){
cout<<get<2>(t)<<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.*;
import java.math.*;
import java.lang.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// 整数の入力
int n = sc.nextInt();
Map<String, List<Integer>> numMap = new TreeMap<>();
Map<Integer, Integer> countMap = new HashMap<>();
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 | N,que=int(input()),[]
for i in range(N):
s,p=list(input().split())
que.append((s,-int(p),i+1))
que.sort()
for x in que:
print(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> a[110];
for(int i=0; i<n; i++) {
string s;
int p;
cin >> s >> p;
a[i] = make_pair(make_pair(s,-p),i);
}
sort(a, a+n);
for(int i=0; i<n; i++){
cout << a[i].second + 1 << endl;
}
} | CPP |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | import java.io.InputStream;
import java.io.PrintStream;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
public class Main {
public static void main(String[] args) {
solve(System.in, System.out);
}
static void solve(InputStream is, PrintStream os) {
Scanner sc ... | 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>> vt(N);
for(int i=0;i<N;i++){
string s;
int p;
cin>>s>>p;
vt[i]=make_tuple(s,-p,i+1);
}
sort(vt.begin(),vt.end());
for(int i=0;i<N;i++)cout<<get<2>(vt[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())
r = []
for i in range(n):
c, s = input().split()
r.append((c, -int(s), i+1))
r = sorted(r)
for x in r:
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>> k(n);
for (size_t i = 0; i < n; i++) {
cin>>get<0>(k[i])>>get<1>(k[i]);
get<1>(k[i])*=(-1);
get<2>(k[i])=i+1;
}
sort(k.begin(),k.end());
for (size_t i = 0; i < n; i++) {
cout<<get<2>(k[... | 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.Map;
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 = Integer.parseInt(sc.nextLine());
Map<String,Integer> lst = new TreeMap<String,Integer>();
for (int i = 0; i < N; i++) {
St... | 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])
for l in sorted(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 | #include <bits/stdc++.h>
#define ll long long
#define sz(x) (int)x.size();
using namespace std;
int n,x;
string s;
vector<pair<string,pair<int,int>>>v;
int main(){
cin>>n;
for(int i=0;i<n;i++){
cin>>s>>x;
v.push_back({s,{-x,i+1}});
}
sort(v.begin(), v.end());
for(auto i:v){
cout<<i.second.second<<'\n';
... | CPP |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | #include<bits/stdc++.h>
using namespace std;
pair<pair<string,int>,int> p[110];
int main(){
int n,score;
char name[120];
cin >> n;
for(int i=0; i<n; i++){
cin >> name >> score;
p[i] = make_pair(make_pair(name,-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 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n,pre;cin>>n;
vector<tuple<string,int,int>> a(n);
for(int i=1;i<=n;i++){
cin>>get<0>(a.at(i-1))>>pre;
get<1>(a.at(i-1))=0-pre;
get<2>(a.at(i-1))=i;
}
sort(a.begin(),a.end());
for(auto b:a){
cout<<get<2>(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 | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main {
static class Restaurant{
public Restaurant(int id, String name, int score) {
this.id = id;
this.name = name;
this.score = score;
}
int id;
String name;
int score;
}
public static void main(String[] ar... | 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,),*sp = [s.split() for s in open(0)]
sp = [(s,-int(p),i+1) for i,(s,p) in enumerate(sp)]
for _,_,i in sorted(sp):
print(i) | PYTHON3 |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | 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 ss = sc.next();
int num = sc.nextInt();
int num2 = i+1;
s[i] = ss + "... | 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<pair<pair<string,int>,int>> p(N);
for(int i=0;i<N;i++){
string S;
int P;
cin >> S >> P;
p.at(i)=make_pair(make_pair(S,-1*P),i);
}
sort(p.begin(),p.end());
for(int i=0;i<N;i++){
cout << p.at(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())
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 | #include <bits/stdc++.h>
using namespace std;
int main(){
int i, n, p, j;
cin >> n;
vector<tuple<string, int, int>> t(n);
string s;
for (i = 0; i < n; i++){
cin >> s >> p;
t[i] = make_tuple(s, 100 - p, i + 1);
}
sort(t.begin(), t.end());
for (i = 0; i < n; i++) cout << get<2>(t[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 | #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 a;
cin>>s>>a;
vec.push_back(make_tuple(s,-a,i+1));
}
sort(vec.begin(),vec.end());
for(int i=0;i<N;i++){
cout << get<2>(vec.at(i)) << end... | CPP |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | N = int(input())
L = []
for i in range(N):
[S,P] = input().split()
P = int(P)
L.append((S,-P,i+1))
L = sorted(L)
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 in = new Scanner(System.in);
int N = in.nextInt();
Pair[] a = new Pair[N];
for(int i=0; i<N; ++i){
String s = in.next();
int p = in.nextInt();
a[i] = new Pair(i+1, s, p);
}
Arrays.sort(a,
... | 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[] info = new String[n];
for(int i = 0;i < n;i++){
info[i] = sc.next()+"_"+(1100-sc.nextInt())+"_"+(i+1);
}
Arrays.sort(info);
... | 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+1;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())
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 | N = int(input())
l=[]
for i in range(N):
S, P= input().split()
l.append([S, -int(P), i+1])
l.sort()
for a in l:
print(a[-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 arg[]){
Scanner sc=new Scanner(System.in);
int a=sc.nextInt();
String str[]=new String[a];
int arr[]=new int[a];
int ind[]=new int[a];
for(int i=0;i<a;i++){
str[i]=sc.next();
arr[i]=sc.nextInt();
ind[i]=i+1;
}
for(int i=0;i... | JAVA |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | #include <bits/stdc++.h>
using namespace std;
int main() {
char in[120];
pair<pair<string,int>,int> p[110];
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())
S=[]
for i in range(N):
s,p=input().split()
p = int(p)
S.append([s, 100-p, i+1])
S=sorted(S)
for s in S:
print(s[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[][] store = new String[N][3];
for(int i = 0; i < N; i++) {
store[i][0] = String.valueOf(i + 1);
store[i][1] = sc.next();
store[i][2] = 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.*;
public class Main{
public static void main(String args[]){
Scanner scanner = new Scanner(System.in);
int N = scanner.nextInt();
List<String> S = new ArrayList();
List<Integer> P = new ArrayList();
Map<String,Integer> namePointIndex = new HashMap();
... | JAVA |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | #include "bits/stdc++.h"
using namespace std;
int main() {
int N;
cin >> N;
vector<tuple<string,int,int>>P;
for (int n = 0; n < N; ++n) {
string S;
int p;
cin >> S >> p;
P.emplace_back(S,-p,n + 1);
}
sort(P.begin(),P.end());
for (int n = 0; n < N; ++n) {
cout << get<2>(P[n]) <<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 = input()
d = {}
res = []
qes = []
score = []
for i in xrange(n):
r,s = raw_input().split()
if r not in d:
d[r] = [(int(s),i)]
else:
d[r].append((int(s),i))
if r not in res:
qes.append(r)
res.append(r)
score.append(s)
qes = sorted(qes)
for j in qes:
for k in sort... | 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.*;
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[] = new String[n];
String sa[] = new String[n];
for (int i=0; i<n; i++){
s[i] = sc.next();
p = Integer.pars... | 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;
string S;
int P;
vector<tuple<string, int, int>> T(N);
for(int i=0; i<N; i++){
cin >> S >> P;
T.at(i)=make_tuple(S, 100-P, 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 | import java.util.*;
class Obj{
String s;
int val, idx;
Obj(String s, int val, int idx){
this.s = s;
this.val = val;
this.idx = idx;
}
public String toString(){
return "" + this.idx;
}
}
public class Main{
public static void main(String args[]){
Scanner in = new Scanner(System.in);
int n = in.nextI... | JAVA |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | N = int(input())
SP = []
for i in range(1,N+1):
s,p = input().split()
SP.append((s,-int(p),i))
SP.sort()
for s,p,i in SP:
print(i) | PYTHON3 |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | #include <bits/stdc++.h>
using namespace std;
int main(){
pair<pair<string, int>, int> p[120];
int n, a;
string s;
scanf("%d",&n);
for(int i=0; i<n; i++){
cin >> s >> a;
p[i] = make_pair(make_pair(s, -a), i);
}
sort(p, p+n);
for(int i=0; i<n; i++) printf("%d\n", p[i].sec... | 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):
x,y = input().split()
a.append([x,-int(y),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 | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>> n;
vector<tuple<string,int,int>> t(n);
string s;
int p;
for (int i=0; i<n; i++){
cin>> s >> p;
t.at(i)=make_tuple(s,100-p,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 | #include<iostream>
#include<utility>
#include<string>
#include<algorithm>
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);
}
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 | import java.util.*;
public class Main{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
String[] list = new String[N];
for(int i = 0; i < N; i++) {
String city = sc.next();
int point = sc.nextInt();
... | JAVA |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
scanf("%d", &n);
vector< tuple<string, int, int> > t(n);
for(int i=0; i < n; i++) {
cin >> get<0>(t.at(i)) >> get<1>(t.at(i));
get<1>(t.at(i)) *= -1;;
get<2>(t.at(i)) = i+1;
}
sort(t.begin(), t.end());
for(auto &tx : t) {
printf("%d\n", ge... | 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())
R = [[i + 1] + input().split() for i in range(N)]
R.sort(key=lambda x: (x[1], - int(x[2])))
for r, _, _ in R:
print(r)
| 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> a[101];
for(int i=0;i<n;i++){
string s;
int x;
cin>>s>>x;
a[i]=make_pair(make_pair(s,-1*x),i+1);
}
sort(a,a+n);
for(int i=0;i<n;i++){
cout<<a[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 | print("\n".join([i[2] for i in sorted([input().split()+[str(i+1)] for i in range(int(input()))], 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 | 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];
for (int i = 0; i < N; i++) {
String s = sc.next();
P[i] = sc.nextInt();
String 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 | n=int(input())
data=[tuple(input().split()+[i+1]) for i in range(n)]
data.sort(key=lambda tup:(tup[0],-int(tup[1])))
for i in data:
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 | //package atCoder;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
//int m = sc.nextInt();
int i,j;
Rest[] rests = new Rest[n];
for(i=0;i<n;i++) {
Rest target = new Rest(sc.next(),sc.nextInt(),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.*;
import static java.util.Comparator.*;
class Restaurant {
private String city;
private int score;
private int index;
public Restaurant(String city, int score, int index) {
this.city = city;
this.score = score;
this.index = index;
}
public String getCity... | 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<pair<pair<string, int>, int> > A(n);
string s;
int p;
for(int i=0; i<n; i++){
cin >> s;
cin >> p;
A[i] = {{s,100-p}, i+1};
}
sort(A.begin(),A.end());
for(int i=0; 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>> R(N);
string S;
int P;
for (int i = 0; i < N; i++){
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 java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int n = Integer.parseInt(sc.next());
String[] restaurants = new String[n];
for (int i = 0; i < n; i++) {
String name = sc.next();
int 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 | import java.awt.*;
import java.util.*;
import java.util.List;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
Map<String, List<Point>> map = new TreeMap<>();
for (int i = 0; i < n; i++) {
String s = ... | JAVA |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | 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>> tree = new TreeMap<>();
for (int i=0;i<n;i++){
String s = 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())
S=[]
for i in range(N):
s, n=input().split()
S.append([s,int(n),i+1])
S.sort(key=lambda x:(x[0], -x[1]))
[print(p[2]) for p in S] | PYTHON3 |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | #include <bits/stdc++.h>
using namespace std;
int main(){
int n,a;
string s;
cin >> n;
vector<pair<string,pair<int,int>>> v;
for (int i = 0; i < n; ++i){
cin >> s >> a;
v.push_back({s,{-a,i+1}});
}
sort(v.begin(), v.end());
for(auto x:v){
cout << x.second.second << endl;
}
}
| CPP |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | #include <bits/stdc++.h>
using namespace std;
char in[10];
pair<pair<string,int>,int> p[100];
int main(){
int n; cin >> n;
for(int i=0; i<n; i++) {
int t; scanf("%s %d\n",in,&t);
string tmp=in;
p[i] = make_pair(make_pair(in,-t),i);
}
sort(p,p+n);
for(int i=0; i<n; i++) printf("%d\n",p[i].second+1);
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 | import java.util.*;
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>>();
String sa[] = new String[101];
for(int i = 0; i < 101; i++){
sa[i] = "";
}
... | JAVA |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
int N = Integer.parseInt(sc.next());
String[] place = new String[N];
int[] value = new int[N];
for(int i=0; i<N; i++) {
place[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())
R = []
for n in range(N):
s,p = input().split()
R.append((s,-int(p),n+1))
for s,p,n in sorted(R):
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 | #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++)
{
string s;
int t;
cin >> s;
cin >> 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;
}
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> > p(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.begin(),p.end());
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<pair<pair<string,int>,int>> p(N+1);
string a;
int b;
for(int i=1;i<=N;i++) {
cin>>a>>b;
p[i]=make_pair(make_pair(a,-b),i);
}
sort(p.begin(),p.end());
for(int i=1;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>
using namespace std;
int main(){
int n;
cin>>n;
vector<tuple<string,int,int> > A(n);
for(int i=0;i<n;i++){
cin>>get<0>(A[i]);
int ss;
cin>>ss;
get<1>(A[i])=100-ss;
get<2>(A[i])=i+1;
}
sort(A.begin(),A.end());
for(int i=0;i<n;i++){
printf("%d\n",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 = input().split()
l.append((s, -int(p), i + 1))
l.sort()
for i in range(N):
print(l[i][2]) | PYTHON3 |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | def solve():
N = int(raw_input())
SP = []
for i in range(N):
SiPi = raw_input().split()
Si = SiPi[0]
Pi = int(SiPi[1])
SP.append([Si, - Pi, i+1])
SP.sort()
for i in range(N):
print SP[i][2]
if __name__ == '__main__':
solve()
| 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();
List<Restaurant> list = new ArrayList<>();
for(int i=1; i<=n; i++){
String city = 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;
vector<tuple<string,int,int>> data(n);
for(int i=0;i<n;i++){
string s;
int p;
cin>>s>>p;
data[i]=make_tuple(s,100-p,i+1);
}
sort(data.begin(),data.end());
for(int i=0;i<n;i++)cout<<get<2>(data[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;
typedef long long ll;
pair<string,pair<ll,ll>>p[214514];
int main(){
ll n;
cin>>n;
for(int i=0;i<n;i++){
cin>>p[i].first>>p[i].second.first;
p[i].second.first*=-1;
p[i].second.second=i+1;
}
sort(p,p+n);
for(int i=0;i<n;i++)cout<<p[i].second.second<<endl;
retu... | CPP |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
pair<pair<string,int>,int> p[120];
for(int i=0;i<n;i++){
string s;
int k;
cin >> s >> k;
p[i]=make_pair(make_pair(s,-k),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 | n = int(input())
l = [[input().split(),i] for i in range(1,n+1)]
l.sort(key=lambda l: (l[0][0],-int(l[0][1])))
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 | #include <bits/stdc++.h>
using namespace std;
int main()
{
string S;
int P;
pair<pair<string, int>, int> p[110];
int N;
cin >> N;
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 +... | 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())
restaurants = []
for i in range(n):
line = raw_input().split()
restaurants.append((line[0], int(line[1]), i+1))
restaurants.sort(key=lambda x: (x[0], -x[1]))
for i in range(n):
print restaurants[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.Arrays;
import java.util.Scanner;
import java.util.stream.Stream;
public class Main {
private static Scanner sc;
public static void main(String[] args) throws Exception {
sc = new Scanner(System.in);
int N = sc.nextInt();
restaurant[] ary = new restaurant[N];
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 |
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[] s = new String[n];
int m = Integer.MAX_VALUE;
for (int i = 0; i < s.length; i++) {
s[i] = sc.next() + "," + (m - sc.nextInt(... | JAVA |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | N=int(input())
SP=[]
for i in range(N):
S,P=input().split()
SP.append((S,-int(P),i+1))
SP.sort()
for i in SP:
print(i[2])
| PYTHON3 |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | N = int(input())
X = []
for i in range(N):
s, p = input().split()
X.append([s, -int(p), i+1])
X.sort()
for i in range(N):
print(X[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 n = sc.nextInt();
String[] s = new String[n];
for(int i = 0; i < n; i++){
String city = sc.next();
double point = 1 / sc.nextDouble();
int num = i + 1;
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 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
int N;
cin >> N;
pair<pair<string, int>, int> P[110];
rep(i, N){
string S;
int A;
cin >> S >> A;
P[i]=make_pair(make_pair(S, -A), i);
}
sort(P, P+N);
rep(i, N) cout << P[i].seco... | 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())
R=[]
for i in range(n):
s,p=input().split()
R.append([s,100-int(p),i+1])
R.sort()
for r in R:
print(r[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 = input()
arr = []
for i in xrange(N):
A,B = raw_input().split()
B = int(B)
arr.append([A,B,i+1])
arr.sort(key = lambda x : -x[1])
arr.sort(key = lambda x : x[0])
for i in xrange(N):
print arr[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 | n = int(input())
a = []
for i in range(n):
s, p = input().split()
a.append((s, -int(p), i + 1))
a.sort()
for b in a:
print(b[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;
const int N=105;
pair<pair<string,int>,int>a[N];
int main()
{
int n;
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>a[i].first.first>>a[i].first.second;
a[i].first.second=-a[i].first.second;
a[i].second=i;
}
sort(a+1,a+n+1);
for(int i=1;i<=n;i++)
cout<<a[i].second<<endl... | CPP |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | #include <bits/stdc++.h>
using namespace std;
int main(){
int N;
cin>>N;
vector<tuple<string,int,int>> X;
for(int i=1;i<=N;i++){
string s;
int p;
cin>>s>>p;
p=-p;
X.push_back(tie(s,p,i));
}
sort(X.begin(),X.end());
for(int i=0;i<N;i++){
cout<<get<2>(X.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())
rs= []
for i in range(n):
s, p = input().split()
rs.append((s,-int(p),i+1))
rs.sort()
for r in rs:
print(r[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>> p(N);
for (int i=0; i<N; i++){
int x;
cin>>get<0>(p.at(i))>>x;
get<1>(p.at(i))=-x;
get<2>(p.at(i))=i+1;
}
sort(p.begin(),p.end());
for (int i=0; i<N; i++){
cout<<get<2>(p.at(i))<<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>
#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.at(... | CPP |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
public class Main {
public static void main(String args[]) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());... | JAVA |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | import java.util.*;
import java.lang.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
String[] S = new String[101];
String[] ss = new String[N];
int[] P = new int[101];
for( int i=0; i<N; i++ ){
String str = sc.next();
int a = 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())
spn=[[(s,-int(p)) for s,p in[input().split()]]+[i+1] for i in range(N)]
spn.sort()
#print(spn)
for a,b in spn:
print(b)
| 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();
int [] in = new int [n];
String [] str = new String [n];
int [] ans = new int [n];
for(int i=0;i<n;i++){str[i] = 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 | 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[2])
| PYTHON3 |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
Tuple[] ts = new Tuple[n];
for (int i = 0; i < n; i++) {
String s = in.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 sys
N = int(sys.stdin.readline())
R = {}
for i in xrange(N):
s, p = sys.stdin.readline().strip().split()
if s in R:
R[s] += [(int(p), i+1)]
else:
R[s] = [(int(p), i+1)]
for k,V in sorted(R.items()):
for v in sorted(V, reverse=True):
print v[1] | PYTHON |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | 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 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 | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
String[] sp = new String[n];
for (int i = 0; i < n; i++) {
String city = sc.next();
int point = sc.nextInt();
sp[i] = city + "_" + (1100 - point) + "_" + (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;
char in[10];
pair<pair<string,int>,int> p[101];
int main(){
int a;scanf("%d",&a);
for(int i=0;i<a;i++){
int t;scanf("%s%d",in,&t);
p[i]=make_pair(make_pair(in,-t),i);
}
sort(p,p+a);
for(int i=0;i<a;i++) printf("%d\n",p[i].second+1);
} | CPP |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | #include <bits/stdc++.h>
#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])<<endl;
}
} | CPP |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.