QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#695912 | #9528. New Energy Vehicle | QingTian# | Compile Error | / | / | C++14 | 7.4kb | 2024-10-31 21:02:48 | 2024-10-31 21:02:52 |
Judging History
This is the latest submission verdict.
- [2024-10-31 21:02:52]
- Judged
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2024-10-31 21:02:48]
- Submitted
answer
王一学 17:03:56
@青天零云
青天零云 17:03:57
王一学
要不下次或者线上
@王一学 这样
青天零云 17:03:59
我们
青天零云 17:04:05
线上vp
青天零云 17:04:10
石珈铭
我们有昆明吗
@石珈铭 还没消息
王一学 17:04:13
其实可以
王一学 17:04:44
要不线上vp点别的场
王一学 17:04:48
ecf先留着
青天零云 17:04:54
那就成都
王一学 17:04:57
okk
青天零云 17:05:02
等下
石珈铭 17:05:04
现在吗
青天零云 17:05:05
还没有
青天零云 17:05:08
成都
王一学 17:05:19
ucup上有
青天零云 17:05:19
哈尔滨
青天零云 17:05:25
哦
青天零云 17:05:28
要不哈尔滨
王一学 17:05:29
他们昨天vp了
王一学 17:05:55
王一学
他们昨天vp了
前天
青天零云 17:06:02
王一学
前天
@王一学 因为他们申请了
青天零云 17:06:06
我们没有权限
王一学 17:06:09
哦哦
王一学 17:06:18
那就哈尔滨
王一学 17:08:44
你们一会先开
王一学 17:08:49
我去课上看一眼
青天零云 17:49:07
6.10开始,连麦打
青天零云 17:49:18
我主机
青天零云 17:49:24
代码写完发我
石珈铭 18:03:56
石珈铭 18:03:59
咋进
石珈铭 18:04:14
没入口
青天零云 18:04:21
https://qoj.ac/contest/1817
石珈铭 18:04:28
ok
青天零云 18:04:42
搜索信息能力有待提高
石珈铭 18:05:02
我以为在
石珈铭 18:05:09
ucup官网上
青天零云 18:09:53
发起了语音通话
音视频通话已结束
青天零云 18:10:02
发起了语音通话
音视频通话已结束
石珈铭 18:40:08
#include <bits/stdc++.h>
#define int long long
#define pb push_back
#define debug(x) cerr << #x << " = " << x << endl
#define inf 0x3f3f3f3f3f3f3f3f
#define fi first
#define se second
#define endl "\n"
using namespace std;
const int N = 2e5 + 10;
const int MOD = 998244353;
int T = 1;
int n;
void solve(){
using pci = pair<char, int>;
vector<pci>v, ans;
cin >> n;
for (int i = 0; i < n; i ++){
char c;
int p;
cin >> c >> p;
v.pb({c, p});
}
char cur = v[0].fi;
string h = "ENWS";
map<char, int>mp;
mp['E'] = 0;
mp['N'] = 1;
mp['W'] = 2;
mp['S'] = 3;
auto lf = [&](char c) -> char {
int t = (mp[c] + 5) % 4;
return h[t];
};
auto ri = [&](char c) -> char {
return h[(mp[c] + 3) % 4];
};
for (auto [c, p] : v){
if (cur == c){
ans.pb({'Z', p});
}
else {
if (c == lf(cur)){
ans.pb({'L', 0});
}
else if (c == ri(cur)){
ans.pb({'R', 0});
}
else{
ans.pb({'L', 0});
ans.pb({'L', 0});
}
ans.pb({'Z', p});
}
}
cout << ans.size() << ' ' << v[0].fi << endl;
for (auto [c, p] : ans){
if (c == 'Z') cout << c << ' ' << p << endl;
else cout << c << endl;
}
}
signed main(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin >> T;
while (T --){
solve();
}
return 0;
}
石珈铭 18:43:12
石珈铭 18:51:48
青天零云 19:07:04
#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N= 2e5+10,M=2*N;
int n,m,k;
bool bz[N],vis[N];
int h[N],e[M],ne[M],idx;
int cnt=0;
int step=0;
vector<int> res[N];
void add(int a,int b){
e[idx]=b,ne[idx]=h[a],h[a]=idx++;
}
void dfs(int u,int num){
cnt++;
vis[u]=1;
if(bz[u]) return;
step=max(num,step);
res[num].push_back(u);
vector<int> ans;
for(int i=h[u];i!=-1;i=ne[i]){
int v=e[i];
if(!vis[v]){
ans.push_back(v);
dfs(v,num+1);
}
}
res[num].push_back(ans.size());
for(auto i:ans) res[num].push_back(i);
}
void solve(){
cin>>n>>m>>k;
memset(h,-1,sizeof h);
for(int i=1;i<=k;i++){
int x;cin>>x;
bz[x]=1;
}
for(int i=1;i<=m;i++){
int a,b;cin>>a>>b;
add(a,b);add(b,a);
}
for(int i=1;i<=n;i++){
bool flag=0;
for(int j=h[i];j!=-1;j=ne[j]){
if(!bz[e[j]]){
flag=1;
break;
}
}
if(!flag){
cout<<"No\n";
return;
}
}
for(int i=1;i<=n;i++){
if(!bz[i]){
dfs(i,1);
break;
}
}
if(cnt!=n){
cout<<"No\n";
return;
}else{
cout<<"Yes\n";
for(int i=1;i<=step;i++){
if(res[i].size()==2) continue;
for(auto j:res[i]) cout<<j<<' ';
cout<<'\n';
}
}
}
signed main(){
ios::sync_with_stdio(false);
cin.tie(0);
int _=1;
while(_--) solve();
return 0;
}
青天零云 19:35:04
#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N= 4e5+10,M=2*N;
int n,m,k;
bool bz[N],vis[N];
int h[N],e[M],ne[M],idx;
int cnt=0;
int step=0;
int ixx=0;
vector<int> res[M];
void add(int a,int b){
e[idx]=b,ne[idx]=h[a],h[a]=idx++;
}
void dfs(int u){
cnt++;
vis[u]=1;
if(bz[u]) return;
int num=++step;
res[num].push_back(u);
vector<int> ans;
for(int i=h[u];i!=-1;i=ne[i]){
int v=e[i];
if(!vis[v]){
ans.push_back(v);
dfs(v);
}
}
res[num].push_back(ans.size());
for(auto i:ans) res[num].push_back(i);
}
void solve(){
cin>>n>>m>>k;
memset(h,-1,sizeof h);
for(int i=1;i<=k;i++){
int x;cin>>x;
bz[x]=1;
}
for(int i=1;i<=m;i++){
int a,b;cin>>a>>b;
add(a,b);add(b,a);
}
for(int i=1;i<=n;i++){
if(!bz[i]){
dfs(i);
break;
}
}
if(cnt!=n){
cout<<"No\n";
return;
}else{
cout<<"Yes\n";
int stt=0;
for(int i=1;i<=step;i++){
if(res[i].size()==2) continue;
stt++;
}
cout<<stt<<'\n';
for(int i=1;i<=step;i++){
if(res[i].size()==2) continue;
for(auto j:res[i]) cout<<j<<' ';
cout<<'\n';
}
}
}
signed main(){
ios::sync_with_stdio(false);
cin.tie(0);
int _=1;
while(_--) solve();
return 0;
}
王一学 21:02:19
#include<bits/stdc++.h>
#define INF 2147483647LL
#define int long long
#define MAXN 500005
#define mod 1000000007
#define PI 3.14
#define eps 1e-10
#define pa pair<int,int>
#define ms(a,x) memset(a,x,sizeof(a))
#define mc(ar1,ar2) memcpy(ar1,ar2,sizeof(ar2))
#define mkp(a,b) make_pair(a,b)
#define ls (p<<1)
#define rs (p<<1|1)
#define fn(i,st,ed) for(int i=st;i<=ed;++i)
#define fd(i,st,ed) for(int i=st;i>=ed;--i)
#define fg(i,x,head,e) for(int i=head[x];~i;i=e[i].nxt)
using namespace std;
inline int read(){int x=0,f=1;char c=getchar();while(!isdigit(c)){if(c=='-')f=-1;c=getchar();}while(isdigit(c)){x=x*10+c-'0';c=getchar();}return x*f;}
int a[MAXN],x[MAXN],t[MAXN],lst[MAXN],dis[MAXN],nowdis[MAXN];
void solve(){
int n,m,ans=0,sum=0;cin>>n>>m;
fn(i,1,n)cin>>a[i];
fn(i,1,m)cin>>x[i]>>t[i];
fn(i,1,n)t[m+i]=i;
fn(i,1,n)nowdis[i]=0;
fd(i,n+m,1)lst[i]=nowdis[t[i]],nowdis[t[i]]=i;
fn(i,1,n)dis[i]=a[i];
fn(i,1,n)sum+=dis[i];
priority_queue<int,vector<int>,greater<int> >q;
fn(i,1,n+m)q.push(i);
fn(i,1,m){
int tmp=x[i]-x[i-1];
while(!q.empty()&&q.top()<i)q.pop();
while(tmp&&!q.empty()){
int stp=t[q.top()],len=min(tmp,dis[stp]);
dis[stp]-=len,sum-=len,tmp-=len;
if(!dis[stp])q.pop();
}
if(tmp)break;
sum+=a[t[i]]-dis[t[i]];
dis[t[i]]=a[t[i]];
ans=max(ans,x[i]+sum);
if(lst[i])q.push(lst[i]);
}
cout<<ans<<endl;
}
signed main(){
ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
int T;cin>>T;
while(T--){solve();}
return 0;
}
詳細信息
answer.code:2:1: error: stray ‘@’ in program 2 | @青天零云 | ^ answer.code:7:1: error: stray ‘@’ in program 7 | @王一学 这样 | ^ answer.code:18:1: error: stray ‘@’ in program 18 | @石珈铭 还没消息 | ^ answer.code:44:16: error: invalid digit "8" in octal constant 44 | 青天零云 17:05:08 | ^~ answer.code:70:1: error: stray ‘@’ in program 70 | @王一学 因为他们申请了 | ^ answer.code:75:14: error: invalid digit "9" in octal constant 75 | 王一学 17:06:09 | ^~ answer.code:81:11: error: invalid digit "8" in octal constant 81 | 王一学 17:08:44 | ^~ answer.code:84:11: error: invalid digit "8" in octal constant 84 | 王一学 17:08:49 | ^~ answer.code:117:14: error: invalid digit "9" in octal constant 117 | 石珈铭 18:05:09 | ^~ answer.code:120:13: error: invalid digit "9" in octal constant 120 | 青天零云 18:09:53 | ^~ answer.code:130:14: error: invalid digit "8" in octal constant 130 | 石珈铭 18:40:08 | ^~ answer.code:131:10: error: #include expects "FILENAME" or <FILENAME> 131 | #include <bits/stdc++.h> | ^ answer.code:1:1: error: ‘王一学’ does not name a type 1 | 王一学 17:03:56 | ^~~~~~ answer.code: In function ‘void solve()’: answer.code:148:21: error: ‘pair’ does not name a type; did you mean ‘pa’? 148 | using pci = pair<char, int>; | ^~~~ | pa answer.code:148:33: error: expected unqualified-id before ‘,’ token 148 | using pci = pair<char, int>; | ^ answer.code:132:13: error: expected unqualified-id before ‘long’ 132 | #define int long long | ^~~~ answer.code:148:35: note: in expansion of macro ‘int’ 148 | using pci = pair<char, int>; | ^~~ answer.code:149:9: error: ‘vector’ was not declared in this scope 149 | vector<pci>v, ans; | ^~~~~~ answer.code:149:16: error: ‘lt’ was not declared in this scope; did you mean ‘ls’? 149 | vector<pci>v, ans; | ^~ | ls answer.code:149:19: error: ‘pci’ was not declared in this scope 149 | vector<pci>v, ans; | ^~~ answer.code:149:23: error: ‘gt’ was not declared in this scope 149 | vector<pci>v, ans; | ^~ answer.code:149:26: error: ‘v’ was not declared in this scope 149 | vector<pci>v, ans; | ^ answer.code:149:29: error: ‘ans’ was not declared in this scope 149 | vector<pci>v, ans; | ^~~ answer.code:150:9: error: ‘cin’ was not declared in this scope 150 | cin >> n; | ^~~ answer.code:151:33: error: expected ‘)’ before ‘;’ token 151 | for (int i = 0; i < n; i ++){ | ~ ^ | ) answer.code:151:35: error: ‘i’ was not declared in this scope 151 | for (int i = 0; i < n; i ++){ | ^ answer.code:158:9: error: ‘string’ was not declared in this scope; did you mean ‘stdin’? 158 | string h = "ENWS"; | ^~~~~~ | stdin answer.code:159:9: error: ‘map’ was not declared in this scope; did you mean ‘mkp’? 159 | map<char, int>mp; | ^~~ | mkp answer.code:159:20: error: expected unqualified-id before ‘,’ token 159 | map<char, int>mp; | ^ answer.code:132:13: error: expected unqualified-id before ‘long’ 132 | #define int long long | ^~~~ answer.code:159:22: note: in expansion of macro ‘int’ 159 | map<char, int>mp; | ^~~ answer.code:159:29: error: ‘mp’ was not declared in this scope; did you mean ‘mkp’? 159 | map<char, int>mp; | ^~ | mkp answer.code:164:21: error: ‘amp’ was not declared in this scope 164 | auto lf = [&](char c) -> char { | ^~~ answer.code:164:24: error: expected ‘,’ before ‘;’ token 164 | auto lf = [&](char c) -> char { | ^ | , answer.code:164:24: error: expected identifier before ‘;’ token answer.code:164:24: error: expected ‘]’ before ‘;’ token 164 | auto lf = [&](char c) -> char { | ^ | ] answer.code: In lambda function: answer.code:164:24: error: expected ‘{’ before ‘;’ token answer.code: In function ‘void solve()’: answer.code:164:25: error: expected primary-expression before ‘]’ token 164 | auto lf = [&](char c) -> char { | ...