Submission #1100531

# Submission time Handle Problem Language Result Execution time Memory
1100531 2024-10-14T08:19:36 Z vjudge1 Star triangles (IZhO11_triangle) C++14
0 / 100
105 ms 584 KB
#include<bits/stdc++.h>
#define pb push_back
#define int long long
#define S second
#define F first
#define inputt freopen("triangles.txt","r",stdin);freopen("triangles.txt","w",stdout);
#define ahah ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;

const int N=1e6+7;
const int MOD=1e9+7;

int x[N],y[N];

signed main() {
	ahah
	inputt
	int n;
	cin >> n;
	for(int i = 1 ; i <= n ; i++){
		cin >> x[i] >> y[i];
	}
	int ans=0;
	for(int i = 1 ; i <= n ; i++){
		for(int j = i+1 ; j <= n ; j++){
			for(int k = j+1 ; k <= n ; k++){
				set<int>xax;
				set<int>yax;
				xax.insert(x[i]);
				xax.insert(x[j]);
				xax.insert(x[k]);
				yax.insert(y[i]);
				yax.insert(y[j]);
				yax.insert(y[k]);
				if(xax.size() == 2 and yax.size() == 2){
					ans++;
				}
			}
		}
	}
	cout << ans;
}

Compilation message

triangle.cpp: In function 'int main()':
triangle.cpp:6:23: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
    6 | #define inputt freopen("triangles.txt","r",stdin);freopen("triangles.txt","w",stdout);
      |                ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
triangle.cpp:17:2: note: in expansion of macro 'inputt'
   17 |  inputt
      |  ^~~~~~
triangle.cpp:6:58: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
    6 | #define inputt freopen("triangles.txt","r",stdin);freopen("triangles.txt","w",stdout);
      |                                                   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
triangle.cpp:17:2: note: in expansion of macro 'inputt'
   17 |  inputt
      |  ^~~~~~
# Verdict Execution time Memory Grader output
1 Runtime error 105 ms 584 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -