제출 #926037

#제출 시각아이디문제언어결과실행 시간메모리
926037Zakir060XOR Sum (info1cup17_xorsum)C++17
0 / 100
67 ms131072 KiB
#include <bits/stdc++.h> using namespace std; #define int long long void xakir() { /* int n,m,res=0; cin>>n>>m; if(n>=m) { res=0; for(int i=2;i<=m;i++) { res+=(n%i); } } else { res=(m-n)*n; for(int i=2;i<=n;i++) { res+=(n%i); } } cout<<res; for(int i=1;i<=m;i++) { cout<<i<<" "<<(n%i)<<endl; } */ int n; cin>>n; vector<int>v(n+1); for(int i=1;i<=n;i++) { cin>>v[i]; } vector<int>pre(n*n+n); for(int i=1;i<=n;i++) { for(int j=i;j<=n;j++) { pre.push_back(v[i]+v[j]); } } int res=0; for(int i=0;i<pre.size();i++) { res^=(pre[i]); } cout<<res; } signed main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); cout.setf( ios::fixed); cout.precision(4); system("color 0A"); int t=1; //cin>>t; while(t--) { xakir(); } /** ░█████╗░░░░░░░░░░░░░░░ ██╔══██╗░░██╗░░░░██╗░░ ██║░░╚═╝██████╗██████╗ ██║░░██╗╚═██╔═╝╚═██╔═╝ ╚█████╔╝░░╚═╝░░░░╚═╝░░ ░╚════╝░░░░░░░░░░░░░░░ **/ }

컴파일 시 표준 에러 (stderr) 메시지

xorsum.cpp: In function 'void xakir()':
xorsum.cpp:36:14: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   36 | for(int i=0;i<pre.size();i++) {
      |             ~^~~~~~~~~~~
xorsum.cpp: In function 'int main()':
xorsum.cpp:47:7: warning: ignoring return value of 'int system(const char*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   47 | system("color 0A");
      | ~~~~~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...