QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#525740 | #677. Koala Game | Rafi22# | Compile Error | / | / | C++17 | 2.0kb | 2024-08-20 21:26:53 | 2024-08-20 21:26:53 |
Judging History
This is the latest submission verdict.
- [2024-08-20 21:26:53]
- Judged
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2024-08-20 21:26:53]
- Submitted
answer
#include "koala.h"
#include <bits/stdc++.h>
using namespace std;
#ifdef DEBUG
auto&operator<<(auto&o,pair<auto,auto>p){return o<<"("<<p.first<<", "<<p.second<<")";}
auto operator<<(auto&o,auto x)->decltype(x.end(),o){o<<"{";int i=0;for(auto e:x)o<<","+!i++<<e;return o<<"}";}
#define debug(X...)cerr<<"["#X"]: ",[](auto...$){((cerr<<$<<"; "),...)<<endl;}(X)
#else
#define debug(...){}
#endif
#define ll long long
#define ld long double
#define endl '\n'
#define st first
#define nd second
#define pb push_back
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
#define FOR(i,l,r) for(int i=(l);i<=(r);i++)
#define ROF(i,r,l) for(int i=(r);i>=(l);i--)
int inf=2000000007;
ll infl=1000000000000000007;
ll mod=1000000007;
ll mod1=998244353;
vector<int>ask(vector<int>V)
{
int n=sz(V);
int B[100],R[100];
FOR(i,0,n-1) B[i]=V[i];
playRound(B,R);
vector<int>ans(n);
FOR(i,0,n-1) ans[i]=R[i];
return ans;
}
int minValue(int n,int W)
{
vector<int>V(n,0);
V[0]=1;
vector<int>R=ask(V);
FOR(i,1,n-1) if(R[i]==0) return i;
return 0;
}
int maxValue(int n,int W)
{
vector<int>C(n);
FOR(i,0,n-1) C[i]=i;
while(sz(C)>1)
{
int k=W/sz(C),xd=0;
vector<int>V(n,0);
for(auto i:C) V[i]=k;
vector<int>R=ask(V);
vector<int>nC;
for(auto i:C) if(R[i]>k) nC.pb(i);
C=nC;
}
return C[0];
}
int greaterValue(int n,int W)
{
int l=1,r=8;
while(l<=r)
{
sr=(l+r)/2;
vector<int>V(n,0);
V[0]=sr;
V[1]=sr;
vector<int>R=ask(V);
if(R[0]>sr&&R[1]<=sr) return 0;
if(R[1]>sr&&R[0]<=sr) return 1;
if(R[0]<=sr&&R[1]<=sr) r=sr-1;
else l=sr+1;
}
}
void allValues(int N, int W, int *P)
{
if (W == 2*N) {
// TODO: Implement Subtask 4 solution here.
// You may leave this block unmodified if you are not attempting this
// subtask.
} else {
// TODO: Implement Subtask 5 solution here.
// You may leave this block unmodified if you are not attempting this
// subtask.
}
}
详细
implementer.cpp: In function ‘void grader()’: implementer.cpp:138:11: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 138 | fscanf(fin, "%d %d %d",&F,&G,&maxQueries); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ implementer.cpp: In function ‘void runGame(int)’: implementer.cpp:89:11: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 89 | fscanf(fin,"%d %d",&N,&W); | ~~~~~~^~~~~~~~~~~~~~~~~~~ implementer.cpp:91:15: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 91 | fscanf(fin,"%d",&P[i]); | ~~~~~~^~~~~~~~~~~~~~~~ answer.code: In function ‘int greaterValue(int, int)’: answer.code:70:17: error: ‘sr’ was not declared in this scope; did you mean ‘r’? 70 | sr=(l+r)/2; | ^~ | r answer.code:80:1: warning: control reaches end of non-void function [-Wreturn-type] 80 | } | ^