Submission #37516634


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
 
typedef long long int lli;

lli N = 1000000007;
//vector <vector <lli>> arr(N,);
//double eps = 1e-9;
 
void solve()
{
	lli n, k, x, q, ch, i;
	cin>>n;
	lli arr[n];
	for(i=0;i<n;i++) cin>>arr[i];
	cin>>q;
	for(i=0;i<q;i++)
	{
		cin>>ch;
		if(ch==2){cin>>k; cout<<arr[k-1]<<'\n';}
		else{cin>>k>>x; arr[k-1]=x;}
	}
}
 
void usaco()
{
	//freopen("diamond.in","r",stdin);
  	//freopen("diamond.out","w",stdout);
}
 
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	solve();
}

Submission Info

Submission Time
Task B - First Query Problem
User Pesto
Language C++ (GCC 9.2.1)
Score 200
Code Size 571 Byte
Status AC
Exec Time 42 ms
Memory 4340 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 11
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 10 ms 3500 KiB
00_sample_01.txt AC 2 ms 3500 KiB
00_sample_02.txt AC 2 ms 3512 KiB
01_random_03.txt AC 31 ms 3444 KiB
01_random_04.txt AC 39 ms 4332 KiB
01_random_05.txt AC 40 ms 4340 KiB
01_random_06.txt AC 16 ms 4152 KiB
01_random_07.txt AC 37 ms 4272 KiB
01_random_08.txt AC 42 ms 4336 KiB
01_random_09.txt AC 38 ms 4332 KiB
01_random_10.txt AC 39 ms 4304 KiB