玄关abcC题求调
  • 板块灌水区
  • 楼主wuzhexu
  • 当前回复1
  • 已保存回复1
  • 发布时间2025/1/18 22:12
  • 上次更新2025/1/19 10:07:43
查看原帖
玄关abcC题求调
1174984
wuzhexu楼主2025/1/18 22:12

atcoder abc C题求调

为什么代码读取不了数据啊

谢谢大佬们【拜倒】

#include<bits/stdc++.h>

using namespace std;

#define int long long

vector<int> arr;

vector<int> l;

signed main(){
	
	int n;
	
	int d;
	
	int s;
	
	int j=0;
	
	cin>>n;
	
	while(n--){
		cin>>d;
		if(d==3){
			cin>>s;
			cout<<arr[s-1]<<endl;
		}else if(d==2){
			
			arr.erase(arr.begin());
			
			l.erase(l.begin());
			
			arr[0]=0;
			j--;
			
			for(int y=1;y<j;y++){
				arr[y]=arr[y]-l[y-1];
			}
		}else if(d==1){
			cin>>s;
			l[j]=s;
			if(j==0) arr[j]=0;
			else arr[j]=l[j-1];
			j++;
		}
	}
	
}

【蒟蒻膜拜】

2025/1/18 22:12
加载中...