# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
859357 | 2023-10-10T04:51:39 Z | imarn | 드문 곤충 (IOI22_insects) | C++17 | 34 ms | 856 KB |
#include<bits/stdc++.h> #include "insects.h" #define f first #define s second #define pb push_back using namespace std; int siz[2001]{0}; int min_cardinality(int N) { vector<int>vec; int vis[2001]={0}; move_inside(0); int sz=0; for(int i=0;i<N;i++)siz[i]=1; for(int i=0;i<N;i++){ if(vis[i])continue; move_inside(i); if(press_button()==1){ vis[i]=1;sz++;vec.pb(i); } else move_outside(i); } int l=1,r=N/sz; int ans=1; int memsize=sz; int cnt=0; while(l<r){ int tt=cnt; int m=(l+r+1)>>1; for(int i=0;i<N;i++){ if(!vis[i]){ move_inside(i); int y=press_button(); if(y<=m){ cnt++;vis[i]=2; } else move_outside(i); } } if(cnt/memsize<m-1)r=m-1; else l=m,ans=m; }return l; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 344 KB | Output is correct |
3 | Correct | 0 ms | 344 KB | Output is correct |
4 | Correct | 0 ms | 344 KB | Output is correct |
5 | Correct | 0 ms | 344 KB | Output is correct |
6 | Correct | 2 ms | 344 KB | Output is correct |
7 | Correct | 1 ms | 344 KB | Output is correct |
8 | Correct | 2 ms | 344 KB | Output is correct |
9 | Correct | 2 ms | 344 KB | Output is correct |
10 | Incorrect | 5 ms | 344 KB | Wrong answer. |
11 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 344 KB | Output is correct |
3 | Correct | 0 ms | 344 KB | Output is correct |
4 | Correct | 0 ms | 344 KB | Output is correct |
5 | Correct | 0 ms | 344 KB | Output is correct |
6 | Correct | 2 ms | 344 KB | Output is correct |
7 | Correct | 1 ms | 344 KB | Output is correct |
8 | Correct | 2 ms | 344 KB | Output is correct |
9 | Correct | 2 ms | 344 KB | Output is correct |
10 | Incorrect | 5 ms | 344 KB | Wrong answer. |
11 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 344 KB | Output is correct |
3 | Correct | 0 ms | 344 KB | Output is correct |
4 | Correct | 0 ms | 344 KB | Output is correct |
5 | Correct | 0 ms | 344 KB | Output is correct |
6 | Correct | 0 ms | 344 KB | Output is correct |
7 | Correct | 27 ms | 344 KB | Output is correct |
8 | Correct | 11 ms | 856 KB | Output is correct |
9 | Correct | 28 ms | 344 KB | Output is correct |
10 | Incorrect | 34 ms | 344 KB | Wrong answer. |
11 | Halted | 0 ms | 0 KB | - |