답안 #364115

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
364115 2021-02-08T09:03:10 Z Ahmadsm2005 CONSUL (info1cup19_consul) C++14
49.5437 / 100
65 ms 364 KB
#include <bits/stdc++.h>
#include "grader.h"
//#define endl '\n'
#define modulo 1000000007
//#define int long long
#define PI acos(-1)
#pragma GCC optimize("-Ofast")
//#pragma GCC optimize("trapv")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx2,tune=native")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-funroll-all-loops,-fpeel-loops,-funswitch-loops")
#define sinDegrees(x) sin((x) * PI / 180.0)
#define cosDegrees(x) cos((x) * PI / 180.0)
#define tanDegrees(x) tan((x) * PI / 180.0)
#define atanDegrees(x) atan(x)* 180.0 / PI
#define asinDegrees(x) asin(x)* 180.0 / PI
#define EPS 0.000000001
using namespace std;
int power(int x,int y,int m)
{
int temp;
if(y == 0)
return 1;
temp = (power(x, y/2,m))%m;
if (y%2 == 0)
return ((temp%m)*temp);
else
return ((x*temp%m)*temp%m)%m;
}
int inv(int x,int m=modulo)
{
return (power(x,m-2,m))%m;
}
///IOI 2021 isA
int F=40,K=10;
bool freq[1001];
map<int,int>lol;
void solve(int N){
int X=F-K,ANS=-1;
srand(1298);
if(N>100)
X=80,K=80;
for(int i=0;i<=N;i++)
freq[i]=0;
for(int i=0;i<X;i++){
if(i*3>N)
break;
int Z=rand()%N;
while(freq[Z]){
Z=rand()%N;
}
freq[Z]=1;
int RE=kth(Z+1);
lol.insert({RE,0});
lol.at(RE)++;
X--;
}
vector<pair<int,int>>TEMP;
for(auto itr=lol.begin();itr!=lol.end();itr++){
TEMP.push_back({itr->second,itr->first});
}
lol.clear();
sort(TEMP.begin(),TEMP.end()),reverse(TEMP.begin(),TEMP.end());
for(int i=0;i<min((int)TEMP.size(),X+K);i++){
if(cnt(TEMP[i].second)*3>N){
ANS=TEMP[i].second;
break;
}
}
say_answer(ANS);
}
/*int32_t main()
{
//freopen("output.txt","w",stdout);
//freopen("sorting.in","r",stdin);
cin.tie(0),iostream::sync_with_stdio(0);

return 0;
}*/
# 결과 실행 시간 메모리 Grader output
1 Correct 23 ms 364 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 9 ms 364 KB Wrong answer
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Partially correct 53 ms 364 KB Output is partially correct
2 Partially correct 61 ms 364 KB Output is partially correct
3 Correct 39 ms 364 KB Output is correct
4 Correct 58 ms 364 KB Output is correct
5 Partially correct 46 ms 364 KB Output is partially correct
6 Correct 50 ms 364 KB Output is correct
7 Partially correct 65 ms 364 KB Output is partially correct
8 Partially correct 48 ms 364 KB Output is partially correct
9 Partially correct 45 ms 364 KB Output is partially correct
10 Partially correct 47 ms 364 KB Output is partially correct
11 Correct 49 ms 364 KB Output is correct
12 Partially correct 33 ms 364 KB Output is partially correct
13 Partially correct 45 ms 364 KB Output is partially correct
14 Partially correct 40 ms 364 KB Output is partially correct