submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s564947759 | p03816 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N;
cin>>N;
map<int,int> m;
for(int i=0;i<N;i++){
int x;
cin>>x;
if(m.count(x)){
m.at(x)++;
}else{
m[x]=0;
}
}
int sum=0;
for(auto i:m){
sum+=i
}
cout<<sum/2+sum%2<<endl;
}
| a.cc: In function 'int main()':
a.cc:20:8: error: no match for 'operator+=' (operand types are 'int' and 'std::pair<const int, int>')
20 | sum+=i
| ~~~^~~
|
s665852480 | p03816 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N;
cin>>N;
map<int,int> m;
for(int i=0;i<N;i++){
int x;
cin>>x;
if(m.count(x)){
m.at(x)++;
}else{
m[x]=0;
}
}
int sum=0;
for(int i:m){
sum=sum+i;
}
cout<<sum/2+sum%2<<endl;
}
| a.cc: In function 'int main()':
a.cc:19:13: error: cannot convert 'std::pair<const int, int>' to 'int' in initialization
19 | for(int i:m){
| ^
|
s662792615 | p03816 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N;
cin>>N;
map<int,int> m;
for(int i=0;i<N;i++){
int x;
cin>>x;
if(m.count(x)){
m.at(x)++;
}else{
m[x]=0;
}
}
int sum=0;
for(auto i:m){
sum=sum+i;
}
cout<<sum/2+sum%2<<endl;
}
| a.cc: In function 'int main()':
a.cc:20:12: error: no match for 'operator+' (operand types are 'int' and 'std::pair<const int, int>')
20 | sum=sum+i;
| ~~~^~
| | |
| int std::pair<const int, int>
In file included from /usr/include/c++/14/bits/stl_algobase.h:67,
... |
s104857240 | p03816 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N;
cin>>N;
map<int,int> m;
for(int i=0;i<N;i++){
int x;
cin>>x;
if(m.count(x)){
m.at(x)++;
}else{
m[x]=0;
}
}
int sum=0;
for(auto i:m){
sum+=i;
}
cout<<sum/2+sum%2<<endl;
}
| a.cc: In function 'int main()':
a.cc:20:8: error: no match for 'operator+=' (operand types are 'int' and 'std::pair<const int, int>')
20 | sum+=i;
| ~~~^~~
|
s916325181 | p03816 | C++ | #inlude<bits/stdc++.h>
using namespace std;
int a[100050],n,ans;
int main()
{
cin>>n;
for(int i=1;i<=n;i++)
cin>>a[i];
sort(a+1,a+n+1);
for(int i=1;i<=n;i++)
if(a[i]==a[i-1])
ans++;
if(ans%2==1) ans++;
cout<<n-ans<<endl;
return 0;
}
| a.cc:1:2: error: invalid preprocessing directive #inlude; did you mean #include?
1 | #inlude<bits/stdc++.h>
| ^~~~~~
| include
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope
6 | cin>>n;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in head... |
s846485398 | p03816 | C++ | #include<bits/stdc++.h>
#define int long lnog
using namespace std;
const int N=100010;
int n,a[N],ans;
signed main()
{
cin>>n;
for(int i=1;i<=n;i++)
cin>>a[i];
sort(a+1,a+1+n);
for(int i=1;i<=n;i++)
if(a[i]==a[i-1])
ans++;
if(ans%2==1)ans++;
cout<<n-ans<<"\n";
return 0;
} | a.cc:4:11: error: expected initializer before 'N'
4 | const int N=100010;
| ^
a.cc:5:5: error: expected initializer before 'n'
5 | int n,a[N],ans;
| ^
a.cc: In function 'int main()':
a.cc:8:10: error: 'n' was not declared in this scope; did you mean 'yn'?
8 | cin>>n;
| ... |
s516037096 | p03816 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < n; i++)
#define vi vector<int>
#define all(a) (a).begin(),(a).end()
int main(){
ll n; cin >> n;
vi a(n); rep(i, n) cin >> a[i];
// unique 真に unique にするための前処理で sort
sort(all(a));
a.erase(unique(all(a)), a.end());
int ans =... | a.cc: In function 'int main()':
a.cc:8:3: error: 'll' was not declared in this scope; did you mean 'all'?
8 | ll n; cin >> n;
| ^~
| all
a.cc:8:16: error: 'n' was not declared in this scope; did you mean 'yn'?
8 | ll n; cin >> n;
| ^
| yn
|
s296616062 | p03816 | C++ | #include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = s; i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << endl;
#define CFYN(... | a.cc: In function 'int main()':
a.cc:18:5: error: expected ',' or ';' before 'int'
18 | int n; cin >> n;
| ^~~
a.cc:18:19: error: 'n' was not declared in this scope
18 | int n; cin >> n;
| ^
|
s851549140 | p03816 | C++ | #include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define INF 1000000010
#define EPS 1e-9
#define fst first
#define scd second
#define debug(x) cout<<x<<endl;
#define repi(i,x,n) for(int i=x;i<n;i++)
#define rep(i,n) repi(i,0,n)
#define lp(i,n) repi(i,0,n)
#define repn(i,n) for(int i=n;i>=0;i--)
#def... | a.cc: In function 'int main()':
a.cc:10:34: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
10 | #define repi(i,x,n) for(int i=x;i<n;i++)
| ^
a.cc:11:18: note: in expansion of macro 'repi'
11 | #define rep(i,n) repi(i,0,n)
| ... |
s866107702 | p03816 | C++ | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
class Program
{
const int MOD = 1000000007;
const int INF = 1 << 30;
static void Main(string[] args)
{
Solve();
}
static void Solve()
{
Scaner sc = new... | a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
2 | using System.Collections.Generic;
| ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
3 | using System.L... |
s841447487 | p03816 | C++ | #include <bits/stdc++.h>
#define rep(i,a,b) for(ll i=ll(a);i<ll(b);i++)
int a[110000];
map <int,int> b;
int main(){
int n,c=0,d=0;
std::cin>>n;
rep(i,0,n){std::cin>>a[i];b[a[i]]++;}
rep(i,0,b.size()){
if(b[i]>0)c++;
if(b[i]>1)d+=b[i]-1;
}
std::cout<<c-d%2;
}
| a.cc:4:1: error: 'map' does not name a type
4 | map <int,int> b;
| ^~~
a.cc: In function 'int main()':
a.cc:2:24: error: 'll' was not declared in this scope
2 | #define rep(i,a,b) for(ll i=ll(a);i<ll(b);i++)
| ^~
a.cc:8:3: note: in expansion of macro 'rep'
8 | rep(i,0,n)... |
s173480851 | p03816 | C++ | // luogu-judger-enable-o2
| /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s162970112 | p03816 | C++ | #include<bits/stdc++.h>
using namespace std;
const int maxn=100000+10;
int a[maxn],n,vis[maxn];
int main(){
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>a[i];
if(!vis[a[i]]) vis[a[i]]++,ans++;
}
if(ans%2) cout<<ans;
else cout<<ans-1;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:44: error: 'ans' was not declared in this scope; did you mean 'abs'?
10 | if(!vis[a[i]]) vis[a[i]]++,ans++;
| ^~~
| abs
a.cc:12:12: error: 'ans' was not declared i... |
s937809070 | p03816 | C++ | #include<bits/stdc++.h>
using namespace std;
const ll maxn=100000+10;
int a[maxn],n,vis[maxn];
int main(){
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>a[i];
if(!vis[a[i]]) vis[a[i]]++,ans++;
}
if(ans%2) cout<<ans;
else cout<<ans-1;
return 0;
} | a.cc:3:7: error: 'll' does not name a type
3 | const ll maxn=100000+10;
| ^~
a.cc:4:7: error: 'maxn' was not declared in this scope
4 | int a[maxn],n,vis[maxn];
| ^~~~
a.cc:4:19: error: 'maxn' was not declared in this scope
4 | int a[maxn],n,vis[maxn];
| ^~~~
... |
s974416687 | p03816 | C++ | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define vd(T) vector<vector<T>>
#define v(T) vector<T>
#define mod (ll)(1e9+7)
#define pp(T) pair<T,T>
#define pb push_back
#define mp make_pair
#define NN 100005
#define IO ios_base::sync_with_stdio(NULL),cin.tie(0),cout.tie(0)
#define loop(i,a,b) for(l... | a.cc: In function 'long long int setup_k(long long int*, long long int)':
a.cc:72:1: warning: no return statement in function returning non-void [-Wreturn-type]
72 | }
| ^
a.cc: In function 'int main()':
a.cc:88:18: error: 'edl' was not declared in this scope
88 | cout<<1<<edl;
| ... |
s337562695 | p03816 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, i, count = 0;
cin >> n;
vevtor<int> a(n);
for(i = 0; i < n; i++){
cin >> a.at(i);
}
for(i = 0; i < n - 1; i++){
if(a.at(i) == a.at(i + 1)){
count++;
}
}
cout << (count + 1) / 2 << endl;
} | a.cc: In function 'int main()':
a.cc:8:3: error: 'vevtor' was not declared in this scope
8 | vevtor<int> a(n);
| ^~~~~~
a.cc:8:10: error: expected primary-expression before 'int'
8 | vevtor<int> a(n);
| ^~~
a.cc:10:12: error: 'a' was not declared in this scope
10 | cin >> a.at(... |
s236884308 | p03816 | C++ | #include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
long long inf=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
long long c=a%i_7;
if(c>=0)return c;
return c+i_7;
}
using namespace std;
long long gcd(long long a, long long b){
if(a<b){
swap(a,b);
}
if(a%b==0){
re... | a.cc: In function 'int main()':
a.cc:2:18: error: expected ',' or ';' before 'for'
2 | #define REP(i,n) for(int i=0;i<n;i++)
| ^~~
a.cc:83:3: note: in expansion of macro 'REP'
83 | REP(i,nmax){
| ^~~
a.cc:83:7: error: 'i' was not declared in this scope
83 | REP(i,nmax){
... |
s804756288 | p03816 | C++ | #include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
long long inf=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
long long c=a%i_7;
if(c>=0)return c;
return c+i_7;
}
using namespace std;
long long gcd(long long a, long long b){
if(a<b){
swap(a,b);
}
if(a%b==0){
re... | a.cc: In function 'int main()':
a.cc:2:18: error: expected ',' or ';' before 'for'
2 | #define REP(i,n) for(int i=0;i<n;i++)
| ^~~
a.cc:82:3: note: in expansion of macro 'REP'
82 | REP(i,100010){
| ^~~
a.cc:82:7: error: 'i' was not declared in this scope
82 | REP(i,100010){
... |
s767384079 | p03816 | C++ | #include <iostream>
#include <utility>
#include <vector>
using namespace std;
#define ll long long
int main () {
ll n;
cin >> n;
ll a[n];
for (ll i = 0; i < n; i++) {
cin >> a[i];
}
sort(a, a + n);
vector<pair<ll, ll> > box;
ll now = 0;
ll num = 0;
for (ll i = 0; i < n; i++) {
if (i =... | a.cc: In function 'int main()':
a.cc:14:3: error: 'sort' was not declared in this scope; did you mean 'short'?
14 | sort(a, a + n);
| ^~~~
| short
|
s188350922 | p03816 | C++ | #include<cstdio>
#include<iostream>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<set>
#define ll long long
using namespace std;
int main()
{
int n;
set<int>s;
cin>>n;
for(int i = 0; i < n; i++){
int t;
cin>>t;
s.insert(t);
}
int num = s.size();
int a... | a.cc: In function 'int main()':
a.cc:21:8: error: 'more' was not declared in this scope
21 | if(more % 2 != 0)ans = num+1;
| ^~~~
|
s362244692 | p03816 | C++ | /*g++ file.cpp -o file.out*/
/*./file.out*/
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
#define LL long long
#define Mod 1000000007
#define L_Mod 17100000013
#define rep(i,n) ... | a.cc: In function 'int main()':
a.cc:32:5: error: 'return0' was not declared in this scope
32 | return0;
| ^~~~~~~
|
s310300366 | p03816 | C++ | #include<cstdio>
#include<algorithm>
using namespace std;
int arr[100005];
int main(){
int n, x;
scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("%d",&x);
if(!arr[x]){
arr[x] = 1;
cnt++;// 记录不重复的数字
}
}
printf("%d\n",(n-cnt)&1?cnt-1:cnt);
return 0;
}
| a.cc: In function 'int main()':
a.cc:13:13: error: 'cnt' was not declared in this scope; did you mean 'int'?
13 | cnt++;// 记录不重复的数字
| ^~~
| int
a.cc:16:22: error: 'cnt' was not declared in this scope; did you mean 'int'?
16 | printf("%d\n",(n-cnt)&1?cnt-1:cnt);
... |
s281652861 | p03816 | C++ | #include<cstdio>
#include<algorithm>
using namespace std;
int arr[100005];
int main(){
int N, x;
scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("%d",&x);
if(!arr[x]){
arr[x] = 1;
cnt++;// 记录不重复的数字
}
}
printf("%d\n",(n-cnt)&1?cnt-1:cnt);
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:17: error: 'n' was not declared in this scope
8 | scanf("%d",&n);
| ^
a.cc:13:13: error: 'cnt' was not declared in this scope; did you mean 'int'?
13 | cnt++;// 记录不重复的数字
| ^~~
| int
a.cc:16:22: error:... |
s791352609 | p03816 | Java | import java.util.*;
public class Main {
public static void main (String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
HashSet<Integer> set = new HashSet<>();
int count = 0;
for (int i = 0; i < n; i++){
int x = sc.nextInt();
if (set.contains(x)){
... | Main.java:35: error: class, interface, enum, or record expected
count++;
^
Main.java:36: error: class, interface, enum, or record expected
count = count / 2 * 2;
^
Main.java:37: error: class, interface, enum, or record expected
System.out.println(n - count);
^
Main.java:38: error... |
s597316982 | p03816 | C++ | import collections
N = int(input())
A = [int(i) for i in input().split()]
con = collections.Counter(A)
ans = len(set(A))
tmp = 0
for i in con.values():
if i % 2 == 0:
tmp += 1
if tmp % 2 != 0:
ans -= 1
print(ans) | a.cc:1:1: error: 'import' does not name a type
1 | import collections
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s257644130 | p03816 | C++ | #include<iostream>
#include<algorithm>
#include<string>
#include<math.h>
#include<cmath>
#include<vector>
#include<stack>
#include<queue>
#include<functional>
#include<map>
#include<set>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define ll long long
int main(){
int n;
cin >> n;
int a[(int)1e5+1]={... | a.cc: In function 'int main()':
a.cc:35:18: error: expected '}' at end of input
35 | return 0;
| ^
a.cc:15:11: note: to match this '{'
15 | int main(){
| ^
|
s773700401 | p03816 | C++ | #include<iostream>
#include<algorithm>
#include<string>
#include<math.h>
#include<cmath>
#include<vector>
#include<stack>
#include<queue>
#include<functional>
#include<map>
#include<set>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define ll long long
int main(){
int n;
cin >> n;
int a[(int)1e5+1]={... | a.cc: In function 'int main()':
a.cc:35:18: error: expected '}' at end of input
35 | return 0;
| ^
a.cc:15:11: note: to match this '{'
15 | int main(){
| ^
|
s542475964 | p03816 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i=0;i<(n);++i)
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int n;cin >> n;
vector<int> cnt(100001);
rep(i,n){
int a;
cin >> a;
cnt[a]++;
... | a.cc: In function 'int main()':
a.cc:23:36: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
23 | if(ans%2==0) cout << ans-1 << end;
| ~~~~~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/istream:4... |
s549241661 | p03816 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i=0;i<(n);++i)
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int n;cin >> n;
vector<int> cnt(100001);
rep(i,n){
int a;
cin >> a;
cnt[a]++;
... | a.cc: In function 'int main()':
a.cc:32:32: error: 'emdl' was not declared in this scope
32 | cout << ans << emdl;
| ^~~~
|
s437074737 | p03816 | Java | import java.util.LinkedList;
import java.util.Scanner;
public class Cards {
public static void main(String[] args) {
// TODO Auto-generated method stub
@SuppressWarnings("resource")
Scanner scan = new Scanner(System.in);
LinkedList<Integer> l = new LinkedList<Integer>();
int x = scan.nextInt();
int count... | Main.java:4: error: class Cards is public, should be declared in a file named Cards.java
public class Cards {
^
1 error
|
s650303697 | p03816 | Java | import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedList;
import java.util.Scanner;
import java.util.Stack;
import javax.swing.ScrollPaneConstants;
import org.omg.Messaging.SyncScopeHelper;
public class Solution {
static Scanner input = new Scanner(System.in);
... | Main.java:11: error: class Solution is public, should be declared in a file named Solution.java
public class Solution {
^
Main.java:9: error: package org.omg.Messaging does not exist
import org.omg.Messaging.SyncScopeHelper;
^
2 errors
|
s438467120 | p03816 | Java | import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedList;
import java.util.Scanner;
import java.util.Stack;
import javax.swing.ScrollPaneConstants;
import javax.swing.text.AbstractDocument.LeafElement;
public class main {
static Scanner input = new Scanner(System... | Main.java:10: error: class main is public, should be declared in a file named main.java
public class main {
^
1 error
|
s913220006 | p03816 | C++ | #include<iostream>
#include<string>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<vector>
#include<functional>
#include<iomanip>
#include<queue>
#include<cassert>
#include<tuple>
#include<set>
#include<map>
#include<list>
#include<bitset>
#define PB push_back
#define ALL(a) (a).begin... | In file included from /usr/include/c++/14/set:62,
from a.cc:13:
/usr/include/c++/14/bits/stl_tree.h: In instantiation of 'std::pair<std::_Rb_tree_node_base*, std::_Rb_tree_node_base*> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_get_insert_unique_pos(const key_type&) [with _Key = int; _... |
s493138100 | p03816 | C++ | #include <bits/stdc++.h>
using namespace std;
int a[1000005];
int n,sum;
int cmp(int a,int b)
{
return a>b;
}
int main()
{
int x;
int t=0;
cin>>n;
for(int i=0; i<n; i++)
{
cin>>x;
a[x]++;
}
int cnt=t;
//cout<<t<<endl;
for(int i=0; i<100000; i++)
{
if(... | a.cc: In function 'int main()':
a.cc:25:18: error: expected ';' before ':' token
25 | cnt++:
| ^
| ;
a.cc:51:21: error: 'j' was not declared in this scope
51 | for(j=i+1; j<100000; j++)
| ^
|
s861418047 | p03816 | C++ | // G++ MACRO.CPP -STD=C++17
#include <bits/stdc++.h>
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
using namespace std;
#define dump(x) cout << #x << " = " << (x) << endl;
#define YES(n) cout << ((n) ? "YES" : "NO" ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No" ) << ... | a.cc: In function 'int main()':
a.cc:38:21: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::map<long long int, long long int>')
38 | #define COUT(x) cout<<(x)<<endl
| ~~~~^~~~~
| |
| std::o... |
s850161303 | p03816 | C++ | // G++ MACRO.CPP -STD=C++17
#include <bits/stdc++.h>
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
using namespace std;
#define dump(x) cout << #x << " = " << (x) << endl;
#define YES(n) cout << ((n) ? "YES" : "NO" ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No" ) << ... | a.cc: In function 'int main()':
a.cc:38:21: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::map<long long int, long long int>')
38 | #define COUT(x) cout<<(x)<<endl
| ~~~~^~~~~
| |
| std::o... |
s526269786 | p03816 | C++ | #include<iostream>
#include<map>
using namespace std;
int main(){
int n,sum=0,a[100000];
map<int,bool> m={};
cin>>n;
for(int i=0;i<n;i++){
cin>>a[i];
if(!m[a[i]]){
m[a[i]]=true;
sum++;
}
cout<<(sum%2==0?sum:sum-1);
} | a.cc: In function 'int main()':
a.cc:15:2: error: expected '}' at end of input
15 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s769704465 | p03816 | C++ | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <li... | a.cc: In function 'int main()':
a.cc:51:23: error: no matching function for call to 'max(int, ll)'
51 | rep(i, N) res += max(0, c[i]-1);
| ~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: not... |
s266719703 | p03816 | C++ | #include <stdio.h>
int main(void) {
// your code goes here
int d[10000];
int N;
scanf("%d",N);
for(int i = 0; i < N; i++)scanf("%d",d[i]);
sort(d, d+N);
int ln = -1;
int cout;
for(int i = 0; i < N; i++)if(ln == d[i])cout++;
if(cout % 2 != 0)printf("%d",cout);
if(cout % 2 == 0)printf("%d",cout-1);
return ... | a.cc: In function 'int main()':
a.cc:10:9: error: 'sort' was not declared in this scope; did you mean 'short'?
10 | sort(d, d+N);
| ^~~~
| short
|
s497348698 | p03816 | C++ | #include <iostream>
#include <algorithm>
using namespace std ;
int main(int argc, char** argv) {
int n , elements ;
cin >> n ;
int arr[n] ;
for ( int i = 0 ; i < n ; i++ ) {
cin >> arr[i] ;
}
sort ( arr , arr + n ) ;
elements = unique( arr , arr + n ) - arr ;
if ( elements % 2 == 0 ) {
elements -- ;
}
cou... | a.cc: In function 'int main(int, char**)':
a.cc:16:25: error: expected ';' before 'return'
16 | cout << elements
| ^
| ;
17 | return 0;
| ~~~~~~
|
s437140511 | p03816 | C++ | #include <Bits/stdc++.h>
using namespace std ;
int main(int argc, char** argv) {
int n , elements ;
cin >> n ;
int arr[n] ;
for ( int i = 0 ; i < n ; i++ ) {
cin >> arr[i] ;
}
sort ( arr , arr + n ) ;
elements = unique( arr , arr + n ) - arr ;
cout << elements ;
return 0;
} | a.cc:1:10: fatal error: Bits/stdc++.h: No such file or directory
1 | #include <Bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s511070478 | p03816 | C++ | #include <bits/stdc++.h>
using namespace std;
int ar[1000000],cc[100050];
vector<pair<int,int> > gg[100050];
map<int,int> o;
int main()
{
int n;
cin>>n;
for(int i=0;i<n;i++){
cin>>ar[i];
cc[ar[i]]++;
}
sort(ar,ar+n);
long long h=0,l=0;
for(int i=0;i<100050;i++){
int x;
if(cc[i]!=0){
if(cc[i]%2==0)
h++;... | a.cc: In function 'int main()':
a.cc:23:4: error: expected ';' before '}' token
23 | l++
| ^
| ;
......
26 | }
| ~
|
s011939971 | p03816 | Java |
import java.util.Scanner;
import java.math.*;
public class Solve {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scan = new Scanner(System.in);
int N = scan.nextInt();
int counter = 0;
int[] array = new int[N];
for (int i = 0; i < N; i++) {
array[i] = scan.next... | Main.java:6: error: class Solve is public, should be declared in a file named Solve.java
public class Solve {
^
1 error
|
s845026873 | p03816 | C++ | // 170516.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//
#include "stdafx.h"
#include <iostream>
#include <vector>
using namespace std;
int main()
{
int N; cin >> N;
vector<int>A(N);
vector<int>cnt(100001);
for (int i = 0; i < N; i++) {
cin >> A[i];
cnt[A[i]]++;
}
int cnt2 = 0;
int ans = 0;
for (int i = 0; i < ... | a.cc:4:10: fatal error: stdafx.h: No such file or directory
4 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s023844890 | p03816 | C++ | #include<cstdio>
#include<vector>
#include<iostream>
using namespace std;
int gcd(int a,int b){if(a<b){swap(a,b);}if(b==0){return a;}return gcd(a%b,b);}
int main(void){
int N,i,q,am=0;
vector<bool> a;
scanf("%d",&N);
ans.resize(100000);
for(;N>0;N--){
scanf("%d",&q);
if(a[q]){am++;}
a[q]=true;
}
if(am%2){a... | a.cc: In function 'int main()':
a.cc:10:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
10 | ans.resize(100000);
| ^~~
| abs
|
s531056729 | p03816 | C++ | #include<cstdio>
#include<algorithm>
#include<vetor>
int N;
std::vector<int> A;
int lgd = 0;
int lg, cnt = 0, ans, in;
int main(){
scanf("%d", &N);
ans = N;
for(int l = 0; l < N; l++){
scanf("%d", &in);
A.push_back(in);
}
std::sort(A.begin(), A.end());
lg = A[0];
for(int l = 1; l < N; l++){
... | a.cc:3:9: fatal error: vetor: No such file or directory
3 | #include<vetor>
| ^~~~~~~
compilation terminated.
|
s724039288 | p03816 | C++ | #include<cstdio>
#include<algorithm>
#include<tuple>
int N;
int A[100002];
int lgd = 0;
int lg, cnt = 0, ans;
int main(){
scanf("%d", &N);
ans = N;
for(int l = 0; l < N; l++){
scanf("%d", &A[l]);
}
std::sort(A[0], A[N-1]);
lg = A[0];
for(int l = 1; l < N; l++){
if(lg == A[l]){
cnt++;
... | In file included from /usr/include/c++/14/algorithm:61,
from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h: In instantiation of 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]':
/usr/inclu... |
s919101662 | p03816 | C++ | #include<cstdio>
#include<algorithm>
#include<tuple>
int N;
int A[100002];
int lgd = 0;
int lg, cnt = 0;
int main(){
scanf("%d", &N);
ans = N;
for(int l = 0; l < N; l++){
scanf("%d", &A[l]);
}
std::sort(A);
lg = A[0];
for(int l = 1; l < N; l++){
if(lg == A[l]){
cnt++;
}else{
l... | a.cc: In function 'int main()':
a.cc:13:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
13 | ans = N;
| ^~~
| abs
a.cc:18:12: error: no matching function for call to 'sort(int [100002])'
18 | std::sort(A);
| ~~~~~~~~~^~~
In file included from /usr/include/c++/14/alg... |
s415975800 | p03816 | C++ | #include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<stack>
#include<queue>
#include<vector>
#include<algorithm>
#include <iomanip>
typedef long long int ll;
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define REP(i,n) for (int i=0;i<(n);i++)
#define EREP... | a.cc: In function 'int main()':
a.cc:46:23: error: incompatible types in assignment of 'bool' to 'bool [100010]'
46 | if(!(f[A[i]])){f=true;ans++;}
| ~^~~~~
|
s627633946 | p03816 | C++ | #include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
int main(void)
{
int N;
scanf("%d", &N);
vector<int> a;
vector<int> b;
priority_queue<int> c;
a.resize(N);
for (int i = 0; i < N; i++) {
scanf("%d", a.data() + i);
}
sort(a.begin(),... | a.cc: In function 'int main()':
a.cc:74:2: error: expected '}' at end of input
74 | }
| ^
a.cc:10:1: note: to match this '{'
10 | {
| ^
|
s589458138 | p03816 | C++ | #include<bits/stdc++.h>
using namespace std;
int N;
int A[100005];
int B[100005];
int main()
{
scanf("%d", &N);
int len = 0;
for(int i=0;i<N:i++)
{
scanf("%d", &A[i]);
B[A[i]]++;
len = max(len, A[i]);
}
int flag = 0;
int ans = 0;
for(int i=1;i<=len;i++)
{
... | a.cc: In function 'int main()':
a.cc:10:17: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
10 | for(int i=0;i<N:i++)
| ^
a.cc:10:20: error: found ':' in nested-name-specifier, expected '::'
10 | for(int i=0;i<... |
s422268666 | p03816 | C++ | #include<bits/stdc++.h>
using namespace std;
int N;
int A[100005];
int B[100005];
int main()
{
scanf("%d", &N);
int len = 0;
for(int i=0;i<N:i++;i++)
{
scanf("%d", &A[i]);
B[A[i]]++;
len = max(len, A[i]);
}
int flag = 0;
int ans = 0;
for(int i=1;i<=len;i++)
... | a.cc: In function 'int main()':
a.cc:10:17: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
10 | for(int i=0;i<N:i++;i++)
| ^
a.cc:10:20: error: found ':' in nested-name-specifier, expected '::'
10 | for(int i=... |
s004382767 | p03816 | C++ | #include<bits/stdc++.h>
using namespace std;
int N;
int A[100005];
int B[100005];
int main()
{
scanf("%d", &N);
for(int i=0;i<N:i++;i++)
{
}
}
| a.cc: In function 'int main()':
a.cc:9:17: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
9 | for(int i=0;i<N:i++;i++)
| ^
a.cc:9:20: error: found ':' in nested-name-specifier, expected '::'
9 | for(int i=0;... |
s580021922 | p03816 | C++ | #include <iostream>
#include <cstring>
#include <stdio.h>
using namespace std;
int a[100005];
int main(){
int n, i;
cin>>n;
for(i = 0; i<n; i++)
cin>>a[i];
sort(a, a+n);
int c = 1, e = 0, dis = 1;
for(i = 0; i<n-1; i++){
if(a[i] != a[i+1]){
dis++;
if(c%2 == 0)
e++;
c = 1;
}
else{
c++;
... | a.cc: In function 'int main()':
a.cc:14:9: error: 'sort' was not declared in this scope; did you mean 'short'?
14 | sort(a, a+n);
| ^~~~
| short
|
s583913182 | p03816 | Java | import java.util.HashSet;
public class Main {
public static void main(String[] args) {
HashSet<Integer> cards = new HashSet<Integer>();
Scanner sc = new Scanner(System.in);
int num = sc.nextInt();
for(int i = 0; i < num; i++) {
cards.add(sc.nextInt());
}
int res = cards.size();
if(r... | Main.java:6: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:6: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s089007285 | p03816 | C++ | #include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cst... | a.cc: In function 'int main()':
a.cc:177:34: error: expected ';' before ')' token
177 | P(ans.size()) - 1);
| ^
| ;
|
s852870981 | p03816 | C | #include<iostream>
#include<list>
using namespace std;
int main(void){
int i;
int N;
int A[100001];
int hoge[100001]={0};
int cnt=0;
scanf("%d",&N);
int ans = N;
for(i=0;i<N;i++){
scanf("%d",&A[i]);
hoge[A[i]]++;
}
for(i=1;i<N;i++){
if(hoge[i]>1)cnt+=(hoge[i] - 1);
}
if(cnt%2==0){ans -= cnt;}
els... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s711425657 | p03816 | C++ | #include<iostream>
#include<algorithm>
#include<set>
using namespace std;
int main(void)
{
int n;
while(cin>>n)
{
s.clear();
for(int i=0;i<n;i++)
{
int x;
cin>>x;
s.insert(x);
}
if(s.size()%2==0)
cout<<s.size()-1<<e... | a.cc: In function 'int main()':
a.cc:10:9: error: 's' was not declared in this scope
10 | s.clear();
| ^
|
s172960802 | p03816 | C |
int main(void){int a[100000],n,f[100001]={0},i,j,ans=0;scanf("%d",&n);for(i=0;i<n;i++){scanf("%d",&a[i]);f[a[i]]=1;}
for(i=0;i<n;i++)ans+=f[i+1];
printf("%lld\n",ans-ans%2?0:1);return 0;}
int main(void){int a[100000],n,f[100001]={0},i,j,ans=0;scanf("%d",&n);for(i=0;i<n;i++){scanf("%d",&a[i]);f[a[i]]=1;}
for(i=0;i<n;i... | main.c: In function 'main':
main.c:2:56: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
2 | int main(void){int a[100000],n,f[100001]={0},i,j,ans=0;scanf("%d",&n);for(i=0;i<n;i++){scanf("%d",&a[i]);f[a[i]]=1;}
| ^~~~~
mai... |
s697339195 | p03816 | C++ | /* template.cpp(shinobu_menkoi) {{{ */
#include <bits/stdc++.h>
using namespace std;
// clang-format off
#define GET_MACRO(_1, _2, _3, _4, NAME, ...) NAME
#define rep(...) GET_MACRO(__VA_ARGS__, rep4, rep3, rep2, rep1)(__VA_ARGS__)
#define rep1(n) rep2(_, n)
#define rep2(i, n) rep3(i, 0, n)
#define rep3(i, a, n) rep4(... | a.cc: In function 'int main()':
a.cc:82:11: error: no match for 'operator-' (operand types are 'vi' {aka 'std::vector<int>'} and 'int')
82 | print(v - sum % 2);
| ~ ^ ~~~~~~~
| | |
| | int
| vi {aka std::vector<int>}
In file included from /usr/inc... |
s641346586 | p03816 | C++ | #include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "set"
#include "functional"
#include "algorithm"
#include "math.h"
#include "utility"
using namespace std;
const long long int MOD = 1000000007;
int N;
int box;
int num[100001];
int s, e;
int box;
int ans=0;
int main() {
cin >> N;
for... | a.cc:18:5: error: redefinition of 'int box'
18 | int box;
| ^~~
a.cc:15:5: note: 'int box' previously declared here
15 | int box;
| ^~~
|
s998719894 | p03816 | C++ | #include <iostream>
#include <vector>
#include <map>
using namespace std;
int main(){
int n;
cin >> n;
vector<int> v;
for(int i = 0; i < n; i++){
int t;
cin >> t;
v.push_back(t);
}
sort(v.begin(),v.end());
vector<int> k;
map<int, int> counter;
for(int i = 0; i < n; i++){
if(counter.c... | a.cc: In function 'int main()':
a.cc:15:3: error: 'sort' was not declared in this scope; did you mean 'short'?
15 | sort(v.begin(),v.end());
| ^~~~
| short
|
s005149749 | p03816 | C++ | #include<iostream>
using namespace std;
int n, a, num[100001] = {}, max = 0, two = 0, ans = 0;
int main(){
cin >> n;
for (int i = 0; i < n; i++){
cin >> a;
num[a]++;
if (num[a] == 3){
num[a] = 1;
}
if (a > max){
max = a;
}
}
for (int i = 1; i <= max; i++){
if (num[i] > 0){
ans++;
}
... | a.cc: In function 'int main()':
a.cc:17:25: error: reference to 'max' is ambiguous
17 | if (a > max){
| ^~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/... |
s700816649 | p03816 | C++ | #include <vector>
#include <iostream>
using namespace std;
int main(){
int n;
cin >> n;
int a[n];
int i = 0, j = n-1, ans = n;
while(i < n){
cin >> a[i];
i++;
}
sort(a, a+n);
i = 0;
while(i < j){
while(a[i] != a[i+1] && i < n) i++;
while(a[j-1] != a[j] && j > 0) j--;
if(i == n-1 &... | a.cc: In function 'int main()':
a.cc:14:3: error: 'sort' was not declared in this scope; did you mean 'short'?
14 | sort(a, a+n);
| ^~~~
| short
|
s692074052 | p03816 | C++ | #include <algorithm>//min/max/sort(rand-access it)/merge
#include <array>
#include <bitset>
// #include <chrono>//std::chrono::/system_clock/steady_clock/high_resolution_clock/duration
#include <climits>//INT_MAX/INT_MIN/ULLONG_MAX
#include <cmath>//fmin/fmax/fabs/sin(h)/cos(h)/tan(h)/exp/log/pow/sqrt/cbrt/ceil/floor/r... | a.cc: In function 'int main()':
a.cc:80:33: error: 'm' was not declared in this scope
80 | for (int j = 0; j < m; ++j)
| ^
a.cc:82:25: error: 'rra' was not declared in this scope; did you mean 'rar'?
82 | cout << rra[i][j] << "\t";
| ... |
s376632638 | p03817 | C++ | #include <iostream>
using ll = long long;
using namespace std;
int main(){
ll x;
scanf("%lld", &x);
ll ans = 2*x/11;
x %= 11;
ans += (x+5)/6
printf("%lld\n", ans);
return 0;
} | a.cc: In function 'int main()':
a.cc:9:23: error: expected ';' before 'printf'
9 | ans += (x+5)/6
| ^
| ;
10 | printf("%lld\n", ans);
| ~~~~~~
|
s890737857 | p03817 | C++ | #include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#incl... | a.cc: In function 'int main()':
a.cc:144:2: error: expected '}' at end of input
144 | }
| ^
a.cc:133:26: note: to match this '{'
133 | /*signed*/int main(void) {
| ^
|
s029572944 | p03817 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for (ll i = 0; i < (n); ++i)
int main() {
ll x;
cin >> x;
if(x<=6){
cout << 1 << endl;
return(0);
}else if(x<=11){
cout << 2 << endl;
return(0);
}
ll q,r;
q = x/11;
r = x%11;
if(r == 0){
cout << ... | a.cc: In function 'int main()':
a.cc:22:3: error: expected '}' before 'else'
22 | else if(r <= 6){
| ^~~~
a.cc:20:13: note: to match this '{'
20 | if(r == 0){
| ^
|
s021167256 | p03817 | C++ | #include<iostream>
using namespace std;
int main(){
long long x;
cin >> x;
if(x < 6) cout << 1 << endl;
else if(x % 11 > 5) cout << (x / 11)*2 + 2 << endl;
else cout << (x / 11) *2 + 1 << endl;
return 0; | a.cc: In function 'int main()':
a.cc:10:12: error: expected '}' at end of input
10 | return 0;
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s939673836 | p03817 | C++ | #include<iostream>
using namespace std;
int main(){
long long x;
cin >> x;
if(x % 11 > 5) cout << (x / 11)*2 + 2 << endl;
else if(x % 11 == 1) cout << (x / 11)*2 << endl;
else cout << (x / 11) *2 + 1 << endl;
return 0; | a.cc: In function 'int main()':
a.cc:10:12: error: expected '}' at end of input
10 | return 0;
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s827911343 | p03817 | C++ | #include<iostream>
using namespace std;
int main(){
long long x;
cin >> x;
if(x % 11 > 5) cout << (x / 11)*2 + 2 << endl;
else id(x % 11 == 1) cout << (x / 11)*2 << endl;
else cout << (x / 11) *2 + 1 << endl;
return 0; | a.cc: In function 'int main()':
a.cc:8:8: error: 'id' was not declared in this scope
8 | else id(x % 11 == 1) cout << (x / 11)*2 << endl;
| ^~
a.cc:9:3: error: 'else' without a previous 'if'
9 | else cout << (x / 11) *2 + 1 << endl;
| ^~~~
a.cc:10:12: error: expected '}' at end of input... |
s886878206 | p03817 | C++ | #include<stdio.h>
#include<iostream>
#include<vector>
#include<math.h>
#include<queue>
#include<map>
#include<algorithm>
#include<string.h>
#include<functional>
#include<limits.h>
#include<stdlib.h>
#include<cmath>
#include<cstring>
#include<set>
#include<climits>
using namespace std;
#define intmax INT_MAX
#define lm... | a.cc: In function 'int main()':
a.cc:58:10: error: expected primary-expression before '%' token
58 | if(n!=0%%n!=5)cnt++;
| ^
|
s248670208 | p03817 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;
const int INF=1000000007;
int main() {
ll n;
cin >> n;
ll ans = 2*(n/11);
if(n%11==0) continue;
else if(n%11<=6) ans++;
else ans+=2;
cout << ans << endl;
}
| a.cc: In function 'int main()':
a.cc:12:15: error: continue statement not within a loop
12 | if(n%11==0) continue;
| ^~~~~~~~
|
s128442679 | p03817 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A;
cin >> A;
if(A <= 6){
cout << 1 << endl;
exit;
}
for(int YUNI = 0; YUNI < A; YUNI++){
} | a.cc: In function 'int main()':
a.cc:16:4: error: expected '}' at end of input
16 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s603745225 | p03817 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
typedef long long int ll;
int main()
{
ll res = 0;
res += (n/11)*2;
n %= 11;
if(n <= 5) res += 1;
else res += 2;
cout << res << endl;
} | a.cc: In function 'int main()':
a.cc:9:11: error: 'n' was not declared in this scope; did you mean 'yn'?
9 | res += (n/11)*2;
| ^
| yn
|
s009797078 | p03817 | C++ | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
int main() {
long long N;
cin>>N;
long long counter=0;
cout<<1<<endl;
if(N%11=0)
cout<<N*2/11<<endl;
else if(N%11<=6)
cout<<(N/11)*2+1<<endl;
else
cout<<N/11+2<<endl;}
| a.cc: In function 'int main()':
a.cc:10:7: error: lvalue required as left operand of assignment
10 | if(N%11=0)
| ~^~~
|
s080592562 | p03817 | C++ | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
const int N = pow(10,5);
vector<bool> isp(N+1, true);
void sieve() {
isp[0] = false;
isp[1] = false;
for (int i=2; pow(i,2)<=N; i++) {
if (isp[i]) for(int j=2; i*j<=N; j++) isp[i*j] = false;
}
}
int main() {
long long N,
cin... | a.cc: In function 'int main()':
a.cc:20:6: error: expected initializer before '>>' token
20 | cin>>N;
| ^~
|
s664821901 | p03817 | C++ | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
const int N = pow(10,5);
vector<bool> isp(N+1, true);
void sieve() {
isp[0] = false;
isp[1] = false;
for (int i=2; pow(i,2)<=N; i++) {
if (isp[i]) for(int j=2; i*j<=N; j++) isp[i*j] = false;
}
}
int main() {
long long N,
lon... | a.cc: In function 'int main()':
a.cc:20:3: error: expected unqualified-id before 'long'
20 | long long a[N];
| ^~~~
|
s895686210 | p03817 | C++ | //#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#define PI 3.14159265359
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
const long long INF= 1e+18+1;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll> >vvl;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
const ll MOD=1000... | a.cc: In function 'int main()':
a.cc:18:7: error: expected initializer before '%=' token
18 | ll x%=11;
| ^~
|
s175254636 | p03817 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define sz size()
#define bgn begin()
#define en end()
#define pb push_b... | a.cc: In function 'int main()':
a.cc:394:12: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>')
394 | cout<<cnt<endl;
| ~~~~~~~~~^~~~~
In file included from /usr/include/c++/14/regex:68,
... |
s643213642 | p03817 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define sz size()
#define bgn begin()
#define en end()
#define pb push_b... | a.cc: In function 'int main()':
a.cc:380:8: error: 'n' was not declared in this scope
380 | fo(i,n){
| ^
a.cc:5:31: note: in definition of macro 'fo'
5 | #define fo(a,b) for(int a=0;a<b;a++)
| ^
a.cc:390:11: error: expected ';' before '}' token
390 | x-=5... |
s121008790 | p03817 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define sz size()
#define bgn begin()
#define en end()
#define pb push_b... | a.cc: In function 'int main()':
a.cc:380:10: error: expected initializer before '+=' token
380 | int ans+=(x/11)*2;
| ^~
a.cc:382:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
382 | ans++;
| ^~~
| abs
a.cc:384:5: error: 'ans' was not declared in this sc... |
s024780322 | p03817 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define sz size()
#define bgn begin()
#define en end()
#define pb push_b... | a.cc: In function 'int main()':
a.cc:382:8: error: 'n' was not declared in this scope
382 | fo(i,n){
| ^
a.cc:5:31: note: in definition of macro 'fo'
5 | #define fo(a,b) for(int a=0;a<b;a++)
| ^
|
s465310766 | p03817 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i,n) for(int i=n; i>-1; --i)
#define ALL(a) (a).begin(),(a).end()
#define INIT(a,n,x); REP(i,(n)){ (a)[i]=(x); }
#define CINA(a,n); REP(i,(n)){ cin >> (a)[i... | a.cc: In function 'int main()':
a.cc:32:10: error: 'X' was not declared in this scope
32 | r = (X*2)/11;
| ^
|
s804386597 | p03817 | C++ | #include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define intll int long long
int main() {
intll n;
cin >> n;
if(n/11 == 0)
cout << n/11 *2 << endl;
else if(n/11 >=7)
cout << n/11*2 +2 << endl;
else
cout << n.11*2... | a.cc: In function 'int main()':
a.cc:16:14: error: expected ';' before numeric constant
16 | cout << n.11*2+1 << endl;
| ^~~
| ;
|
s723409875 | p03817 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
long long x; cin >> x;
ll ans = (x / 11) * 2;
x %= 11;
if (x > 0) ans++;
if (x > 6) ans++;
cout << ans << '\n';
} | a.cc: In function 'int main()':
a.cc:6:3: error: 'll' was not declared in this scope
6 | ll ans = (x / 11) * 2;
| ^~
a.cc:8:14: error: 'ans' was not declared in this scope; did you mean 'abs'?
8 | if (x > 0) ans++;
| ^~~
| abs
a.cc:9:14: error: 'ans' was not dec... |
s299320080 | p03817 | C++ | #include<iosteam>
using namespace std;
int main(){
long long x;
cin >> x;
long long ans;
ans = x*2/11;
if(ans*11==x) cout << ans << endl;
if(ans*11<x && ans*11<x-6) cout << ans+1 << endl;
} | a.cc:1:9: fatal error: iosteam: No such file or directory
1 | #include<iosteam>
| ^~~~~~~~~
compilation terminated.
|
s754080823 | p03817 | C | #include<stdio.h>
int main(){
long long int x;
scanf("%lld",&x);
long long int ans;
if(x11==0||x%11==6){
ans=x*2/11;;
}else{
ans=(x*2)/11+1;
}
printf("%lld\n",ans);
return 0;
}
| main.c: In function 'main':
main.c:6:8: error: 'x11' undeclared (first use in this function)
6 | if(x11==0||x%11==6){
| ^~~
main.c:6:8: note: each undeclared identifier is reported only once for each function it appears in
|
s413630500 | p03817 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
long long x;
scanf("%lld",&x);
x *= 2;
x = (x/11) + min(1,x%11);
printf("%lld",x);
}
| a.cc: In function 'int main()':
a.cc:7:19: error: no matching function for call to 'min(int, long long int)'
7 | x = (x/11) + min(1,x%11);
| ~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
... |
s801879493 | p03817 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = unsigned long long;
int main() {
ll x;
cin >> x;
ll result = 0;
ll div = x / 11;
ll mod = x % 11;
result += div * 2;
if (mod == 0) {
continue;
} else if (5 < mod) {
result += 2;
} else {
++result;
}
cout << result << endl;
}
| a.cc: In function 'int main()':
a.cc:13:5: error: continue statement not within a loop
13 | continue;
| ^~~~~~~~
|
s228963949 | p03817 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long x; cin>>x;
cout<<x/11*2;<<endl;
}
| a.cc: In function 'int main()':
a.cc:6:18: error: expected primary-expression before '<<' token
6 | cout<<x/11*2;<<endl;
| ^~
|
s017327414 | p03817 | C++ | #include <iostream>
#include <vector>
#include <cstring>
#include <algorithm> // sort
#define REP(i, n) for (long long i = 0; i < (n); i++)
typedef long long ll;
static const ll MOD = 1000000007;
static const ll INF = 1000000000000000000LL;
using namespace std;
//arc068_c
//サイコロの6と5を繰り返せば良い
//x / 11 と x / 6
int main... | a.cc: In function 'int main()':
a.cc:26:15: error: expected ';' before '}' token
26 | else res++
| ^
| ;
27 | }
| ~
|
s043675545 | p03817 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
long x;
long sum=0;
while(X>0){
if(sum%2==0)X-=6;
else X-=5;
sum++;
}
cout << sum;
} | a.cc: In function 'int main()':
a.cc:7:9: error: 'X' was not declared in this scope
7 | while(X>0){
| ^
|
s856981668 | p03817 | C++ | #include<iostream>
#include<cstring>
#include<cmath>
#include<queue>
#include<algorithm>
#define LL long long
#define INF 0x3f3f3f3f
using namespace std;
const int N=2e5+100;
int arr[N];
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
LL n;
while(cin>>n) {
LL ans=0;
... | a.cc: In function 'int main()':
a.cc:26:24: error: expected primary-expression before ';' token
26 | ans=n/11*2-;
| ^
|
s779017401 | p03817 | C++ | #include<iostream>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<cstring>
#include<cmath>
#include<ctime>
#include<algorithm>
#include<utility>
#include<stack>
#include<queue>
#include<vector>
#include<set>
#include<map>
#define EPS 1e-9
#define PI acos(-1.0)
#define INF 0x3f3f3f3f
#define LL long long
c... | a.cc:44:12: warning: missing terminating " character
44 | printf("%ll
| ^
a.cc:44:12: error: missing terminating " character
44 | printf("%ll
| ^~~~
a.cc:45:13: error: stray '\' in program
45 | d\n",res);
| ^
a.cc:45:15: warning: missing te... |
s673897085 | p03817 | C++ | #include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
using namespace std;
#define INF 0x7fffffff
#define PI acos(-1.0)
#define MOD 2520
#define E 1e-12
#define ll long long
using namespace std;
#define N 1500
int a[N];
int main()
{
ll n;
scanf("%lld",&n);
if(n==6)
{
cout<<1<<endl... | a.cc: In function 'int main()':
a.cc:21:17: error: return-statement with no value, in function returning 'int' [-fpermissive]
21 | return;
| ^~~~~~
|
s308175409 | p03817 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
ll x,ans;
cin >> x;
ans = x/11;
ans *= 2;
x %= 11;
if(x == 0);
else if(x <= 5)ans++;
else ans += 2;
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:4:3: error: 'll' was not declared in this scope
4 | ll x,ans;
| ^~
a.cc:5:10: error: 'x' was not declared in this scope
5 | cin >> x;
| ^
a.cc:6:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
6 | ans = x/11;
| ^~~... |
s070134132 | p03817 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
long long x, cnt = 0;
cin >> x;
if(x > 11){
cnt = x / 11;
x %= 11;
}
if(x == 0) cout << cnt * 2 << endl;
else if((x < 7) && (x > 0)) cout << 1 + cnt * 2 << endl;
else if((x < 11) && (x > 0))cout << 2 + cnt * 2 << endl;
return 0;
| a.cc: In function 'int main()':
a.cc:17:12: error: expected '}' at end of input
17 | return 0;
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s359365158 | p03817 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
long x;
cin >> x;
cout << max(1, min((x / 11) * 2 + 2, ((x + 4) / 11) * 2 + 1)) << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:7:16: error: no matching function for call to 'max(int, const long int&)'
7 | cout << max(1, min((x / 11) * 2 + 2, ((x + 4) / 11) * 2 + 1)) << endl;
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:... |
s906962807 | p03817 | C++ | #include <bits/stdc++.h>
using namespace std;
using lli = long long int;
using Vint = vector<int>;
using Vlli = vector<lli>;
using Wint = vector<Vint>;
using Wlli = vector<Vlli>;
using pii = pair<int, int>;
using pll = pair<lli, lli>;
const int MOD = 1e9 + 7;
const int INFi = 2e9 + 1;
const lli INFl = (lli)(9e18) + 1... | a.cc: In function 'int main()':
a.cc:39:12: error: expected '}' at end of input
39 | return 0;
| ^
a.cc:34:15: note: to match this '{'
34 | int main(void){
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.