結果
問題 |
No.1569 Nixoracci's Number
|
ユーザー |
|
提出日時 | 2021-08-02 19:20:19 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,359 bytes |
コンパイル時間 | 1,583 ms |
コンパイル使用メモリ | 166,916 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-16 14:41:53 |
合計ジャッジ時間 | 2,735 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
#include<bits/stdc++.h> //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> #define ll long long int #define ld long double #define pb push_back #define fi first #define se second #define all(x) x.begin(),x.end() #define mem(x,y) memset(x,y,sizeof(x)) #define sz(x) (int)x.size() #define pii pair<int,int> #define pll pair<ll,ll> #define pi 3.141592653589793238 #define INF 1e9+7 #define INFL 1e18 #define mod 1000000007 //#define mod 998244353 #define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); using namespace std; //using namespace __gnu_pbds; //typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> os; //typedef tree<pii,null_type,less<pii>,rb_tree_tag,tree_order_statistics_node_update> os_pair; ll power(ll x,ll n){ll res =1;while(n>0){if(n%2==1){res=res*x;}x=x*x;n=n/2;}return res;} ll powm(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;} //cout<< fixed << setprecision(10) //__builtin_popcountll() void solve(){ ll n,i,j,k; cin>>n>>k; ll a[n+1]; ll x=0; for(i=0;i<n;i++) { cin>>a[i]; x=x^a[i]; } a[n]=x; k--; k=k%(n+1); cout<<a[k]<<"\n"; } int main() { fast; int t=1; //cin>>t; //assert(1 <= t && t <= 10); while(t--) { solve(); } }