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;
vector<tuple<string, int, int>> p(n);
for(int i = 0; i < n; i++){
string a;
int b;
cin >> a >> b;
p.at(i) = make_tuple(a, -1 * b ,i);
}
sort(p.begin(), p.end());
for(auto q : p){
cout << get<2>(q) + 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();
String[] list = new String[n];
for(int i = 0; i < n; i ++){
String restaurant = sc.next();
int score = sc.nextInt();
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;cin>>n;
vector<tuple<string,int,int>> x(n);
for(int i=0;i<n;i++){
cin>>get<0>(x.at(i))>>get<1>(x.at(i));
get<1>(x.at(i))=(-1)*get<1>(x.at(i));
get<2>(x.at(i))=i+1;
}
sort(x.begin(),x.end());
for(int j=0;j<n;j++)cout<<get<2>(x.at(j))<... | 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 =[[i] + input().split() for i in range(N)]
SP.sort(key=lambda x:(x[1],-int(x[2])))
for i,s,p 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(raw_input())
r = []
for i in xrange(1,n+1):
rest,score = raw_input().split()
score=int(score)
r.append((rest,score,i))
r = sorted(r,key=lambda x:(x[0], -x[1], x[2]))
for x in r:
print x[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())
def f(x): return (x[0], -int(x[1]))
SP = [(f(input().split()), i) for i in range(1, N+1)]
SP.sort()
for _, 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;
vector<tuple<string, int, int> > S;
int main()
{
int N; cin >> N;
for(int i=0; i<N; ++i)
{
string s; cin >> s;
int t; cin >> t;
S.emplace_back(s, -t, i);
}
sort(S.begin(), S.end());
for(auto x: S) cout << get<2>(x) +1<< endl;
} | CPP |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | l = []
for i in range(int(raw_input ())):
s, p = [x for x in raw_input ().split()]
l.append((s, -1 * int(p), i + 1))
l.sort()
for i in l: print i[-1] | PYTHON |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | N = int(input())
x = []
for i in range(N):
s, p = input().split()
x.append((s, -int(p), i+1))
x.sort()
for v in x:
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 | N = int(input())
R = [list(input().split()) + [i+1] for i in range(N)]
R.sort(key=lambda x: (x[0], -int(x[1])))
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 = int(input())
ls = []
for i in range(N):
s = input().split()
ls.append([s[0],-int(s[1]),i+1])
ls.sort()
for i in range(N):
print(ls[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 {
Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
Main m = new Main();
m.run();
}
void run() {
int n = sc.nextInt();
String[] s = new String[n];
for(int i =0 ;i < n ;i ++) {
s[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 | import java.util.*;
class Main{
static Scanner sc = new Scanner(System.in);
public static void main(String args[]){
int N = sc.nextInt();
List <R> r = new ArrayList<>();
for(int i=0;i<N;i++){
r.add(new R(sc.next(),sc.nextInt(),i+1));
}
Collections.sort(r);
... | 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> pr[n];
for(int i=0;i<n;i++){
string s;
int p;
cin>>s>>p;
pr[i].first.first=s;
pr[i].first.second=-p;
pr[i].second=i+1;
}
sort(pr,pr+n);
for(int i=0;i<n;i++)
cout<<pr[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 | N = int(input())
R = []
for i in range(N):
S,P = input().split()
R.append([S, -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 | import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;
import java.util.Collections;
class Rest {
public int id;
public String name;
public int score;
public Rest(int id, String name, int score) {
this.id = id;
this.name = name;
this.score = 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.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
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++) {
s[i] = sc.next() + "," + (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 | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
map<string,set<pair<int,int>>>m;
for( int i=1;i<=n;i++)
{
string s;
int a;
cin>>s>>a;
m[s].insert({(a*-1),i});
}
for(auto it : m)
{
//cout<<(it.first);
for(auto v: it.second)
cout<<v.second<<endl;
}
} | CPP |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | import java.util.*;
public class Main {
static class Spclass {
int m;
String s;
int p;
}
public static void main(String[] args) {
int i;
Scanner sc = new Scanner(System.in);
int n = Integer.parseInt(sc.next());
Spclass[] sp = new Spclass[n];
for(i = 0; i < n; i++) {
sp[i] = new Spclass();
sp[... | 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=open(0).read().split()
print(*sorted(range(1,len(l)//2+1),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 | import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
Restaurant[] arr = new Restaurant[n];
for (int i = 0; i < n; i++) {
String s = sc.next();
int p = sc.nextInt();
arr[i] = new Re... | JAVA |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | n = int(input())
li = [input().split() + [i] for i in range(n)]
li.sort(key=lambda x: (x[0], -int(x[1])))
for x, y, z in li:
print(z + 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())
D = []
for i in range(n):
s, p = map(str,input().split())
D.append([s, int(p)*-1, i+1])
D.sort()
for j in D:
print(j[2]) | PYTHON3 |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | #include<bits/stdc++.h>
using namespace std;
int n,a[120],r[120];
string s[120];
inline bool cmp(int x,int y){
if(s[x]!=s[y]) return (s[x]<s[y]);
else return (a[x]>a[y]);
}
int main(){
cin>>n;
for(int i=1;i<=n;i++){
cin>>s[i]>>a[i];
r[i]=i;
}
sort(r+1,r+n+1,cmp);
for(int i=1;i<=n;i++) cout<<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 | 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 | import java.util.*;
public class Main {
Scanner sc = new Scanner(System.in);
final int MOD = 1000000007;
final int MAX = Integer.MAX_VALUE;
final long LMAX = Long.MAX_VALUE;
void doIt() {
int n = sc.nextInt();
Res[] rs = new Res[n];
for(int i = 0; i < n; i++) {
rs[i] = new Res(sc.next(), 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())
L = [input().split()+[i] for i in range(1,n+1)]
L.sort(key=lambda l:(l[0],-int(l[1])))
for l in L: print(l[2]) | PYTHON3 |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | import java.util.Scanner;
import java.util.TreeSet;
public class Main {
public static void main(String[] args) {
try (Scanner sc = new Scanner(System.in)) {
int n = sc.nextInt();
TreeSet<Restaurant> set = new TreeSet<>();
for (int i = 1; i <= n; i++) {
String s = sc.next();
int p = sc.nextInt();
... | JAVA |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | #include<bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >>n;
vector<pair<pair<string,int>,int>>a(n);
for(int i=0;i<n;i++){
string z;int zz;
cin >> z >>zz;
a.at(i)=make_pair(make_pair(z,-1*zz),i+1);
}
sort(a.begin(),a.end());
for(int i=0;i<n;i++){
cout << a.at(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;
pair <pair <string, int>, int> p [110];
int main () {
int a; cin>>a;
for (int i = 0; i <a; i ++) {
int t; string in;
cin>>in>>t;
//string tmp = in;
p [i] = make_pair (make_pair (in, -t), i);
}
std :: sort (p, p + a);
for (int i = 0; i <a; i ++)
cout<<(p [i]. second + 1)<... | CPP |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int N=sc.nextInt();
String[] S = new String[N];
int[] P = new int[N];
String[] sp = new String[N];
for(int i=0;i<N;i++){
S[i]=sc.next();
P[i]=sc.nextInt... | 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 | #abc128b
n=int(raw_input())
l=[]
for i in xrange(n):
c,p=map(str,raw_input().split())
l.append([i+1,c,int(p)])
ll=sorted(l,key=lambda x:(x[1],-x[2]))
for i in xrange(n):
print ll[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 | 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();
Main main = new Main();
Restanrant[] re = new Restanrant[N];
for (int i=0;i<N;i++) {
Restanrant r = main.new Restanrant();
r.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 | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
Map<String, ArrayList<int[]>> map = new HashMap<>();
Set<String> set = new TreeSet<>();
for (int i = 0; i < n; i++) {
Stri... | 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[] names = new String[n];
int[] scores = new int[n];
List<String> nameList = new ArrayList<>();
Set<String> nameSet = new TreeSet<>();
Map<Strin... | 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;
vector<tuple<string,int,int>> r;
string s;
int p;
for(int i(1);i<=N;++i){
cin >> s >> p;
p = -p;
r.push_back(tie(s,p,i));
}
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 | n = int(input())
l = [input().split()+[i+1] for i in range(n)]
l = sorted(l, key = lambda x:(x[0],-int(x[1])))
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 n;
cin>>n;
vector<tuple<string,int,int>>book(n);
for(int i=0;i<n;i++) {
cin>>get<0>(book[i])>>get<1>(book[i]);
get<2>(book[i])=i+1;
get<1>(book[i])*=-1;
}
sort(book.begin(),book.end());
for(int i=0;i<n;i++) cout<<get<2>(book[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())
SPI = [input().split()+[i] for i in range(N)]
SPI.sort(key=lambda x:(x[0], -int(x[1])))
for _,_,i in SPI:
print(i+1) | PYTHON3 |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | #include <bits/stdc++.h>
using namespace std;
int main(){
int n, p;
string s;
cin >> n;
tuple<string, int, int>r[110];
for(int i=0;i<n;i++){
cin >> s >> p;
r[i]=make_tuple(s,-p,i+1);
}
for(int i=0;i<n;i++){
sort(r, r+n);
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 | #include <bits/stdc++.h>
using namespace std;
int main(){
int N,a,b;
string s;
cin>>N;
vector<tuple<string,int,int>> t;
for(int i=0;i<N;i++){
cin>>s>>a;
t.push_back(make_tuple(s,(-1)*a,i+1));
}
sort(t.begin(),t.end());
for(int i=0;i<N;i++){
tie(s,a,b)=t[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 | import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Scanner;
class Main {
public static void main(String[]args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int count = 0 ;
Main m = new Main();
ArrayList<Var>... | 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;
for(int i=1;i<=n;i++){
string s;
int p;
cin>>s>>p;
a.push_back(make_pair(make_pair(s,-1*p),i));
}
sort(a.begin(),a.end());
for(int i=0;i<n;i++){
cout<<a.at(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 | for v in sorted([[*input().split()]+[i+1] for i in range(int(input()))],key=lambda x:(x[0],-int(x[1]))):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.Comparator;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = Integer.parseInt(sc.next());
Map<String, Map<Integer, Integer>> cities = new TreeMap<>();
for(int ... | JAVA |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | #include<bits/stdc++.h>
using namespace std;
int main(){
map<pair<string,int>,int> R;
int N;
cin>>N;
for(int i=0;i<N;i++){
string t;
int s;
cin>>t>>s;
pair<string,int>p(t,-s);
R[p]=i+1;
}for(auto p:R){
auto k=p.first;
auto v=p.second;
cout<<v<<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;
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++) cout << p[i].second+1 << endl;
retur... | CPP |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | import java.util.*;
class Restaurant implements Comparable<Restaurant> {
String city;
int point;
int i;
public Restaurant(String city, int point, int i) {
this.city = city;
this.point = point;
this.i = i;
}
public int compareTo(Restaurant other) {
int ans = city.compareTo(other.city);
... | JAVA |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;cin>>n;
string s[n];
int p[n];
vector<tuple<string,int,int>> P;
for(int i=0;i<n;i++){
cin>>s[i]>>p[i];
P.emplace_back(s[i],100-p[i],i+1);
}
sort(begin(P),end(P));
for(int i=0;i<n;i++){
cout<<get<2>(P[i])<<endl;
}
} | CPP |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | n=int(input())
R=[list(input().split()) + [i+1] for i in range(n)]
R.sort(key=lambda x: (x[0],-int(x[1])))
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=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 | N=int(input())
L=[]
for i in range(N) :
S,P=input().split()
L+=[[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;
typedef long long ll;
int main() {
int n;
cin>>n;
map<pair<string,int>,int> mp;
for (int i=0;i<n;i++) {
string s;
int p;
cin>>s>>p;
mp[{s,-p}]=i+1;
}
for (auto p:mp)
cout<<p.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 | N=int(input())
X=[]
for i in range(N):
S,P =map(str,input().split())
X +=[[S,100-int(P),i+1]]
X=sorted(X)
for j in range(N):
print(X[j][2]) | PYTHON3 |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | N = int(input())
S = sorted((list((lambda y: (y[0], -int(y[1]), x))(input().split()))) for x in range(1, N+1))
for x in S:
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.*;
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);
}
... | 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>> B;
for(int i=0;i<N;i++){
string s;
int p;
cin>>s>>p;
B.push_back(make_tuple(s,-p,i+1));
}
sort(B.begin(),B.end());
for(int i=0;i<N;i++){
cout<<get<2>(B.at(i))<<endl;
}
} | CPP |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | n = int(input())
S = [input().split()+[i+1] for i in range(n)]
t = sorted(S, key=lambda x: [x[0], -int(x[1])])
for m in t:
print(m[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):
a,b = input().split()
l.append((a,-int(b),i+1))
l.sort()
for a,b,k in l:
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.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
Restaurant restaurants[] = new Restaurant[n];
for(int i = 0; i < n; i++){
String city = sc.next();
int... | JAVA |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | #include <bits/stdc++.h>
using namespace std;
int main(){
long long n,p;
string s;
cin >> n;
pair<pair<string, long long>, int> pa[n];
for(int i=0;i<n;i++){
cin >> s >> p;
pa[i]=make_pair(make_pair(s, -p), i+1);
}
sort(pa, pa+n);
for(int i=0;i<n;i++){
cout << pa[i].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 | import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;
//AtCoder Beginner Contest 128
//B Guidebook
public class Main {
static class Pair {
int i;
String S;
int P;
Pair(int i, String S, int P) {
this.i = i;
this.S = S;
this.P = P;
}
}
public 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.*;
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[] index = new int[N];
TreeMap<String,Integer> shop = new TreeMap<String,Integer>();
String[] ans = new String[N];
f... | 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>> t;
for(int i = 0;i < n;i++){
string a;
int b;
cin >> a >> b;
t.emplace_back(a,100-b,i);
}
sort(t.begin(),t.end());
for(int i = 0;i < n;i++){
cout << get<2>(t[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 | for*_,i in sorted((s,-int(p),i)for i in range(int(input()))for s,p in[input().split()]):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, *SP = open(0).read().split()
sp = sorted((s, -int(p), i) for i, (s, p) in enumerate(zip(*[iter(SP)] * 2), 1))
[print(i) for _, _, i in sp]
| PYTHON3 |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | #include<bits/stdc++.h>
using namespace std;
int main(){
int N;
cin>>N;
pair<pair<string,int>,int>p[110];
for(int i=0;i<N;i++){
string s;
int t;
cin>>s>>t;
p[i].first.first=s;
p[i].first.second=-t;
p[i].second=i+1;
}
sort(p,p+N);
for(int i=0;i<N;i++){
cout<<p[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 | 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[101];
String[] ss = new String[N];
int[] P = new int[101];
for( int i=0; i<N; i++ ){
String str = sc.next();
int a = sc.nextInt();
S[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 | n=int(input())
l=[]
for i in range(n):
s,p=input().split()
l.append([s,-int(p),i+1])
l.sort()
for city,price,idx in l:
print(idx) | 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,*l=open(0).read().split()
print(*sorted(range(1,int(n)+1),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 | import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int num = sc.nextInt();
String array[][] = new String[num][3];
for(int i = 0; i < num; i ++) {
array[i][0] = sc.next();
array[i][1] = sc.next();
array[i]... | JAVA |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | N = int(input())
R = []
for i in range(N):
s,p = input().split()
R.append([s,100-int(p),i+1])
R.sort()
for j in R:
print(j[2]) | PYTHON3 |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | for*_,a in sorted([input().split()+[i]for i in range(int(input()))],key=lambda x:(x[0],-int(x[1]))):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 | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n,i=0;
cin>>n;
vector< pair< pair<string,int>,int > > v;
string s;
int p;
while(n--)
{
i++;
cin>>s>>p;
v.push_back({{s,-p},i});
}
sort(v.begin(),v.end());
for(auto q:v) cout<<q.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;
using vppsii=vector<pair<pair<string,int>,int>>;
vppsii a(N);
for(int i=0;i<N;i++){
string s;
int p;
cin>>s>>p;
a.at(i)=make_pair(make_pair(s,-p),i+1);
}
sort(a.begin(),a.end());
for(auto e:a){
cout<<e.second... | CPP |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | # include <bits/stdc++.h>
using namespace std;
char in[120];
pair<pair<string,int>,int> p[110];
int main(){
int a;scanf("%d",&a);
for(int i=0;i<a;i++){
int t;scanf("%s%d",in,&t);
string tmp=in;
p[i]=make_pair(make_pair(in,-t),i);
}
std::sort(p,p+a);
for(int i=0;i<a;i++)printf("%d\n",p[i].second+1);
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.Scanner;
import java.util.Arrays;
import java.util.Comparator;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
uu[] t=new uu[n];
for(int i=0; i<n; i++){
String k= sc.next();
int p=sc.nextInt();
t[i]=new uu(i+1,k,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())
sp = [[i+1]+input().split() for i in range(n)]
sp.sort(key=lambda x:(x[1],- int(x[2])))
for x in sp:
print(x[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 | #include<bits/stdc++.h>
using namespace std;
int main(){
int i,n;cin>>n;
pair<string,int> r[n];
map<int,int> p_i;
for(i=0;i<n;i++){
cin>>r[i].first>>r[i].second;r[i].second*=-1;
p_i[r[i].second]=i+1;
}
sort(r,r+n);
for(i=0;i<n;i++){cout<<p_i[r[i].second]<<endl;}
} | CPP |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | import java.util.Arrays;
import java.util.Scanner;
public class Main {
private void solve() {
Scanner in = new Scanner(System.in);
int N = in.nextInt();
Restrant[] rests = new Restrant[N];
for(int i=0; i<N; i++) {
rests[i] = new Restrant(i+1, in.next(), in.nextInt());
}
Arrays.sort(rests);
for(Restr... | 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();
List<String[]> list = new ArrayList<>();
for (int i = 0; i < n; i++) {
String[] str = new String[3];
str[0] = sc.next... | JAVA |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | #include<bits/stdc++.h>
using namespace std;
int main(){
int N;
cin >> N;
vector<tuple<string,int,int>> A;
for(int i=1;i<N+1;i++){
string S;
int P;
cin >> S >> P;
P*=-1;
A.push_back(tie(S,P,i));
}
sort(A.begin(),A.end());
for(int i=0;i<N;i++){
cout << get<2>(A.at(i)) <<endl;
}
}
... | CPP |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | n=int(input())
list=[]
for i in range(n):
s,p=input().split()
list.append((s, -int(p), i+1))
list.sort()
for s,p,i in list:
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.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
List<String> S = new ArrayList<Strin... | 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.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<R> list = new ArrayList<>();
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 | //package abc128.B;
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[] sp = new String[n];
for (int i = 0; i < n; i++) {
String s = sc.next();
int p = sc.nextInt();... | JAVA |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | n=int(input())
for v in sorted(list(list(input().split())+[i+1] for i in range(n)),key=lambda x:(x[0],-int(x[1]))):print(v[2]) | PYTHON3 |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,i;
cin>>n;
tuple<string,int,int>t[n];
for(i=0;i<n;i++){
string s;
int p;
cin>>s>>p;
t[i]=make_tuple(s,-p,i);
}
sort(t,t+n);
for(i=0;i<n;i++){
cout<<get<2>(t[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 num = sc.nextInt();
Map<String, Map<Integer, Integer>> gidebook = new TreeMap<>();
List<Integer> ansList = new ArrayList<>();
for (int i = 1; i <= num; ... | 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>
using namespace std;
pair<pair<string,int>,int> pii[105];
int main()
{
int n,p;
string s;
cin>>n;
for(int i=1; i<=n; i++){
cin>>s>>p;
pii[i]=make_pair(make_pair(s,-p),i);
}
sort(pii+1,pii+n+1);
for(int i=1; i<=n; i++){
cout<<pii[i].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 | import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
int n = Integer.parseInt(sc.next());
String[][] r = new String[n][3];
for (int i = 0; i < n; i++) {
r[i][0] = sc.next();
r[i][1] = 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 | #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 S;
int P;
cin >> S >> P;
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 | import java.util.*;
class Restaurant implements Comparable<Restaurant> {
String direc;
int num;
int i;
public Restaurant(String direc, int num, int i) {
this.direc = direc;
this.num = num;
this.i = i;
}
public int compareTo(Restaurant other) {
int ans = direc.compareTo(other.direc);
if (ans != 0)
... | JAVA |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | 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[] check = new String[N];
for(int i = 1; i<=N;i++) {
check[i-1] = sc.next() + " " + (1100-sc.nextInt()) + " " + i;
}
Arrays.sor... | 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=[0]*n
for i in range(n):
s,p=input().split()
p=int(p)
l[i]=(s,-p,i+1)
l=sorted(l)
for i in range(n):
print(l[i][2]) | PYTHON3 |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
Map<String, List<Integer>> restaurants = new TreeMap<>();
Map<String, Integer> order = new HashMap<>();
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.*;
class Com implements Comparator<Point>{
public int compare(Point a,Point b){
int c = a.c.compareTo(b.c);
if (c==0){
return b.p-a.p;
}
return c;
}
}
class Point{
String c;
int p;
int in;
Point(String a,int b,int d){
c = 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 | n = int(input())
sp = [input().split() + [i] for i in range(n)]
sp.sort(key = lambda x: (x[0],-int(x[1])))
for _,_,i in sp:
print(i + 1) | PYTHON3 |
p03030 AtCoder Beginner Contest 128 - Guidebook | You have decided to write a book introducing good restaurants. There are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i. No two restaurants have the same score.
You want to in... | 6 | 0 | #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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.