submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s297701963 | p03958 | C++ | use std::io;
fn next_vec() -> Vec<i64> {
let mut buf = String::new();
io::stdin().read_line(&mut buf).unwrap();
buf.split_whitespace().map(|n| n.parse().unwrap()).collect()
}
fn main(){
let v = next_vec();
let k = v[0];
let t = v[1] as usize;
let mut a = next_vec();
a.sort();
let... | a.cc:1:1: error: 'use' does not name a type
1 | use std::io;
| ^~~
a.cc:3:1: error: 'fn' does not name a type
3 | fn next_vec() -> Vec<i64> {
| ^~
a.cc:9:1: error: 'fn' does not name a type
9 | fn main(){
| ^~
|
s249888160 | p03958 | C++ | #include <algorithm>
#include <iostream>
#define lim 100
using namespace std;
int main (void){
int K, T;
int a[lim]={};
int ans;
cin >> K >> T;
for(int i=0; i<T; i++){
cin >> a[i];
}
sort(a, a + 100);
/*
for(int i=99; i>100-T-5; i--){
cout << a[i];
}
... | a.cc: In function 'int main()':
a.cc:24:26: error: expected primary-expression before '>' token
24 | for(int i = lim-2; i=>0; i--){
| ^
|
s591829089 | p03958 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int k,t,ans=0;
cin >> k >> t;
vector<int> a(t);
for(int i=0;i<t;i++){
cin >> a[i];
}
int prev = -1;
while(1){
int x = 0;
for(int i=0;i<t;i++){
if(i == prev) continue;
if(a[x] < a[i]){
x = i;
}
}
if(a[x] <= 0) x = prev;
if(x == p... | a.cc: In function 'int main()':
a.cc:26:25: error: expected ';' before '}' token
26 | prev = x
| ^
| ;
27 | }
| ~
|
s601093402 | p03958 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int k,t;
cin >> k >> t;
vector<int> a(t);
for(int i=0;i<t;i++){
cin >> a[i];
}
int prev = -1;
while(1){
int x = 0;
for(int i=0;i<t;i++){
if(i == prev) continue;
if(a[x] < a[i]){
x = i;
}
}
if(a[x] <= 0) x = prev;
if(x == prev){
... | a.cc: In function 'int main()':
a.cc:23:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
23 | ans++;
| ^~~
| abs
a.cc:26:25: error: expected ';' before '}' token
26 | prev = x
| ... |
s970541319 | p03958 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(){
int k,t;
cin>>k>>t;
vector<int>vec;
for(int i=0;i<t;i++){
int x;cin>>x; vec.push_back(x);
}
int mini=1000000;
do{
int x=0;
for(int i=0;i+1<vec.size();i++){
if(vec[i]==vec[i+1])x++;
}
mini=min(mini,x);
}while(next_permutation(vec... | a.cc: In function 'int main()':
a.cc:19:47: error: expected ')' before ';' token
19 | }while(next_permutation(vec.begin(),vec.end());
| ~ ^
| )
|
s571907488 | p03958 | C++ | #include <cstdio>
#include <utility>
#include <typeinfo>
#include <cmath>
#include <numeric>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <map>
#include <stack>
#include <queue>
#include <string>
#include <vector>
#include <tuple>
#define REP(i,n) for(int i=0;i<n;i++)
typedef long long int ll;
u... | a.cc: In function 'int main()':
a.cc:31:16: error: 'max' cannot be used as a function
31 | cout << max(0,max - (k-max) -1 ) << endl;
| ~~~^~~~~~~~~~~~~~~~~~~~~
|
s803889377 | p03958 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <cstring>
using namespace std;
int k,t,ans=INT_MAX,dp[10010][110];
void f(int type, int n, int a[]){
if(n==k){
ans=min(ans,0);
return;
}
bool flag=false;
for(int i=0;i<t;i++){
if(type!=i&&a[i]>0){
a... | a.cc:7:13: error: 'INT_MAX' was not declared in this scope
7 | int k,t,ans=INT_MAX,dp[10010][110];
| ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
4 | #include <cstring>
+++ |+#include <climits>
5 | using names... |
s309040852 | p03958 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int K,T;
int cake[101];
int main(){
cin>>K>>T;
for(int i = 0; i < T; i++){
cin>>cake[i];
}
sort(cake,cake+T);
if(T == 1){
cout<<cake[0]-1<<endl;
}
else if(cake[T-1] - cake[T-2] > 1){
int sum = 0;
for(int i = 0; i < T-1; i... | a.cc: In function 'int main()':
a.cc:28:24: error: expected '}' at end of input
28 | else cout<<'0'<<endl;
| ^
a.cc:6:11: note: to match this '{'
6 | int main(){
| ^
|
s709009551 | p03958 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int K,T;
int cake[101];
int main(){
cin>>K>>T;
for(int i = 0; i < T; i++){
cin>>cake[i];
}
sort(cake,cake+T);
if(T == 1){
cout<<cake[0]-1<<endl;
}
else if(cake[T-1] - cake[T-2] > 1){
int sum = 0;
for(int i = 0; i < T-1; i... | a.cc: In function 'int main()':
a.cc:28:24: error: expected '}' at end of input
28 | else cout<<'0'<<endl;
| ^
a.cc:6:11: note: to match this '{'
6 | int main(){
| ^
|
s340331620 | p03958 | C | #include <stdio.h>
int find_max(int n, b[]){
int w,max=0,max_idx=0;
for(w=0;w<n;w++){
if(b[w]>max){
max=b[w];
max_idx=w;
}
}
return max_idx;
}
int main(void){
// Here your code !
int K,T,i, idx, cnt = 0;
scanf("%d%d",&K,&T);
int a[... | main.c:3:21: error: unknown type name 'b'
3 | int find_max(int n, b[]){
| ^
main.c: In function 'main':
main.c:28:15: error: implicit declaration of function 'find_max' [-Wimplicit-function-declaration]
28 | idx = find_max(T, a);
| ^~~~~~~~
main.c:34:13: erro... |
s740062481 | p03958 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(){
int K, T;
cin >> K >> T;
vector<int> v(T);
for(auto i = 0; i < T; i++)
cin >> v[i];
sort(v.begin(), v.end());
int p(0), q(T-1);
while(true){
// a b a b c a c
// a b ... | a.cc: In function 'int main()':
a.cc:37:5: error: 'reutrn' was not declared in this scope
37 | reutrn 0;
| ^~~~~~
|
s572422745 | p03958 | C++ | int main() {
int K, T; cin >> K >> T;
vector<pair<int, int>> vs;
rep(i, T) {
int x; cin >> x;
vs.push_back({x, i});
}
int last = -1;
int N = vs.size();
while(vs.size() > 1) { // T-1要素すべて消すまで回す。O(K)
sort(all(vs));
for(int i=N-1; i>=N-2; i--) {
if(last != vs[i].second) {
i... | a.cc: In function 'int main()':
a.cc:3:13: error: 'cin' was not declared in this scope
3 | int K, T; cin >> K >> T;
| ^~~
a.cc:4:3: error: 'vector' was not declared in this scope
4 | vector<pair<int, int>> vs;
| ^~~~~~
a.cc:4:10: error: 'pair' was not declared in this scope
4 |... |
s817816275 | p03958 | C++ | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
int main(){
int K,T;
priority_queue<int,vector<int>,greater<int>> queue;
int a[100];#include <iostream>
#include <vector>
#include <queue>
using namespace std;
int main(){
int K,T;
priority_queue<int,vector<int>,greater<int>> queu... | a.cc:10:14: error: stray '#' in program
10 | int a[100];#include <iostream>
| ^
a.cc: In function 'int main()':
a.cc:10:15: error: 'include' was not declared in this scope
10 | int a[100];#include <iostream>
| ^~~~~~~
a.cc:10:32: error: expected primary-expression before... |
s308347762 | p03958 | C++ | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
int main(){
int K,T;
priority_queue<int,vector<int>,greater<int>> queue;
int a[100];
int min=100000;
int max=-1;
int count = 0;
cin >> K >> T;
for(int i=0;i<T;i++){
cin >> a[i];
if(a[i]>max){
max=a[i];
}
... | a.cc: In function 'int main()':
a.cc:44:12: error: no match for 'operator+=' (operand types are 'int' and 'std::priority_queue<int, std::vector<int>, std::greater<int> >')
44 | count+=queue,top()*2;
| ~~~~~^~~~~~~
a.cc:44:20: error: 'top' was not declared in this scope
44 | count+=queue,to... |
s571684204 | p03958 | C++ | #include <vector>
#include<string>
#include <iostream>
using namespace std;
int k,t;
int a[111];
int b[111];
int solve() {
for (int i=0; i<t; i++) {
b[i] = a[i];
}
if(t == 1) return b[0];
while (true) {
sort(b, b+t);
reverse(b, b+t);
if(b[1] == 0) return b[0];
... | a.cc: In function 'int solve()':
a.cc:17:9: error: 'sort' was not declared in this scope; did you mean 'short'?
17 | sort(b, b+t);
| ^~~~
| short
a.cc:18:9: error: 'reverse' was not declared in this scope
18 | reverse(b, b+t);
| ^~~~~~~
|
s718857577 | p03958 | C++ | #include<iostream>
#include<string>
#include<algorithm>
#include<functional>
using namespace std;
int main(){
int k,t;
cin >> k >> t;
int a[105] ={},b[10005]={};;
for(int i =0; i < t;i++){
cin >> a[i];
}
if(t != 1){
int c = 0,nold = -1;
while(c < k){
// for(int i =0; i < t;i++)cout << a[i];
// cout <<... | a.cc: In function 'int main()':
a.cc:37:75: error: 'i7' was not declared in this scope; did you mean 'i'?
37 | if(a[i] != 0 && a[i] <= a[n] && (nold != i7 ))n = i;
| ^~
| ... |
s119704563 | p03958 | C | #include <stdio.h>
int main(void){
int K=6,T=3,i,max=0,maxi=0,k,count=0;
scanf("%d %d",&K,&T);
int a[T];
int a[3]={1,4,1};
i=0;
while(i<T){
scanf("%d",&a[i]);
i++;
}
while(count!=K){
k=0;
for(k=0;k<T;k++){
if(k==a[maxi]){
... | main.c: In function 'main':
main.c:9:9: error: redeclaration of 'a' with no linkage
9 | int a[3]={1,4,1};
| ^
main.c:8:9: note: previous declaration of 'a' with type 'int[T]'
8 | int a[T];
| ^
|
s249733040 | p03958 | C | #include <stdio.h>
#include<string.h>
int main(void) {
int t,k;
scanf("%d %d", &k,&t);
int a[t + 5];
for( int i= 0; i < t; i++){
scanf("%d", &a[i]);
}
int maxIndex = 0;
int minIndex = 0;
int max = 0;
int min = 0;
for(int i = 0; i< t; i++){
if(a[i] > max){
maxIndex = i;
max = a[i];
}
else ... | main.c: In function 'main':
main.c:24:31: error: expected expression before '<' token
24 | else if(a[i] =< min){
| ^
|
s221064310 | p03958 | C++ | use std::io::prelude::*;
use std::io;
fn read_to_string() -> String {
let mut buf = String::new();
let mut stdin = io::stdin();
stdin.read_to_string(&mut buf);
buf
}
fn solve(p: Vec<u64>, q: Vec<u64>) -> u64 {
let w = p.len();
let h = q.len();
let mut pq: Vec<_> = p.iter()
.map(|... | a.cc:1:1: error: 'use' does not name a type
1 | use std::io::prelude::*;
| ^~~
a.cc:2:1: error: 'use' does not name a type
2 | use std::io;
| ^~~
a.cc:4:1: error: 'fn' does not name a type
4 | fn read_to_string() -> String {
| ^~
a.cc:11:1: error: 'fn' does not name a type
11 | fn solve... |
s397029131 | p03958 | C++ | /* vim:set foldmethod=marker: */
#include <bits/stdc++.h>
using namespace std;
//{{{
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define REP(i,a,b) for(int i=(int)(a); i<(int)(b); i++)
#define RREP(i,a,b) for(int i=(int)(a); i>=b; i--)
#define rep(i,n) REP(i,0,n)
#define rrep(i,n) RREP... | a.cc: In function 'void solve()':
a.cc:47:15: error: no match for 'operator!=' (operand types are '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' and 'std::reverse_iterator<__gnu_cxx::__normal_iterator<int*, std::vector<int> > >')
47 | while (mn != mx) {
| ~~ ^~ ~~
| | ... |
s462372638 | p03958 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main(int argc, const char * argv[]) {
int K,T;
cin >> K >> T;
vector<int> a(T);
for(int i=0;i<T;i++){
cin >> a[i];
}
int tempIndex = 0;
int count =0;
sort(a.rbegin(),a.rend());
a[0]--;
for(int i=1;i<K;i+... | a.cc: In function 'int main(int, const char**)':
a.cc:14:5: error: 'sort' was not declared in this scope; did you mean 'short'?
14 | sort(a.rbegin(),a.rend());
| ^~~~
| short
|
s438019645 | p03958 | C++ | #include<iostream>
#include<vector>
#include<math.h>
#include <stdlib.h>
using namespace std;
int main() {
int a, c, ans = 0;
double b;
cin >> a >> b;
for(int i = 0; i < b; i++) {
cin >> c;
if(a / 2 < c) {
if((c - a / 2 <= 1) && (a % 2 == 1)) {
ans += (c - a / 2) * 2 - 1;
}
}
co... | a.cc: In function 'int main()':
a.cc:21:2: error: expected '}' at end of input
21 | }
| ^
a.cc:7:12: note: to match this '{'
7 | int main() {
| ^
|
s968719644 | p03958 | Java | import java.util.Arrays;
import java.util.Scanner;
public class KCakes {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int k, t;
int[] numberOfEach;
k = sc.nextInt();
t = sc.nextInt();
numberOfEach = new int [t];
for (int i=0; i<t ;++i) {
numberOfEach[i] = sc.nextInt... | Main.java:5: error: class KCakes is public, should be declared in a file named KCakes.java
public class KCakes {
^
1 error
|
s090763857 | p03958 | C++ | #include<iostream>
#include<vector>
#include<math.h>
#include <stdlib.h>
using namespace std;
int main() {
int a, c, ans = 0;
double b;
cin >> a >> b;
if(b != 1) {
for(int i = 0; i < b; i++) {
cin >> c;
if(a / 2 + 1 < c) {zzzz
ans += (c - a / 2) * 2 - 1;
}
}
}else {
ans ... | a.cc: In function 'int main()':
a.cc:14:26: error: 'zzzz' was not declared in this scope
14 | if(a / 2 + 1 < c) {zzzz
| ^~~~
|
s283547172 | p03958 | C | #include <stdio.h>
#include <stdlib.h>
int cmp(const void *a,const void *b){
return *(int *)b-*(int *)a;
}
int main(void){
int k,t,a[100],i,j,n,c=0,f[10000];
scanf("%d %d",&k,&t);
n=k;
for(i=0;i<t;i++)
scanf("%d",&a[i]);
qsort(a,t,sizeof(int),cmp);
while(n){
for(i=0;i<t;i++){
for(j=0;f[j]!=0... | main.c: In function 'main':
main.c:15:26: error: expected ')' before ';' token
15 | for(j=0;f[j]!=0;j++
| ~ ^
| )
16 | ;
| ~
main.c:22:5: error: expected expression before '}' token
22 | }
| ^... |
s640634166 | p03958 | C++ | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#inclu... | In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
from /usr/include/c++/14/algorithm:60,
from a.cc:1:
/usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _It... |
s599483544 | p03958 | C++ | #include <iostream>
#include<string>
#include<vector>
using namespace std;
int main() {
int K, T;
cin >> K >> T;
if (K == 1) {
cout << 0 << endl;
return;
}
if (T == 1) {
cout << K - 1 << endl;
return;
}
vector<int>a(T);
for (int i = 0; i < T; i++) {
cin >> a[i];
}
int fIndex = 0;
int sIndex = ... | a.cc: In function 'int main()':
a.cc:13:17: error: return-statement with no value, in function returning 'int' [-fpermissive]
13 | return;
| ^~~~~~
a.cc:17:17: error: return-statement with no value, in function returning 'int' [-fpermissive]
17 | return;
... |
s680135803 | p03958 | C++ | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
int main(){
int K;
cin >> K;
int T;
cin >> T;
int tmp = T;
vector<int> nums;
while(tmp--){
int element;
cin >> element;
nums.push_back(element);
}
pr... | a.cc: In function 'int main()':
a.cc:28:37: error: 'class std::vector<int>' has no member named 'push'
28 | tmp.push(t);
| ^~~~
|
s372051060 | p03958 | Java | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int k = sc.nextInt();
int t = sc.nextInt();
int a[];
int maxa = 0;
int maxi = 0;
a = new int[t];
for(int i = 0; i<t; i++){
a[i] = sc.nextInt();
if... | Main.java:20: error: > or ',' expected
if(maxa =< toai){
^
1 error
|
s540812215 | p03958 | Java | import java.util.Scanner;
public class Solution {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int K = sc.nextInt();
if (K == 1) {
System.out.println(0);
}
int T = sc.nextInt();
int[] a = new int[T];
for... | Main.java:3: error: class Solution is public, should be declared in a file named Solution.java
public class Solution {
^
1 error
|
s110085015 | p03958 | C++ | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int K = sc.nextInt();
if (K == 1) {
System.out.println(0);
}
int T = sc.nextInt();
int[] a = new int[T];
for (in... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.Scanner;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main {
| ^~~~~~
|
s669632025 | p03958 | Java | import java.util.Scanner;
public class Solution {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int K = sc.nextInt();
if (K == 1) {
System.out.println(0);
}
int T = sc.nextInt();
int[] a = new int[T];
for (int ... | Main.java:3: error: class Solution is public, should be declared in a file named Solution.java
public class Solution {
^
1 error
|
s771715320 | p03958 | Java | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int k = sc.nextInt();
int t = sc.nextInt();
int a[];
int maxa = 0;
int maxi = 0;
a = new int[t]
for(int i = 0; i<t; i++){
a[i] = sc.nextInt();
if(... | Main.java:10: error: ';' expected
a = new int[t]
^
1 error
|
s756357714 | p03958 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int k,t;
cin >> k >> t;
vector<int> a(t);
max = -1;
for(int i = 0; i < t; i++){
cin >> a[i];
if(max < a[i])
max = a[i];
}
int ans;
ans = k - ((k - max) * 2 + 1);
if(ans < 0)
ans = 0;
cout <... | a.cc: In function 'int main()':
a.cc:10:10: error: overloaded function with no contextual type information
10 | max = -1;
| ^
a.cc:13:17: error: call to non-'constexpr' function 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = int; _Alloc = std::alloca... |
s713306727 | p03958 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main()
{
int K, T;
cin >> K;
cin >> T;
vector<int> A(T);
int temp;
int temp_Index;
for(int i=0; i < T; i++)
cin >> A[i];
int cont = 0;
vector<int>::iterator maxIt;
size_t max_Index;
for(int t=K; t > 0; t--){
maxIt = max_e... | a.cc: In function 'int main()':
a.cc:21:13: error: 'max_element' was not declared in this scope
21 | maxIt = max_element(A.begin(), A.end());
| ^~~~~~~~~~~
|
s427875367 | p03958 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main(){
int K,T;
vector<int> a;
cin >> K >> T;
int input;
while(cin >> input){
a.push_back(input);
}
std::sort(a.begin(),a.end(),std::greater<int>());
if(T == 1){
cout << K - a[0];
}else{
int sum = 0;
for(int i = 1;i < a.size();i++){
su... | a.cc: In function 'int main()':
a.cc:13:14: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
13 | std::sort(a.begin(),a.end(),std::greater<int>());
| ^~~~
| qsort
|
s792650995 | p03958 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;
int main()
{
int k, t; cin >> k >> t;
vector<int>A(t);
for (int i = 0; i < t; i++) {
cin >> A[i];
}
sort(A.begin(), A.end(),greater<int>());
while(A.size()>1){
if (A.front() > A.back()) {
... | a.cc: In function 'int main()':
a.cc:30:37: error: expected '}' at end of input
30 | cout<<A.front() - 1 << endl;
| ^
a.cc:9:1: note: to match this '{'
9 | {
| ^
|
s738791212 | p03958 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main(){
int K,T;
vector<int> a;
cin >> K >> T;
int input;
while(cin >> input){
a.push_back(input);
}
sort(a.begin(),a.end(),std::greater<int>());
if(T == 1){
cout << K - a[0];
}else{
int sum = 0;
for(int i = 1;i < a.size();i++){
sum += ... | a.cc: In function 'int main()':
a.cc:13:9: error: 'sort' was not declared in this scope; did you mean 'short'?
13 | sort(a.begin(),a.end(),std::greater<int>());
| ^~~~
| short
|
s450821613 | p03958 | C++ | #include <cstdio>
#include <vector>
#include <algorithm>
#include <iostream>
#include <queue>
#include <string>
#include <cstdlib>
#include <set>
#include <map>
#include <conio.h>
#define INT long long
#define MOD 1000000007
#define oo 1987654321
using namespace std;
bool cmp(int a, int b){ return a>b; }
int k, t, p[1... | a.cc:10:10: fatal error: conio.h: No such file or directory
10 | #include <conio.h>
| ^~~~~~~~~
compilation terminated.
|
s996308892 | p03958 | Java | mport java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int t = sc.nextInt();
List<Integer> list = new LinkedLi... | Main.java:1: error: class, interface, enum, or record expected
mport java.util.Collections;
^
Main.java:2: error: class, interface, enum, or record expected
import java.util.LinkedList;
^
Main.java:3: error: class, interface, enum, or record expected
import java.util.List;
^
Main.java:4: error: class, interface, enum, ... |
s545808707 | p03958 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <queue>
using namespace std;
int main(){
int K,T;
cin>>K>>T;
vector<int> v(T);
int i,j,k;
for(i=0;i<T;i++) cin>>v[i];
priority_queue<pair<int,int>> qu;
for(i=0;i<T;i++) qu.push(make_pair(v[i],i));
int pre=-1;
int res=0;
while(!qu.empty()){
pa... | a.cc: In function 'int main()':
a.cc:30:34: error: decrement of member 'std::pair<int, int>::first' in read-only object
30 | qu.top().first--;
| ~~~~~~~~~^~~~~
|
s536854565 | p03958 | C++ | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#inclu... | a.cc: In function 'int main()':
a.cc:48:61: error: expected ')' before ';' token
48 | sort(cake.begin(), cake.end(),greater<int>();
| ~ ^
| )
|
s589437799 | p03958 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <set>
#include <queue>
#include <fstream>
#include <stdio.h>
#include <math.h>
using namespace std;
int main(int argc, const char * argv[]) {
int K,T;
int tt;
... | a.cc: In function 'int main(int, const char**)':
a.cc:20:12: error: 'INT_MIN' was not declared in this scope
20 | int max=INT_MIN;
| ^~~~~~~
a.cc:13:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
12 | #include <math.h>
+++ |+#incl... |
s786054638 | p03958 | C++ | #include "bits/stdc++.h"
using namespace std;
#define int long long
#define DEBUG 1
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define dump(o) if(DEBUG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DEBUG){cerr<<#o; for(auto &e:(o))ce... | a.cc: In function 'int main()':
a.cc:24:20: error: no matching function for call to 'max(int, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type)'
24 | cout << max(0,a[T - 1] - 1) << endl;
| ~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/a... |
s396001540 | p03958 | C++ | #include <iostream>
#include <cfloat>
#include <climits>
#include <list>
#include <algorithm>
using namespace std;
const int intinf = INT_MAX;
const long longinf = LONG_MAX;
const double doubleinf = DBL_MAX;
#define map std::unordered_map;
#define set std::unordered_set;
long long int f(int a, int b, int s, int p,... | a.cc: In function 'long long int f(int, int, int, int, std::__cxx11::list<int>)':
a.cc:28:23: error: no matching function for call to 'min(long long int&, int&)'
28 | cnt = std::min(j, p);
| ~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/inc... |
s865376891 | p03958 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <map>
#include <vector>
using namespace std;
#define debug(x) cout<<#x<<": "<<x<<endl
#define rep(i,a,b) for(int i=a;i<b;i++)
#define PB push_back
#define putn(x,n) cout<< fixed<< setprecision(n)<< x << endl;
typedef long long ll;
int main(){
cin.ti... | a.cc: In function 'int main()':
a.cc:26:41: error: expected ';' before '{' token
26 | sort(a.begin(), a.end()){
| ^
| ;
a.cc:41:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
41 | ... |
s421752576 | p03958 | C++ | #include <iostream>
#include <cstdio>
#include <cassert>
#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
using namespace std;
int ans;
int n,t,a[100],max;
int main() {
cin >> n >> t;
max = 0;
rep(i,n){
cin >> a[i];
if(max < a[i]) max = a[i];
}
if(max>n-max+1){
ans = max-(n-max)... | a.cc: In function 'int main()':
a.cc:11:3: error: reference to 'max' is ambiguous
11 | max = 0;
| ^~~
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/bits/ios_base.h:41,
from ... |
s354357445 | p03958 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
long long int K, T;
cin >> K >> T;
vector<long long int>a( T );
priority_queue<pair<long long int, long long int>, vector<long long int, long long int>, greater<pair<long long int, long long int>>>que;
for( size_t i = 0; i < T; i++ ) {
cin >> a[i];
qu... | In file included from /usr/include/c++/14/vector:66,
from /usr/include/c++/14/functional:64,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h: In instantiation of 'struct std::_Vector_base<long long int, lon... |
s989455982 | p03958 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main() {
int N = 0, day = 0;
cin >> N;
cin >> day;
vector<int> cakes;
int arg = 0;
for(int i = 0; i < N; i++) {
cin >> arg;
cakes.push_back(arg);
}
int max = *max_element(cakes.begin(), cakes.end());
... | a.cc: In function 'int main()':
a.cc:19:16: error: 'max_element' was not declared in this scope
19 | int max = *max_element(cakes.begin(), cakes.end());
| ^~~~~~~~~~~
|
s432261239 | p03958 | C++ | #include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<29
#define LINF LLONG_MAX/3
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define ALL(v) (v).begin(),(v).end()
#define all(v) ALL(v)
#define debug(x) cerr<<#x<<":... | a.cc:18:1: error: 'll' does not name a type; did you mean 'all'?
18 | ll gcd(ll a,ll b){
| ^~
| all
a.cc: In function 'int main()':
a.cc:45:17: error: 'i' was not declared in this scope
45 | sort(ALL(a[i]));
| ^
a.cc:11:17: note: in definition of macro 'ALL'
11 | #define ... |
s658407380 | p03958 | C++ | #include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
#include<queue>
#include<map>
#include<algorithm>
#include<complex>
#include<string>
#include<cstring>
using namespace std;
#define rep2(x,from,to) for(int x=(from);(x)<(to);(x)++)
#define rep(x,to) rep2(x,0,to)
#define INF 100000000
#define debug(x) ... | a.cc:23:5: error: 'int index' redeclared as different kind of entity
23 | int index;
| ^~~~~
In file included from /usr/include/string.h:462,
from /usr/include/c++/14/cstring:43,
from a.cc:10:
/usr/include/strings.h:50:20: note: previous declaration 'const char* index(cons... |
s296777781 | p03958 | C++ | #include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const int INF = 1<<29;
const double EPS = 1e-8;
typedef vector<int> vec;
typedef pair<int,int> P;
typedef long long ll;
int main(){
int K, T;
cin >> K >> T;
priority_queue<int> a;
for(int i=0;i<T;i++){
int temp;... | a.cc: In function 'int main()':
a.cc:24:30: error: expected primary-expression before '.' token
24 | int small = a.top(); .a.pop();
| ^
|
s166360245 | p03958 | C++ | #include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
#include<queue>
#include<map>
#include<algorithm>
#include<complex>
#include<string>
#include<cstring>
using namespace std;
#define rep2(x,from,to) for(int x=(from);(x)<(to);(x)++)
#define rep(x,to) rep2(x,0,to)
#define INF 100000000
#define debug(x) ... | a.cc:23:5: error: 'int index' redeclared as different kind of entity
23 | int index;
| ^~~~~
In file included from /usr/include/string.h:462,
from /usr/include/c++/14/cstring:43,
from a.cc:10:
/usr/include/strings.h:50:20: note: previous declaration 'const char* index(cons... |
s330677704 | p03958 | C++ | #include<stdio.h>
#include<vector>
#include<string>
#include<iostream>
using namespace std;
void solve(){
}
int main() {
int k,t;
int a[105];
cin>>k>>t;
for(int i=0;i<t;i++){
cin>>a[i];
}
sort(a,a+t);
int o=0;
for(int i=0;i<t-1;i++){
o+=a[i];
}
cout<<max(0,a... | a.cc: In function 'int main()':
a.cc:17:5: error: 'sort' was not declared in this scope; did you mean 'short'?
17 | sort(a,a+t);
| ^~~~
| short
|
s478240994 | p03958 | C++ | #include <iostream>
using namespace std;
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int K, T;
int a[100];
cin >> K >> T;
for(int i=0; i<T; i++) cin >> a[i];
sort(a, a+T);
int rest = 0;
for(int i=0; i<T-1; i++) rest += a[i];
cout << max(0, a[T-1] - rest - 1) << endl;
retu... | a.cc: In function 'int main()':
a.cc:12:5: error: 'sort' was not declared in this scope; did you mean 'short'?
12 | sort(a, a+T);
| ^~~~
| short
|
s726169869 | p03958 | C++ | #include <iostream>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cassert>
#include <algorithm>
#include <iterator>
#include <string>
#include <vector>
#include <list>
#include <deque>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <tuple>
#include <queue>
#... | a.cc: In function 'int main()':
a.cc:49:11: error: 'sum' was not declared in this scope
49 | int d=sum-v[t-1];
| ^~~
|
s710979719 | p03959 | C++ | #include <iostream>
//#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <queue>
//#include <deque>
//#include <bitset>
#include <math.h>
using namespace std ;
using ll = long long ;
//using ld = long double ;
using vll = vector<ll> ;
us... | a.cc: In function 'int main()':
a.cc:52:19: error: expected ']' before ')' token
52 | if(a[n-1!=b[0]){
| ^
| ]
|
s983455419 | p03959 | C++ | #include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(long long)(n);++i)
#define all(a) a.begin(), a.end()
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T&... | a.cc:48:3: error: expected unqualified-id before 'return'
48 | return 0;
| ^~~~~~
a.cc:49:1: error: expected declaration before '}' token
49 | }
| ^
|
s573748951 | p03959 | C++ | #include<bits/stdc++.h>
using namespace std;
/******* All Required define Pre-Processors and typedef Constants *******/
#define rep(i,n) for(int i=0; i<(n); ++i)
#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.rbegin(), cont.rend()
#define Dcout(a) cout << setprecision(20) << a << endl
#define ll lo... | a.cc: In function 'int main()':
a.cc:220:2: error: expected '}' at end of input
220 | }
| ^
a.cc:168:11: note: to match this '{'
168 | int main(){
| ^
|
s921103930 | p03959 | C++ | #include <bits/stdc++.h>
using namespace std;
using i64 = long long;
const i64 MOD = 1e9 + 7;
const i64 INF = i64(1e18) + 7;
template <typename T>
bool chmin(T& x, T y){
if(x > y){
x = y;
return true;
}
return false;
}
template <typename T>
bool chmax(T& x, T y){
if(x < y){
... | a.cc: In function 'int main()':
a.cc:99:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
99 | return;
| ^~~~~~
|
s287751305 | p03959 | C++ | #include <bits/stdc++.h>
using namespace std;
using i64 = long long;
const i64 MOD = 1e9 + 7;
const i64 INF = i64(1e18) + 7;
template <typename T>
bool chmin(T& x, T y){
if(x > y){
x = y;
return true;
}
return false;
}
template <typename T>
bool chmax(T& x, T y){
if(x < y){
... | a.cc: In function 'int main()':
a.cc:99:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
99 | return;
| ^~~~~~
|
s415803264 | p03959 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define all(x)... | a.cc: In function 'int main()':
a.cc:156:22: error: expected '}' at end of input
156 | cout << ans << endl;}
| ^
a.cc:108:12: note: to match this '{'
108 | int main() {
| ^
|
s326666864 | p03959 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define all(x)... | a.cc: In function 'int main()':
a.cc:112:10: error: expected ';' before '}' token
112 | cin>>a[i]}
| ^
| ;
a.cc:156:22: error: expected '}' at end of input
156 | cout << ans << endl;}
| ^
a.cc:108:12: note: to match this '{'
108 | int main() {
| ... |
s064103592 | p03959 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define all(x)... | a.cc: In function 'int main()':
a.cc:155:22: error: expected '}' at end of input
155 | cout << ans << endl;}
| ^
a.cc:134:5: note: to match this '{'
134 | else{
| ^
a.cc:155:22: error: expected '}' at end of input
155 | cout << ans << endl;}
| ^
a.cc... |
s931919269 | p03959 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define all(x)... | a.cc: In function 'int main()':
a.cc:112:10: error: expected ';' before '}' token
112 | cin>>a[i]}
| ^
| ;
a.cc:155:22: error: expected '}' at end of input
155 | cout << ans << endl;}
| ^
a.cc:134:5: note: to match this '{'
134 | else{
| ^
a.cc:15... |
s988427378 | p03959 | C++ | #pragma GCC optimize("Ofast", "unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
constexpr ll mod = 1000000007LL;
int main(void){
int N; cin >> N;
vector<int> T(N), A(N);
for (auto& ti : T) cin >> ti;
for (auto& ai : A) cin >> ai;
vector<int> d(N, 0);
d[0] = T[0];
d[N - 1] = ... | a.cc: In function 'int main()':
a.cc:24:17: error: expected primary-expression before '}' token
24 | }
| ^
a.cc:23:31: error: expected ';' before '}' token
23 | return
| ^
| ;
2... |
s285839645 | p03959 | C++ | #include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
#define ld long double
int gcd(int x, int y) { return (x % y)? gcd(y, x % y): y; } //最大公約数
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; } //最小公倍数
using Graph = vector<vector<ll>>;
ll inf=30000... | a.cc: In function 'int main()':
a.cc:54:19: error: no matching function for call to 'max(int, long long int)'
54 | ans=(ans*max(0,(1+min(min(ma[y-1]-mii,maa-mi[y-1]),min(maa-mii,ma[y-1]-mi[y-1])))))%p;
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file incl... |
s513579351 | p03959 | C++ | #include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
#define ld long double
int gcd(int x, int y) { return (x % y)? gcd(y, x % y): y; } //最大公約数
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; } //最小公倍数
using Graph = vector<vector<ll>>;
ll inf=30000... | a.cc: In function 'int main()':
a.cc:50:19: error: no matching function for call to 'max(int, long long int)'
50 | ans=(ans*max(0,(1+min(min(ma[y-1]-mii,maa-mi[y-1]),min(maa-mii,ma[y-1]-mi[y-1])))))%p;
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file incl... |
s386776850 | p03959 | C++ | #include<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define PI acos(-1)
#define pcnt __builtin_popcountll
#define rng(a) a.begin(), a.end()
#define sz(x) (int)(x).size()
#define v(T) vector<T>
#define vv(T) v(v(T))
#define fi first
#define se second
using namespace std;
using ll = long long;
using... | a.cc: In function 'int main()':
a.cc:86:112: error: expected ';' before '{' token
86 | if ((hs[n - i - 1] != 0 && as[i] != hs[n - i - 1]) || (us[n - i - 1] != 0 && as[i] > us[n - i - 1]) {
| ... |
s863289091 | p03959 | C++ | n = int(input())
t = list(map(int,input().split()))
a = list(map(int,input().split()))
ans = [0 for i in range(n)]
ans[0] = t[0]
ans[-1] = a[-1]
if n==1 and a[0]!=t[0]:
print(0)
exit()
for i in range(n-1):
if t[i]<t[i+1]:
ans[i+1] = t[i+1]
for i in range(1,n)[::-1]:
if a[i]<a[i-1]:
if an... | a.cc:1:1: error: 'n' does not name a type
1 | n = int(input())
| ^
|
s023753632 | p03959 | C++ | #pragma target("avx")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef unordered_map<ll, ll> U_MAP;
typedef priority_queue<ll> pq;
typedef priority_queue<ll, vector<ll>, greater<ll>> rpq;
const int INF = 1e9, MOD = 1e9 + ... | a.cc:92:14: error: macro "rep" passed 3 arguments, but takes just 2
92 | rep(i, 0, n) {
| ^
a.cc:16:9: note: macro "rep" defined here
16 | #define rep(i, n) for (ll(i) = 0; (i) < (int)(n); (i)++)
| ^~~
a.cc: In function 'int main()':
a.cc:92:3: error: 'rep' was not declared in t... |
s624184402 | p03959 | C++ | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
using namespace std;
typedef l... | a.cc: In function 'int main()':
a.cc:93:32: error: 'm' was not declared in this scope
93 | if(ma[i]==1&&mt[i]==1&&m[i]!=t[i]){
| ^
|
s995029426 | p03959 | C++ | 0#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ALL(a) (a).begin(),(a).end()
#define ALLR(a) (a).rbegin(),(a).rend()
#define spa << " " <<
#define test cout<<"test"<<endl;
#define fi first
#define se second
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define rep(i,n,m) f... | a.cc:1:2: error: stray '#' in program
1 | 0#include<bits/stdc++.h>
| ^
a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 0#include<bits/stdc++.h>
| ^
a.cc:21:11: error: 'pair' does not name a type
21 | using P = pair<ll, ll>;
| ^~~~
a.cc: In function 'll median... |
s207048245 | p03959 | C++ | #include <bits/stdc++.h>
using namespace std;
#define INF_LL 1LL << 40
#define INF 2000000000
#define MOD 1000000007
#define ll long long
#define all(x) x.begin(), x.end()
#define REP(i, a, b) for(int i = a; i < b; i++)
#define rep(i, n) REP(i, 0, n)
#define prique priority_queue
#define double float
typedef pair<int, ... | a.cc: In function 'int main()':
a.cc:55:9: error: expected primary-expression before '}' token
55 | }
| ^
|
s143462580 | p03959 | C++ | #include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<deque>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<un... | a.cc: In function 'void solve()':
a.cc:68:16: error: expected primary-expression before '=' token
68 | if(i === n - 1 || (i + 1 <= n - 1 && a[i] > a[i + 1])) {
| ^
|
s579404957 | p03959 | C++ | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define rep1(i,n) for(int i=1;i<=(int)(n);++i)
#define rep11(i,n) for(int i=1;i<(int)(n);++i)
#define repo(i,o,n) for(int i=o;i<(int)(n);++i)
#define repm(i,n) for(int i=(... | a.cc: In function 'int main()':
a.cc:37:37: error: expected primary-expression before '<' token
37 | if (a[0] != t[n-1]) cout << 0 < <endl;;
| ^
|
s602817089 | p03959 | C++ |
#include<bits/stdc++.h>
#include<math.h>
#include <stdio.h>
#include<vector>
#include<deque>
#include<stdlib.h>
#include <algorithm>
#include<set>
#include<map>
#include <limits>
#include<iomanip>
#include<string>
#define rep(i,n) for(int i = 0; i < n; i++)
typedef long long ll;
using namespace std;
#define llMAX nume... | a.cc: In function 'int main()':
a.cc:82:8: error: 's' was not declared in this scope
82 | if(s[i+1]<s[i]){
| ^
|
s451458042 | p03959 | C++ |
#include<bits/stdc++.h>
#include<math.h>
#include <stdio.h>
#include<vector>
#include<deque>
#include<stdlib.h>
#include <algorithm>
#include<set>
#include<map>
#include <limits>
#include<iomanip>
#include<string>
#define rep(i,n) for(int i = 0; i < n; i++)
typedef long long ll;
using namespace std;
#define llMAX nume... | a.cc: In function 'int main()':
a.cc:27:10: error: 'rec' was not declared in this scope; did you mean 'rep'?
27 | vector<rec> r(n);
| ^~~
| rep
a.cc:27:13: error: template argument 1 is invalid
27 | vector<rec> r(n);
| ^
a.cc:27:13: error: template argument 2 is... |
s936083234 | p03959 | C |
#define MAX 100010
#define MOD 1000000007
#define min(a,b) ((a)<(b)?a:b)
#define max(a,b) ((a)>(b)?a:b)
#define MAX 100010
int h[2][MAX];
int a[2][MAX];
int main(){
int i,j,n;
scanf("%d",&n);
for(j=0;j<2;j++){
for(i=0;i<n;i++){
scanf("%d",&(a[j][i]));
}
}
long int s=1;
int m=0;
for(i=... | main.c: In function 'main':
main.c:16:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
16 | scanf("%d",&n);
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 |
main.c:16:3: warning: incompatible implicit d... |
s670368564 | p03959 | C++ | #include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007LL;
long long GCD(long long a, long long b){return b == 0 ? a : GCD(b, a % b);}
long long fast_exp(long long base, long long exp, long long mod = MOD) {
long long tot = 1;
for(;exp > 0;exp >>= 1) {
if((exp & 1) == 1) tot = to... | a.cc: In function 'int main()':
a.cc:58:8: error: 'pref' was not declared in this scope; did you mean 'pre'?
58 | if(pref[n - 1] != suf[0]){
| ^~~~
| pre
|
s185577264 | p03959 | C++ | #include <bits/stdc++.h>
using namespace std;
long long MOD=1000000007LL;
int main(){
int N;
long long ans=1;
cin >> N;
vector<int> T(N);
vector<int> A(N);
for(auto &i:T)cin >> i;
for(auto &i:A)cin >> i;
vector<bool> t(N,false);
vector<bool> a(N,false);
for(int i=0;i<N;i++){
if(i==0)t[i]=true;
else ... | a.cc: In function 'int main()':
a.cc:37:37: error: expected ';' before '{' token
37 | else(!t[i] && !a[i]){
| ^
| ;
|
s053224683 | p03959 | C++ | #include<iostream>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<utility>
#include<algorithm>
#include<cstdio>
#include<iomanip>
#include<queue>
#include<stack>
#define ll int64_t
#define Rep(i, n) for (ll i = 0; i < n; i++)
using namespace std;
const int MOD = 1000000007;
int main(){
... | a.cc:82:2: error: stray '#' in program
82 | }#include<iostream>
| ^
a.cc:82:3: error: 'include' does not name a type
82 | }#include<iostream>
| ^~~~~~~
a.cc:99:11: error: redefinition of 'const int MOD'
99 | const int MOD = 1000000007;
| ^~~
a.cc:18:11: note: 'const int MOD' prev... |
s780475235 | p03959 | C++ | #include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<utility>
#include<cmath>
#include<string>
#include<cstring>
#include<map>
#include<queue>
#include<set>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define prin(arg) std::cout<<arg<<"\n"
#define prin2(arg... | a.cc: In function 'int main()':
a.cc:67:2: error: expected '}' at end of input
67 | }
| ^
a.cc:30:11: note: to match this '{'
30 | int main(){
| ^
|
s828372273 | p03959 | C++ | #include "pch.h"
//
/*
ll used[10];
ll maxi;
ll dfs(Graph& graph, ll v, ll deep) {
used[v] = 1;
vector<ll> maxd;
maxd.push_back(deep);
for (int i = 0; i < graph[v].size(); i++) {
if (used[graph[v][i].to] == 0) {
maxd.push_back(dfs(graph, graph[v][i].to, deep + 1));
}
}
sort(all(maxd), greater<ll>());
if ... | a.cc:1:10: fatal error: pch.h: No such file or directory
1 | #include "pch.h"
| ^~~~~~~
compilation terminated.
|
s415776716 | p03959 | Java | import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
long mod = 1000000007;
long ans1=1;
long[] t1=new long[n];
long[] a1=new long[n];
long[] ans=new long[n];
for(int i = 0; i<n; i++){
t1[i] = sc.nextLong();
... | Main.java:22: error: cannot find symbol
if(ti[i]>a1[i]){
^
symbol: variable ti
location: class Main
1 error
|
s202184426 | p03959 | C++ | /*------------------------------------------------------------------*/
/*------------------------- begin template -------------------------*/
/*------------------------------------------------------------------*/
// ref: tanakh <https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8>
// diff: using Parser
macro_rules! in... | a.cc:40:10: error: too many decimal points in number
40 | (0..$len).map(|_| read_value!($parser, $t)).collect::<Vec<_>>()
| ^~~~~~~
a.cc:160:2: error: invalid preprocessing directive #[
160 | #[allow(unused_imports)]
| ^
a.cc:7:1: error: 'macro_rules' does not name a type
7 | macr... |
s420611245 | p03959 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ldouble long double
#define llong long long int
#define print(x) cout << x << endl
#define ternary(condition, x, y) ((condition) ? x : y)
#define rep(i, n) for (int i = 0; i < n; ++i)
#define all(STL) STL.begin(), STL.end()
#define stl_rep(itr, STL) for (auto itr... | a.cc: In lambda function:
a.cc:33:53: error: expected '{' before ')' token
33 | ans *= min(t[i], [i]) % MOD;
| ^
a.cc: In function 'int main(int, char**)':
a.cc:33:43: error: no matching function for call to 'min(__gnu_cxx::__a... |
s031660512 | p03959 | C++ | N = int(input())
T = list(map(int, input().split()))
A = list(map(int, input().split()))
h = [[] for i in range(N)]
for i in range(N):
if i == 0:
h[i].append(T[i])
elif i == N - 1:
h[i].append(A[i])
else:
if T[i] > T[i - 1]:
h[i].append(T[i])
elif A[i] > A[i + 1]:... | a.cc:1:1: error: 'N' does not name a type
1 | N = int(input())
| ^
|
s819282149 | p03959 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template<typename Q_temp>
using smaller_queue = priority_queue <Q_temp, vector<Q_temp>, greater<Q_temp> >;
const int INF = (int) 2ae9;
const ll LINF = (ll) 4e18;
const... | a.cc:12:23: error: unable to find numeric literal operator 'operator""ae9'
12 | const int INF = (int) 2ae9;
| ^~~~
|
s554361967 | p03959 | C++ | n=int(input())
s=input().split()
s.insert(0,"0")
s.append("0")
ss=input().split()
ss.insert(0,"0")
s.append("0")
res=1
for i in range(1,n):
if int(s[i-1])!=int(s[i]):
if int(ss[i+1])!=int(ss[i]) and s[i]!=ss[i]:
res*=0
if int(ss[i])<int(s[i]):
res*=0
continue
elif int(ss[i])!=int(ss[i+1]):
if int(s[i])<... | a.cc:1:1: error: 'n' does not name a type
1 | n=int(input())
| ^
|
s007666057 | p03959 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;
typedef long long int ll;
#define INF 1 << 30
#define REP(i,n) for(ll i=0; i<(int)(n); i++)
#define FOR(i,k,n) for(ll i=(k);i<(int)(n);i++)
vector<bool> gen_sosuu(vector<bool> sosuu){
int size = sosuu.size();
REP(i,size){
sosuu[i] = t... | a.cc: In function 'int main()':
a.cc:55:18: error: 'ans' was not declared in this scope; did you mean 'abs'?
55 | REP(i,r-l-t) ans = (ans*c[l])%mod;
| ^~~
| abs
a.cc:58:20: error: 'ans' was not declared in this scope; did you mean 'abs'?
58 | if(b[0]!=a[n-1]) an... |
s333712269 | p03959 | C++ | #include<bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 1, 1, -1, -1};
int dx[]={1, -1, 0, 0, 1, -1, -1, 1};
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0... | a.cc: In function 'int main()':
a.cc:25:9: error: reference to 'tm' is ambiguous
25 | tm[0] = t[0] - 1;
| ^~
In file included from /usr/include/time.h:39,
from /usr/include/pthread.h:23,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
... |
s363463795 | p03959 | C++ | #include<bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 1, 1, -1, -1};
int dx[]={1, -1, 0, 0, 1, -1, -1, 1};
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0... | a.cc: In function 'int main()':
a.cc:25:9: error: reference to 'tm' is ambiguous
25 | tm[0] = t[0] - 1;
| ^~
In file included from /usr/include/time.h:39,
from /usr/include/pthread.h:23,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
... |
s582826776 | p03959 | C++ | # include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <bitset>
# include <complex>
#include<limits.h>
#include<unorde... | a.cc: In function 'int main()':
a.cc:47:36: error: expected primary-expression before '=' token
47 | if (a[i]<a[i + 1]) = 0;
| ^
|
s693196211 | p03959 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <bitset>
#include <cmath>
#include <string>
#include <fstream>
#define FI first
#define SE second
#define VE vector<int>
#define PB push_back
#define PA pair<int,int>
#define MA make_pair
#define LL long long
#define FOR... | a.cc: In function 'int main()':
a.cc:72:17: error: 't' was not declared in this scope
72 | (ans*=min(t[i],a[i]))%=INF;
| ^
a.cc:72:22: error: 'a' was not declared in this scope
72 | (ans*=min(t[i],a[i]))%=INF;
| ^
|
s835300788 | p03959 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <bitset>
#include <cmath>
#include <string>
#include <fstream>
#define FI first
#define SE second
#define VE vector<int>
#define PB push_back
#define PA pair<int,int>
#define MA make_pair
#define LL long long
#define FOR... | a.cc: In function 'int main()':
a.cc:71:9: error: expected primary-expression before ')' token
71 | )
| ^
a.cc:84:2: error: expected '}' at end of input
84 | }
| ^
a.cc:30:11: note: to match this '{'
30 | int main(){
| ^
|
s297538824 | p03959 | C++ | #include<iostream>
using namespace std;
int T[100000],A[100000],temp[100000]={0};
bool mt[100000]={0};
int main(){
int N,i,j=0;
unsigned __int64 ans=1;
cin>>N;
for(i=0;i<N;i++){
cin>>T[i];
}
for(i=0;i<N;i++){
cin>>A[i];
}
mt[0]=1;mt[N-1]=1;
for(i=1;i<N;i++){
if(T[i]!=T[i-1]) mt[i]=1;
if(A[N-1-i]... | a.cc: In function 'int main()':
a.cc:9:19: error: expected initializer before 'ans'
9 | unsigned __int64 ans=1;
| ^~~
a.cc:38:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
38 | ans=ans*temp[i]%100000007;
| ^~~
| abs
a.cc:42:19: er... |
s466308694 | p03959 | C++ | #include <iostream>
using namespace std;
#define MOD 1000000007
#define REPS(i, n) for(int i = 1; i <= n; i++)
#define min(a, b) (a < b) ? a : b
typedef long long ll;
int main()
{
int n, t[10002], a[10002];
cin >> n;
REPS(i, n) cin >> t[i];
REPS(i, n) cin >> a[i];
t[0] = a[n+1] = 0;
if(t[n] != a[1]){
... | a.cc:44:5: error: stray '@' in program
44 | yuto@DESKTOP-38451T9:/mnt/c/Users/yuto/Documents/ubuntu/atcoder/cf2016$ vim c.cpp
| ^
a.cc:45:5: error: stray '@' in program
45 | yuto@DESKTOP-38451T9:/mnt/c/Users/yuto/Documents/ubuntu/atcoder/cf2016$ g++ c.cpp
| ^
a.cc:46:5: error: stray '@' in pro... |
s055150111 | p03959 | C++ | #include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<functional>
#include<queue>
#include <iomanip>
#include<map>
#include<limits>
#include<cmath>
#include<algorithm>
#include<bitset>
#include<utility>
#include<complex>
#include<cstdlib>
#include<set>
#include<cctype>
#define DBG cerr << '!' ... | a.cc: In function 'int main()':
a.cc:60:28: error: no matching function for call to 'min(ll&, int&)'
60 | dp[i] = min(dp[i],now);
| ~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
... |
s353726086 | p03959 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <algorithm>
#include <cstdlib>
using namespace std;
typedef long long ll;
int a[100000];
int b[100000];
int h[100000];
int ah[100000];
int bh[100000];
const ll MOD = ll(1e9 + 7);
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
... | a.cc: In function 'int main()':
a.cc:25:9: error: 'memset' was not declared in this scope
25 | memset(ah, -1, sizeof ah);
| ^~~~~~
a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
6 | #include <cstdlib>
+++ |+#include <cstr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.