# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
306612 | 2020-09-26T03:04:32 Z | chubyxdxd | 버섯 세기 (IOI20_mushrooms) | C++17 | 9 ms | 364 KB |
#include "mushrooms.h" #include <bits/stdc++.h> #define pb push_back using namespace std; int count_mushrooms(int n){ int ans=1; vector<int> A; vector<int> B; A.pb(0); int j; for(int i=1;i<n;i++){ if(A.size()>=100 or B.size()>=100)break; j=i; vector<int> m; m.pb(0); m.pb(i); int f=use_machine(m); if(f==1)B.pb(i); else A.pb(i); } //cout<<123<<endl; /* for(auto i:A)cout<<i<<" "; cout<<endl; for(auto i:B)cout<<i<<" "; cout<<endl;*/ if(A.size()>=3){ ans=n; int i=j+1; vector<int> m; while(i<n){ int l=0; m.clear(); while(m.size()<198 and i<n){ m.pb(A[l]); l++; m.pb(i); i++; } m.pb(A[l]); //for(auto i:m)cout<<i<<" "; //cout<<endl; int f=use_machine(m); f=f/2; ans-=f; } ans-=int(B.size()); return ans; } ans=0; int i=j+1; vector<int> m; while(i<n){ m.clear(); int l=0; while(m.size()<=198 and i<n){ m.pb(B[l]); l++; m.pb(i); i++; } m.pb(B[l]); //for(auto i:B)cout<<i<<" "; //cout<<endl; int f=use_machine(m); f=f/2; ans+=f; } ans+=int(A.size()); return ans; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Correct | 0 ms | 256 KB | Output is correct |
3 | Correct | 1 ms | 256 KB | Output is correct |
4 | Correct | 1 ms | 256 KB | Output is correct |
5 | Correct | 2 ms | 256 KB | Output is correct |
6 | Correct | 3 ms | 256 KB | Output is correct |
7 | Partially correct | 8 ms | 364 KB | Output is partially correct |
8 | Partially correct | 7 ms | 256 KB | Output is partially correct |
9 | Partially correct | 8 ms | 256 KB | Output is partially correct |
10 | Partially correct | 8 ms | 256 KB | Output is partially correct |
11 | Partially correct | 9 ms | 256 KB | Output is partially correct |
12 | Incorrect | 2 ms | 256 KB | Duplicate value 0 in the query array. |
13 | Halted | 0 ms | 0 KB | - |