submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s117353128
p03779
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { ll n;cin>>n; ll sm = 0; rep(i,100000) { sm+=i; if (s >= n) { cout << i; return 0; } } }
a.cc: In function 'int main()': a.cc:11:9: error: 's' was not declared in this scope 11 | if (s >= n) { | ^
s838840307
p03779
C++
#include <bits/stdc++.h> using namespace std; int main(){ int x; cin >> x; int dp[x+1]; for(int i=0;i<=x;i++) dp[i]=1e9+1; dp[0]=0; dp[1]=1; dp[2]=2; dp[3]=2; int t=3; for(int i=4;i<=x;i++){ if(dp[i-t]==t) t++; dp[i]=t; } cout << dp[n] << endl; }
a.cc: In function 'int main()': a.cc:18:16: error: 'n' was not declared in this scope 18 | cout << dp[n] << endl; | ^
s781648588
p03779
C++
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <ctime> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define REP(i,n) for (int i = 0; i < (n); ++i) #define SORT(a) sort((a).begin(), (a).end()); #define UNIQ(a) SORT(a);(a).erase(unique((a).begin(), (a).end()), (a).end()); #define FIND(a,x) find((a).begin(), (a).end(), (x)) != (a).end() #define REVERSE(a) reverse((a).begin(), (a).end()); using namespace std; using ll = long long; using P = pair<int,int>; const int MOD = 1000000007; // 10^9 + 7 int main() { cin.tie(0); ios::sync_with_stdio(false); srand((unsigned)time(NULL)); int x; cin >> x; cout << ceil((sqrt(8 * x + 1) - 1) / 2); << endl; }
a.cc: In function 'int main()': a.cc:34:44: error: expected primary-expression before '<<' token 34 | cout << ceil((sqrt(8 * x + 1) - 1) / 2); << endl; | ^~
s589316114
p03779
C++
1
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 1 | ^
s676883532
p03779
C++
#include <iostream> #include <vector> #include <numeric> typedef long long ll; const int INF = 1e9; const int MOD = 1e9+7; const ll LINF = 1e18; using namespace std; #define rep(i, a, b) for (int i = a; i < b; i++) #define rrep(i, a, b) for (int i = a; i <= b; i++) #define revrep(i, s) for (int i = s-1; i > 0; i--) #define revrrep(i, s) for (int i = s-1; i >= 0; i--) #define all(a) begin((a)),end((a)) #define uniq(c) (c).erase(unique(all((c))), end((c))) long long solve(long long index, vector<int64_t> divs, long long X, long long now) { if (index > divs.size()) return LINF; if (X == now) return index; return std::min({solve(index + 1, divs, X, now + divs[index]), solve(index + 1, divs, X, now - divs[index]), solve(index + 1, divs, X, now)}); } int main() { long long X; cin >> X; vector<long long> divs(X); iota(divs.begin(), divs.end(), 1); cout << solve(0, divs, X, 0) << endl; }
a.cc: In function 'long long int solve(long long int, std::vector<long int>, long long int, long long int)': a.cc:26:20: error: no matching function for call to 'min(<brace-enclosed initializer list>)' 26 | return std::min({solve(index + 1, divs, X, now + divs[index]), | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 27 | solve(index + 1, divs, X, now - divs[index]), | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 28 | solve(index + 1, divs, X, now)}); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 1 provided a.cc: In function 'int main()': a.cc:36:22: error: could not convert 'divs' from 'vector<long long int>' to 'vector<long int>' 36 | cout << solve(0, divs, X, 0) << endl; | ^~~~ | | | vector<long long int>
s819356408
p03779
C++
#include <iostream> #include <map> #include <vector> #include <numeric> typedef long long ll; const int INF = 1e9; const int MOD = 1e9+7; const ll LINF = 1e18; using namespace std; #define rep(i, a, b) for (int i = a; i < b; i++) #define rrep(i, a, b) for (int i = a; i <= b; i++) #define revrep(i, s) for (int i = s-1; i > 0; i--) #define revrrep(i, s) for (int i = s-1; i >= 0; i--) #define all(a) begin((a)),end((a)) #define uniq(c) (c).erase(unique(all((c))), end((c))) long long solve(long long index, vector<int64_t> divs, long long X, long long now) { if (index > divs.size()) return LINF; if (X == now) return index; return min({solve(index + 1, divs, X, now + divs[index]), solve(index + 1, divs, X, now - divs[index]), solve(index + 1, divs, X, now)}); } int main() { long long X; cin >> X; vector<long long> divs(X); iota(divs.begin(), divs.end(), 1); cout << solve(0, divs, X, 0) << endl; }
a.cc: In function 'long long int solve(long long int, std::vector<long int>, long long int, long long int)': a.cc:27:15: error: no matching function for call to 'min(<brace-enclosed initializer list>)' 27 | return min({solve(index + 1, divs, X, now + divs[index]), | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 28 | solve(index + 1, divs, X, now - divs[index]), | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 29 | solve(index + 1, divs, X, now)}); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 1 provided a.cc: In function 'int main()': a.cc:37:22: error: could not convert 'divs' from 'vector<long long int>' to 'vector<long int>' 37 | cout << solve(0, divs, X, 0) << endl; | ^~~~ | | | vector<long long int>
s417858687
p03779
C++
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; typedef unsigned long long int ull; typedef long double ldb; typedef long long int ll; #define for01(k,n) for (ll i=k; i<n; i++) #define for02(k,n) for (ll j=k; j<n; j++) #define for03(k,n) for (ll k=k; k<n; k++) #define for11(k,n) for (ll i=k; i<=n; i++) #define for12(k,n) for (ll j=k; j<=n; j++) #define for13(k,n) for (ll k=k; k<=n; k++) #define pb push_back #define mp make_pair #define pf push_front #define popf pop_front #define popb pop_back #define vll vector<ll> #define f first #define s second #define pp pair <ll, ll> #define lb lower_bound #define ub upper_bound #define emp empty() #define beg begin() #define en end() #define si size() #define bk back() #define deci(n) fixed<<setprecision(n) #define mll map<ll,ll> #define mint map<int,int> #define mll_it map<ll,ll>::iterator #define mint_it map<int,int>::iterator #define p0(a) cout << a << " " #define p1(a) cout << a << "\n" #define mem(a,n) memset(a, n, sizeof(a)); // n = 0 OR -1 only #define MAX LLONG_MAX #define MIN LLONG_MIN #define MOD1 1000000007 #define MOD2 998244353 #define BOOST ios_base::sync_with_stdio(false); cin.tie(NULL) // CUSTOM HASH FUNCTION - O(1) struct custom_hash { static uint64_t splitmix64(uint64_t x) { // http://xorshift.di.unimi.it/splitmix64.c x += 0x9e3779b97f4a7c15; x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9; x = (x ^ (x >> 27)) * 0x94d049bb133111eb; return x ^ (x >> 31); } size_t operator()(uint64_t x) const { static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count(); return splitmix64(x + FIXED_RANDOM); } }; //gp_hash_table - Open Address Hash Table //gp_hash_table<int, int> table; const int RANDOM = chrono::high_resolution_clock::now().time_since_epoch().count(); struct chash { int operator()(int x) const { return x ^ RANDOM; } }; //gp_hash_table<key, int, chash> table; // Indexed Set typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indSet; /* FUNCTIONS: 1. The function "find_by_order" returns an iterator to the element at a given position: 2. The function "order_of_key" returns the position of a given element -> If the element does not appear in the set, we get the position that the element would have in the set -> O(log n)*/ void swap(multimap<char, int>& mp1, multimap<char, int>&mp2, char c1, char c2) { auto it1 = mp1.find(c1); auto it2 = mp2.find(c2); //p1(it1->s << " " << it2->s); mp1.erase(it1); mp2.erase(it2); mp1.insert(mp(c2, it2->s)); mp2.insert(mp(c1, it1->s)); } int main() { BOOST; ll X; cin >> X; ll sum = 0; for(int i = 1; ; i++) { sum += i; if(sum >= X) { cout << i << endl; return 0; } }
a.cc: In function 'int main()': a.cc:122:2: error: expected '}' at end of input 122 | } | ^ a.cc:107:1: note: to match this '{' 107 | { | ^
s118025675
p03779
C++
#include<bits/stdc++.h> using namespace std; int main(){ long x; int i=0; cin >> x; while(x!=0){ i++; if(x>=2*i+1)y-=i; else if(x==i)x-=i; } cout << i; }
a.cc: In function 'int main()': a.cc:9:17: error: 'y' was not declared in this scope 9 | if(x>=2*i+1)y-=i; | ^
s532400995
p03779
C++
11
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 11 | ^~
s237560569
p03779
C++
#include <bits/stdc++.h> using namespace std; #define ll long long #define REP(i,n) for(long long i=0;i<n;++i) #define REPP(i,m,n) for(long long i=m;i<n;++i) #define rep(i,n) for(long long i = n-1;i>=0;--i) #define repp(i,n,m) for(long long i = n-1; i >= m; --i) #define ALL(N) (N.begin(),N.end()) #define de cout << "line : " << __LINE__ << " debug" << endl; #define pb push_back #define pq priority_queue #define Dcout(N) cout << setprecision(20) << N << endl constexpr int INF = 2147483647; constexpr long long INFF = 9223372036854775807; signed main() { cin.tie(0); ios::sync_with_stdio(false); int X;cin >> X int ans = 0,cnt = 0; REP(i,N){ if(X <= cnt){ cout << i << endl; return 0; } else{ cnt += i; } } }
a.cc: In function 'int main()': a.cc:19:19: error: expected ';' before 'int' 19 | int X;cin >> X | ^ | ; 20 | int ans = 0,cnt = 0; | ~~~ a.cc:21:11: error: 'N' was not declared in this scope 21 | REP(i,N){ | ^ a.cc:4:38: note: in definition of macro 'REP' 4 | #define REP(i,n) for(long long i=0;i<n;++i) | ^ a.cc:22:17: error: 'cnt' was not declared in this scope; did you mean 'int'? 22 | if(X <= cnt){ | ^~~ | int
s364458275
p03779
C++
#include <bits/stdc++.h> using namespace std; #define ll long long #define REP(i,n) for(long long i=0;i<n;++i) #define REPP(i,m,n) for(long long i=m;i<n;++i) #define rep(i,n) for(long long i = n-1;i>=0;--i) #define repp(i,n,m) for(long long i = n-1; i >= m; --i) #define ALL(N) (N.begin(),N.end()) #define de cout << "line : " << __LINE__ << " debug" << endl; #define pb push_back #define pq priority_queue #define Dcout(N) cout << setprecision(20) << N << endl constexpr int INF = 2147483647; constexpr long long INFF = 9223372036854775807; signed main() { cin.tie(0); ios::sync_with_stdio(false); int X; int ans = 0,cnt = 0; REP(i,N){ if(X <= cnt){ cout << i << endl; return 0; } else{ cnt += i; } } }
a.cc: In function 'int main()': a.cc:21:11: error: 'N' was not declared in this scope 21 | REP(i,N){ | ^ a.cc:4:38: note: in definition of macro 'REP' 4 | #define REP(i,n) for(long long i=0;i<n;++i) | ^
s516548649
p03779
C++
#include<bits/stdc++.h> using namespace std ; int main(){ intn , sum , x ; sum = 0 ; cin >> x ; for(int i=1; sum<x; i++){ sum += i ; n = i ; } cout << n << endl ; }
a.cc: In function 'int main()': a.cc:5:3: error: 'intn' was not declared in this scope; did you mean 'int'? 5 | intn , sum , x ; | ^~~~ | int a.cc:5:10: error: 'sum' was not declared in this scope 5 | intn , sum , x ; | ^~~ a.cc:5:16: error: 'x' was not declared in this scope 5 | intn , sum , x ; | ^ a.cc:10:5: error: 'n' was not declared in this scope 10 | n = i ; | ^ a.cc:12:11: error: 'n' was not declared in this scope; did you mean 'yn'? 12 | cout << n << endl ; | ^ | yn
s403990130
p03779
C++
#include <iostream> #include <cmath> using namespace std; int main(){ long long int X; long long int A; cin >> X; A = X; X *= 2LL; long long int x = sqrt(X); x++; long long int ans = 0LL; while(x>=0){ if(x * (x+1) == X){ ans = x; break; }else if(x * (x+1) < X){ x++; long long int d = x (x+1) / 2 - Z; if(d <= x) ans = x - 1; else ans = x + 1; break; } x--; } cout << ans; }
a.cc: In function 'int main()': a.cc:21:27: error: 'x' cannot be used as a function 21 | long long int d = x (x+1) / 2 - Z; | ~~^~~~~ a.cc:21:39: error: 'Z' was not declared in this scope 21 | long long int d = x (x+1) / 2 - Z; | ^
s171922158
p03779
C++
#define _USE_MATH_DEFINES #include <bits/stdc++.h> using namespace std; #define rep(i, n) REP(i, 0, n) #define ALL(v) v.begin(), v.end() #define MSG(a) cout << #a << " " << a << endl; #define REP(i, x, n) for (int i = x; i < n; i++) #define OP(m) cout << m << endl typedef long long ll; typedef unsigned long long ull; int main() { int x; cin >> x; int sum = 0; int i = ; do { i++; sum += i; } while (x > sum); OP(i); return 0; }
a.cc: In function 'int main()': a.cc:18:13: error: expected primary-expression before ';' token 18 | int i = ; | ^
s650559584
p03779
C++
#include <bits/stdc++.h> int main(){ int x,t=0,c=0; std::cin>>x; while(t<x) {cnt++;t+=c;} std::cout<<c; }
a.cc: In function 'int main()': a.cc:5:15: error: 'cnt' was not declared in this scope; did you mean 'int'? 5 | while(t<x) {cnt++;t+=c;} | ^~~ | int
s015862658
p03779
C++
#include <bits/stdc++.h> using namespace std; int main() { int X; cint >> X; int count = 0; int ans = 0; vector<int> vec; for (int i = 0; i < X + 1; i++) { vec; } for (int i = 0; size.vec(); i++) { ans++; count++; if (X < count + i + 1) { break } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:8:5: error: 'cint' was not declared in this scope; did you mean 'uint'? 8 | cint >> X; | ^~~~ | uint a.cc:19:26: error: overloaded function with no contextual type information 19 | for (int i = 0; size.vec(); i++) | ^~~ a.cc:25:18: error: expected ';' before '}' token 25 | break | ^ | ; 26 | } | ~
s209395456
p03779
C++
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); : : : int x, i; cin >> x; : for (i = 1; i*(i+1)/2 < x; i++) ;//why this<=========================??????????????????????????????????? cout << i << '\n'; }
a.cc: In function 'int main()': a.cc:6:183: error: expected primary-expression before ':' token 6 | cin.tie(0); : : : | ^ a.cc:8:10: error: 'x' was not declared in this scope 8 | cin >> x; : | ^ a.cc:8:111: error: expected primary-expression before ':' token 8 | cin >> x; : | ^ a.cc:9:15: error: 'i' was not declared in this scope 9 | for (i = 1; i*(i+1)/2 < x; i++) ;//why this<=========================??????????????????????????????????? | ^
s030993203
p03779
C++
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); : : : int x, i; ; : cin >> x; : for (i = 1; i*(i+1)/2 < x; i++) ;//why this<=========================??????????????????????????????????? cout << i << '\n'; }
a.cc: In function 'int main()': a.cc:6:183: error: expected primary-expression before ':' token 6 | cin.tie(0); : : : | ^ a.cc:7:114: error: expected primary-expression before ':' token 7 | int x, i; ; : | ^ a.cc:8:111: error: expected primary-expression before ':' token 8 | cin >> x; : | ^ a.cc:9:15: error: 'i' was not declared in this scope 9 | for (i = 1; i*(i+1)/2 < x; i++) ;//why this<=========================??????????????????????????????????? | ^ a.cc:9:27: error: 'x' was not declared in this scope 9 | for (i = 1; i*(i+1)/2 < x; i++) ;//why this<=========================??????????????????????????????????? | ^
s645631398
p03779
C++
#include <iostream> #include <vector> #include <algorithm> #include <cmath> int main() { long N; std::cin >> N; long partial=1+8*N; double edge=sqrt(partial)); partial=edge-1; edge=partial/2; long result=std::ceil(edge); std::cout << result << std::endl; return 0; }
a.cc: In function 'int main()': a.cc:12:30: error: expected ',' or ';' before ')' token 12 | double edge=sqrt(partial)); | ^
s362967235
p03779
C++
#include <iostream> #include <conio.h> using namespace std; int main() { int goal = 0; int position = 0; int count = 0; cin >> goal; int command(int count, int goal, int position); count = command(count, goal, position); cout << count; _getch(); } int command(int count, int goal, int position) { count++; if (position + count == goal) return count; if (position + (2 * count) + 1 > goal) { command(count, goal, position); }else if (position > goal) { command(count, goal, position - count); } else if (position + (2 * count) + 1 < goal) { command(count, goal, position + count); } }
a.cc:2:10: fatal error: conio.h: No such file or directory 2 | #include <conio.h> | ^~~~~~~~~ compilation terminated.
s281081269
p03779
C++
#include <bits/stdc++h> using namespace std; int main(){ int x; int ans=1,me=0; while(me<x){ me+ans; ans++; } cout << ans << endl; }
a.cc:1:10: fatal error: bits/stdc++h: No such file or directory 1 | #include <bits/stdc++h> | ^~~~~~~~~~~~~~ compilation terminated.
s882989313
p03779
C
#include<stdio.h> int main(){ int x; scanf("%d" &x); int a = 0; int i; for( i = 0; a<x; i++) a += i; i--; printf("%d\n", i); return 0; }
main.c: In function 'main': main.c:5:14: error: invalid operands to binary & (have 'char *' and 'int') 5 | scanf("%d" &x); | ~~~~ ^ | | | char *
s077453298
p03779
C
#include<stdio.h> int main(){ int x; scanf("%d" &x); int a = 0; int i; for( i = 0; a<X; i++) a += i; i--; printf("%d\n", i); return 0; }
main.c: In function 'main': main.c:5:14: error: invalid operands to binary & (have 'char *' and 'int') 5 | scanf("%d" &x); | ~~~~ ^ | | | char * main.c:8:17: error: 'X' undeclared (first use in this function) 8 | for( i = 0; a<X; i++) | ^ main.c:8:17: note: each undeclared identifier is reported only once for each function it appears in
s302841251
p03779
C
#include<stdio.h> int main(){ int X; scanf("%d" &X); int a = 0; for(int i = 0; a<X; i++) a += i; i--; printf("%d\n", i); return 0; }
main.c: In function 'main': main.c:5:14: error: invalid operands to binary & (have 'char *' and 'int') 5 | scanf("%d" &X); | ~~~~ ^ | | | char * main.c:9:3: error: 'i' undeclared (first use in this function) 9 | i--; | ^ main.c:9:3: note: each undeclared identifier is reported only once for each function it appears in
s221371076
p03779
C
#include<stdio.h> int main(){ int X; scanf("%d" &X); int a = 0; for(int i = 0; a<X; i++) p += i; i--; printf("%d\n", i); return 0; }
main.c: In function 'main': main.c:5:14: error: invalid operands to binary & (have 'char *' and 'int') 5 | scanf("%d" &X); | ~~~~ ^ | | | char * main.c:8:3: error: 'p' undeclared (first use in this function) 8 | p += i; | ^ main.c:8:3: note: each undeclared identifier is reported only once for each function it appears in main.c:9:3: error: 'i' undeclared (first use in this function) 9 | i--; | ^
s159865615
p03779
C
#include<stdio.h> int main(){ int X; scanf("%d" &X); int a = 0; for(int i = 0; a<X; i++); p += i; i--; printf("%d\n", i); return 0; }
main.c: In function 'main': main.c:5:14: error: invalid operands to binary & (have 'char *' and 'int') 5 | scanf("%d" &X); | ~~~~ ^ | | | char * main.c:8:3: error: 'p' undeclared (first use in this function) 8 | p += i; | ^ main.c:8:3: note: each undeclared identifier is reported only once for each function it appears in main.c:8:8: error: 'i' undeclared (first use in this function) 8 | p += i; | ^
s329335591
p03779
C
#include<stdio.h> int main(){ int x; scanf("%d" &X); int a = 0; for(int i = 0; a<X; i++); p += i; i--; printf("%d\n", i); return 0; }
main.c: In function 'main': main.c:5:15: error: 'X' undeclared (first use in this function) 5 | scanf("%d" &X); | ^ main.c:5:15: note: each undeclared identifier is reported only once for each function it appears in main.c:8:3: error: 'p' undeclared (first use in this function) 8 | p += i; | ^ main.c:8:8: error: 'i' undeclared (first use in this function) 8 | p += i; | ^
s307497057
p03779
C
#include<stdio.h> int main(){ int x; scanf("%d"m &X); int a = 0; for(int i = 0; a<X; i++); p += i; i--; printf("%d\n", i); return 0; }
main.c: In function 'main': main.c:5:13: error: expected ')' before 'm' 5 | scanf("%d"m &X); | ~ ^ | ) main.c:7:20: error: 'X' undeclared (first use in this function) 7 | for(int i = 0; a<X; i++); | ^ main.c:7:20: note: each undeclared identifier is reported only once for each function it appears in main.c:8:3: error: 'p' undeclared (first use in this function) 8 | p += i; | ^ main.c:8:8: error: 'i' undeclared (first use in this function) 8 | p += i; | ^
s437540582
p03779
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n; cin>>n; vector<int>a(1); a[0]=1; if(n==1){ cout <<1; return 0; } for(int i=1;a[i]<1000000000;i++){ a.push_back( (i+1)+a[i-1] ); if(a[i]>=n){ cout<<i+1; return 0; } }
a.cc: In function 'int main()': a.cc:20:10: error: expected '}' at end of input 20 | } | ^ a.cc:5:12: note: to match this '{' 5 | int main() { | ^
s159650621
p03779
C++
#include<bits/stdc++.h> #define all(x) (x).begin(),(x).end() typedef long long ll; #define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i) #define REP(i,num,n) for(ll i=num, i##_len=(n); i<i##_len; ++i) #define repprev(i,a,b) for(ll i=b-1;i>=a;i--) #define reprev(i,n) repprev(i,0,n) using namespace std; #define sz(x) ((int)(x).size()) #define ZERO(a) memset(a,0,sizeof(a)) #define MINUS(a) memset(a,0xff,sizeof(a)) #define MEMSET(v, h) memset((v), h, sizeof(v)) template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; } template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; } template<class T> int former(const vector<T> &v, T x){ return upper_bound(v.begin(),v.end(),x) - v.begin() - 1; } template<class T> int latter(const vector<T> &v, T x){ return lower_bound(v.begin(),v.end(),x) - v.begin(); } #define pb push_back #define mp make_pair #define y0 y3487465 #define y1 y8687969 #define j0 j1347829 #define j1 j234892 #define BIT_FLAG_0 (1<<0) // 0000 0000 0000 0001 #define BIT_FLAG_1 (1<<1) // 0000 0000 0000 0010 #define BIT_FLAG_2 (1<<2) // 0000 0000 0000 0100 #define BIT_FLAG_3 (1<<3) // 0000 0000 0000 1000 #define BIT_FLAG_4 (1<<4) // 0000 0000 0001 0000 #define BIT_FLAG_5 (1<<5) // 0000 0000 0010 0000 #define BIT_FLAG_6 (1<<6) // 0000 0000 0100 0000 #define BIT_FLAG_7 (1<<7) // 0000 0000 1000 0000 ll gcd(ll a,ll b){return b?gcd(b,a%b):a;} const ll LLINF = 1LL<<60; const int INTINF = 1<<30; const int MAX = 510000; const int MOD = 1000000007; long long fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++){ fac[i] = fac[i - 1] * i % MOD; inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD; finv[i] = finv[i - 1] * inv[i] % MOD; } } // 二項係数計算 long long COM(int n, int k){ if (n < k) return 0; if (n < 0 || k < 0) return 0; return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD; } struct UnionFind { vector<ll> par; // par[i]:iの親の番号 (例) par[3] = 2 : 3の親が2 UnionFind(ll n) : par(n, -1) { } void init(ll n) { par.assign(n, -1); } ll root(ll x) { if (par[x] < 0) return x; else return par[x] = root(par[x]); } bool issame(ll x, ll y) { return root(x) == root(y); } bool merge(ll x, ll y) { x = root(x); y = root(y); if (x == y) return false; if (par[x] > par[y]) swap(x, y); // merge technique par[x] += par[y]; par[y] = x; return true; } ll size(ll x) { return -par[root(x)]; } }; template <typename T> vector<T> dijkstra(int s,vector<vector<pair<int, T> > > & G){ const T INF = numeric_limits<T>::max(); using P = pair<T, int>; int n=G.size(); vector<T> d(n,INF); vector<int> b(n,-1); priority_queue<P,vector<P>,greater<P> > q; d[s]=0; q.emplace(d[s],s); while(!q.empty()){ P p=q.top();q.pop(); int v=p.second; if(d[v]<p.first) continue; for(auto& e:G[v]){ int u=e.first; T c=e.second; if(d[u]>d[v]+c){ d[u]=d[v]+c; b[u]=v; q.emplace(d[u],u); } } } return d; } vector<vector<int> > bfs(vector<string> &s,int sy,int sx,char wall,int dir){ int h=s.size(),w=s.front().size(); vector<vector<int> > dp(h,vector<int>(w,-1)); using P = pair<int, int>; queue<P> q; dp[sy][sx]=0; q.emplace(sy,sx); int dy[]={1,-1,0,0,1,1,-1,-1}; int dx[]={0,0,1,-1,1,-1,1,-1}; auto in=[&](int y,int x){return 0<=y&&y<h&&0<=x&&x<w;}; while(!q.empty()){ int y,x; tie(y,x)=q.front();q.pop(); for(int k=0;k<dir;k++){ int ny=y+dy[k],nx=x+dx[k]; if(!in(ny,nx)||s[ny][nx]==wall) continue; if(~dp[ny][nx]) continue; dp[ny][nx]=dp[y][x]+1; q.emplace(ny,nx); } } return dp; } int64_t power(int64_t x, int64_t n, int64_t mod) { int64_t ret = 1; while(n > 0) { if(n & 1) (ret *= x) %= mod; (x *= x) %= mod; n >>= 1; } return ret; } vector<int> sieve_of_eratosthenes(int n) { vector<int> primes(n); for (int i = 2; i < n; ++i) primes[i] = i; for (int i = 2; i*i < n; ++i) if (primes[i]) for (int j = i*i; j < n; j+=i) primes[j] = 0; return primes; } std::vector<ll> divisor(ll n)//nの約数を列挙 { std::vector<ll> ret; for(ll i=1 ; i*i<=n ; ++i) { if(n%i == 0) { ret.push_back(i); if(i!=1 && i*i!=n) { ret.push_back(n/i); } } } return ret; } const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}; const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1}; int main(void) { cin.tie(0); ios::sync_with_stdio(false); int X; cin >> X; int sum = 0; int t; for(t = 1; ;t++){ sum += t; (sum >= X) break; } cout << t << endl; }
a.cc: In function 'int main()': a.cc:198:19: error: expected ';' before 'break' 198 | (sum >= X) break; | ^~~~~~ | ;
s610726750
p03779
C++
#include<bits/stdc++.h> #define all(x) (x).begin(),(x).end() typedef long long ll; #define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i) #define REP(i,num,n) for(ll i=num, i##_len=(n); i<i##_len; ++i) #define repprev(i,a,b) for(ll i=b-1;i>=a;i--) #define reprev(i,n) repprev(i,0,n) using namespace std; #define sz(x) ((int)(x).size()) #define ZERO(a) memset(a,0,sizeof(a)) #define MINUS(a) memset(a,0xff,sizeof(a)) #define MEMSET(v, h) memset((v), h, sizeof(v)) template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; } template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; } template<class T> int former(const vector<T> &v, T x){ return upper_bound(v.begin(),v.end(),x) - v.begin() - 1; } template<class T> int latter(const vector<T> &v, T x){ return lower_bound(v.begin(),v.end(),x) - v.begin(); } #define pb push_back #define mp make_pair #define y0 y3487465 #define y1 y8687969 #define j0 j1347829 #define j1 j234892 #define BIT_FLAG_0 (1<<0) // 0000 0000 0000 0001 #define BIT_FLAG_1 (1<<1) // 0000 0000 0000 0010 #define BIT_FLAG_2 (1<<2) // 0000 0000 0000 0100 #define BIT_FLAG_3 (1<<3) // 0000 0000 0000 1000 #define BIT_FLAG_4 (1<<4) // 0000 0000 0001 0000 #define BIT_FLAG_5 (1<<5) // 0000 0000 0010 0000 #define BIT_FLAG_6 (1<<6) // 0000 0000 0100 0000 #define BIT_FLAG_7 (1<<7) // 0000 0000 1000 0000 ll gcd(ll a,ll b){return b?gcd(b,a%b):a;} const ll LLINF = 1LL<<60; const int INTINF = 1<<30; const int MAX = 510000; const int MOD = 1000000007; long long fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++){ fac[i] = fac[i - 1] * i % MOD; inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD; finv[i] = finv[i - 1] * inv[i] % MOD; } } // 二項係数計算 long long COM(int n, int k){ if (n < k) return 0; if (n < 0 || k < 0) return 0; return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD; } struct UnionFind { vector<ll> par; // par[i]:iの親の番号 (例) par[3] = 2 : 3の親が2 UnionFind(ll n) : par(n, -1) { } void init(ll n) { par.assign(n, -1); } ll root(ll x) { if (par[x] < 0) return x; else return par[x] = root(par[x]); } bool issame(ll x, ll y) { return root(x) == root(y); } bool merge(ll x, ll y) { x = root(x); y = root(y); if (x == y) return false; if (par[x] > par[y]) swap(x, y); // merge technique par[x] += par[y]; par[y] = x; return true; } ll size(ll x) { return -par[root(x)]; } }; template <typename T> vector<T> dijkstra(int s,vector<vector<pair<int, T> > > & G){ const T INF = numeric_limits<T>::max(); using P = pair<T, int>; int n=G.size(); vector<T> d(n,INF); vector<int> b(n,-1); priority_queue<P,vector<P>,greater<P> > q; d[s]=0; q.emplace(d[s],s); while(!q.empty()){ P p=q.top();q.pop(); int v=p.second; if(d[v]<p.first) continue; for(auto& e:G[v]){ int u=e.first; T c=e.second; if(d[u]>d[v]+c){ d[u]=d[v]+c; b[u]=v; q.emplace(d[u],u); } } } return d; } vector<vector<int> > bfs(vector<string> &s,int sy,int sx,char wall,int dir){ int h=s.size(),w=s.front().size(); vector<vector<int> > dp(h,vector<int>(w,-1)); using P = pair<int, int>; queue<P> q; dp[sy][sx]=0; q.emplace(sy,sx); int dy[]={1,-1,0,0,1,1,-1,-1}; int dx[]={0,0,1,-1,1,-1,1,-1}; auto in=[&](int y,int x){return 0<=y&&y<h&&0<=x&&x<w;}; while(!q.empty()){ int y,x; tie(y,x)=q.front();q.pop(); for(int k=0;k<dir;k++){ int ny=y+dy[k],nx=x+dx[k]; if(!in(ny,nx)||s[ny][nx]==wall) continue; if(~dp[ny][nx]) continue; dp[ny][nx]=dp[y][x]+1; q.emplace(ny,nx); } } return dp; } int64_t power(int64_t x, int64_t n, int64_t mod) { int64_t ret = 1; while(n > 0) { if(n & 1) (ret *= x) %= mod; (x *= x) %= mod; n >>= 1; } return ret; } vector<int> sieve_of_eratosthenes(int n) { vector<int> primes(n); for (int i = 2; i < n; ++i) primes[i] = i; for (int i = 2; i*i < n; ++i) if (primes[i]) for (int j = i*i; j < n; j+=i) primes[j] = 0; return primes; } std::vector<ll> divisor(ll n)//nの約数を列挙 { std::vector<ll> ret; for(ll i=1 ; i*i<=n ; ++i) { if(n%i == 0) { ret.push_back(i); if(i!=1 && i*i!=n) { ret.push_back(n/i); } } } return ret; } const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}; const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1}; int main(void) { cin.tie(0); ios::sync_with_stdio(false); int X; cin >> X; int sum = 0; for(t = 1; ; t++){ sum += t; (sum >= X) break; } cout << t << endl; }
a.cc: In function 'int main()': a.cc:195:9: error: 't' was not declared in this scope 195 | for(t = 1; ; t++){ | ^ a.cc:197:19: error: expected ';' before 'break' 197 | (sum >= X) break; | ^~~~~~ | ; a.cc:199:12: error: 't' was not declared in this scope 199 | cout << t << endl; | ^
s935457956
p03779
C
#include<stdio.h> int main(){ int i,j,k,T; scanf("%d",&T); i=1; while(i(i+1)/2 < T) i++; printf("%d\n",i-1); return 0; }
main.c: In function 'main': main.c:8:9: error: called object 'i' is not a function or function pointer 8 | while(i(i+1)/2 < T) | ^ main.c:4:7: note: declared here 4 | int i,j,k,T; | ^
s690439098
p03779
C
#include<stdio.h> #include<math.h> int main (){ int x; scanf("%d",x); int a=ceil(sqrt(2*x))-1; while(2x>a*a+a) a++; printf("%d",a); }
main.c: In function 'main': main.c:8:9: error: invalid suffix "x" on integer constant 8 | while(2x>a*a+a) a++; | ^~
s254501563
p03779
C++
#include <bits/stdc++.h> using namespace std; const int MOD = 1e9 + 7; int main() { ios :: sync_with_stdio(0); cin.tie(nullptr); int x; long long csum = 0; cin >> x; for(int i = 1; i <= x; ++i) { cout << 1; for(int j = 0; j <= csum; ++j) if (i * (i + 1) / 2 - j == x) { cout << i; return 0; } csum += i; csum = min(csum, x); } return 0; }
a.cc: In function 'int main()': a.cc:24:19: error: no matching function for call to 'min(long long int&, int&)' 24 | csum = min(csum, x); | ~~~^~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:24:19: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 24 | csum = min(csum, x); | ~~~^~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:24:19: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 24 | csum = min(csum, x); | ~~~^~~~~~~~~
s165319456
p03779
C++
#include <bits/stdc++.h> using namespace std; const int MOD = 1e9 + 7; int main() { ios :: sync_with_stdio(0); cin.tie(nullptr); int x; long long csum = 0; cin >> x; for(int i = 1; i <= x; ++i) { cout << 1; for(int j = 0; j <= csum; ++j) if (i * (i + 1) / 2 - j == x) { cout << i; return 0; } csum += i; csum = max(csum, x); } return 0; }
a.cc: In function 'int main()': a.cc:24:19: error: no matching function for call to 'max(long long int&, int&)' 24 | csum = max(csum, x); | ~~~^~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:24:19: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 24 | csum = max(csum, x); | ~~~^~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:24:19: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 24 | csum = max(csum, x); | ~~~^~~~~~~~~
s463052342
p03779
C++
#include <stdio.h> int main() { long long scannum; long long num = 0; long long i; scanf_s("%lld", &scannum); for (i = 0; num <= scannum; i++) { num += i + 1; if (num >= scannum) { break; } } printf("%lld", i + 1); return 0; }
a.cc: In function 'int main()': a.cc:8:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 8 | scanf_s("%lld", &scannum); | ^~~~~~~ | scanf
s685447513
p03779
C++
#include<iostream> int main(){ ll x; cin>>x; ll n=0; while(x)x-=++n; cout<<n<<endl; }
a.cc: In function 'int main()': a.cc:3:5: error: 'll' was not declared in this scope 3 | ll x; | ^~ a.cc:4:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 4 | cin>>x; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:4:10: error: 'x' was not declared in this scope 4 | cin>>x; | ^ a.cc:5:7: error: expected ';' before 'n' 5 | ll n=0; | ^~ | ; a.cc:6:18: error: 'n' was not declared in this scope 6 | while(x)x-=++n; | ^ a.cc:7:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 7 | cout<<n<<endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:7:11: error: 'n' was not declared in this scope 7 | cout<<n<<endl; | ^ a.cc:7:14: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 7 | cout<<n<<endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/iostream:41: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s910317573
p03779
C++
x = STDIN.gets.chomp.to_i time = 0 loc = 0 loop do time += 1 loc += time if x <=loc break end end puts time
a.cc:1:1: error: 'x' does not name a type 1 | x = STDIN.gets.chomp.to_i | ^
s879070123
p03779
C++
x = STDIN.gets.chomp.to_i time = 0 loc = 0 loop do- time += 1 loc += time if x <=loc break end end puts time
a.cc:1:1: error: 'x' does not name a type 1 | x = STDIN.gets.chomp.to_i | ^
s337160905
p03779
C++
#include <iostream> #include<algorithm> #include<cmath> using namespace std; int main() { int x,cnt=0; for(int i=0; i<=x; i++) { cnt+=i; if(cnt>=x) { break; } } cout << i << endl; }
a.cc: In function 'int main()': a.cc:13:11: error: 'i' was not declared in this scope 13 | cout << i << endl; | ^
s023985796
p03779
C++
#include<bits/stdc++.h> #define mins(a,b) a=min(a,b) #define maxs(a,b) a=max(a,b) using namespace std; int main(){ long long int n,x=0; cin>>n; for(int ans=1;ans<1000000000;ans++){ x+=ans; if(x>=n) break; } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:13:9: error: 'ans' was not declared in this scope; did you mean 'abs'? 13 | cout<<ans<<endl; | ^~~ | abs
s985966302
p03779
C++
#include<bits/stdc++.h> #define mins(a,b) a=min(a,b) #define maxs(a,b) a=max(a,b) using namespace std; int main(){ long long int n,x=0,; cin>>n; for(int ans=1;ans<1000000000;ans++){ x+=ans; if(x>=n) break; } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:6:23: error: expected unqualified-id before ';' token 6 | long long int n,x=0,; | ^ a.cc:13:9: error: 'ans' was not declared in this scope; did you mean 'abs'? 13 | cout<<ans<<endl; | ^~~ | abs
s353102017
p03779
C++
X = int(input()) sum_d = 0 i = 1 while True: sum_d += i if sum_d >= X: print(i) break i += 1
a.cc:1:1: error: 'X' does not name a type 1 | X = int(input()) | ^
s700020761
p03779
Java
import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.NoSuchElementException; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.IntStream; public class Main { public static void main(String[] args) throws IOException { new Main().solve(); } private void solve() throws IOException { try { // solveA(); // solveB(); solveC(); // solveD(); // solveE(); // solveF(); } finally { if (in != null) { in.close(); } if (out != null) { out.flush(); out.close(); } } } private void solveA() { String strA = next(); String strB = next(); if (strA.equals("H")) { System.out.println(strB.equals("H") ? "H" : "D"); } else { System.out.println(strB.equals("H") ? "D" : "H"); } } private void solveB() { int numW = nextInt(); int numA = nextInt(); int numB = nextInt(); long res = 0; if (numA + numW < numB) { res = Math.abs(numB - (numA + numW)); } else if (numB + numW < numA) { res = Math.abs(numA - (numB + numW)); } System.out.println(res); } private void solveC() { int numX = nextInt(); // int res = 0; // // int sum = 0; // // int cnt = 0; // int wkTotal = 0; // while (true) { // cnt++; // wkTotal += cnt; // if (wkTotal >= numX) { // res = cnt; // break; // } // } // // for (int i = 0;; i++) { // sum += i; // if (sum >= numX) { // res = i; // break; // } // } AtomicInteger wkRes = new AtomicInteger(-1); res = IntStream.range(0, 1000000000).reduce(0, (inSum, index) -> { int wk = inSum + index; if (wk >= numX && wkRes.intValue() == -1) { wkRes.set(index); } return wk; }); // AtomicInteger wkTotal2 = new AtomicInteger(0); // AtomicInteger wkRes2 = new AtomicInteger(-1); // IntStream.range(0, 200).forEach(index -> { // wkTotal2.addAndGet(index); // if (wkTotal2.intValue() >= numX && wkRes2.intValue() == -1) { // wkRes2.set(index); // return; // } // }); out.println(wkRes); } private void solveD() { int numN = nextInt(); out.println(""); } private void solveE() { int numN = nextInt(); out.println(""); } private void solveF() { int numN = nextInt(); out.println(""); } private final PrintWriter out = new PrintWriter(System.out); private final InputStream in = System.in; private final byte[] buffer = new byte[1024]; private int ptr = 0; private int buflen = 0; private boolean hasNextByte() { if (ptr < buflen) { return true; } else { ptr = 0; try { buflen = in.read(buffer); } catch (IOException e) { e.printStackTrace(); } if (buflen <= 0) { return false; } } return true; } private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1; } private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126; } private void skipUnprintable() { while (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; } public boolean hasNext() { skipUnprintable(); return hasNextByte(); } public int nextInt() { return Integer.parseInt(next()); } public String next() { if (!hasNext()) throw new NoSuchElementException(); StringBuilder sb = new StringBuilder(); int b = readByte(); while (isPrintableChar(b)) { sb.appendCodePoint(b); b = readByte(); } return sb.toString(); } public long nextLong() { if (!hasNext()) throw new NoSuchElementException(); long n = 0; boolean minus = false; int b = readByte(); if (b == '-') { minus = true; b = readByte(); } if (b < '0' || '9' < b) { throw new NumberFormatException(); } while (true) { if ('0' <= b && b <= '9') { n *= 10; n += b - '0'; } else if (b == -1 || !isPrintableChar(b)) { return minus ? -n : n; } else { throw new NumberFormatException(); } b = readByte(); } } }
Main.java:89: error: cannot find symbol res = IntStream.range(0, 1000000000).reduce(0, (inSum, index) -> { ^ symbol: variable res location: class Main 1 error
s183077339
p03779
C++
#include <bits/stdc++.h> using namespace std; int main () { int X; cin >> X; long ans, sum = 0; for(int i = 1; i <= X; i++) { if(X - sum - i > i) sum += i; else if (X == sum + i) sum += i; if(sum == X) { ans = i; break; } } cout << << endl; return 0; }
a.cc: In function 'int main()': a.cc:15:12: error: expected primary-expression before '<<' token 15 | cout << << endl; | ^~
s406187512
p03779
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,N) for(int i=0;i<int(N);++i) #define rep1(i,N) for(int i=1;i<int(N);++i) int main() { int X; cin>>X; ll x=0,cnt=0; rep1(i,inf){ x+=i; cnt++; if(x>=X)break; } cout<<cnt<<endl; }
a.cc: In function 'int main()': a.cc:9:9: error: 'll' was not declared in this scope 9 | ll x=0,cnt=0; | ^~ a.cc:10:16: error: 'inf' was not declared in this scope; did you mean 'ynf'? 10 | rep1(i,inf){ | ^~~ a.cc:4:37: note: in definition of macro 'rep1' 4 | #define rep1(i,N) for(int i=1;i<int(N);++i) | ^ a.cc:11:17: error: 'x' was not declared in this scope 11 | x+=i; | ^ a.cc:12:17: error: 'cnt' was not declared in this scope; did you mean 'int'? 12 | cnt++; | ^~~ | int a.cc:15:15: error: 'cnt' was not declared in this scope; did you mean 'int'? 15 | cout<<cnt<<endl; | ^~~ | int
s769602453
p03779
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,N) for(int i=0;i<int(N);++i) int main() { int X; cin>>X; ll x=0,cnt=0; rep1(i,inf){ x+=i; cnt++; if(x>=X)break; } cout<<cnt<<endl; }
a.cc: In function 'int main()': a.cc:8:9: error: 'll' was not declared in this scope 8 | ll x=0,cnt=0; | ^~ a.cc:9:14: error: 'i' was not declared in this scope 9 | rep1(i,inf){ | ^ a.cc:9:16: error: 'inf' was not declared in this scope; did you mean 'ynf'? 9 | rep1(i,inf){ | ^~~ | ynf a.cc:9:9: error: 'rep1' was not declared in this scope; did you mean 'rep'? 9 | rep1(i,inf){ | ^~~~ | rep a.cc:14:15: error: 'cnt' was not declared in this scope; did you mean 'int'? 14 | cout<<cnt<<endl; | ^~~ | int
s972314097
p03779
C++
#include <bits/stdc++.h> #define repd(i,a,b) for (int i=(a);i<(b);i++) #define rep(i,n) repd(i,0,n) //#define int long long typedef long long ll; using namespace std; const int MOD = 1000000007; const int INF = 1010000000; const double EPS = 1e-10; const pair<int,int> fd[] = {make_pair(1,0),make_pair(-1,0),make_pair(0,1),make_pair(0,-1)}; signed main(){ int x;cin>>x; int lim = x+1 repd(i,1,lim){ x -= i; if(x <= 0){ cout << i << endl; return 0; } } }
a.cc: In function 'int main()': a.cc:2:21: error: expected ',' or ';' before 'for' 2 | #define repd(i,a,b) for (int i=(a);i<(b);i++) | ^~~ a.cc:16:3: note: in expansion of macro 'repd' 16 | repd(i,1,lim){ | ^~~~ a.cc:16:8: error: 'i' was not declared in this scope 16 | repd(i,1,lim){ | ^ a.cc:2:36: note: in definition of macro 'repd' 2 | #define repd(i,a,b) for (int i=(a);i<(b);i++) | ^
s714882970
p03779
C++
#include <iostream> using namespace std; int main(){ int N; int k; cin >> N; for (int i=1;;i++) { int l1=(i*(i+1))/2 - N; if(l1 >= 0){ k = i; break;} } cout <<k;
a.cc: In function 'int main()': a.cc:16:12: error: expected '}' at end of input 16 | cout <<k; | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s456577124
p03779
C++
#include <iostream> using namespace std; int main(){ int N; int k; cin >> N; for (int i=1;;i++) { int l1=i*(i+1) - N; if(l1 >= 0){ k = i; break;} cout <<k; }
a.cc: In function 'int main()': a.cc:18:4: error: expected '}' at end of input 18 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s698036781
p03779
C++
#include <iostream> using namespace std; int main(){ int N; int k; cin >> N; for (int i=1;;i++) { int l1=i*(i+1) - N; if(l1 >= 0){ k = i; break;} } cout <<k;
a.cc: In function 'int main()': a.cc:16:12: error: expected '}' at end of input 16 | cout <<k; | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s979534661
p03779
C++
#include <iostream> using namespace std; int main() { long long x; cin >> x; int n = sqrt(2 * x); cout << n << endl; if (n*(n + 1) / 2 < x) { n++; } cout << n << endl; return 0; }
a.cc: In function 'int main()': a.cc:6:17: error: 'sqrt' was not declared in this scope 6 | int n = sqrt(2 * x); | ^~~~
s365100714
p03779
C++
// #include <bits/stdc++.h> #include <map> #include <set> #include <ctime> #include <cstring> #include <queue> #include <iostream> #include <algorithm> using namespace std; #define mod 1000000007 #define INF 1000000000 #define mp make_pair #define pb push_back #define mt make_tuple #define eb emplace_back #define all(x) begin(x), end(x) #define len(x) ((int)(x).size()) #define contains(a, x) (a.find(x) != end(a)) #define rep(i, n) for (int i = 0; i < (int)n; ++i) #define F(i,a,b) for(int i = (int)(a); i < (int)(b); ++i) #define RF(i,a,b)for(int i = (int)(a); i >= (int)(b); --i) using dbl = double; using ll = long long; using ull = unsigned long long; using vi = vector<int>; using vvi = vector<vi>; using vvl = vector<long long>; using pi = pair<int,int>; #define fast() {ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);} #define log(x) cout << x << endl; int main() { ll X; cin >> X; ll t = int(sqrt<ll>(2*X)+.5); log(t); return 0; }
a.cc: In function 'int main()': a.cc:42:20: error: 'sqrt' was not declared in this scope 42 | ll t = int(sqrt<ll>(2*X)+.5); | ^~~~ a.cc:42:16: error: expected primary-expression before 'int' 42 | ll t = int(sqrt<ll>(2*X)+.5); | ^~~
s913495024
p03779
C++
#include<bits/stdc++.h> using namespace std; int main() { long long INF = 1e9 + 1; ll X, x=0; cin >> X; for (int i = 1; i < INF; i++) { x += i; if (X >= x) cout << i << endl; } return 0; }
a.cc: In function 'int main()': a.cc:5:9: error: 'll' was not declared in this scope 5 | ll X, x=0; | ^~ a.cc:6:16: error: 'X' was not declared in this scope 6 | cin >> X; | ^ a.cc:8:17: error: 'x' was not declared in this scope 8 | x += i; | ^
s040759751
p03779
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; int main(){ int i,sum=0; for(i=1;sum<=x;i++) { sum+=i; } cout<<i; return 0; }
a.cc: In function 'int main()': a.cc:7:22: error: 'x' was not declared in this scope 7 | for(i=1;sum<=x;i++) | ^
s647037916
p03779
C++
#include<bits/stdc++.h> using namespace std; int main(){ int x,ans=0,i=0; cin>>x; while(ans<x){ i++ ans+=i; } cout<<i<<endl; return 0; }
a.cc: In function 'int main()': a.cc:7:20: error: expected ';' before 'ans' 7 | i++ | ^ | ; 8 | ans+=i; | ~~~
s417388379
p03779
C++
#include<bits/stdc++.h> using namespace std; int main(){ int x,ans=0,i=0; cin>>x; while(ans>=i){ i++ ans+=i; } cout<<i<<endl; return 0; }
a.cc: In function 'int main()': a.cc:7:20: error: expected ';' before 'ans' 7 | i++ | ^ | ; 8 | ans+=i; | ~~~
s947935355
p03779
C++
#include<bits/stdc++.h> using namespace std; int main(){ int x,ans=0,i=0; cin>>x; while(ans>=i){ i++ ans+=i; } cout<<ans; return 0; }
a.cc: In function 'int main()': a.cc:7:20: error: expected ';' before 'ans' 7 | i++ | ^ | ; 8 | ans+=i; | ~~~
s016729072
p03779
C++
#include<bits/stdc++.h> using namespace std; int main(){ int x,ans=0,i=0; cin>>x; while(ans>=i){ i++ ans+=i; } cout<<i; return 0; }
a.cc: In function 'int main()': a.cc:7:20: error: expected ';' before 'ans' 7 | i++ | ^ | ; 8 | ans+=i; | ~~~
s998715036
p03779
C++
#include<bits/stdc++.h> using namespace std; int main(){ int x,ans=0,i=0; cin>>x; while(ans>=i){ i++ ans+=i; } cout<<i; return 0; }
a.cc: In function 'int main()': a.cc:7:20: error: expected ';' before 'ans' 7 | i++ | ^ | ; 8 | ans+=i; | ~~~
s797035619
p03779
C++
#include<bits/stdc++.h> using namespace std; tepedef long long ll; int main(){ int x,ans=0,i=0; cin>>x; while(ans>=i){ i++ ans+=i; } cout<<i; return 0; }
a.cc:3:1: error: 'tepedef' does not name a type; did you mean 'typedef'? 3 | tepedef long long ll; | ^~~~~~~ | typedef a.cc: In function 'int main()': a.cc:8:20: error: expected ';' before 'ans' 8 | i++ | ^ | ; 9 | ans+=i; | ~~~
s445279234
p03779
C++
#include<bits/stdc++.h> using namespace std; tepedef long long ll; int main(){ cout<<2; return 0; }
a.cc:3:1: error: 'tepedef' does not name a type; did you mean 'typedef'? 3 | tepedef long long ll; | ^~~~~~~ | typedef
s754407764
p03779
C++
#include <iostream> using namespace std; int main(){ cin>>n; cout<<n/2; return 0; }
a.cc: In function 'int main()': a.cc:4:14: error: 'n' was not declared in this scope 4 | cin>>n; | ^
s442227073
p03779
C++
#include <iostream> signed main(){ int X; cin >> X; int i; for (i = 1; i*(i + 1) / 2 < X; i++); cout << i << endl; return 0; }
a.cc: In function 'int main()': a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin >> X; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:11:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 11 | cout << i << endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:11:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 11 | cout << i << endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/iostream:41: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s077596808
p03779
C++
#include <iostream> #include <string> #include <algorithm> using namespace std; int main(){ int X,a=0,b=0; cin >> X; for(int i=0; i<X; i++){ a += 1; b += a; if(c>=X){ cout << a << endl; return 0; } } }
a.cc: In function 'int main()': a.cc:11:8: error: 'c' was not declared in this scope 11 | if(c>=X){ | ^
s539891396
p03779
C++
#include <iostream> #include <string> #include <algorithm> using namespace std; int main(){ int X,a=0,b=0; cin >> X; for(int i=0; i<X; i++){ a += 1; c += a; if(c>=X){ cout << a << endl; return 0; } } }
a.cc: In function 'int main()': a.cc:10:5: error: 'c' was not declared in this scope 10 | c += a; | ^
s519099124
p03779
Java
import java.util.*;public class Main{public static void main(String[] args){Scanner sc = new Scanner(System.in)int x=sc.nextInt(),t=0;while(t*(t+1)/2<x){t++;}System.out.println(t);}}
Main.java:1: error: ';' expected import java.util.*;public class Main{public static void main(String[] args){Scanner sc = new Scanner(System.in)int x=sc.nextInt(),t=0;while(t*(t+1)/2<x){t++;}System.out.println(t);}} ^ 1 error
s799857422
p03779
C++
#include<iostream> using namespace std; int main(){ int x; int iwa=0,ta=0; cin>>x: for(int i=0;i<1000000000;i++){ iwa++; ta+=iwa; if(ta>=x){break;} } cout<<iwa<<endl; }
a.cc: In function 'int main()': a.cc:6:9: error: expected ';' before ':' token 6 | cin>>x: | ^ | ; a.cc:7:15: error: 'i' was not declared in this scope 7 | for(int i=0;i<1000000000;i++){ | ^
s298876651
p03779
C++
#include<iostream> #include<climits> #include<math.h> #include<vector> #include<algorithm> #include<cstdio> #include<stdio.h> #include <string> #include <complex> #include <functional> using namespace std; typedef pair<int,int> P; double dat[100][100]; //int dp[6][1010];//動的計画法 int prime[10000001]; char str[1010][1010]; vector<pair<int,int> > pc[100001]; int ABS(int a){return max(a,-a);} int main(){ int x,tmp; cin>>x; for(int i=1;i<=x;i+){ tmp+=i; if(tmp>=x){ cout<<i; return 0; } } return 0; }
a.cc: In function 'int main()': a.cc:22:28: error: expected primary-expression before ')' token 22 | for(int i=1;i<=x;i+){ | ^
s841365645
p03779
C++
#include<bitset> //1 #include<iostream> //2 #include<cmath> //3 using namespace std; //1 #include<bits/stdc++.h> //2 #define int long long //大悪魔すくにきあ //3 int GoHome(int n){ //1 } // 2 int Kaerinasai(int n){return n*(n+1)/2;} //3 int main(){ //1 int sucu; // 2 int tkmt; //3 cin>>sucu;tkmt=0; //1 tkmt = sucu; // 2 #define Would //3 tkmt=0; //1 #define you // 2 #define rep(a) for(int i=0;i<a;i++) //3 while(Kaerinasai(tkmt)<sucu){Would you ++tkmt;} //1 #undef rep(a) // 2 Would you cerr << "塚本はつかも 岩になる"; //3 #define Oreno_Kotaeha(kore) cout<<(kore)<<endl //1 Oreno_Kotaeha(tkmt); // 2 const int tempura = 810; //3 you return 0; //1 Would you } // 2
a.cc:20:15: warning: extra tokens at end of #undef directive 20 | #undef rep(a) // 2 | ^ a.cc: In function 'long long int GoHome(long long int)': a.cc:8:1: warning: no return statement in function returning non-void [-Wreturn-type] 8 | } // 2 | ^ At global scope: cc1plus: error: '::main' must return 'int'
s130568446
p03779
C++
#include "bits/stdc++.h" using namespace std; #define MOD 1000000007 #define Nmax 200010 #define FOR(i,a,b) for(long long i=(a);i<(b);i++) #define RFOR(i,a,b) for(long long i = (b-1);i>=a;i--) #define REP(i,n) FOR(i,0,n) #define RREP(i,n) RFOR(i,0,n) #define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr) #define RITR(itr,mp) for(auto itr = (mp).rbegin(); itr != (mp).rend(); ++itr) #define dump(x) cout << #x << " = " << (x) << endl; #define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl; typedef long long ll; typedef pair<ll,ll> P; typedef vector<P> Graph; int main() { ll X; cin >> X; ll cnt=0,ans=0; while(ans<X){ ans+=cnt+1; cnt++; } ans-=cnt; cnt--;//X以下の最小の座標にいる cnt=min(X-ans+cnt,X-(ans+(2*cnt+3-(cnt+3))); cout << fixed << cnt << endl; return 0; }
a.cc: In function 'int main()': a.cc:27:52: error: expected ')' before ';' token 27 | cnt=min(X-ans+cnt,X-(ans+(2*cnt+3-(cnt+3))); | ~ ^ | )
s275351530
p03779
C++
#include<stdio.h> int x; int main(){ scanf("%d",&x); printf("%d",(int)2*sqrt(x)+0.5); }
a.cc: In function 'int main()': a.cc:5:22: error: 'sqrt' was not declared in this scope 5 | printf("%d",(int)2*sqrt(x)+0.5); | ^~~~
s482086041
p03779
C
i; main(a){ for(a-=i;(a-=i++)>0;gets(atoi(&a)); printf("%d\n",i-1); }
main.c:1:1: warning: data definition has no type or storage class 1 | i; | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int] 2 | main(a){ | ^~~~ main.c: In function 'main': main.c:2:1: error: type of 'a' defaults to 'int' [-Wimplicit-int] main.c:3:25: error: implicit declaration of function 'gets' [-Wimplicit-function-declaration] 3 | for(a-=i;(a-=i++)>0;gets(atoi(&a)); | ^~~~ main.c:3:30: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration] 3 | for(a-=i;(a-=i++)>0;gets(atoi(&a)); | ^~~~ main.c:3:39: error: expected ')' before ';' token 3 | for(a-=i;(a-=i++)>0;gets(atoi(&a)); | ~ ^ | ) main.c:5:1: error: expected expression before '}' token 5 | } | ^
s936586185
p03779
C
i; main(a){ for(;(a-=i)++>0;scanf("%d",&a)); printf("%d\n",i); }
main.c:1:1: warning: data definition has no type or storage class 1 | i; | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int] 2 | main(a){ | ^~~~ main.c: In function 'main': main.c:2:1: error: type of 'a' defaults to 'int' [-Wimplicit-int] main.c:3:16: error: lvalue required as increment operand 3 | for(;(a-=i)++>0;scanf("%d",&a)); | ^~ main.c:3:21: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 3 | for(;(a-=i)++>0;scanf("%d",&a)); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | i; main.c:3:21: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 3 | for(;(a-=i)++>0;scanf("%d",&a)); | ^~~~~ main.c:3:21: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:4:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 4 | printf("%d\n",i); | ^~~~~~ main.c:4:5: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:4:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:4:5: note: include '<stdio.h>' or provide a declaration of 'printf'
s632049948
p03779
C
i; main(a){ scanf("%d",&a); for(i;a-i++>0;) a-=i; } printf("%d\n",i); }
main.c:1:1: warning: data definition has no type or storage class 1 | i; | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int] 2 | main(a){ | ^~~~ main.c: In function 'main': main.c:2:1: error: type of 'a' defaults to 'int' [-Wimplicit-int] main.c:3:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 3 | scanf("%d",&a); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | i; main.c:3:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 3 | scanf("%d",&a); | ^~~~~ main.c:3:5: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c: At top level: main.c:7:12: error: expected declaration specifiers or '...' before string constant 7 | printf("%d\n",i); | ^~~~~~ main.c:7:19: error: expected declaration specifiers or '...' before 'i' 7 | printf("%d\n",i); | ^ main.c:8:1: error: expected identifier or '(' before '}' token 8 | } | ^
s929249640
p03779
C
i; main(a){ scanf("%d",&a); for(i;a-i>0;i++){ a-=i; } printf("%d\n"a?i-1:i); }
main.c:1:1: warning: data definition has no type or storage class 1 | i; | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int] 2 | main(a){ | ^~~~ main.c: In function 'main': main.c:2:1: error: type of 'a' defaults to 'int' [-Wimplicit-int] main.c:3:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 3 | scanf("%d",&a); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | i; main.c:3:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 3 | scanf("%d",&a); | ^~~~~ main.c:3:5: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:7:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 7 | printf("%d\n"a?i-1:i); | ^~~~~~ main.c:7:5: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:7:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:7:5: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:7:18: error: expected ')' before 'a' 7 | printf("%d\n"a?i-1:i); | ~ ^ | )
s214739059
p03779
C
i; main(a){ scanf("%d",&a); for(i;a-i<=0;i++){ a-=i; } printf("%d",a?i+1:i) }
main.c:1:1: warning: data definition has no type or storage class 1 | i; | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int] 2 | main(a){ | ^~~~ main.c: In function 'main': main.c:2:1: error: type of 'a' defaults to 'int' [-Wimplicit-int] main.c:3:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 3 | scanf("%d",&a); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | i; main.c:3:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 3 | scanf("%d",&a); | ^~~~~ main.c:3:5: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:7:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 7 | printf("%d",a?i+1:i) | ^~~~~~ main.c:7:5: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:7:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:7:5: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:7:25: error: expected ';' before '}' token 7 | printf("%d",a?i+1:i) | ^ | ; 8 | } | ~
s177766963
p03779
C
#include <iostream> using namespace std; int main() { int X; cin >> X; int t = 0; while(t*(t+1)/2 <= X) t++; cout << t << endl; return 0; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s052073293
p03779
C++
int main() { ll X; cin >> X; for (int i = 1; ; i++) { if (2 * X <= i * (i + 1)) { // auto K = i * (i + 1) / 2; // assert(K - X < i); std::cout << i << "\n"; return 0; } } return 0; }
a.cc: In function 'int main()': a.cc:2:3: error: 'll' was not declared in this scope 2 | ll X; cin >> X; | ^~ a.cc:2:9: error: 'cin' was not declared in this scope 2 | ll X; cin >> X; | ^~~ a.cc:2:16: error: 'X' was not declared in this scope 2 | ll X; cin >> X; | ^ a.cc:7:12: error: 'cout' is not a member of 'std' 7 | std::cout << i << "\n"; | ^~~~ a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | int main() {
s498956929
p03779
C++
#include <iostream> using namespace std; using ll = long long; int main(int argc, const char * argv[]) { ll x, sum = 0, ans; cin >> x; for (int i = 0; i <= x && !flag; i++) { sum += i; if (sum >= x) { ans = i; break; } } cout << ans << endl; }
a.cc: In function 'int main(int, const char**)': a.cc:8:32: error: 'flag' was not declared in this scope 8 | for (int i = 0; i <= x && !flag; i++) { | ^~~~
s084289619
p03779
C++
#include <iostream> #include <string> #include <cstring> #include <map> using namespace std; int run(int x, int arr[x]) { int titen = 0; for (int i = 1; i <= x; i++) { if (arr[i] == 1) { titen += i; } } if (titen == x) { for (int j = x; j > 0; j--) { if (arr[j] == 1) { int ans = j; return ans; } } } else { for (int i = 1; i <= x; i++) { if (arr[i] == 0) { arr[i] = 1; break; } else { arr[i] = 0; } } return run(x, arr); } } int main() { int x, ans; cin >> x; int arr[(x + 1)]; for (int i = 1; i <= x; i++) { arr[i] = 0; } arr[1] = 1; ans = run(x, arr); cout << ans << endl; }
a.cc:8:25: error: use of parameter outside function body before ']' token 8 | int run(int x, int arr[x]) { | ^ a.cc: In function 'int run(...)': a.cc:10:25: error: 'x' was not declared in this scope 10 | for (int i = 1; i <= x; i++) { | ^ a.cc:11:11: error: 'arr' was not declared in this scope 11 | if (arr[i] == 1) { | ^~~ a.cc:15:17: error: 'x' was not declared in this scope 15 | if (titen == x) { | ^ a.cc:17:14: error: 'arr' was not declared in this scope 17 | if (arr[j] == 1) { | ^~~ a.cc:24:14: error: 'arr' was not declared in this scope 24 | if (arr[i] == 0) { | ^~~ a.cc:31:21: error: 'arr' was not declared in this scope 31 | return run(x, arr); | ^~~
s814292044
p03779
C
#include <stdio.h> int main() { int X; scanf("%d", &X); for (int i = 1; i < X; i++) if ((1 + i) * i / 2 >= X) { ans = i; break; } printf("%d", ans); return 0; }
main.c: In function 'main': main.c:9:7: error: 'ans' undeclared (first use in this function) 9 | ans = i; | ^~~ main.c:9:7: note: each undeclared identifier is reported only once for each function it appears in
s680593923
p03779
C
#include <stdio.h> int main() { int X; scanf(“%d”, &X); for (int i = 1; i < X; i++) if ((1 + i) * i / 2 >= X) { ans = i; break; } printf(“%d\n”, ans); return 0; }
main.c: In function 'main': main.c:6:9: error: stray '\342' in program 6 | scanf(<U+201C>%d<U+201D>, &X); | ^~~~~~~~ main.c:6:10: error: expected expression before '%' token 6 | scanf(“%d”, &X); | ^ main.c:6:12: error: stray '\342' in program 6 | scanf(<U+201C>%d<U+201D>, &X); | ^~~~~~~~ main.c:9:7: error: 'ans' undeclared (first use in this function) 9 | ans = i; | ^~~ main.c:9:7: note: each undeclared identifier is reported only once for each function it appears in main.c:12:10: error: stray '\342' in program 12 | printf(<U+201C>%d\n<U+201D>, ans); | ^~~~~~~~ main.c:12:11: error: expected expression before '%' token 12 | printf(“%d\n”, ans); | ^ main.c:12:13: error: stray '\' in program 12 | printf(“%d\n”, ans); | ^ main.c:12:15: error: stray '\342' in program 12 | printf(<U+201C>%d\n<U+201D>, ans); | ^~~~~~~~
s307567169
p03779
C
#include <stdio.h> int main() { int X, ans; scanf(“%d”, &X); for (int i = 1; i < X; i++) if ((1 + i) * i / 2 >= X) { ans = i; break; } printf(“%d”, ans); return 0; }
main.c: In function 'main': main.c:6:9: error: stray '\342' in program 6 | scanf(<U+201C>%d<U+201D>, &X); | ^~~~~~~~ main.c:6:10: error: expected expression before '%' token 6 | scanf(“%d”, &X); | ^ main.c:6:12: error: stray '\342' in program 6 | scanf(<U+201C>%d<U+201D>, &X); | ^~~~~~~~ main.c:12:10: error: stray '\342' in program 12 | printf(<U+201C>%d<U+201D>, ans); | ^~~~~~~~ main.c:12:11: error: expected expression before '%' token 12 | printf(“%d”, ans); | ^ main.c:12:13: error: stray '\342' in program 12 | printf(<U+201C>%d<U+201D>, ans); | ^~~~~~~~
s505583411
p03779
C
#include <stdio.h> int main() { int X; scanf(“%d”, &X); for (int i = 1; i < X; i++) if ((1 + i) * i / 2 >= X) { ans = i; break; } printf(“%d”, ans); return 0; }
main.c: In function 'main': main.c:6:9: error: stray '\342' in program 6 | scanf(<U+201C>%d<U+201D>, &X); | ^~~~~~~~ main.c:6:10: error: expected expression before '%' token 6 | scanf(“%d”, &X); | ^ main.c:6:12: error: stray '\342' in program 6 | scanf(<U+201C>%d<U+201D>, &X); | ^~~~~~~~ main.c:9:7: error: 'ans' undeclared (first use in this function) 9 | ans = i; | ^~~ main.c:9:7: note: each undeclared identifier is reported only once for each function it appears in main.c:12:10: error: stray '\342' in program 12 | printf(<U+201C>%d<U+201D>, ans); | ^~~~~~~~ main.c:12:11: error: expected expression before '%' token 12 | printf(“%d”, ans); | ^ main.c:12:13: error: stray '\342' in program 12 | printf(<U+201C>%d<U+201D>, ans); | ^~~~~~~~
s600745078
p03779
C
#include < stdio.h > int main() { int X; scanf(“%d”, &X); for (int i = 1; i < X; i++) if ((1 + i) * i / 2 >= X) { ans = i; break; } printf(“%d”, ans); return 0; }
main.c:1:10: fatal error: stdio.h : No such file or directory 1 | #include < stdio.h > | ^~~~~~~~~~~ compilation terminated.
s353267713
p03779
C
#include < stdio.h > int main() { int X; scanf(“%d”, &X); for (int i = 1; i < X; i++) if ((1 + i) * i / 2 >= X) { ans = i; break; } printf(“%d”, ans); return 0; }
main.c:1:10: fatal error: stdio.h : No such file or directory 1 | #include < stdio.h > | ^~~~~~~~~~~ compilation terminated.
s130960237
p03779
C++
#include < stdio.h > int main() { int X; scanf(“%d”, &X); for (int i = 1; i < X; i++) if ((1 + i) * i / 2 >= X) { ans = i; break; } printf(“%d”, ans); return 0; }
a.cc:1:10: fatal error: stdio.h : No such file or directory 1 | #include < stdio.h > | ^~~~~~~~~~~ compilation terminated.
s936472941
p03779
C++
#include<bits/stdc++.h> using namespace std; typedef long long LL; typedef pair<LL,LL> P; const LL mod=1000000007; int main(){ int x; cin >> x; for(int i=1;i<=x;i++){ if(t*(t+1)/2>=x){ cout << i << endl; return 0; } } return 0; }
a.cc: In function 'int main()': a.cc:11:12: error: 't' was not declared in this scope 11 | if(t*(t+1)/2>=x){ | ^
s468295373
p03779
C++
import java.io.*; class Report12_2 { public static void main(String[] args) { try { BufferedReader br = new BufferedReader(new FileReader("./score.txt")); PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter("oddScore.txt"))); while(true) { String str = br.readLine(); int num = Integer.parseInt(str); if (num == -1) { pw.close(); break; } else if(num % 2 == 1) { pw.println(num); } } } catch(IOException e) { System.out.println("Error"); } // System.out.println("何個の数値の和を求めますか?"); // String str = br.readLine(); // int num = Integer.parseInt(str); // System.out.println(num + "個の数値の和を求めます。\n入力してください"); // for (int i = 0; i < num; i++) { // String num_str = br.readLine(); // int val = Integer.parseInt(num_str); // sum += val; // } // System.out.println(sum); } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:15: error: expected ':' before 'static' 4 | public static void main(String[] args) | ^~~~~~~ | : a.cc:4:33: error: 'String' has not been declared 4 | public static void main(String[] args) | ^~~~~~ a.cc:4:42: error: expected ',' or '...' before 'args' 4 | public static void main(String[] args) | ^~~~ a.cc:50:2: error: expected ';' after class definition 50 | } | ^ | ; a.cc: In static member function 'static void Report12_2::main(int*)': a.cc:9:25: error: 'BufferedReader' was not declared in this scope 9 | BufferedReader br = new | ^~~~~~~~~~~~~~ a.cc:11:25: error: 'PrintWriter' was not declared in this scope 11 | PrintWriter pw = new | ^~~~~~~~~~~ a.cc:16:33: error: 'String' was not declared in this scope 16 | String str = br.readLine(); | ^~~~~~ a.cc:17:44: error: 'Integer' was not declared in this scope 17 | int num = Integer.parseInt(str); | ^~~~~~~ a.cc:17:61: error: 'str' was not declared in this scope; did you mean 'std'? 17 | int num = Integer.parseInt(str); | ^~~ | std a.cc:20:41: error: 'pw' was not declared in this scope 20 | pw.close(); | ^~ a.cc:25:41: error: 'pw' was not declared in this scope 25 | pw.println(num); | ^~ a.cc:31:23: error: 'IOException' does not name a type 31 | catch(IOException e) | ^~~~~~~~~~~ a.cc:33:25: error: 'System' was not declared in this scope 33 | System.out.println("Error"); | ^~~~~~
s151080558
p03779
C++
#include <iostream> using namespace std; int main(){ int X; int i; cin>>X; for(i=0;i<1000000000;i++){ if(i(1+i)/2>=X) break; } cout<<i<<endl; }
a.cc: In function 'int main()': a.cc:9:13: error: 'i' cannot be used as a function 9 | if(i(1+i)/2>=X) break; | ~^~~~~
s922704059
p03779
C++
#include <iostream> using namespace std; int main(){ int X; int i; for(i=0;i<1000000000;i++){ if(i(1+i)/2>=X) break; } cout<<i<<endl; }
a.cc: In function 'int main()': a.cc:8:13: error: 'i' cannot be used as a function 8 | if(i(1+i)/2>=X) break; | ~^~~~~
s540841693
p03779
C
#include<stdio.h> int main(void){ int X, i, sum; scanf("%d", &X); sum=0; for(i=0; sum<X; i++){ sum+=i; } printf("%d", i-1); return 0;
main.c: In function 'main': main.c:12:1: error: expected declaration or statement at end of input 12 | return 0; | ^~~~~~
s772006697
p03779
C++
#include <iostream> #include <math.h> using namespace std; int main(){ // int X = 2; int X = 0; cin >> X; int sum = 0; for(int i = 1; i <= X; i++){ sum += i; if(sum >= X){ int dis = sum - X; if(dis < X){ cout << i << endl; break; } } }
a.cc: In function 'int main()': a.cc:21:6: error: expected '}' at end of input 21 | } | ^ a.cc:5:11: note: to match this '{' 5 | int main(){ | ^
s879698168
p03779
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { // int X = 2; int X = 0; cin >> X; int sum = 0; for(int i = 1; i <= X; i++){ sum += i; if(sum >= X){ int dis = sum - X; if(dis < X){ cout << i << endl; break; } } } } return 0; }
a.cc:23:5: error: expected unqualified-id before 'return' 23 | return 0; | ^~~~~~ a.cc:24:1: error: expected declaration before '}' token 24 | } | ^
s169712148
p03779
C++
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Text; namespace AtCoder { class MainClass { //C#7.0 int X; void Solve() { io.i(out X); Mathf mat = new Mathf(); int ans; for (ans = 1; ;ans++) if (mat.TousaSum(1, 1, ans) >= X) break; io.o(ans); } public static void Main(string[] args) { new MainClass().Stream(); } IO io = new IO(); void Stream() { Solve(); io.writeFlush(); } class IO { string[] nextBuffer; int BufferCnt; char[] cs = new char[] { ' ' }; StreamWriter sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false }; public IO() { nextBuffer = new string[0]; BufferCnt = 0; Console.SetOut(sw); } public string next() { if (BufferCnt < nextBuffer.Length) return nextBuffer[BufferCnt++]; string st = Console.ReadLine(); while (st == "") st = Console.ReadLine(); nextBuffer = st.Split(cs, StringSplitOptions.RemoveEmptyEntries); BufferCnt = 0; return nextBuffer[BufferCnt++]; } public char nextChar() { return char.Parse(next()); } public int nextInt() { return int.Parse(next()); } public long nextLong() { return long.Parse(next()); } public double nextDouble() { return double.Parse(next()); } public string[] array() { return Console.ReadLine().Split(' '); } public char[] arrayChar() { return Array.ConvertAll(array(), char.Parse); } public int[] arrayInt() { return Array.ConvertAll(array(), int.Parse); } public long[] arrayLong() { return Array.ConvertAll(array(), long.Parse); } public double[] arrayDouble() { return Array.ConvertAll(array(), double.Parse); } private bool typeEQ<T, U>() { return typeof(T).Equals(typeof(U)); } private T convertType<T, U>(U v) { return (T)Convert.ChangeType(v, typeof(T)); } private T suitType<T>(string s) { if (typeEQ<T, int>()) return convertType<T, int>(int.Parse(s)); if (typeEQ<T, long>()) return convertType<T, long>(long.Parse(s)); if (typeEQ<T, double>()) return convertType<T, double>(double.Parse(s)); if (typeEQ<T, char>()) return convertType<T, char>(char.Parse(s)); return convertType<T, string>(s); } public void i<T>(out T v) { v = suitType<T>(next()); } public void i<T, U>(out T v1, out U v2) { var a = array(); v1 = suitType<T>(a[0]); v2 = suitType<U>(a[1]); } public void i<T, U, V>(out T v1, out U v2, out V v3) { var a = array(); v1 = suitType<T>(a[0]); v2 = suitType<U>(a[1]); v3 = suitType<V>(a[2]); } public void i<T, U, V, W>(out T v1, out U v2, out V v3, out W v4) { var a = array(); v1 = suitType<T>(a[0]); v2 = suitType<U>(a[1]); v3 = suitType<V>(a[2]); v4 = suitType<W>(a[3]); } public void ini(out int[] a, int size) { a = new int[size]; for (int i = 0; i < size; i++) a[i] = nextInt(); } public void ini(out int[] a1, out int[] a2, int size) { a1 = new int[size]; a2 = new int[size]; for (int i = 0; i < size; i++) { a1[i] = nextInt(); a2[i] = nextInt(); } } public void ini(out string[] a, int size) { a = new string[size]; for (int i = 0; i < size; i++) a[i] = next(); } public void inii(out int[] a, int size) { a = new int[size]; for (int i = 0; i < size; i++) a[i] = nextInt() - 1; } public void inii(out int[] a1, out int[] a2, int size) { a1 = new int[size]; a2 = new int[size]; for (int i = 0; i < size; i++) { a1[i] = nextInt() - 1; a2[i] = nextInt() - 1; } } public void o<T>(T v) { Console.WriteLine(v); } public void o<T>(params T[] a) { foreach (T v in a) Console.WriteLine(v); } public void o<T>(List<T> l) { foreach (T v in l) sw.WriteLine(v); } public void ol<T>(T v) { Console.Write(v + " "); } public void ol<T>(params T[] a) { foreach (T v in a) Console.Write(v + " "); Console.WriteLine(""); } public void YN(bool f) { Console.WriteLine(f ? "YES" : "NO"); } public void Yn(bool f) { Console.WriteLine(f ? "Yes" : "No"); } public void yn(bool f) { Console.WriteLine(f ? "yes" : "no"); } public void br(){Console.WriteLine("");} public void writeFlush() { Console.Out.Flush(); } public string pad0<T>(T v, int n) { return v.ToString().PadLeft(n, '0'); } } class Mathf { public int mod = 1000000007;//10^9+7 public long Pow(long a, long b) { if (b == 0) return 1; if (b % 2 == 1) return (a % mod * Pow(a % mod, b - 1) % mod) % mod; else return Pow(a * a % mod, b / 2) % mod; } public long Fact(long n) { return n != 0 ? (n % mod * (Fact(n - 1) % mod) % mod) : 1; } public long C(long n, long r) { if (r == 0 || n == r) return 1; else return (Fact(n) % mod * Pow((Fact(n - r) % mod * Fact(r) % mod) % mod, mod - 2) % mod) % mod; } public long Sum(params long[] a) { return a.Aggregate((v, next) => (v % mod + next) % mod); } public int GCD(int a, int b) { if (a < b) Swap(ref a, ref b); return b == 0 ? a : GCD(b, a % b); } public int GCD(int[] array) { return array.Aggregate((v, next) => GCD(v, next)); } public void Swap<T>(ref T a, ref T b) { T tmp = a; a = b; b = tmp; } public T Max<T>(params T[] v) { return v.Max(); } public T Min<T>(params T[] v) { return v.Min(); } public double Dis(int x1, int y1, int x2, int y2) { return Math.Sqrt(Math.Pow((x2 - x1), 2) + Math.Pow((y2 - y1), 2)); } public int Digit(long n) { return (n == 0) ? 1 : (int)Math.Log10(n) + 1; } public int Clamp(int n, int a, int b) {return (n < a) ? a : (b < n) ? b : n;} public long Clamp(long n, long a, long b) {return (n < a) ? a : (b < n) ? b : n;} public double Clamp(double n, double a, double b) { return (n < a) ? a : (b < n) ? b : n;} public long Tousa(long a, long d, int no) { return a + (no - 1) * d; } public long TousaSum(long a, long d, int no) { return no* (2 * a + (no - 1) * d) / 2; } } } class AssociativeArray<T>{ public Dictionary<T, int> dic; public void init(T[] a){dic = new Dictionary<T, int> (); for (int i = 0;i<a.Length;i++){if (!dic.ContainsKey(a[i])) dic[a[i]] = 0;dic[a[i]]++;} } public int ValueSum() { int s = 0; foreach (var i in dic) s += i.Value; return s; } public int KeyNum() { return dic.Keys.Count; } public int Max(){return dic.Values.Max();}public int Min() { return dic.Values.Min(); } public T MaxKey() { return dic.First(d => d.Value == Max()).Key; } public T MinKey() { return dic.First(d => d.Value == Min()).Key; } public bool isContains(T k) { return dic.ContainsKey(k); } //:sort->array } class Time{ public bool isLeapYear(int y) { return (y % 400 == 0 || (y % 4 == 0 && y % 100 != 0)); } } class BucketSort { public int[] bucket; public void Init(int[] a) { bucket = new int[a.Max() + 1]; for (int i = 0; i < a.Length; ++i) ++bucket[a[i]]; for (int i = 0, j = 0; j < bucket.Length; ++j) for (int k = bucket[j]; k != 0; --k, ++i) a[i] = j; } } static class StringEX { public static string Reversed(this string s) { return string.Join("", s.Reverse()); } public static string Repeat(this string s, int n) { return string.Concat(Enumerable.Repeat(s, n).ToArray()); } } static class CharEX{ public static int toInt(this char c) { return int.Parse(c.ToString()); } } }
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; | ^~~~~~ a.cc:3:7: error: expected nested-name-specifier before 'System' 3 | using System.Collections.Generic; | ^~~~~~ a.cc:4:7: error: expected nested-name-specifier before 'System' 4 | using System.Diagnostics; | ^~~~~~ a.cc:5:7: error: expected nested-name-specifier before 'System' 5 | using System.IO; | ^~~~~~ a.cc:6:7: error: expected nested-name-specifier before 'System' 6 | using System.Linq; | ^~~~~~ a.cc:7:7: error: expected nested-name-specifier before 'System' 7 | using System.Text; | ^~~~~~ a.cc:26:15: error: expected ':' before 'static' 26 | public static void Main(string[] args) { new MainClass().Stream(); } | ^~~~~~~ | : a.cc:26:33: error: 'string' has not been declared 26 | public static void Main(string[] args) { new MainClass().Stream(); } | ^~~~~~ a.cc:26:42: error: expected ',' or '...' before 'args' 26 | public static void Main(string[] args) { new MainClass().Stream(); } | ^~~~ a.cc:27:9: error: 'IO' does not name a type 27 | IO io = new IO(); | ^~ a.cc:31:13: error: 'string' does not name a type 31 | string[] nextBuffer; int BufferCnt; char[] cs = new char[] { ' ' }; | ^~~~~~ a.cc:31:53: error: expected unqualified-id before '[' token 31 | string[] nextBuffer; int BufferCnt; char[] cs = new char[] { ' ' }; | ^ a.cc:32:13: error: 'StreamWriter' does not name a type 32 | StreamWriter sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false }; | ^~~~~~~~~~~~ a.cc:33:19: error: expected ':' before 'IO' 33 | public IO() { nextBuffer = new string[0]; BufferCnt = 0; Console.SetOut(sw); } | ^~~ | : a.cc:34:19: error: expected ':' before 'string' 34 | public string next() { | ^~~~~~~ | : a.cc:34:20: error: 'string' does not name a type 34 | public string next() { | ^~~~~~ a.cc:42:19: error: expected ':' before 'char' 42 | public char nextChar() { return char.Parse(next()); } | ^~~~~ | : a.cc:43:19: error: expected ':' before 'int' 43 | public int nextInt() { return int.Parse(next()); } | ^~~~ | : a.cc:44:19: error: expected ':' before 'long' 44 | public long nextLong() { return long.Parse(next()); } | ^~~~~ | : a.cc:45:19: error: expected ':' before 'double' 45 | public double nextDouble() { return double.Parse(next()); } | ^~~~~~~ | : a.cc:46:19: error: expected ':' before 'string' 46 | public string[] array() { return Console.ReadLine().Split(' '); } | ^~~~~~~ | : a.cc:46:20: error: 'string' does not name a type 46 | public string[] array() { return Console.ReadLine().Split(' '); } | ^~~~~~ a.cc:47:19: error: expected ':' before 'char' 47 | public char[] arrayChar() { return Array.ConvertAll(array(), char.Parse); } | ^~~~~ | : a.cc:47:24: error: expected unqualified-id before '[' token 47 | public char[] arrayChar() { return Array.ConvertAll(array(), char.Parse); } | ^ a.cc:48:19: error: expected ':' before 'int' 48 | public int[] arrayInt() { return Array.ConvertAll(array(), int.Parse); } | ^~~~ | : a.cc:48:23: error: expected unqualified-id before '[' token 48 | public int[] arrayInt() { return Array.ConvertAll(array(), int.Parse); } | ^ a.cc:49:19: error: expected ':' before 'long' 49 | public long[] arrayLong() { return Array.ConvertAll(array(), long.Parse); } | ^~~~~ | : a.cc:49:24: error: expected unqualified-id before '[' token 49 | public long[] arrayLong() { return Array.ConvertAll(array(), long.Parse); } | ^ a.cc:50:19: error: expected ':' before 'double' 50 | public double[] arrayDouble() { return Array.ConvertAll(array(), double.Parse); } | ^~~~~~~ | : a.cc:50:26: error: expected unqualified-id before '[' token 50 | public double[] arrayDouble() { return Array.ConvertAll(array(), double.Parse); } | ^ a.cc:51:20: error: expected ':' before 'bool' 51 | private bool typeEQ<T, U>() { return typeof(T).Equals(typeof(U)); } | ^~~~~ | : a.cc:51:26: error: expected ';' at end of member declaration 51 | private bool typeEQ<T, U>() { return typeof(T).Equals(typeof(U)); } | ^~~~~~ | ; a.cc:51:32: error: expected unqualified-id before '<' token 51 | private bool typeEQ<T, U>() { return typeof(T).Equals(typeof(U)); } | ^ a.cc:52:20: error: expected ':' before 'T' 52 | private T convertType<T, U>(U v) { return (T)Convert.ChangeType(v, typeof(T)); } | ^~ | : a.cc:52:21: error: 'T' does not name a type 52 | private T convertType<T, U>(U v) { return (T)Convert.ChangeType(v, typeof(T)); } | ^ a.cc:53:20: error: expected ':' before 'T' 53 | private T suitType<T>(string s) { | ^~ | : a.cc:53:21: error: 'T' does not name a type 53 | private T suitType<T>(string s) { | ^ a.cc:60:19: error: expected ':' before 'void' 60 | public void i<T>(out T v) { v = suitType<T>(next()); } | ^~~~~ | : a.cc:60:25: error: variable or field 'i' declared void 60 | public void i<T>(out T v) { v = suitType<T>(next()); } | ^ a.cc:60:25: error: expected ';' at end of member declaration 60 | public void i<T>(out T v) { v = suitType<T>(next()); } | ^ | ; a.cc:60:26: error: expected unqualified-id before '<' token 60 | public void i<T>(out T v) { v = suitType<T>(next()); } | ^ a.cc:61:19: error: expected ':' before 'void' 61 | public void i<T, U>(out T v1, out U v2) { | ^~~~~ | : a.cc:61:25: error: variable or field 'i' declared void 61 | public void i<T, U>(out T v1, out U v2) { | ^ a.cc:61:25: error: expected ';' at end of member declaration 61 | public void i<T, U>(out T v1, out U v2) { | ^ | ; a.cc:61:26: error: expected unqualified-id before '<' token 61 | public void i<T, U>(out T v1, out U v2) { | ^ a.cc:64:19: error: expected ':' before 'void' 64 | public void i<T, U, V>(out T v1, out U v2, out V v3) { | ^~~~~ | : a.cc:64:25: error: variable or field 'i' declared void 64 | public void i<T, U, V>(out T v1, out U v2, out V v3) { | ^ a.cc:64:25: error: expected ';' at end of member declaration 64 | public void i<T, U, V>(out T v1, out U v2, out V v3) { | ^ | ; a.cc:64:26: error: expected unqualified-id before '<' token 64 | public void i<T, U, V>(out T v1, out U v2, out V v3) { | ^ a.cc:68:19: error: expected ':' before 'void' 68 | public void i<T, U, V, W>(out T v1, out U v2, out V v3, out W v4) { | ^~~~~ | : a.cc:68:25: error: variable or field 'i' declared void 68 | public void i<T, U, V, W>(out T v1, out U v2, out V v3, out W v4) { | ^ a.cc:68:25: error: expected ';' at end of member declaration 68 | public void i<T, U, V, W>(out T v1, out U v2, out V v3, out W v4) { | ^ | ; a.cc:68:26: error: expected unqualified-id before '<' token 68 | public void i<T, U, V, W>(out T v1, out U v2, out V v3, out W v4) { | ^ a.cc:72:19: error: expected ':' before 'void' 72 | public void ini(out int[] a, int size) { | ^~~~~ | : a.cc:72:29: error: 'out' has not been declared 72 | public void ini(out int[] a, int size) { | ^~~ a.cc:72:29: error: two or more data types in declaration of 'parameter' a.cc:72:38: error: expected ')' before 'a' 72 | public void ini(out int[] a, int size) { | ~ ^~ | ) a.cc:72:37: error: expected ';' at end of member declaration 72 | public void ini(out int[] a, int size) { | ^ | ; a.cc:72:39: error: 'a' does not name a type 72 | public void ini(out int[] a, int size) {
s787948146
p03779
C++
#include <bits/stdc++.h> #define FOR(i,bg,ed) for(ll i=(bg);i<(ed);i++) #define REP(i,n) FOR(i,0,n) #define MOD 1000000007 //#define int long long using namespace std; typedef long long ll; const int INF = 1e9; signed main() { int X; cin >> X; int sum = 0; for (int t=1; true; t++) { sum += t; if (sum >= X) break; } cout << t << endl; }
a.cc: In function 'int main()': a.cc:23:13: error: 't' was not declared in this scope 23 | cout << t << endl; | ^
s383016198
p03779
C++
#include <iostream> #include <string> #include <algorithm> #include <cstring> #include <cstdio> #include <cmath> #include <cctype> #define div 1000000000+7 typedef long long ll; using namespace std; int main() { long x; long count = 0; cin >> x; for(int i = 1; i < INT_MAX; i++){ x = x - i; count++; if(x <= 0){ break; } } cout << count << endl; }
a.cc: In function 'int main()': a.cc:20:24: error: 'INT_MAX' was not declared in this scope 20 | for(int i = 1; i < INT_MAX; i++){ | ^~~~~~~ a.cc:8:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 7 | #include <cctype> +++ |+#include <climits> 8 |
s066006461
p03779
Java
import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.InputMismatchException; public class Main { static void solve(B.FastScanner sc, PrintWriter out) { int X = sc.ni(); int dist = 0, i=0; while(dist<X) { dist += ++i; } out.println(i); } public static void main(String[] args) { B.FastScanner sc = new B.FastScanner(System.in); PrintWriter out = new PrintWriter(System.out); solve(sc, out); out.flush(); } static class FastScanner { private final InputStream is; private byte[] inbuf = new byte[1024]; private int lenbuf = 0, ptrbuf = 0; FastScanner(InputStream is) { this.is = is; } char nc() { return (char) skip(); } char[] nca(int n) { char[] buf = new char[n]; int b = skip(), p = 0; while (p < n && !(isSpaceChar(b))) { buf[p++] = (char) b; b = readByte(); } return n == p ? buf : Arrays.copyOf(buf, p); } String ns() { int b = skip(); StringBuilder sb = new StringBuilder(); while (!(isSpaceChar(b))) { sb.appendCodePoint(b); b = readByte(); } return sb.toString(); } int ni() { int num = 0, b; boolean minus = false; while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ; if (b == '-') { minus = true; b = readByte(); } while (true) { if (b >= '0' && b <= '9') { num = num * 10 + (b - '0'); } else { return minus ? -num : num; } b = readByte(); } } int[] nia(int n) { int[] a = new int[n]; for (int i = 0; i < n; i++) a[i] = ni(); return a; } long nl() { long num = 0, b; boolean minus = false; while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ; if (b == '-') { minus = true; b = readByte(); } while (true) { if (b >= '0' && b <= '9') { num = num * 10 + (b - '0'); } else { return minus ? -num : num; } b = readByte(); } } double nd() { return Double.parseDouble(ns()); } private int readByte() { if (lenbuf == -1) throw new InputMismatchException(); if (ptrbuf >= lenbuf) { ptrbuf = 0; try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); } if (lenbuf <= 0) return -1; } return inbuf[ptrbuf++]; } private int skip() { int b; while ((b = readByte()) != -1 && isSpaceChar(b)) ; return b; } private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); } } }
Main.java:8: error: package B does not exist static void solve(B.FastScanner sc, PrintWriter out) { ^ Main.java:18: error: package B does not exist B.FastScanner sc = new B.FastScanner(System.in); ^ Main.java:18: error: package B does not exist B.FastScanner sc = new B.FastScanner(System.in); ^ 3 errors
s572937687
p03779
C++
#include <iostream> #include <cmath> using namespace std; int main(){ int X; cin >> X; cout << ceil( (-1+sqrt(1+8*X)) / 2 ) << endl; } [
a.cc:11:1: error: expected unqualified-id before '[' token 11 | [ | ^