답안 #646397

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
646397 2022-09-29T18:05:43 Z murad_2005 XOR Sum (info1cup17_xorsum) Java 11
컴파일 오류
0 ms 0 KB
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define ull unsigned long long
#define ui unsigned int
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define pb push_back
#define pf push_front
#define pii pair<int, int>
#define pil pair<int, ll>
#define plli pair<long long, int>
#define pdi pair<double, int>
#define pldldi pair<ld, pair<ld, int>>
#define pdd pair<double, double>
#define pid pair<int, double>
#define piii pair<int, pair<int, int>>
#define pllll pair<long long, long long>
#define pllllll pair<ll, pllll>
#define INF 2e9 + 5
#define size(v) v.size()
#define f first
#define s second
#define Pi 3.14159265359

using namespace std;

const int up = 1e5 + 5;

int a[up];

void solve(){
    int n;
    cin >> n;
    int Res = 0;
    for(int i = 1; i <= n; i++){
        cin >> a[i];
        for(int j = 1; j <= i; j++){
            Res ^= (a[i] + a[j]);
        }
    }
    cout << Res;
}

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int t;
    t = 1;
    // cin >> t;
    while(t--){
        solve();
    }
    return 0;
}

Compilation message

xorsum.java:1: error: illegal character: '#'
#include<bits/stdc++.h>
^
xorsum.java:1: error: class, interface, or enum expected
#include<bits/stdc++.h>
        ^
xorsum.java:2: error: illegal character: '#'
#define ll long long
^
xorsum.java:3: error: illegal character: '#'
#define ld long double
^
xorsum.java:4: error: illegal character: '#'
#define ull unsigned long long
^
xorsum.java:5: error: illegal character: '#'
#define ui unsigned int
^
xorsum.java:6: error: illegal character: '#'
#define eb emplace_back
^
xorsum.java:7: error: illegal character: '#'
#define all(v) v.begin(), v.end()
^
xorsum.java:8: error: illegal character: '#'
#define rall(v) v.rbegin(), v.rend()
^
xorsum.java:9: error: illegal character: '#'
#define pb push_back
^
xorsum.java:10: error: illegal character: '#'
#define pf push_front
^
xorsum.java:11: error: illegal character: '#'
#define pii pair<int, int>
^
xorsum.java:12: error: illegal character: '#'
#define pil pair<int, ll>
^
xorsum.java:13: error: illegal character: '#'
#define plli pair<long long, int>
^
xorsum.java:14: error: illegal character: '#'
#define pdi pair<double, int>
^
xorsum.java:15: error: illegal character: '#'
#define pldldi pair<ld, pair<ld, int>>
^
xorsum.java:16: error: illegal character: '#'
#define pdd pair<double, double>
^
xorsum.java:17: error: illegal character: '#'
#define pid pair<int, double>
^
xorsum.java:18: error: illegal character: '#'
#define piii pair<int, pair<int, int>>
^
xorsum.java:19: error: illegal character: '#'
#define pllll pair<long long, long long>
^
xorsum.java:20: error: illegal character: '#'
#define pllllll pair<ll, pllll>
^
xorsum.java:21: error: illegal character: '#'
#define INF 2e9 + 5
^
xorsum.java:22: error: illegal character: '#'
#define size(v) v.size()
^
xorsum.java:23: error: illegal character: '#'
#define f first
^
xorsum.java:24: error: illegal character: '#'
#define s second
^
xorsum.java:25: error: illegal character: '#'
#define Pi 3.14159265359
^
xorsum.java:29: error: class, interface, or enum expected
const int up = 1e5 + 5;
^
xorsum.java:31: error: class, interface, or enum expected
int a[up];
^
xorsum.java:33: error: class, interface, or enum expected
void solve(){
^
xorsum.java:35: error: class, interface, or enum expected
    cin >> n;
    ^
xorsum.java:36: error: class, interface, or enum expected
    int Res = 0;
    ^
xorsum.java:37: error: class, interface, or enum expected
    for(int i = 1; i <= n; i++){
    ^
xorsum.java:37: error: class, interface, or enum expected
    for(int i = 1; i <= n; i++){
                   ^
xorsum.java:37: error: class, interface, or enum expected
    for(int i = 1; i <= n; i++){
                           ^
xorsum.java:39: error: class, interface, or enum expected
        for(int j = 1; j <= i; j++){
        ^
xorsum.java:39: error: class, interface, or enum expected
        for(int j = 1; j <= i; j++){
                       ^
xorsum.java:39: error: class, interface, or enum expected
        for(int j = 1; j <= i; j++){
                               ^
xorsum.java:41: error: class, interface, or enum expected
        }
        ^
xorsum.java:44: error: class, interface, or enum expected
}
^
xorsum.java:48: error: class, interface, or enum expected
    cin.tie(0);
    ^
xorsum.java:49: error: class, interface, or enum expected
    int t;
    ^
xorsum.java:50: error: class, interface, or enum expected
    t = 1;
    ^
xorsum.java:52: error: class, interface, or enum expected
    while(t--){
    ^
xorsum.java:54: error: class, interface, or enum expected
    }
    ^
xorsum.java:56: error: class, interface, or enum expected
}
^
45 errors