Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 40121

TLE given codeforces question

$
0
0

The following code gives TLE but i think it should have given Runtime Errror... As The size of the input(n) was 10^5... and i took it as 100.

#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
int x[102],y[102];
set<int> s1;
set<int> s2;
for(int i=1;i<=n;i++)
{
cin>>x[i]>>y[i];
s1.insert(x[i]);
s2.insert(y[i]);
}
cout<<min(s1.size(),s2.size())<<endl;
}

Viewing all articles
Browse latest Browse all 40121

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>