답안 #548450

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
548450 2022-04-13T12:54:19 Z Baizho XORanges (eJOI19_xoranges) C++17
0 / 100
99 ms 7936 KB
#include <bits/stdc++.h>
using namespace std;

#pragma GCC optimization("g", on)
#pragma GCC optimization("03")
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse,-fgcse-lm")
#pragma GCC optimize("-ftree-pre,-ftree-vrp")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-fpeephole2")
#pragma GCC optimize("-fsched-spec")
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC optimize("unroll-loops")

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int>pii;
typedef pair<ll,ll> pll;
typedef long double ld;

#define T ll t; cin>>t; while(t--)
#define precise(a) fixed<<setprecision(a)
//#define sz(x) (ll)x.size()
#define sz size()
#define ff first
#define ss second
#define in insert
#define mp make_pair
#define sp " "
#define space cout<<"\n"
#define begin begin()
#define end end()
#define ndl cout<<endl
#define all(a) a.begin,a.end
#define rall(x) x.rbegin(), x.rend()
#define rend rend()
#define rbegin rbegin()
#define pb push_back
#define sp " "
#define space cout<<"\n"
#define begin begin()
#define end end()
#define ndl cout<<endl
#define rend rend()
#define rbegin rbegin()
#define pb push_back
#define yes cout<<"yes"<<endl;
#define no cout<<"no"<<endl;
#define YESn cout<<"YES\n";
#define NOn cout<<"NO\n";
#define yesn cout<<"yes\n";
#define non cout<<"no\n";
#define Yesn cout<<"Yes\n";
#define Non cout<<"No\n";
#define Yes cout<<"Yes"<<endl;
#define No cout<<"No"<<endl;
#define YES cout<<"YES"<<endl;
#define NO cout<<"NO"<<endl;

const ll mod=int(1e9)+7;   //(b + (a%b)) % b (to mod -1%(10^9+7) correctly in c++ its -1 but its suppose to be 10^9+6
const ll N=int(2e5)+7;
const ll inf=ll(1e10);
const ll LLmn=LLONG_MIN;
const ll LLmx=LLONG_MAX;
const ll K=24;
//const ld P=acos(-1.0);

int dx[] = {-1,0,0,1};
int dy[] = {0,-1,1,0};

//ll lcm(ll a, ll b){ return (a / __gcd(a,b))*b; }
//ll binpow(ll a, ll b, ll m){ ll res=1;a%=m; while(b>0){ if(b&1)res=res*a%m; a=a*a%m; b/=2; } return res;}
void Freopen(string Key){ freopen((Key+".in").c_str(), "r", stdin); freopen((Key+".out").c_str(), "w", stdout); }

ll n,q,a[N];

void Baizho()
{
    cin>>n>>q;
    for(ll i=1;i<=n;i++)cin>>a[i];
    while(q--)
    {
        ll t;cin>>t;
        if(t==1)
        {
            ll p,x;cin>>p>>x;
            a[p]=x;
        }
         else
         {
             ll l,r;cin>>l>>r;
             if((r-l+1)%2==0)cout<<0;
              else if((r-l+1)==1) cout<<a[r];
               else cout<<(a[r]^a[r-2]);
            space;
         }
    }
}

int main()
{
    //Freopen("palindrome");
    #define JOJ
	#ifdef JOJo
	    freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
    #endif

    ios_base::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);

    Baizho();

}

Compilation message

xoranges.cpp:4: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
    4 | #pragma GCC optimization("g", on)
      | 
xoranges.cpp:5: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
    5 | #pragma GCC optimization("03")
      | 
xoranges.cpp:6: warning: ignoring '#pragma comment ' [-Wunknown-pragmas]
    6 | #pragma comment(linker, "/stack:200000000")
      | 
xoranges.cpp: In function 'void Freopen(std::string)':
xoranges.cpp:77:34: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   77 | void Freopen(string Key){ freopen((Key+".in").c_str(), "r", stdin); freopen((Key+".out").c_str(), "w", stdout); }
      |                           ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xoranges.cpp:77:76: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   77 | void Freopen(string Key){ freopen((Key+".in").c_str(), "r", stdin); freopen((Key+".out").c_str(), "w", stdout); }
      |                                                                     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 99 ms 7936 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -