結果

問題 No.1623 三角形の制作
ユーザー aa
提出日時 2021-07-23 22:19:19
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,648 bytes
コンパイル時間 647 ms
コンパイル使用メモリ 72,312 KB
実行使用メモリ 9,032 KB
最終ジャッジ日時 2023-09-25 22:24:31
合計ジャッジ時間 4,530 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
8,760 KB
testcase_01 AC 1 ms
4,384 KB
testcase_02 TLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>

///////////////////////////////
#define DEBUG
///////////////////////////////

#define PI 3.14159265359
#define MOD 1000000007
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define lep(i, n) for (long i = 0; i < (long)(n); i++)
#define llep(i, n) for (long long i = 0; i < (long long)(n); i++)
#define rep2(i, m, n) for (int i = m-1; i < (int)(n); i++)
#define lep2(i, m, n) for (long i = m-1; i < (long)(n); i++)
#define llep2(i, m, n) for (long long i = m-1; i < (long long)(n); i++)
#define repinf(i) for(int i = 0;;i++)
#define lepinf(i) for(long i = 0;;i++)
#define llepinf(i) for(long long i = 0;;i++)
#define _GLIBCXX_DEBUG



int read(){
	int x = 0; char c;
	while(((c=getchar())>'9' || c<'0')&&c!='-');
	const int f=(c=='-')&&(c=getchar());
	while(x=x*10-48+c,(c=getchar())>='0'&&c<='9');
	return f?-x:x;
}

#include <cmath>
#include <limits>
#include <iostream>

int maxim(int a, int b, int c){
	return 	a < b ?
				b < c ? 
			 		c
				:b
			:b>c?
				a
			:a>c?
				a
			:c;
}

int main(void){
	int n = read();
	int r[n], g[n], b[n];
	rep(i,n){
		r[i] = read();
	}
	rep(i,n){
		g[i] = read();
	}
	rep(i,n){
		b[i] = read();
	}
	double max = 0;
	int cnt = 0;
	double s = 0;
	double sq = 0;
	int m = 0;
	for(int i = 0; i < n;i++){
		for(int j = 0;j < n;j++){
			for(int k = 0; k < n;k++){
				if(r[i] != maxim(r[i],g[j],b[k])) continue;
				if(!(r[i] < g[j] + b[k]) || !(r[i] + g[j] > b[k]) || !(r[i]+ b[k] > g[j])) continue;
				// printf("%d[%d],%d[%d],%d[%d]\n", r[i],i+1,g[j],j+1,b[k],k+1);
				cnt +=1;
			}
		}
	}
	printf("%d\n",cnt);

return 0;
}
0