提出 #5777939


ソースコード 拡げる

#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
            ∧_∧  
      ∧_∧  (´<_` )  Welcome to My Coding Space!
     ( ´_ゝ`) /  ⌒i     
    /   \     | |     
    /   / ̄ ̄ ̄ ̄/  |  
  __(__ニつ/     _/ .| .|____  
     \/____/ (u ⊃  
---------------------------------------------------------------------------------------------------*/














int N;
string S[101];
int P[101];
//---------------------------------------------------------------------------------------------------
void _main() {
	cin >> N;
	rep(i, 0, N) cin >> S[i] >> P[i];

	vector<int> ans;
	rep(i, 0, N) ans.push_back(i);
	sort(all(ans), [&](int a, int b) {
		if (S[a] != S[b]) return S[a] < S[b];
		return P[a] > P[b];
	});

	fore(i, ans) cout << (i + 1) << endl;
}













提出情報

提出日時
問題 B - Guidebook
ユーザ hamayanhamayan
言語 C++14 (GCC 5.4.1)
得点 200
コード長 1706 Byte
結果 AC
実行時間 1 ms
メモリ 256 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 2
AC × 7
セット名 テストケース
Sample 01.txt, 02.txt
All 01.txt, 02.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt
ケース名 結果 実行時間 メモリ
01.txt AC 1 ms 256 KiB
02.txt AC 1 ms 256 KiB
11.txt AC 1 ms 256 KiB
12.txt AC 1 ms 256 KiB
13.txt AC 1 ms 256 KiB
14.txt AC 1 ms 256 KiB
15.txt AC 1 ms 256 KiB