Submission #174276


Source Code Expand

//include----------------------------------------------------------------------------------------------------------------------
#include <bits/stdc++.h>

//using namespace--------------------------------------------------------------------------------------------------------------
using namespace std;

//define-----------------------------------------------------------------------------------------------------------------------
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define INF 1 << 25
#define CLR(a) memset((a), 0 ,sizeof(a))
#define dump(x) cerr << #x << " = " << (x) << "\n";
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n";
#define sq(n) (n) * (n)

//typedef----------------------------------------------------------------------------------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef unsigned int uint;
typedef unsigned long long ull;

//const------------------------------------------------------------------------------------------------------------------------
const double EPS = 1e-10;
const double PI = acos( -1.0 );

//global-----------------------------------------------------------------------------------------------------------------------
int n;
VI ar;
//function---------------------------------------------------------------------------------------------------------------------
int main() {
	scanf( "%d", &n );
	ar.resize( n );
	rep( i, n ) {
		scanf( "%d", &ar[ i ] );
	}
	SORT( ar );
	per( i, n - 2 ) {
		if ( ar[ i ] < ar[ n - 1 ] ) {
			printf( "%d\n", ar[ i ] );
			return 0;
		}
	}
	return 0;
}

Submission Info

Submission Time
Task B - 心配性な富豪、ファミリーレストランに行く。
User stone725
Language C++ (G++ 4.6.4)
Score 100
Code Size 2319 Byte
Status AC
Exec Time 24 ms
Memory 932 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:46:19: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
./Main.cpp:49:26: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 15
Set Name Test Cases
All random_1.txt, random_10.txt, random_2.txt, random_3.txt, random_4.txt, random_5.txt, random_6.txt, random_7.txt, random_8.txt, random_9.txt, small_1.txt, small_2.txt, small_3.txt, small_4.txt, small_5.txt
Case Name Status Exec Time Memory
random_1.txt AC 21 ms 736 KB
random_10.txt AC 20 ms 804 KB
random_2.txt AC 21 ms 928 KB
random_3.txt AC 20 ms 804 KB
random_4.txt AC 20 ms 924 KB
random_5.txt AC 21 ms 800 KB
random_6.txt AC 21 ms 924 KB
random_7.txt AC 22 ms 928 KB
random_8.txt AC 21 ms 924 KB
random_9.txt AC 24 ms 768 KB
sample_1.txt AC 21 ms 804 KB
sample_2.txt AC 21 ms 928 KB
sample_3.txt AC 20 ms 800 KB
small_1.txt AC 21 ms 932 KB
small_2.txt AC 21 ms 928 KB
small_3.txt AC 21 ms 804 KB
small_4.txt AC 20 ms 804 KB
small_5.txt AC 20 ms 928 KB