paste bin
Author
Language
C++
Plain text
Accesslog
Action script
Ada
Apache
Arduino
Armasm
Autohotkey
Awk
Bash
Basic
Brainfuck
C
Clojure
Cmake
C#
css
D
Delphi
Dockerfile
Erlang
Fortran
F#
Gauss
Go
Gradle
Graphql
Groovy
Haskell
Ini
Java
JavaScript
json
Julia
Kotlin
Lasso
LaTeX
Leaf
lisp
llvm
Lua
Makefile
Markdown
Mathematica
Matlab
Nginx
Objective-C
Ocaml
Oxygene
Perl
PgSQL
php
Powershell
Processing
Profile
Properties
Puppet
Purebasic
Python
Q
QML
R
Ruby
Rust
Scala
Scheme
Scilab
Shell
Smalltalk
SQL
Swift
Typescript
VB.NET
VB Script
Verilog
Vim
Wasm
x86asm
Xml
Xquery
Yaml
source code:
#include <cstdio> #include <algorithm> using std::sort; struct member { int index; int time; bool operator<(const member &b)const { if (time!=b.time) return time<b.time; else return index<b.index; } }; int main(void) { int N,i,t1,t2; member *a; scanf("%d",&N); a=new member [N]; for(i=0;i<N;i++) { scanf("%d%d",&t1,&t2); a[i].time=t1+t2; a[i].index=i+1; } sort(a,a+N); for(i=0;i<N;i++) { if(i>0) printf(" "); printf("%d",a[i].index); } printf("\n"); return 0; }
comment: