submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s738172238
p03861
C++
#include <iostream> using namespace std; int main(void){ long int a, b, x, count; cin >> a >> b >> c; for(int i = a; i <= b; i++){ if(i % x == 0){ count++; } } cout << count << endl; }
a.cc: In function 'int main()': a.cc:5:20: error: 'c' was not declared in this scope 5 | cin >> a >> b >> c; | ^
s675042695
p03861
C++
#include <iostream> using namespace std; int main(void){ long int a, b, x, count; cin >> a >> b >> c; for(int i = a; i <= b; i++){ if(i % x == 0){ count++; } } cout << count << endl; }
a.cc: In function 'int main()': a.cc:5:20: error: 'c' was not declared in this scope 5 | cin >> a >> b >> c; | ^
s329188430
p03861
C++
a.cc:1:1: error: '\U00003042' does not name a type 1 | あ | ^~
s640028966
p03861
C++
a.cc:1:1: error: '\U00003042' does not name a type 1 | あ | ^~
s050076924
p03861
C++
/* ID: rchalam1 LANG: C++14 TASK: */ // For train.usaco.org, fill the template above. // Competitive Coding Template // GCC OPTIMIAZTION FLAGS #ifdef ONLINE_JUDGE #pragma GCC target ("avx2") #pragma GCC optimization ("O3") #pragma GCC optimization ("unroll-loops") #endif #include <bits/stdc++.h> /* #include <fstream> #include <iostream> #include <string> #include <vector> */ // All Includes for Competitive Coding Template using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; using vi = std::vector<int>; using vll = std::vector<long long>; using vull = std::vector<unsigned long long>; #define FOR(i, a, b) for (auto i = (a); i < (b); ++i) #define F0R(i, a) FOR(i, 0, a) #define ROF(i, a, b) for (auto i = (a); i >= (b); --i) #define R0F(i, a) ROF(i, a, 0) #define ITR(a, x) for (auto& a: x) #define FSRT(set) sort((set).begin(),(set).end()) #define RSRT(set) sort((set).rbegin(),(set).rend()) #define CSRT(set, function) sort((set).begin(),(set).end(), (function)) #define TRS(set) sort((set).begin(),(set).end(), greater<>()) #define REV(set) reverse((set).begin(),(set).end()); #define ALL(set) (set).begin(), (set).end() #define mp make_pair #define mt make_tuple #define pb push_back #define eb emplace_back #define ff first #define ss second // For stdio, call setIO() or setIO(""). void setIO(std::ifstream &readFile, std::ofstream &writeFile, const std::string &name = "", bool stdIO = false) { std::ios_base::sync_with_stdio(false); std::cin.tie(nullptr); std::cout.tie(nullptr); if(!name.empty() && !stdIO) { readFile.open(name + ".in"); if(readFile.fail()) return; writeFile.open(name + ".out"); std::cin.rdbuf(readFile.rdbuf()); std::cout.rdbuf(writeFile.rdbuf()); } } // To time program, create object Timer to start timing, and call Timer.elapsed(). #include <chrono> class Timer { std::chrono::time_point<std::chrono::high_resolution_clock> m_beg; public: Timer() : m_beg(std::chrono::high_resolution_clock::now()) {} void reset() { m_beg = std::chrono::high_resolution_clock::now(); } [[nodiscard]] long double elapsed() const { return std::chrono::duration_cast<std::chrono::duration<long double, std::ratio<1> >>( std::chrono::high_resolution_clock::now() - m_beg).count(); } }; // Defines datatype using dt = int; // Defines MAXN value constexpr dt MAXN = 1e5 + 1; // Defines Modulus constexpr dt MOD = 1e9 + 7; // Defines Floating Point Correction constexpr long double EPS = 1e-9; //***** //START CODE BELOW //***** int main(int argc, char *argv[]) { static std::ifstream readFile; static std::ofstream writeFile; setIO(readFile, writeFile); ll a, b, x; cin >> a >> b >> x; cout << (a ? b / x - (a - 1) / x : ) << '\n'; }
a.cc: In function 'int main(int, char**)': a.cc:114:44: error: expected primary-expression before ')' token 114 | cout << (a ? b / x - (a - 1) / x : ) << '\n'; | ^
s891922382
p03861
C++
#include <iostream> using namespace std; #define int long long int main(){ int a , b , x ; cin >> a >> b >> x ; x = max(1LL, x) ; int ans = b / x - (a - 1) / x ; cout << ans << endl; return 0 ; }
cc1plus: error: '::main' must return 'int'
s700757104
p03861
C++
#include <iostream> using namespace std; int main() { long long x, y, d; cin >> x >> y >> d; long long a = y / d; long long b = (x == 0 ? -1 : (x - 1) / d); cout << a - b << endl; return 0;
a.cc: In function 'int main()': a.cc:10:18: error: expected '}' at end of input 10 | return 0; | ^ a.cc:4:1: note: to match this '{' 4 | { | ^
s978515561
p03861
C++
#include <iostream> #include <string> using namespace std; int main() { string a, b, c, d; cin >> a >> b >> c; d = toupper(b[0]); cout << a[0] << hen << c[0] << endl; }
a.cc: In function 'int main()': a.cc:9:21: error: 'hen' was not declared in this scope 9 | cout << a[0] << hen << c[0] << endl; | ^~~
s597910688
p03861
C++
#include<bits/stdc++.h> using namespace std; long long a,b,x; long long f(n){ if(n>=0)return n/x+1; else return 0; } int main(){ std::cin>>a>>b>>x; std::cout<<f(b)-f(a-1); return 0; }
a.cc:4:13: error: 'n' was not declared in this scope; did you mean 'yn'? 4 | long long f(n){ | ^ | yn a.cc: In function 'int main()': a.cc:10:15: error: 'f' cannot be used as a function 10 | std::cout<<f(b)-f(a-1); | ~^~~ a.cc:10:20: error: 'f' cannot be used as a function 10 | std::cout<<f(b)-f(a-1); | ~^~~~~
s653830365
p03861
C++
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) using namespace std; using P = pair<int, int>; using ll = long long; using M = map<int, int> int main() { ll a, b, x; cin >> a >> b >> x; b = b / x; a = a - 1 / x; if(a < 0) a = 0; cout << b - a << endl; return 0; }
a.cc:7:11: error: two or more data types in declaration of 'type name' 7 | using M = map<int, int> | ^~~~~~~~~~~~~
s091755961
p03861
Java
package com.company; import java.io.*; //import java.util.*; public class Main { //public class Betweenaandb { public static void main(String[] args) { out = new PrintWriter(new BufferedOutputStream(System.out)); MyScanner sc = new MyScanner();//start long a=sc.nextLong(); long b=sc.nextLong(); long n=sc.nextLong(); if(b%n==0){ long cout=((b-a)/n)+1; out.println(cout); }else { long cout=((b-a)/n); out.println(cout); } out.close(); } //-----------PrintWriter for faster output--------------------------------- public static PrintWriter out; //-----------MyScanner class for faster input---------- public static class MyScanner { BufferedReader br; StringTokenizer st; public MyScanner() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while (st == null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } String nextLine() { String str = ""; try { str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } } //-------------------------------------------------------- }
Main.java:34: error: cannot find symbol StringTokenizer st; ^ symbol: class StringTokenizer location: class MyScanner Main.java:43: error: cannot find symbol st = new StringTokenizer(br.readLine()); ^ symbol: class StringTokenizer location: class MyScanner 2 errors
s582233554
p03861
C
#include <iostream> using namespace std; int main() { long long int a, b, x,div,r,res; cin >> a >> b >> x; if(a == 0) { div = b / x; res = div + 1; cout << div; } else { div = b / x; r= (a - 1) / x; res = div - r; cout << res; } }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s085460872
p03861
C++
#include<bits/stdc++.h> using namespace std; int main() { ll a, b, x, p, q, cnt=0; cin >> a >> b >> x; if(a%x==0) p = (a/x) - 1 ; else p=(a/x); q = b/x; cout<<q-p<<"\n" ; return 0; }
a.cc: In function 'int main()': a.cc:6:5: error: 'll' was not declared in this scope 6 | ll a, b, x, p, q, cnt=0; | ^~ a.cc:7:12: error: 'a' was not declared in this scope 7 | cin >> a >> b >> x; | ^ a.cc:7:17: error: 'b' was not declared in this scope 7 | cin >> a >> b >> x; | ^ a.cc:7:22: error: 'x' was not declared in this scope 7 | cin >> a >> b >> x; | ^ a.cc:10:9: error: 'p' was not declared in this scope 10 | p = (a/x) - 1 ; | ^ a.cc:12:9: error: 'p' was not declared in this scope 12 | p=(a/x); | ^ a.cc:14:5: error: 'q' was not declared in this scope 14 | q = b/x; | ^ a.cc:16:13: error: 'p' was not declared in this scope 16 | cout<<q-p<<"\n" ; | ^
s857724026
p03861
C
#include <bits/stdc++.h> using namespace std; int main () { long long a,b,c; cin>>a>>b>>c; long long r= b/c - a/c; if(a%c==0){ r++; } cout<<r; }
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory 1 | #include <bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s739862951
p03861
C++
# include<string> #include <iostream> using namespace std; int main(){ int n,a,x,c=0; cin>>n>>a>>x; if(n>a){ for(int i=0;i<=n;i++){ if(n<=a){ if((n)%x==0){ n+=1; c++; } else{ n+=1; } } else{ break; } std::cout << c << std::endl; }}
a.cc: In function 'int main()': a.cc:28:3: error: expected '}' at end of input 28 | }} | ^ a.cc:5:11: note: to match this '{' 5 | int main(){ | ^
s598293522
p03861
C++
#include <iostream> int main(){ long int a, b, x, n=0; cin >> a >> b >> x; for(int i = a; i <= b; i++){ if(i%x == 0){ n = n + 1; } } cout << n << endl; }
a.cc: In function 'int main()': a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin >> a >> b >> 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:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 11 | 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:11:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 11 | 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) | ^~~~
s397113390
p03861
C++
#include <iostream> int main(){ int a, b, x, n=0; cin >> a >> b >> x; for(int i = a; i <= b; i++){ if(i%x == 0){ n = n + 1; } } cout << n << endl; }
a.cc: In function 'int main()': a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin >> a >> b >> 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:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 11 | 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:11:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 11 | 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) | ^~~~
s188354018
p03861
C++
#include <bits/stdc++.h> using namespace std; #define vit vector<int>::iterator #define pb push_back #define ppb pop_back #define mp make_pair #define all(x) (x).begin(), (x).end() #define forn(i, n) for(int i = 0; i < int(n); i++) #define fr first #define sc second #define skip continue #define PI 3.14159265 typedef unsigned long long ull; typedef long long ll; typedef unsigned int ui; typedef long double ld; typedef vector<int> vi; typedef vector<long long> vll; typedef vector<bool> vb; const int INF = 1e9 + 5; const long long MAXN=2e5 + 5;; void faster(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } bool cmp(const string& a, const string& b) { return (a + b) < (b + a); } vector<int> Reversed(const vector<int>& s){ vector<int> d = s; reverse(all(d)); return d; } void solve(){ ll a, b, x; cin >> a >> b >> c; ll cnt = 0; for(int i = a; i <= b; i++){ if(i % c == 0) cnt++; } cout << cnt; } int main(){ //freopen("slalom.in","r",stdin); //freopen("slalom.out","w",stdout); //faster(); int n = 1; //cin >> n; while(n--){ solve(); cout << endl; } //fclose(stdout); }
a.cc: In function 'void solve()': a.cc:45:22: error: 'c' was not declared in this scope 45 | cin >> a >> b >> c; | ^
s274570802
p03861
C++
#include <bits/stdc++.h> using namespace std; int main() { long long A,B,X; cin >> A >> B >> X; if (!(A==B)){ cout << B/X-(A-1)/X << endl; } else { cout << 0 << endl; }
a.cc: In function 'int main()': a.cc:12:2: error: expected '}' at end of input 12 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s248124510
p03861
C++
#include <bits/stdc++.h> using namespace std; int main() { int64_t=a,b,x; cin >> a >> b >> x; if(a!=0) cout << b/x-(a-1)/x << endl; else cout << b/x+1 << endl; }
a.cc: In function 'int main()': a.cc:5:10: error: expected unqualified-id before '=' token 5 | int64_t=a,b,x; | ^ a.cc:6:10: error: 'a' was not declared in this scope 6 | cin >> a >> b >> x; | ^ a.cc:6:15: error: 'b' was not declared in this scope 6 | cin >> a >> b >> x; | ^ a.cc:6:20: error: 'x' was not declared in this scope 6 | cin >> a >> b >> x; | ^
s905870800
p03861
C++
#include <bits/stdc++.h> using namespace std; typedef long long LL; #define REP(i, n) for(int i = 0; i < (int)(n); i++) #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define ALL(x) (x).begin(),(x).end() const int IINF = 1e9; const LL LINF = 1e18; const LL MOD = 1e9+7; int main() { LL a, b, x; cin >> a >> b >> x; cout << b/x - max(0, a - 1)/x << endl; return 0; }
a.cc: In function 'int main()': a.cc:16:22: error: no matching function for call to 'max(int, LL)' 16 | cout << b/x - max(0, a - 1)/x << endl; | ~~~^~~~~~~~~~ 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:16:22: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'LL' {aka 'long long int'}) 16 | cout << b/x - max(0, a - 1)/x << endl; | ~~~^~~~~~~~~~ /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:16:22: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 16 | cout << b/x - max(0, a - 1)/x << endl; | ~~~^~~~~~~~~~
s909270240
p03861
C++
# include <bits/stdc++.h> typedef long long lint; using namespace std; lint gcd(lint x, lint y) { if(x == 0) { return y; } else { return gcd(y%x,x); } } lint lcm(lint x, lint y) { return x/gcd(x,y)*y; } lint C(lint n, lint k) { if(n == k) { return 1; } else if(n < k) { return 0; } else if(k == 0) { return 1; } else if(k == 1) { return n; } else return C(n-1,k-1) + C(n-1,k); } lint P(lint n, lint k) { if(k == 1) { return n; } return (n*(P(n-1,k-1)%1000000007)%1000000007); } int main() { lint a,b,x; cin >> a >> b >> x; if(a == b) { if(a%x == 0) { cout << 2 << endl; }} else { cout << 0 << endl; } return 0; } if(x == 1) { cout << (b-a+1) << endl; return 0; } if(b%x == 0 && a%x == 0) { cout << (b-a+1)/x+1 << endl; } else { cout << (b-a+1)/x << endl; } return 0; }
a.cc:35:3: error: expected unqualified-id before 'if' 35 | if(x == 1) { | ^~ a.cc:40:3: error: expected unqualified-id before 'if' 40 | if(b%x == 0 && a%x == 0) { cout << (b-a+1)/x+1 << endl; } | ^~ a.cc:41:3: error: expected unqualified-id before 'else' 41 | else { cout << (b-a+1)/x << endl; } | ^~~~ a.cc:42:3: error: expected unqualified-id before 'return' 42 | return 0; | ^~~~~~ a.cc:43:1: error: expected declaration before '}' token 43 | } | ^
s080658875
p03861
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { ll a, b, x; cin >> a >> b >> x; ll ans; if (a != 0) { a--; ans = (b/x) - (a / x); cout << ans << endl; } else { ans = (b/x) - (a / x); cout << ans + 1 << endl; } return 0; }
a.cc: In function 'int main()': a.cc:7:9: error: 'll' was not declared in this scope 7 | ll a, b, x; cin >> a >> b >> x; | ^~ a.cc:7:28: error: 'a' was not declared in this scope 7 | ll a, b, x; cin >> a >> b >> x; | ^ a.cc:7:33: error: 'b' was not declared in this scope 7 | ll a, b, x; cin >> a >> b >> x; | ^ a.cc:7:38: error: 'x' was not declared in this scope 7 | ll a, b, x; cin >> a >> b >> x; | ^ a.cc:8:11: error: expected ';' before 'ans' 8 | ll ans; | ^~~~ | ; a.cc:12:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 12 | ans = (b/x) - (a / x); | ^~~ | abs a.cc:17:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 17 | ans = (b/x) - (a / x); | ^~~ | abs
s229644898
p03861
C++
#include <bits/stdc++.h> using namespace std; int main(){ int64_t a,b,x; cin >>a>>b>>x; int64_t count=0; for(int i=a;i<=b;i++){ if(i<x) continue; if(i % x==0)count++; }
a.cc: In function 'int main()': a.cc:13:4: error: expected '}' at end of input 13 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s501693649
p03861
C++
1 1000000000000000000 3
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 1 1000000000000000000 3 | ^
s227234780
p03861
C++
#include <iostream> #include <iomanip> #include <cmath> using namespace std; int count(long long int a, long long int b,long long int x) { long long int c = b - a; long long int t = c / x; int p = 0; if (a % x == 0) { p ++; } if (b % x == 0) { p++; } if (c % x == 0 && p == 2) { p = 1; } return t + p; } int main() { long long int a, b, x; cin >> a >> b >> x; cout << t << endl; // for (int i = 0; i <= 9; ++i) { // cout << i << ", " << 9 << ": " << count(i, 9, 3) << endl; // } // cout << count(4, 8, 2) << endl; // cout << count(0, 5, 1) << endl; // cout << count(9, 9, 2) << endl; // cout << count(1, 10, 3) << endl; }
a.cc: In function 'int main()': a.cc:26:13: error: 't' was not declared in this scope 26 | cout << t << endl; | ^
s133880871
p03861
C++
#include<iostream> #include<cstring> #include<string> #include<algorithm> #include<cmath> #define debug(x) cout<<x<<"\n"; #define Max(a,b) ((a)>(b)?(a):(b)) typedef long long ll; const ll inf=0x3f3f3f3f3f3f; using namespace std; int main() { __int128_t x,a,b,cnt=0; cin>>a>>b>>x; for(__int128_t i=(a/x+1)*x;i<=b;) { if(i>b) break; else { cnt++; i+=x; } } if(a%x==0) cnt++; cout<<cnt<<"\n"; return 0; }
a.cc: In function 'int main()': a.cc:14:12: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and '__int128') 14 | cin>>a>>b>>x; | ~~~^~~ | | | | | __int128 | std::istream {aka std::basic_istream<char>} In file included from /usr/include/c++/14/iostream:42, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed: a.cc:14:14: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type '__int128' 14 | cin>>a>>b>>x; | ^ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed: a.cc:14:14: error: cannot bind non-const lvalue reference of type 'short int&' to a value of type '__int128' 14 | cin>>a>>b>>x; | ^ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed: a.cc:14:14: error: cannot bind non-const lvalue reference of type 'short unsigned int&' to a value of type '__int128' 14 | cin>>a>>b>>x; | ^ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed: a.cc:14:14: error: cannot bind non-const lvalue reference of type 'int&' to a value of type '__int128' 14 | cin>>a>>b>>x; | ^ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed: a.cc:14:14: error: cannot bind non-const lvalue reference of type 'unsigned int&' to a value of type '__int128' 14 | cin>>a>>b>>x; | ^ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed: a.cc:14:14: error: cannot bind non-const lvalue reference of type 'long int&' to a value of type '__int128' 14 | cin>>a>>b>>x; | ^ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed: a.cc:14:14: error: cannot bind non-const lvalue reference of type 'long unsigned int&' to a value of type '__int128' 14 | cin>>a>>b>>x; | ^ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed: a.cc:14:14: error: cannot bind non-const lvalue reference of type 'long long int&' to a value of type '__int128' 14 | cin>>a>>b>>x; | ^ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed: a.cc:14:14: error: cannot bind non-const lvalue reference of type 'long long unsigned int&' to a value of type '__int128' 14 | cin>>a>>b>>x; | ^ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:7: note: conversion of argument 1 would be ill-formed: a.cc:14:14: error: cannot bind non-const lvalue reference of type 'float&' to a value of type '__int128' 14 | cin>>a>>b>>x; | ^ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:7: note: conversion of argument 1 would be ill-formed: a.cc:14:14: error: cannot bind non-const lvalue reference of type 'double&' to a value of type '__int128' 14 | cin>>a>>b>>x; | ^ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:7: note: conversion of argument 1 would be ill-formed: a.cc:14:14: error: cannot bind non-const lvalue reference of type 'long double&' to a value of type '__int128' 14 | cin>>a>>b>>x; | ^ /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed: a.cc:14:14: error: invalid conversion from '__int128' to 'void*' [-fpermissive] 14 | cin>>a>>b>>x; | ^ | | | __int128 a.cc:14:14: error: cannot bind rvalue '(void*)((long int)a)' to 'void*&' /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:7: note: conversion of argument 1 would be ill-formed: a.cc:14:14: error: invalid conversion from '__int128' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} [-fpermissive] 14 | cin>>a>>b>>x; | ^ | | | __int128 /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' (near match) 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:7: note: conversion of argument 1 would be ill-formed: a.cc:14:14: error: invalid conversion from '__int128' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} [-fpermissive] 14 | cin>>a>>b>>x; | ^ | | | __int128 /usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ^~~~~~~~ /usr/include/c++/14/istream:133:7: note: conversion of argument 1 would be ill-formed: a.cc:1
s893345361
p03861
C++
#include <bits/stdc++.h> using namespace std; int main(){ int64_t a,b,x; cin>>a>>b>>c; if(a%x==0) cout<<b/x-a/x+1<<endl; else cout<<b/x-a/x<<endl; }
a.cc: In function 'int main()': a.cc:6:14: error: 'c' was not declared in this scope 6 | cin>>a>>b>>c; | ^
s776061971
p03861
C++
#include <iostream> using namespace std; int main() { long long a , b , c; cin>>a>>b>>c; if(c == 1){ cout<<(b - a + 1)<<"\n"; return; } long long f = b / c, s = (a - 1) / c; long long ans = f - s; if(a == 0)ans++; cout<<ans<<"\n"; }
a.cc: In function 'int main()': a.cc:8:9: error: return-statement with no value, in function returning 'int' [-fpermissive] 8 | return; | ^~~~~~
s357482492
p03861
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++) int main(){ ll a,b,x; cin>>a>>b>>x; ll p=a/x; ll q=b/x; if(a%==0)cout<<q-p+1<<endl; else cout<<q-p<<endl; return 0; }
a.cc: In function 'int main()': a.cc:11:11: error: expected primary-expression before '=' token 11 | if(a%==0)cout<<q-p+1<<endl; | ^
s290852807
p03861
C
#include <stdio.h> int main(void) { long long a,b,x,y=0; scanf("%lld%lld%lld",&a,&b,&x); if(a%x==0) f++; printf("%lld\n",b/x-a/x+f); return 0; }
main.c: In function 'main': main.c:8:20: error: 'f' undeclared (first use in this function) 8 | if(a%x==0) f++; | ^ main.c:8:20: note: each undeclared identifier is reported only once for each function it appears in
s435911803
p03861
C
#include <stdio.h> int main(void) { int i; float a,b,x,y; scanf("%f%f%f",&a,&b,&x); y=0; for(i=a;i<=b;i++){ if(((float)i%x)==0) y++; } printf("%f",y); return 0; }
main.c: In function 'main': main.c:12:22: error: invalid operands to binary % (have 'float' and 'float') 12 | if(((float)i%x)==0) y++; | ~~~~~~~~^ | | | float
s730514188
p03861
C
#include <stdio.h> int main(void) { int i; float a,b,x,y; scanf("%f%f%f",&a,&b,&x); y=0; for(i=a;i<=b;i++){ if((i%x)==0) y++; } printf("%f",y); return 0; }
main.c: In function 'main': main.c:12:15: error: invalid operands to binary % (have 'int' and 'float') 12 | if((i%x)==0) y++; | ^
s132885158
p03861
C
#include <stdui.h> int main(void) { int i; float a,b,x,y; scanf("%f%f%f",&a,&b,&x); y=0; for(i=a;i<=b;i++){ if((i%x)==0) y++; } printf("%f",y); return 0; }
main.c:1:10: fatal error: stdui.h: No such file or directory 1 | #include <stdui.h> | ^~~~~~~~~ compilation terminated.
s398731070
p03861
C
#include <stdio.h> int main(void) { float a,b,x,y; scanf("%f%f%f",&a,&b,&x); y=0; for(i=a;i<=b;i++){ if((i%x)==0) y++ } printf("%f",y); return 0; }
main.c: In function 'main': main.c:10:10: error: 'i' undeclared (first use in this function) 10 | for(i=a;i<=b;i++){ | ^ main.c:10:10: note: each undeclared identifier is reported only once for each function it appears in main.c:11:27: error: expected ';' before '}' token 11 | if((i%x)==0) y++ | ^ | ; 12 | } | ~
s142218481
p03861
C
#include <stdui.h> int main(void) { float a,b,x,y; scanf("%f%f%f",&a,&b,&x); y=0; for(i=a;i<=b;i++){ if((i%x)==0) y++ } printf("%f",y); return 0; }
main.c:1:10: fatal error: stdui.h: No such file or directory 1 | #include <stdui.h> | ^~~~~~~~~ compilation terminated.
s853588511
p03861
C++
#include <bits/stdc++.h> using namespace std; signed main() { int64_t a, b, x; cin >> a >> b >> x; cout << b / x - max(a - 1, 0) / x << '\n'; }
a.cc: In function 'int main()': a.cc:7:22: error: no matching function for call to 'max(int64_t, int)' 7 | cout << b / x - max(a - 1, 0) / x << '\n'; | ~~~^~~~~~~~~~ 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:7:22: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'int') 7 | cout << b / x - max(a - 1, 0) / x << '\n'; | ~~~^~~~~~~~~~ /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:7:22: note: mismatched types 'std::initializer_list<_Tp>' and 'long int' 7 | cout << b / x - max(a - 1, 0) / x << '\n'; | ~~~^~~~~~~~~~
s285541477
p03861
C++
int main(){ int64_t a, b, x; cin >> a >> b >> x; int64_t num = 0; num = (b/x+1)-a/x; if (b%x!=0 && a!=0 && b!=0){num-=1;} // for (int i = a; i <= b; i++){ // if (i%x==0){num++;} // } cout << num << endl; }
a.cc: In function 'int main()': a.cc:2:3: error: 'int64_t' was not declared in this scope 2 | int64_t a, b, x; | ^~~~~~~ a.cc:1:1: note: 'int64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' +++ |+#include <cstdint> 1 | int main(){ a.cc:3:3: error: 'cin' was not declared in this scope 3 | cin >> a >> b >> x; | ^~~ a.cc:3:10: error: 'a' was not declared in this scope 3 | cin >> a >> b >> x; | ^ a.cc:3:15: error: 'b' was not declared in this scope 3 | cin >> a >> b >> x; | ^ a.cc:3:20: error: 'x' was not declared in this scope 3 | cin >> a >> b >> x; | ^ a.cc:4:10: error: expected ';' before 'num' 4 | int64_t num = 0; | ^~~~ | ; a.cc:6:3: error: 'num' was not declared in this scope; did you mean 'enum'? 6 | num = (b/x+1)-a/x; | ^~~ | enum a.cc:11:3: error: 'cout' was not declared in this scope 11 | cout << num << endl; | ^~~~ a.cc:11:18: error: 'endl' was not declared in this scope 11 | cout << num << endl; | ^~~~
s189121056
p03861
C++
#include <bits/stdc++.h> using namespace std; //long long using ll = long long; // pair<int, int> using PII = pair<int, int>; //最大値、mod const int MOD = 1000000007; const int mod = 1000000007; const int INF = 1000000000; const long long LINF = 1e18; const int MAX = 510000; //出力系 #define print(x) cout << x << endl #define prints(x) cout << fixed << setprecision(10) << x << endl #define printc(x) cout << setw(2) << setfill('0') << x << endl; #define yes cout << "Yes" << endl #define YES cout << "YES" << endl #define no cout << "No" << endl #define NO cout << "NO" << endl // begin() end() #define all(x) (x).begin(),(x).end() //for #define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i) //最大公約数 unsigned gcd(unsigned a, unsigned b) { if(a < b) return gcd(b, a); unsigned r; while ((r=a%b)) { a = b; b = r; } return b; } // 最小公倍数 unsigned lcm(unsigned a, unsigned b){ return a / gcd(a, b) * b; } // a = max(a, b), a = min(a, b) template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } // 階乗(MODをとる) ll pow_mod(ll num, ll pow, ll mod) { ll prod = 1; num %= mod; while (pow > 0) { if (pow & 1) prod = prod * num % mod; num = num * num % mod; pow >>= 1; } return prod; } // 二項係数(MODとる、1 ≦ k ≦ n ≦ 10^7 程度) // COMinit() // COM(x, y) // とコンビで使う // テーブルを作る前処理 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; } //int dx[4] = {0, 0, 1, -1}, dy[4] = {1, -1, 0, 0}; struct UnionFind { vector<int> par; vector<int> rank; vector<ll> Size; UnionFind(int n = 1) { init(n); } void init(int n = 1) { par.resize(n + 1); rank.resize(n + 1); Size.resize(n + 1); for (int i = 0; i <= n; ++i) par[i] = i, rank[i] = 0, Size[i] = 1; } int root(int x) { if (par[x] == x) { return x; } else { int r = root(par[x]); return par[x] = r; } } bool issame(int x, int y) { return root(x) == root(y); } bool merge(int x, int y) { x = root(x); y = root(y); if (x == y) return false; if (rank[x] < rank[y]) swap(x, y); if (rank[x] == rank[y]) ++rank[x]; par[y] = x; Size[x] += Size[y]; return true; } ll size(int x){ return Size[root(x)]; } }; #define rrep(i,a,b) for(int i=(a);i>(b);i--) #define rep(i,a,b) for(int i=(a);i<(b);i++) struct Mint { int val; Mint inv() const{ int tmp,a=val,b=mod,x=1,y=0; while(b)tmp=a/b,a-=tmp*b,swap(a,b),x-=tmp*y,swap(x,y); return Mint(x); } public: Mint():val(0){} Mint(ll x){if((val=x%mod)<0)val+=mod;} Mint pow(ll t){Mint res=1,b=*this; while(t){if(t&1)res*=b;b*=b;t>>=1;}return res;} Mint& operator+=(const Mint& x){if((val+=x.val)>=mod)val-=mod;return *this;} Mint& operator-=(const Mint& x){if((val+=mod-x.val)>=mod)val-=mod; return *this;} Mint& operator*=(const Mint& x){val=(ll)val*x.val%mod; return *this;} Mint& operator/=(const Mint& x){return *this*=x.inv();} bool operator==(const Mint& x) const{return val==x.val;} bool operator!=(const Mint& x) const{return val!=x.val;} bool operator<(const Mint& x) const{return val<x.val;} bool operator<=(const Mint& x) const{return val<=x.val;} bool operator>(const Mint& x) const{return val>x.val;} bool operator>=(const Mint& x) const{return val>=x.val;} Mint operator+(const Mint& x) const{return Mint(*this)+=x;} Mint operator-(const Mint& x) const{return Mint(*this)-=x;} Mint operator*(const Mint& x) const{return Mint(*this)*=x;} Mint operator/(const Mint& x) const{return Mint(*this)/=x;} }; struct factorial { vector<Mint> Fact, Finv; public: factorial(int maxx){ Fact.resize(maxx+1),Finv.resize(maxx+1); Fact[0]=Mint(1); rep(i,0,maxx)Fact[i+1]=Fact[i]*(i+1); Finv[maxx]=Mint(1)/Fact[maxx]; rrep(i,maxx,0)Finv[i-1]=Finv[i]*i; } Mint fact(int n,bool inv=0){if(inv)return Finv[n];else return Fact[n];} Mint nPr(int n,int r){if(n<0||n<r||r<0)return Mint(0);else return Fact[n]*Finv[n-r];} Mint nCr(int n,int r){if(n<0||n<r||r<0)return Mint(0);else return Fact[n]*Finv[r]*Finv[n-r];} }; ll modfact(ll n) { if (n <= 1) return 1; return (n * modfact(n - 1)) % MOD; } int main() { ll a, b, x; cin >> a >> b >> x; ll ans = b / x - max((a - 1), 0) / x; cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:191:25: error: no matching function for call to 'max(ll, int)' 191 | ll ans = b / x - max((a - 1), 0) / 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:191:25: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 191 | ll ans = b / x - max((a - 1), 0) / 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:191:25: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 191 | ll ans = b / x - max((a - 1), 0) / x; | ~~~^~~~~~~~~~~~
s433613485
p03861
Java
package atcoder; import java.util.Scanner; /** https://atcoder.jp/contests/abc048/tasks/abc048_b */ public class B048 { /** 入力値A */ private static int a; /** 入力値B */ private static int b; /** 入力値X */ private static int X; /** * メインメソッド * * @param args 実行時引数 */ public static void main(String[] args) { inputDate(); System.out.println(getCount(b) - getCount(a - 1)); } /** 入力値設定 */ private static void inputDate() { var sc = new Scanner(System.in); a = sc.nextInt(); b = sc.nextInt(); X = sc.nextInt(); } /** * Xで割り切れる数を取得 * * @param targetNum 数値 * @return count 個数 */ private static int getCount(int targetNum) { // a == 0 の場合 if (targetNum == -1) { return 0; } else { return targetNum / X + 1; } } }
Main.java:6: error: class B048 is public, should be declared in a file named B048.java public class B048 { ^ 1 error
s852443987
p03861
C++
#include<bits/stdc++.h> using namespace std; int main(){ long long a,b,x; cin>>a>>b>>x; if(a>=1){ cout<<b/x-(a-1)/x<<endl; } else{ cout<<b/x<<endl; }
a.cc: In function 'int main()': a.cc:11:2: error: expected '}' at end of input 11 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s260971703
p03861
C++
#include<bits/stdc++.h> using namespace std; int main(){ long long a,b,x; cin>>a>>b>>x; cout<<b/x-max(0,a)/x<<endl; }
a.cc: In function 'int main()': a.cc:6:16: error: no matching function for call to 'max(int, long long int&)' 6 | cout<<b/x-max(0,a)/x<<endl; | ~~~^~~~~ 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:6:16: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int') 6 | cout<<b/x-max(0,a)/x<<endl; | ~~~^~~~~ /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:6:16: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 6 | cout<<b/x-max(0,a)/x<<endl; | ~~~^~~~~
s050192952
p03861
C++
#include<bits/stdc++.h> #define ll long long #define ld long double #define X first #define Y second #define pb push_back #define max_el(x) max_element(x.begin(),x.end())-x.begin() #define min_el(x) min_element(x.begin(),x.end())-x.begin() #define mp make_pair #define endl '\n' #define fastread ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); using namespace std; // DONT USE MEMSET, USE VECTORS void solve(){ ll a,b,x; cin>>a>>b>>x; ll ans = b/x if(a > 1){ ans -= (a-1)/x; } cout<<ans<<endl; } int main(){ fastread; int t = 1; // cin>>t; for(int i=1;i<=t;i++){ // cout<<"Case #"<<i<<": "; solve(); } return 0; }
a.cc: In function 'void solve()': a.cc:19:9: error: expected ',' or ';' before 'if' 19 | if(a > 1){ | ^~
s488086273
p03861
C++
#include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(),(x).end() using ll = long long; #define vl vector<long long> #define vvl vector<vector<long long>> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) using pll = pair<long long,long long>; #define cY cout<<"Yes"<<endl #define cN cout<<"No"<<endl const long long INF = 1LL << 60; const long long MOD = 1000000007; //最大最小の入れ替え template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } //約数列挙 vector<long long> divisor(long long n) { vector<long long> ret; for (long long i = 1; i * i <= n; i++) { if (n % i == 0) { ret.push_back(i); if (i * i != n) ret.push_back(n / i); } } sort(ret.begin(), ret.end()); // 昇順に並べる return ret; } //コンビネーション ll nCr(ll n, ll r) { ll ans = 1; for (int i = n; i > n - r; --i) { ans = ans*i; } for (int i = 1 ; i < r + 1; ++i) { ans = ans / i; } return ans; } //素因数分解 map< ll, ll > prime_factor(ll n) { map< ll, ll > ret; for(ll i = 2; i * i <= n; i++) { while(n % i == 0) { ret[i]++; n /= i; } } if(n != 1) ret[n] = 1; return ret; } //切り上げの割り算は(a + b - 1) / bでできる //時間を意識しろ //コードテストちゃんとして //画面とにらめっこするな書け //WA出すたびにABCは五億円払え //わからない問題はとばせ //躊躇なくぐぐれ //ここから int main(){ ll a,b,x; cin>>a>>b>>x; if(a!=0){ ll Ans=b/x-(a-1)/x; }else{ ll Ans=b/x; } cout<<Ans<<endl; }
a.cc: In function 'int main()': a.cc:84:11: error: 'Ans' was not declared in this scope 84 | cout<<Ans<<endl; | ^~~
s934310596
p03861
C++
#include <bits/stdc++.h> using namespace std; int main() { long long a,b,x; cin >> a >> b >> x; long long amari=(b-a)/x; if (a%x>b%x || (a%x==0 && b%x==0) amari++; cout << amari << endl; }
a.cc: In function 'int main()': a.cc:8:36: error: expected ';' before 'amari' 8 | if (a%x>b%x || (a%x==0 && b%x==0) amari++; | ^~~~~~ | ; a.cc:9:24: error: expected ')' before ';' token 9 | cout << amari << endl; | ^ | ) a.cc:8:6: note: to match this '(' 8 | if (a%x>b%x || (a%x==0 && b%x==0) amari++; | ^
s328976939
p03861
C++
#include<bits/stdc++.h> using namespace std; int main(){ int64_t a,b,x; cin>>a>>b>>x; if(a!=0){ int64_t ans=(b/x)-((a-1)/x); cout<<ans<<endl; }else{ int64_t asn=1+(b/x); cout<<ans<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:11:11: error: 'ans' was not declared in this scope; did you mean 'asn'? 11 | cout<<ans<<endl; | ^~~ | asn
s627081197
p03861
C++
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> #include<set> #include<map> using namespace std; const double PI = 3.141592653589793238463; int main() { long long a, b, x; cin >> a >> b >> x; while(a%x != 0){ a++; } while(b%x != 0){ b--; } cout << max((b-a)/x +1,0); cout << endl; }
a.cc: In function 'int main()': a.cc:21:16: error: no matching function for call to 'max(long long int, int)' 21 | cout << max((b-a)/x +1,0); | ~~~^~~~~~~~~~~~~~ In file included from /usr/include/c++/14/bits/specfun.h:43, from /usr/include/c++/14/cmath:3906, 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:21:16: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 21 | cout << max((b-a)/x +1,0); | ~~~^~~~~~~~~~~~~~ /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, from a.cc:5: /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:21:16: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 21 | cout << max((b-a)/x +1,0); | ~~~^~~~~~~~~~~~~~
s531871497
p03861
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a,b,x; cin >> a >> b >> x; int count; for(int i = a; i <= b; i++){ if(i % x == 0){ count++ } } cout << count << endl; }
a.cc: In function 'int main()': a.cc:11:14: error: expected ';' before '}' token 11 | count++ | ^ | ; 12 | } | ~
s223167550
p03861
C++
#include<bits/stdc++.h> using namespace std; int main(){ ll a,b,x; cin>>a>>b>>x; ll ans= (b/x)-(a/x)+1; cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:4:2: error: 'll' was not declared in this scope 4 | ll a,b,x; | ^~ a.cc:5:8: error: 'a' was not declared in this scope 5 | cin>>a>>b>>x; | ^ a.cc:5:11: error: 'b' was not declared in this scope 5 | cin>>a>>b>>x; | ^ a.cc:5:14: error: 'x' was not declared in this scope 5 | cin>>a>>b>>x; | ^ a.cc:6:5: error: expected ';' before 'ans' 6 | ll ans= (b/x)-(a/x)+1; | ^~~~ | ; a.cc:7:9: error: 'ans' was not declared in this scope; did you mean 'abs'? 7 | cout<<ans<<endl; | ^~~ | abs
s148958192
p03861
C++
#include <iostream> using namespace std; int main() { long long int a; long long int b; long long int x; //while(cin>>a>>b>>x){ if(a==0 and b==0){ cout<<"1"<<endl; break; }else{ if(a==b or abs(a-b)<x){ cout<<"0"<<endl; break; }else{ if(a%x==0){ cout<<abs(b-a)/x+1<<endl; }else{ cout<<abs(b-a)/x<<endl; } } } //} }
a.cc: In function 'int main()': a.cc:11:25: error: break statement not within loop or switch 11 | break; | ^~~~~ a.cc:15:33: error: break statement not within loop or switch 15 | break; | ^~~~~
s367191780
p03861
C++
#include <iostream> using namespace std; int main() { long long int a; long long int b; long long int x; //while(cin>>a>>b>>x){ if(a==0 and b==0){ cout<<"1"<<endl; break; }else{ if(a==b or abs(a-b)<x){ cout<<"0"<<endl; break; }else{ if(a%x!=0 or b%x!=0){ cout<<abs(b-a)/x<<endl; }else{ cout<<abs(b-a)/x+1<<endl; } } } //} }
a.cc: In function 'int main()': a.cc:11:25: error: break statement not within loop or switch 11 | break; | ^~~~~ a.cc:15:33: error: break statement not within loop or switch 15 | break; | ^~~~~
s097406904
p03861
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i = 0; i < (int)(n); i++) #define all(vec) vec.begin(), vec.end() #define END return 0 typedef int64_t ll; const int mod7 = 1e9 + 7; const int mod9 = 1e9 + 9; const int inf = 1 << 30; const ll INF = 1LL << 60; template<typename T> T gcd(T a, T b) {return b ? gcd(b, a % b) : abs(a);} template<typename T> T lcm(T a, T b) {return a / gcd(a, b) * b;} template<typename T> bool chmax(T &a, T b) {if (a < b) {a = b; return true;} return false;} template<typename T> bool chmin(T &a, T b) {if (a > b) {a = b; return true;} return false;} template<typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val) {fill((T*)array, (T*)(array+N), val);} int main() { ll a, b, x; cin >> a >> b >> x; cout << b / x - max(0LL, a - 1) / x + (a == 0 ? 1 : 0) << endl; }
a.cc: In function 'int main()': a.cc:20:24: error: no matching function for call to 'max(long long int, ll)' 20 | cout << b / x - max(0LL, a - 1) / x + (a == 0 ? 1 : 0) << endl; | ~~~^~~~~~~~~~~~ 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:20:24: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'll' {aka 'long int'}) 20 | cout << b / x - max(0LL, a - 1) / x + (a == 0 ? 1 : 0) << endl; | ~~~^~~~~~~~~~~~ /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:20:24: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 20 | cout << b / x - max(0LL, a - 1) / x + (a == 0 ? 1 : 0) << endl; | ~~~^~~~~~~~~~~~
s591444765
p03861
C++
#include <iostream> using namespace std; int main() { long long int a, b, c; cin >> a >> b >> c; long long int count = 0; if (a==b){ if (a%c==0){ cout << 1 << endl; } else{ cout << 0 << endl; } } else{ count = b/c-a/c; if (b%c==0 or a%c==0) cout ++; cout << count << endl; } }
a.cc: In function 'int main()': a.cc:17:52: error: no 'operator++(int)' declared for postfix '++' [-fpermissive] 17 | if (b%c==0 or a%c==0) cout ++; | ~~~~~^~
s518014303
p03861
C++
#include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <algorithm> #include <bitset> #include <complex> #include <deque> #include <exception> #include <fstream> #include <functional> #include <iomanip> #include <ios> #include <iosfwd> #include <iostream> #include <istream> #include <iterator> #include <limits> #include <list> #include <locale> #include <map> #include <memory> #include <new> #include <numeric> #include <ostream> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdexcept> #include <streambuf> #include <string> #include <typeinfo> #include <utility> #include <valarray> #include <vector> #include <regex> #define REP(i,n) for(int i = 0; i < n; i++) #define FOR(i,j,n) for(int i = j; i < n; i++) #define RFOR(i,j,n) for(int i = j-1; i >= n; i--) #define PREC(n) fixed << setprecision(n) #define print_array(v) REP(__k, v.size()) { cout << v[__k]; if(__k != v.size()-1) cout << " "; else cout << endl; } value #define YesorNo(a) printf(a?"Yes\n":"No\n") #define _LIBCPP_DEBUG 0 using namespace std; int64_t MOD = 1000000007; int64_t solve(int64_t n,int64_t x){ if (n == -1) return -1; return (n/x); } int main() { cin.tie(0); ios::sync_with_stdio(false); int64_t a, b, x; cin >> a >> b >> x; cout << solve(b,k) - solve(a-1,k) << endl; return 0; } //templete by private_yusuke
a.cc: In function 'int main()': a.cc:70:19: error: 'k' was not declared in this scope 70 | cout << solve(b,k) - solve(a-1,k) << endl; | ^
s059922896
p03861
C++
#include<bits/stdc++.h> using namespace std; int main(){ cin.tie(0); ios::sync_with_stdio(false); long long int n,m,x,c=0, temp; cin>>n>>m>>x; temp= m/x - n/x; temp+= (n%x==0) cout<<temp; return 0; }
a.cc: In function 'int main()': a.cc:10:20: error: expected ';' before 'cout' 10 | temp+= (n%x==0) | ^ | ; 11 | cout<<temp; | ~~~~
s272017423
p03861
C++
/****************************************************************************** Online C++ Compiler. Code, Compile, Run and Debug C++ program online. Write your code in this editor and press "Run" button to compile and execute it. *******************************************************************************/ #include <bits/stdc++.h> using namespace std; int main() { long long a,b,x,g,cnt=0,w; cin>>a>>b>>x; for(g=a;g<=b;g++) {if(g%x==0){ra1=0;break;}} for(w=b;w>=a;w--){ if(w%x==0){ra2=0;break;}} if(ra1==0&&ra2==0&&g!=w){cout<<(w-g)/x+1;} else if(g==w&&ra1==0&&ra2==0){cout<<1;} else if{cout<<0;} return 0; }
a.cc: In function 'int main()': a.cc:18:17: error: 'ra1' was not declared in this scope 18 | {if(g%x==0){ra1=0;break;}} | ^~~ a.cc:20:16: error: 'ra2' was not declared in this scope 20 | if(w%x==0){ra2=0;break;}} | ^~~ a.cc:21:8: error: 'ra1' was not declared in this scope 21 | if(ra1==0&&ra2==0&&g!=w){cout<<(w-g)/x+1;} | ^~~ a.cc:21:16: error: 'ra2' was not declared in this scope 21 | if(ra1==0&&ra2==0&&g!=w){cout<<(w-g)/x+1;} | ^~~ a.cc:23:12: error: expected '(' before '{' token 23 | else if{cout<<0;} | ^ | (
s024901374
p03861
C++
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair <int, int> P; #define rep( i, n, m ) for(int i = ( n ); i < ( m ); i++) #define rep_d( i, n, m ) for(int i = ( n ) - 1; i >= ( m ); i--) #define sort_asc( X ) sort(( X ).begin(), ( X ).end()) #define sort_desc( X ) sort(( X ).begin(), ( X ).end(), greater <>()) template <class T> bool chmax( T& a, T b ); template <class T> bool chmin( T& a, T b ); int* eratosthenes( int N ); bool bit_search( int pattern, int N ); template <class T> void cumulative_sum( T array, size_t N ); const ll INF = 1LL << 60; const int k_mod = 1e9 + 7; typedef struct { vector <int> to; int cost; } edge; int main( void ){ ll A, B, C; cin >> A>>B>>C; A = max(1, A); cout << B/C - (A-1)/C << endl; } int* eratosthenes( int N ){ int* prime_array = new int[ N + 1 ]; int lim = N; prime_array[ 0 ] = 0; prime_array[ 1 ] = 0; rep( i, 2, N + 1 ){ prime_array[ i ] = 1; } rep( i, 2, lim ){ if (prime_array[ i ] == 0) continue; lim = N / i; for(int j = i * 2; j < N + 1; j += i){ prime_array[ j ] = 0; } } return prime_array; } template <class T> void cumulative_sum( T array, size_t N ) { rep( i, 1, N + 1 ){ array[ i ] += array[ i - 1 ]; } } template <class T> bool chmax( T& a, T b ) { if (a < b){ a = b; return true; } return false; } template <class T> bool chmin( T& a, T b ) { if (a > b){ a = b; return true; } return false; } bool bit_search( int pattern, int N ){ int cnt = 0; rep( bit, 0, N ){ if (pattern & ( 1 << bit )){ cnt++; } } return true; }
a.cc: In function 'int main()': a.cc:25:16: error: no matching function for call to 'max(int, ll&)' 25 | A = max(1, A); | ~~~^~~~~~ 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:25:16: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'}) 25 | A = max(1, A); | ~~~^~~~~~ /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:25:16: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 25 | A = max(1, A); | ~~~^~~~~~
s762657693
p03861
C++
#include<bits/stdc++.h> #define rep(i,N) for(int i=0;i<(N);i++) #define FOR(i,a,b) for(int i=(a);i<(b);i++) using namespace std; const long long MOD = 1e9 + 7; const long long INF = 1e12; const int inf = 1e9; typedef long long ll; typedef pair<ll,int> P; typedef set<int> S; ll a,b,x; int main(){ cin >> a >> b >> x; ll min1=1; ll max1=-1; if(b<x){ cout<<"0"<<endl; return 0; } else{ if(a%x==0) min1 = a; else min1 = x*(a/x+1); if(b%x==0) max1 = b; else max1 = x*(b/x); //cout<<min1<<" "<<max1<<endl; if(max1<min1) cout<"0"<<endl; else if(min1>b || max1<a || ) cout<<"0"<<endl; else if(min1!=max1) cout<<(max1-min1)/x+1<<endl; else cout<<"1"<<endl; return 0; } }
a.cc: In function 'int main()': a.cc:27:31: error: invalid operands of types 'const char [2]' and '<unresolved overloaded function type>' to binary 'operator<<' 27 | if(max1<min1) cout<"0"<<endl; | ~~~^~~~~~ a.cc:28:37: error: expected primary-expression before ')' token 28 | else if(min1>b || max1<a || ) cout<<"0"<<endl; | ^
s250863831
p03861
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a, b, x; cin >> a >> b >> x; int count = 0; for(int i = a, i <= b; i++){ if(i % x == 0)count++; } cout << count << endl; }
a.cc: In function 'int main()': a.cc:8:19: error: expected ';' before '<=' token 8 | for(int i = a, i <= b; i++){ | ^~~ | ; a.cc:8:20: error: expected primary-expression before '<=' token 8 | for(int i = a, i <= b; i++){ | ^~
s503689999
p03861
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a, b, x; cin >> a >> b >> x; int count = 0; for(int i = a, i <= b; b++){ if(i % x == 0)count++; } cout << count << endl; }
a.cc: In function 'int main()': a.cc:8:19: error: expected ';' before '<=' token 8 | for(int i = a, i <= b; b++){ | ^~~ | ; a.cc:8:20: error: expected primary-expression before '<=' token 8 | for(int i = a, i <= b; b++){ | ^~
s983585872
p03861
C++
#include<bits/stdc++.h> typedef long long ll; typedef long double ld; using namespace std; #define REP(i, l, n) for(int i=(l), i##_len=(n); i<i##_len; ++i) #define ALL(x) (x).begin(),(x).end() #define pb push_back ll gcd(ll a,ll b){return b ? gcd(b,a%b) : a;} ll lcm(ll a,ll b){return a/gcd(a,b)*b;} char alpha[26] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'}; int dx[4] = {-1, 1, 0, 0}; int dy[4] = {0, 0, 1, -1}; int main(){ ll a, b, c; cin >> a >> b >> c; if(c == 1){ cout << b - a + 1 << endl; }else if(b - a + 1 < c){ c = (b/c) * c; if(b >= c && a <= c){ cout << 1 << endl; }else{ cout << 0 << endl; } }else{ ll d = max(a/c, 1), e = b/c; cout << e - d + 1 << endl; } }
a.cc: In function 'int main()': a.cc:30:19: error: no matching function for call to 'max(ll, int)' 30 | ll d = max(a/c, 1), e = b/c; | ~~~^~~~~~~~ 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:30:19: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 30 | ll d = max(a/c, 1), e = b/c; | ~~~^~~~~~~~ /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:30:19: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 30 | ll d = max(a/c, 1), e = b/c; | ~~~^~~~~~~~ a.cc:31:17: error: 'e' was not declared in this scope 31 | cout << e - d + 1 << endl; | ^
s360800972
p03861
C++
#include <bits/stdc++.h> using namespace std; int main() { long long a, b, x; cin >> a >> b >> x; cout << (b/x + 1) - max(0,((a-1)/x + 1)) << endl; }
a.cc: In function 'int main()': a.cc:7:26: error: no matching function for call to 'max(int, long long int)' 7 | cout << (b/x + 1) - max(0,((a-1)/x + 1)) << endl; | ~~~^~~~~~~~~~~~~~~~~ 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:7:26: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int') 7 | cout << (b/x + 1) - max(0,((a-1)/x + 1)) << endl; | ~~~^~~~~~~~~~~~~~~~~ /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:7:26: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 7 | cout << (b/x + 1) - max(0,((a-1)/x + 1)) << endl; | ~~~^~~~~~~~~~~~~~~~~
s164116268
p03861
C++
/** * author: qodjf * created: 04.17.2020 01:37:18 */ #include <bits/stdc++.h> using namespace std; int main() { ll a, b, x; cin >> a >> b >> x; a = (a + x - 1) / x * x; b = b / x * x; ll ans = (b - a) / x + 1; cout << ans << endl; }
a.cc: In function 'int main()': a.cc:9:3: error: 'll' was not declared in this scope 9 | ll a, b, x; | ^~ a.cc:10:10: error: 'a' was not declared in this scope 10 | cin >> a >> b >> x; | ^ a.cc:10:15: error: 'b' was not declared in this scope 10 | cin >> a >> b >> x; | ^ a.cc:10:20: error: 'x' was not declared in this scope 10 | cin >> a >> b >> x; | ^ a.cc:13:5: error: expected ';' before 'ans' 13 | ll ans = (b - a) / x + 1; | ^~~~ | ; a.cc:14:11: error: 'ans' was not declared in this scope; did you mean 'abs'? 14 | cout << ans << endl; | ^~~ | abs
s977193253
p03861
C++
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define zero_pad(num) setfill('0') << std::right << setw(num) using namespace std; using ll = long long; using ld = long double; using P = pair<int, int>; int main() { ll a, b, x; cin >> a >> b >> x; cout << b / x - max(0, a - 1) / x << endl; }
a.cc: In function 'int main()': a.cc:12:24: error: no matching function for call to 'max(int, ll)' 12 | cout << b / x - max(0, a - 1) / x << endl; | ~~~^~~~~~~~~~ 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:12:24: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'}) 12 | cout << b / x - max(0, a - 1) / x << endl; | ~~~^~~~~~~~~~ /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:12:24: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 12 | cout << b / x - max(0, a - 1) / x << endl; | ~~~^~~~~~~~~~
s686645595
p03861
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 a,b,x;cin>>a>>b>>x; ll ans = b/x - max(0L, a-1)/x; cout<<ans; }
a.cc: In function 'int main()': a.cc:8:21: error: no matching function for call to 'max(long int, ll)' 8 | ll ans = b/x - max(0L, a-1)/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:8:21: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'll' {aka 'long long int'}) 8 | ll ans = b/x - max(0L, a-1)/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:8:21: note: mismatched types 'std::initializer_list<_Tp>' and 'long int' 8 | ll ans = b/x - max(0L, a-1)/x; | ~~~^~~~~~~~~
s194106829
p03861
C++
((input: string): void => { const [D, L] = [24, 3]; const new64 = (n) => [n % (1<<D), (n / (1<<D)) | 0, 0] const mul64s = (a, b) => { let r = []; let x = 0; for (let i = 0; i < L; i++) { x = a[i] * b + x; r[i] = x % (1<<D); x = Math.floor(x / (1<<D)); } return r; } const add64s = (a, b) => { let r = []; let x = b; for (let i = 0; i < L; i++) { x = a[i] + x; r[i] = x % (1<<D); x = Math.floor(x / (1<<D)); } return r; } const cmp64 = (a, b) => { for (let i = L-1; i >= 0; i--) { if (a[i] < b[i]) return -1; if (a[i] > b[i]) return 1; } return 0; } const add64 = (a, b) => { let r = []; let x = 0; for (let i = 0; i < L; i++) { x = a[i] + b[i] + x; r[i] = x % (1<<D); x = Math.floor(x / (1<<D)); } return r; } const sub64 = (a, b) => { let r = []; let x = 0; for (let i = 0; i < L; i++) { x = a[i] - b[i] - x; let borrow = 0; while (x < 0) { x += (1<<D); borrow++; } r[i] = x % (1<<D); x = borrow; } return r; } const div64s = (a, b) => { let x = 0; for (let i = L-1; i >= 0; i--) { x = a[i] + x * (1<<D); a[i] = (x / b) | 0; x = x % b; } return x; } const copy64 = (a, b) => { for (let i = 0; i < L; i++) { a[i] = b[i]; } } const shiftL64 = (a) => { const msb = [0, 0, (1<<(D-1))]; let d = a; let r = 0; if (cmp64(a, msb) >= 0) { r = 1; d = sub64(a, msb); } let c = add64(d, d); copy64(a, c); return r; } const div64 = (a, b) => { let d = new64(0); let x = a.slice(); let r = new64(0); for (let i = 0; i < L*D; i++) { let bit = shiftL64(x); shiftL64(d); d = add64s(d, bit); let y = 0; if (cmp64(d, b) >= 0) { d = sub64(d, b); y = 1; } shiftL64(r); r = add64s(r, y); } return r; } const parse64 = (s) => { const l = s.length; let a = new64(0); for (let i = 0; i < l; i++) { a = mul64s(a, 10); a = add64s(a, parseInt(s.substr(i, 1), 10)); } return a; } const print64 = (a) => { let s = ""; let x = a.slice(); while (cmp64(x, new64(0)) !== 0) { s += div64s(x, 10); } if (s === "") { s = "0"; } console.log(s.split('').reverse().join('')); } const divisors = (a, x) => add64s(div64(a, x), 1); const solve = (a, b, x) => sub64(divisors(b, x), (cmp64(a, new64(1)) >= 0 ? divisors(sub64(a, new64(1)), x) : new64(0))); const args = input.trim().split(' '); const a = parse64(args[0]); const b = parse64(args[1]); const x = parse64(args[2]); const c = solve(a, b, x); print64(c); })(require('fs').readFileSync('/dev/stdin', 'utf8'));
a.cc:129:29: error: empty character constant 129 | console.log(s.split('').reverse().join('')); | ^~ a.cc:129:48: error: empty character constant 129 | console.log(s.split('').reverse().join('')); | ^~ a.cc:142:12: warning: multi-character character constant [-Wmultichar] 142 | })(require('fs').readFileSync('/dev/stdin', 'utf8')); | ^~~~ a.cc:142:31: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes 142 | })(require('fs').readFileSync('/dev/stdin', 'utf8')); | ^~~~~~~~~~~~ a.cc:142:45: warning: multi-character character constant [-Wmultichar] 142 | })(require('fs').readFileSync('/dev/stdin', 'utf8')); | ^~~~~~ a.cc:1:8: error: found ':' in nested-name-specifier, expected '::' 1 | ((input: string): void => { | ^ | :: a.cc:1:3: error: 'input' has not been declared 1 | ((input: string): void => { | ^~~~~ a.cc:1:17: error: expected ')' before ':' token 1 | ((input: string): void => { | ~ ^ | ) a.cc:142:2: error: expected unqualified-id before ')' token 142 | })(require('fs').readFileSync('/dev/stdin', 'utf8')); | ^
s447217412
p03861
Java
import java.util.*; class Main{ public static void main(String[] args){ Scanner s=new Scanner(System.in); long a=s.nextLong(); long b=s.nextLong(); long c=s.nextLong(); long count=0; for(int i=a;i<=b;i++){ if((i%c)==0){ count++; } } System.out.println(count); } }
Main.java:9: error: incompatible types: possible lossy conversion from long to int for(int i=a;i<=b;i++){ ^ 1 error
s884404550
p03861
C++
V#include<iostream> #include<stdio.h> #include<vector> #include<algorithm> #include<set> #include<string> #include<map> #include<string.h> #include<complex> #include<math.h> #include<queue> #include <functional> #include<time.h> #include <stack> #include<iomanip> using namespace std; #define rep(i,a,n) for(int i=(a);i<(n);i++) #define ll long long #define llint long long int #define sort(s) sort(s.begin(),s.end()) #define reverse(v) reverse(v.begin(), v.end()); #define Yes(ans) if(ans)cout<<"Yes"<<endl; else cout<<"No"<<endl; #define YES(ans) if(ans)cout<<"YES"<<endl; else cout<<"NO"<<endl; #define hei(a) vector<a> #define whei(a) vector<vector<a>> #define UF UnionFind #define rt (a); return (a); #define Pint pair<int,int> constexpr auto INF = 1000000000; constexpr auto mod = 1000000007; //辞書順はnext_permutation( begin( v ), end( v ) );やで! //2のn乗を求めるよ!!! int ni(int n) { if (n == 0)return 1; int x = ni(n / 2); x *= x; if (n % 2 == 1)x *= 2; return x; } //フィボナッチ数列のx番目を求めるよ! llint f(int x, vector<llint>& s) { if (x == 0)return 0; if (x == 1)return 1; if (s[x] != 0)return s[x]; return s[x] = f(x - 1, s) + f(x - 2, s); } //aとbの最大公約数を求めるよ! llint gcd(llint a, llint b) { if (a < b)swap(a, b); if (b == 0)return a; return gcd(b, a % b); } // a^n mod を計算する long long modpow(long long a, long long n, long long mod) { long long res = 1; while (n > 0) { if (n & 1) res = res * a % mod; a = a * a % mod; n >>= 1; } return res; } // mod. m での a の逆元 a^{-1} を計算するよ! long long modinv(long long a, long long m) { long long b = m, u = 1, v = 0; while (b) { long long t = a / b; a -= t * b; swap(a, b); u -= t * v; swap(u, v); } u %= m; if (u < 0) u += m; return u; } //aCbをmod.mで割った余りを求める ll int c(ll int a, ll int b, ll int m) { ll int ans = 1; for (ll int i = 0; i < b; i++) { ans *= a - i; ans %= m; } for (ll int i = 1; i <= b; i++) { ans *= modinv(i, m); ans %= m; } return ans; } //m進数のn桁を全列挙やで void dfs(int m, int n, llint k, hei(llint) a) { stack<string> st; st.push(""); while (!st.empty()) { string now = st.top(); st.pop(); if (now.size() == n) { cout << now << endl; } else { for (int i = m - 1; i >= 0; i--) { string next = now + to_string(i); st.push(next); } } } } void press(vector<int>& v) { v.erase(unique((v).begin(), (v).end()), v.end()); } void press(vector<char>& v) { v.erase(unique((v).begin(), (v).end()), v.end()); } struct UnionFind { vector<int> par; // par[i]:iの親の番号 (例) par[3] = 2 : 3の親が2 UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化 for (int i = 0; i < N; i++) par[i] = i; } int size(int a) { return par[root(a)]; } int root(int x) { // データxが属する木の根を再帰で得る:root(x) = {xの木の根} if (par[x] == x) return x; return par[x] = root(par[x]); } void unite(int x, int y) { // xとyの木を併合 int rx = root(x); //xの根をrx int ry = root(y); //yの根をry if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時:xの根rxをyの根ryにつける } bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す int rx = root(x); int ry = root(y); return rx == ry; } }; struct segmenttree { hei(int) seg; int s; segmenttree(int n) :seg(n * 2 - 1) { for (int i = 0; i < n * 2 - 1; i++)seg[i] = 0; s = n; } //k番目の値をaに変更 void update(int k, int a) { k += s - 1; seg[k] += a; while (k > 0) { k = (k - 1) / 2; seg[k] = min(seg[k * 2 + 1], seg[k * 2 + 2]); } } //最初はquery(a,b,0,0,n)で呼ぶよ!!!! int query(int a, int b, int k, int l, int r) { if (r <= a || b <= l)return 1000000; if (a <= l && r <= b)return seg[k]; else { int v1 = query(a, b, k * 2 + 1, l, (l + r) / 2); int v2 = query(a, b, k * 2 + 2, (l + r) / 2, r); return min(v1, v2); } } }; int main() { ll a, b, x; cin >> a >> b >> x; b -= a-1; ll ans = b / x; ll y = a % x; ll z = b % x; if (z > x-y)ans++; cout << ans << endl; return 0; }
a.cc:1:2: error: stray '#' in program 1 | V#include<iostream> | ^ a.cc:1:1: error: 'V' does not name a type 1 | V#include<iostream> | ^ In file included from /usr/include/c++/14/cstdlib:79, from /usr/include/c++/14/bits/stl_algo.h:71, from /usr/include/c++/14/algorithm:61, from a.cc:4: /usr/include/stdlib.h:98:8: error: 'size_t' does not name a type 98 | extern size_t __ctype_get_mb_cur_max (void) __THROW __wur; | ^~~~~~ /usr/include/stdlib.h:42:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 41 | # include <bits/waitstatus.h> +++ |+#include <cstddef> 42 | /usr/include/stdlib.h:278:36: error: 'size_t' has not been declared 278 | extern int strfromd (char *__dest, size_t __size, const char *__format, | ^~~~~~ /usr/include/stdlib.h:282:36: error: 'size_t' has not been declared 282 | extern int strfromf (char *__dest, size_t __size, const char *__format, | ^~~~~~ /usr/include/stdlib.h:286:36: error: 'size_t' has not been declared 286 | extern int strfroml (char *__dest, size_t __size, const char *__format, | ^~~~~~ /usr/include/stdlib.h:298:38: error: 'size_t' has not been declared 298 | extern int strfromf32 (char *__dest, size_t __size, const char * __format, | ^~~~~~ /usr/include/stdlib.h:304:38: error: 'size_t' has not been declared 304 | extern int strfromf64 (char *__dest, size_t __size, const char * __format, | ^~~~~~ /usr/include/stdlib.h:310:39: error: 'size_t' has not been declared 310 | extern int strfromf128 (char *__dest, size_t __size, const char * __format, | ^~~~~~ /usr/include/stdlib.h:316:39: error: 'size_t' has not been declared 316 | extern int strfromf32x (char *__dest, size_t __size, const char * __format, | ^~~~~~ /usr/include/stdlib.h:322:39: error: 'size_t' has not been declared 322 | extern int strfromf64x (char *__dest, size_t __size, const char * __format, | ^~~~~~ In file included from /usr/include/stdlib.h:514: /usr/include/x86_64-linux-gnu/sys/types.h:33:9: error: '__u_char' does not name a type 33 | typedef __u_char u_char; | ^~~~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:34:9: error: '__u_short' does not name a type 34 | typedef __u_short u_short; | ^~~~~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:35:9: error: '__u_int' does not name a type 35 | typedef __u_int u_int; | ^~~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:36:9: error: '__u_long' does not name a type 36 | typedef __u_long u_long; | ^~~~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:37:9: error: '__quad_t' does not name a type 37 | typedef __quad_t quad_t; | ^~~~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:38:9: error: '__u_quad_t' does not name a type 38 | typedef __u_quad_t u_quad_t; | ^~~~~~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:39:9: error: '__fsid_t' does not name a type 39 | typedef __fsid_t fsid_t; | ^~~~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:42:9: error: '__loff_t' does not name a type; did you mean '__locale_t'? 42 | typedef __loff_t loff_t; | ^~~~~~~~ | __locale_t /usr/include/x86_64-linux-gnu/sys/types.h:47:9: error: '__ino_t' does not name a type 47 | typedef __ino_t ino_t; | ^~~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:54:9: error: '__ino64_t' does not name a type 54 | typedef __ino64_t ino64_t; | ^~~~~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:59:9: error: '__dev_t' does not name a type 59 | typedef __dev_t dev_t; | ^~~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:64:9: error: '__gid_t' does not name a type 64 | typedef __gid_t gid_t; | ^~~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:69:9: error: '__mode_t' does not name a type; did you mean '__locale_t'? 69 | typedef __mode_t mode_t; | ^~~~~~~~ | __locale_t /usr/include/x86_64-linux-gnu/sys/types.h:74:9: error: '__nlink_t' does not name a type 74 | typedef __nlink_t nlink_t; | ^~~~~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:79:9: error: '__uid_t' does not name a type 79 | typedef __uid_t uid_t; | ^~~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:97:9: error: '__pid_t' does not name a type 97 | typedef __pid_t pid_t; | ^~~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:103:9: error: '__id_t' does not name a type 103 | typedef __id_t id_t; | ^~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:114:9: error: '__daddr_t' does not name a type 114 | typedef __daddr_t daddr_t; | ^~~~~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:115:9: error: '__caddr_t' does not name a type 115 | typedef __caddr_t caddr_t; | ^~~~~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:121:9: error: '__key_t' does not name a type 121 | typedef __key_t key_t; | ^~~~~~~ In file included from /usr/include/x86_64-linux-gnu/sys/types.h:126: /usr/include/x86_64-linux-gnu/bits/types/clock_t.h:7:9: error: '__clock_t' does not name a type 7 | typedef __clock_t clock_t; | ^~~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/sys/types.h:128: /usr/include/x86_64-linux-gnu/bits/types/clockid_t.h:7:9: error: '__clockid_t' does not name a type 7 | typedef __clockid_t clockid_t; | ^~~~~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/sys/types.h:129: /usr/include/x86_64-linux-gnu/bits/types/time_t.h:10:9: error: '__time_t' does not name a type 10 | typedef __time_t time_t; | ^~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/sys/types.h:130: /usr/include/x86_64-linux-gnu/bits/types/timer_t.h:7:9: error: '__timer_t' does not name a type 7 | typedef __timer_t timer_t; | ^~~~~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:134:9: error: '__useconds_t' does not name a type 134 | typedef __useconds_t useconds_t; | ^~~~~~~~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:138:9: error: '__suseconds_t' does not name a type 138 | typedef __suseconds_t suseconds_t; | ^~~~~~~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/sys/types.h:155: /usr/include/x86_64-linux-gnu/bits/stdint-intn.h:24:9: error: '__int8_t' does not name a type; did you mean '__int128_t'? 24 | typedef __int8_t int8_t; | ^~~~~~~~ | __int128_t /usr/include/x86_64-linux-gnu/bits/stdint-intn.h:25:9: error: '__int16_t' does not name a type; did you mean '__int128_t'? 25 | typedef __int16_t int16_t; | ^~~~~~~~~ | __int128_t /usr/include/x86_64-linux-gnu/bits/stdint-intn.h:26:9: error: '__int32_t' does not name a type; did you mean '__int128_t'? 26 | typedef __int32_t int32_t; | ^~~~~~~~~ | __int128_t /usr/include/x86_64-linux-gnu/bits/stdint-intn.h:27:9: error: '__int64_t' does not name a type; did you mean '__int128_t'? 27 | typedef __int64_t int64_t; | ^~~~~~~~~ | __int128_t /usr/include/x86_64-linux-gnu/sys/types.h:158:9: error: '__uint8_t' does not name a type; did you mean '__uint128_t'? 158 | typedef __uint8_t u_int8_t; | ^~~~~~~~~ | __uint128_t /usr/include/x86_64-linux-gnu/sys/types.h:159:9: error: '__uint16_t' does not name a type; did you mean '__uint128_t'? 159 | typedef __uint16_t u_int16_t; | ^~~~~~~~~~ | __uint128_t /usr/include/x86_64-linux-gnu/sys/types.h:160:9: error: '__uint32_t' does not name a type; did you mean '__uint128_t'? 160 | typedef __uint32_t u_int32_t; | ^~~~~~~~~~ | __uint128_t /usr/include/x86_64-linux-gnu/sys/types.h:161:9: error: '__uint64_t' does not name a type; did you mean '__uint128_t'? 161 | typedef __uint64_t u_int64_t; | ^~~~~~~~~~ | __uint128_t In file included from /usr/include/endian.h:35, from /usr/include/x86_64-linux-gnu/sys/types.h:176: /usr/include/x86_64-linux-gnu/bits/byteswap.h:33:17: error: '__uint16_t' does not name a type; did you mean '__uint128_t'? 33 | static __inline __uint16_t | ^~~~~~~~~~ | __uint128_t /usr/include/x86_64-linux-gnu/bits/byteswap.h:48:17: error: '__uint32_t' does not name a type; did you mean '__uint128_t'? 48 | static __inline __uint32_t | ^~~~~~~~~~ | __uint128_t /usr/include/x86_64-linux-gnu/bits/byteswap.h:69:31: error: '__uint64_t' does not name a type; did you mean '__uint128_t'? 69 | __extension__ static __inline __uint64_t | ^~~~~~~~~~ | __uint128_t In file included from /usr/include/endian.h:36: /usr/include/x86_64-linux-gnu/bits/uintn-identity.h:32:17: error: '__uint16_t' does not name a type; did you mean '__uint128_t'? 32 | static __inline __uint16_t | ^~~~~~~~~~ | __uint128_t /usr/include/x86_64-linux-gnu/bits/uintn-identity.h:38:17: error: '__uint32_t' does not name a type; did you mean '__uint128_t'? 38 | static __inline __uint32_t | ^~~~~~~~~~ | __uint128_t /usr/include/x86_64-linux-gnu/bits/uintn-identity.h:44:17: error: '__uint64_t' does not name a type; did you mean '__uint128_t'? 44 | static __inline __uint64_t | ^~~~~~~~~~ | __uint128_t In file included from /usr/include/x86_64-linux-gnu/sys/select.h:37, from /usr/include/x86_64-linux-gnu/sys/types.h:179: /usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h:14:3: error: '__time_t' does not name a type; did you mean '__sig
s667435806
p03861
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a,b,x; cin >> a >> b >> x; int count = 0; for (int i = a; i <= b; i++){ if (i%x == 0) count ++; } cout << count << endl;
a.cc: In function 'int main()': a.cc:11:27: error: expected '}' at end of input 11 | cout << count << endl; | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s104370924
p03861
C++
#include <bits/stdc++.h> using namespace std; int64_t divide(int64_t &n, int64_t &x){ if(n == 0) return 0; return n/x + 1; } int main() { int64_t a, b, x; cin >> a >> b >> x; cout << divide(b, x) - divide(a - 1, x) <<endl; }
a.cc: In function 'int main()': a.cc:12:35: error: cannot bind non-const lvalue reference of type 'int64_t&' {aka 'long int&'} to an rvalue of type 'int64_t' {aka 'long int'} 12 | cout << divide(b, x) - divide(a - 1, x) <<endl; | ~~^~~ a.cc:4:25: note: initializing argument 1 of 'int64_t divide(int64_t&, int64_t&)' 4 | int64_t divide(int64_t &n, int64_t &x){ | ~~~~~~~~~^
s290798255
p03861
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define INF 1e9 #define PI 3.14159265359 #define MOD 1000000007 #define ALL(v) v.begin(),v.end() typedef long long ll; //isPrime //modpow mod inv int main() { cout << fixed << setprecision(10); long long a,b,x; cin >> a >> b >> x; long long ans = b/x-min(a-1,0)/x; cout << ans << endl; }
a.cc: In function 'int main()': a.cc:15:26: error: no matching function for call to 'min(long long int, int)' 15 | long long ans = b/x-min(a-1,0)/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:15:26: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 15 | long long ans = b/x-min(a-1,0)/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:15:26: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 15 | long long ans = b/x-min(a-1,0)/x; | ~~~^~~~~~~
s109541511
p03861
C++
#define rep(i, n) for(ll i = 0; i < n; i++) #include "bits/stdc++.h" using namespace std; using ll = long long; using P = pair<int, int>; int main() { ll a,b,x; cin >> a >> b >> x; cout << b / x - max(a - 1, 0) / x << endl; return 0; }
a.cc: In function 'int main()': a.cc:11:28: error: no matching function for call to 'max(ll, int)' 11 | cout << b / x - max(a - 1, 0) / x << endl; | ~~~^~~~~~~~~~ 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:2: /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:11:28: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 11 | cout << b / x - max(a - 1, 0) / x << endl; | ~~~^~~~~~~~~~ /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:11:28: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 11 | cout << b / x - max(a - 1, 0) / x << endl; | ~~~^~~~~~~~~~
s353513342
p03861
C++
#include <bits/stdc++.h> using namespace std; using Graph = vector<vector<int>>; #define ll long long #define _GLIBCXX_DEBUG const ll MOD = 1000000007; ll f(ll n, llx) { if (n==1) return 0LL; else return n/x+1; } int main() { ll a, b, x; cin >> a >> b >> x; cout << f(b)-f(a-1) << endl; }
a.cc:8:12: error: 'llx' has not been declared 8 | ll f(ll n, llx) { | ^~~ a.cc: In function 'long long int f(long long int, int)': a.cc:10:17: error: 'x' was not declared in this scope 10 | else return n/x+1; | ^ a.cc: In function 'int main()': a.cc:16:12: error: too few arguments to function 'long long int f(long long int, int)' 16 | cout << f(b)-f(a-1) << endl; | ~^~~ a.cc:8:4: note: declared here 8 | ll f(ll n, llx) { | ^ a.cc:16:17: error: too few arguments to function 'long long int f(long long int, int)' 16 | cout << f(b)-f(a-1) << endl; | ~^~~~~ a.cc:8:4: note: declared here 8 | ll f(ll n, llx) { | ^
s281507778
p03861
C++
#include <bits/stdc++.h> using namespace std; int main(){ long long int a,b,x; cin >> a >> b >> x; if(a==b){ if(a%x==0) cout << 0 << endl; }else{ cout << 1 << endl; } }else if(a==0){ cout << 1 + b/x << endl; }else if(a%x==0 && b%x==0){ cout << 1 + b/x-a/x << endl; }else{ cout << b/x-a/x << endl; } }
a.cc:14:6: error: expected unqualified-id before 'else' 14 | }else if(a==0){ | ^~~~ a.cc:16:6: error: expected unqualified-id before 'else' 16 | }else if(a%x==0 && b%x==0){ | ^~~~ a.cc:18:6: error: expected unqualified-id before 'else' 18 | }else{ | ^~~~ a.cc:21:1: error: expected declaration before '}' token 21 | } | ^
s015937320
p03861
C++
#include <bits/stdc++.h> using namespace std; // define #Asukaminato is cute #define ll long long #define rep(i, m) for (int i = 0; i < (int)(m); i++) const int inf = 1000000000; // 10^9 Ten to the power of nine. int main(){ int main (){ ll a,b,x; cin >> a >> b >> x; ll left = (a-1)/x+1; if(a==0) left=0; ll right= b/x+1; ll ans = right-left; cout << ans << "\n"; }
a.cc: In function 'int main()': a.cc:10:18: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 10 | int main (){ | ^~ a.cc:10:18: note: remove parentheses to default-initialize a variable 10 | int main (){ | ^~ | -- a.cc:10:18: note: or replace parentheses with braces to value-initialize a variable a.cc:10:20: error: a function-definition is not allowed here before '{' token 10 | int main (){ | ^ a.cc:18:2: error: expected '}' at end of input 18 | } | ^ a.cc:9:11: note: to match this '{' 9 | int main(){ | ^
s575175769
p03861
C++
#include<stdio.h> int a; int main() { int b,c,sum=0; scanf("%d%d%d",&a,&b,&c); for(int i=a;i<=b;i++) { if(i%c==0) sum++;n } printf("%d\n",sum); }
a.cc: In function 'int main()': a.cc:10:15: error: 'n' was not declared in this scope 10 | sum++;n | ^
s515245142
p03861
C++
a, b, x = map(int, input().split()) mind = (a // x + 1 if a % x != 0 else a // x) maxd = (b // x if b % x != 0 else b // x) if mind > maxd: print(0) else: print(maxd - mind + 1)
a.cc:1:1: error: 'a' does not name a type 1 | a, b, x = map(int, input().split()) | ^
s111742542
p03861
C++
#include<bits/stdc++.h> #define ll long long using namespace std; int main(){ ll a, b, x; cin >> a >> b >> x; cout << (b/x) - max((a-1)/x, 0) << "\n"; }
a.cc: In function 'int main()': a.cc:8:22: error: no matching function for call to 'max(long long int, int)' 8 | cout << (b/x) - max((a-1)/x, 0) << "\n"; | ~~~^~~~~~~~~~~~ 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:8:22: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 8 | cout << (b/x) - max((a-1)/x, 0) << "\n"; | ~~~^~~~~~~~~~~~ /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:8:22: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 8 | cout << (b/x) - max((a-1)/x, 0) << "\n"; | ~~~^~~~~~~~~~~~
s893107521
p03861
C++
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in=new Scanner(System.in); long a=in.nextLong(); long b=in.nextLong(); long x=in.nextLong(); if (a % x == 0) System.out.println( (b / x) - (a / x) + 1); else System.out.println ((b / x) - (a / x)); } }
a.cc:3:1: error: 'import' does not name a type 3 | import java.util.Scanner; | ^~~~~~ a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:5:1: error: expected unqualified-id before 'public' 5 | public class Main { | ^~~~~~
s199453568
p03861
C++
#include<bits/stdc++.h> using namespace std; int main() { int a,b,x; cin >> a >> b >> x; if(a == 0) cout << b/x+1; else cout << (b/x) - ((a-1)/x); << endl; }
a.cc: In function 'int main()': a.cc:8:35: error: expected primary-expression before '<<' token 8 | else cout << (b/x) - ((a-1)/x); << endl; | ^~
s426955046
p03861
C++
#include<iostream> int main(){ long a,b,x; std::cin>>a>>b>>x; std::cout<<(b/x - a/x +(a%x==0))<<endl; return 0; }
a.cc: In function 'int main()': a.cc:6:37: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 6 | std::cout<<(b/x - a/x +(a%x==0))<<endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s324061916
p03861
C++
#include <bits/stdc++.h> using namespace std; int check(int a,int x){ if (a == -1) return 0; else return (n + x) / x; } int main() { int a,b,x; cin >> a >> b >> x; cout << check(b,x) - check(a - 1,x) << endl; return 0; }
a.cc: In function 'int check(int, int)': a.cc:6:16: error: 'n' was not declared in this scope 6 | else return (n + x) / x; | ^
s270654772
p03861
C++
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(i,n) for(int i=0;i<n;i++) #define rep1(i,n) for(int i=1;i<=n;i++) #define rep2(i,n) for(int i=0;i<=n;i++) #define repr(i,a,n) for(int i=a;i<n;i++) #define all(a) a.begin(),a.end() #define P pair<long long,long long> #define double long double #define vector2(a,b,c) vector<vector<int>> a(b/*縦!w*/,vector<int>(c/*横!w*/)) #define INF 1e10 #define MOD 1e9+7 template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } using Graph = vector<vector<int>>; struct edge{int from,to,cost;}; signed main(){ cin>>a>>b>>c; bool k=0; if(a%c==0&&b%c==0) k=1; if(k) cout<<b/c-a/c+1; else cout<<b/c-a/c; }
a.cc: In function 'int main()': a.cc:19:8: error: 'a' was not declared in this scope 19 | cin>>a>>b>>c; | ^ a.cc:19:11: error: 'b' was not declared in this scope 19 | cin>>a>>b>>c; | ^ a.cc:19:14: error: 'c' was not declared in this scope 19 | cin>>a>>b>>c; | ^
s409352547
p03861
C++
#include <bits/stdc++.h> using namespace std; int f(int a,int x){ if (a == -1)return 0; else return((a/x) + 1); } int main() { long long a,b,x; cin >> a >> b >> x; cout << f(b,x) - f(a - 1,x) return 0; }
a.cc: In function 'int main()': a.cc:11:30: error: expected ';' before 'return' 11 | cout << f(b,x) - f(a - 1,x) | ^ | ; 12 | return 0; | ~~~~~~
s118019454
p03861
C
#include<stdio.h> int main(void){ double a,b,n; int cnt=0; scanf("%lf %lf %lf",&a,&b,&n); while(a<=b){ if((int(a%n))==0){ cnt++; } a+=1.0; } printf("%d",cnt); return 0; }
main.c: In function 'main': main.c:7:13: error: expected ')' before 'a' 7 | if((int(a%n))==0){ | ^ | )
s520817019
p03861
C
#include<stdio.h> int main(void){ double a,b,n; int cnt=0; scanf("%lf %lf %lf",&a,&b,&n); while(a<=b){ if(int(a%n)==0){ cnt++; } a+=1.0; } printf("%d",cnt); return 0; }
main.c: In function 'main': main.c:7:8: error: expected expression before 'int' 7 | if(int(a%n)==0){ | ^~~
s292096594
p03861
C
#include<stdio.h> int main(void){ double a,b,n; int cnt=0; scanf("%lf %lf %lf",&a,&b,&n); while(a<=b){ if((int(a%n))==0){ cnt++; } a+=1.0; } printf("%d",cnt); return 0; }
main.c: In function 'main': main.c:7:13: error: expected ')' before 'a' 7 | if((int(a%n))==0){ | ^ | )
s536126478
p03861
C
#include<stdio.h> int main(void){ double a,b,n; int cnt=0; scanf("%lf %lf %lf",&a,&b,&n); while(a<=b){ if(a%n==0){ cnt++; } a+=1.0; } printf("%d",cnt); return 0; }
main.c: In function 'main': main.c:7:9: error: invalid operands to binary % (have 'double' and 'double') 7 | if(a%n==0){ | ^
s961459751
p03861
C
#include<stdio.h> int main(void){ double a,b,n; int cnt=0; scanf("%lf %lf %lf",&a,&b,&n); while(a<=b){ if((a%n)==0){ cnt++; } a+=1.0; } printf("%d",cnt); return 0; }
main.c: In function 'main': main.c:7:10: error: invalid operands to binary % (have 'double' and 'double') 7 | if((a%n)==0){ | ^
s396624613
p03861
C
#include<stdio.h> int main(void){ double a,b,n; int cnt=0; scanf("%f %f %f",&a,&b,&n); while(a<=b){ if((a%n)==0){ cnt++; } a++; } printf("%d",cnt); return 0; }
main.c: In function 'main': main.c:7:10: error: invalid operands to binary % (have 'double' and 'double') 7 | if((a%n)==0){ | ^
s244018095
p03861
C++
#include<iostream> using namespace std; int main(){ int a,b,n,co = 0; cin >> a >> b >> n; for(i=a; a<=b; ++i){ if(i%n == 0){ co += 1; } } cout << co << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:7: error: 'i' was not declared in this scope 8 | for(i=a; a<=b; ++i){ | ^
s110993142
p03861
C
#include<iostream> using namespace std; int main(){ int a,b,n,co = 0; cin >> a >> b >> n; for(i=a; a<=b; ++i){ if(i%n == 0){ co += 1; } } cout << co << endl; return 0; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s535457330
p03861
C++
#include <cstdio> #include <cstdlib> #include <cmath> #include <cstring> #include <numeric> #include <string> #include <complex> #include <algorithm> #include <iostream> #include <vector> #include <bitset> #include <deque> #include <queue> #include <map> #include <utility> #include <functional> #include <iomanip> #include <unordered_map> #include <set> using namespace std; using ull = unsigned long long; using ll =long long ; using prll =pair<ll, ll>; constexpr ll MOD = 1000000007; //10億 = 10^9になってる constexpr ll mINF = -922337200085470000; //llのmax-1桁の小さい方 constexpr ll pINF = 1LL << 60; constexpr ull uINF= 1844674407399900000; //ullのmax-1桁してる constexpr double pi = 3.1415926535897932384; constexpr ll juu = 100000; //10万 10e5 constexpr ll hyaku = 1000000; //100万 10e6 constexpr ll dx[4] = {0,0,1,-1}; //上下左右のベクトル constexpr ll dy[4] = {1,-1,0,0}; //上下左右のベクトル #define all(v) v.begin(), v.end() #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) ll factor[300]; ll memory[300]; /*素朴法で計算 factorは必ずmemset(factor,0,sizeof(factor)); グローバルであるmemoryに個数を書き込む memory配列の走査にはfactorの要素を使う*/ void primefac(ll num) { int i = 0, kosuu = 0; while (*(factor + i) != 0) { while (num % *(factor + i) == 0) { num /= *(factor + i); memory[*(factor + i)] += 1; } if (num == 1) break; i++; } } /*グローバルにあるfactorに素数書き込む.個数を返すので配列は-1しろforは<*/ int elast(ll number) { ll tmp = 0; int flag = 0; *factor = 2; for (int i = 3; i <= number; i++) { flag = 0; for (int j = 0; j <= tmp; j++) { if (i % (*(factor + j)) == 0) { flag = 1; break; } } if (flag) continue; tmp += 1; *(factor + tmp) = i; } return tmp + 2; } //繰り返し二乗。掛けられる数、回数、mod ll powpow(ll n, ll p) { if (p == 1) return n % MOD; if (p % 2 == 1) { return (n * powpow(n, p - 1)) % MOD; } ll dob = powpow(n, p / 2); return (dob * dob) % MOD; } //MODとn、rが互いに素である事が確定していないとこれは出来ない。小定理、またchild,parentでおかしくなる。 mod取った後にそれら同士で割り算するとおかしくなるから逆元使う。(合同式の性質考えろ) ll nCrMod(ll n, ll r) { ll child = 1; ll parent = 1; if (r == 0) return 1; for (ll i = 0; i < r; ++i) { child = child * (n - i) % MOD; parent = parent * (r - i) % MOD; } ll ans = child * powpow(parent, MOD - 2); return ans % MOD; } ll nCr(ll n, ll r) { ll val = 1; ll i; if (r == 0) return 1; for (i = 0; i < r; ++i) { val *= (n - i); val /= (r - i); } return val; } ll nPr(ll n, ll r) { ll val = 1; ll i; for (i = 0; i < r; ++i) { val *= (n - i); } return val; } template <typename T> bool chmin(T &a, const T b) { if (a > b) { a = b; return true; } return false; } template <typename T> bool chmax(T &a, const T b) { if (a < b) { a = b; return true; } return false; } /*ソートして被りを無くす*/ template <typename T> void eraseSame(T &a) { sort(all(a)); a.erase(unique(all(a)), a.end()); } /*aとbで大きい方を後ろにする。変更なしならtrue、ありならfalse */ template <typename T> bool swapmax(T &a, T &b) { T temp; temp = a; if (a > b) { a = b; b = temp; return false; } return true; } ll gcd(ll x, ll y) { return (x % y) ? gcd(y, x % y) : y; } ll lcm(ll x, ll y) { return x / gcd(x, y) * y; } /*一行に入力が何個あるかを1,ぶち込むvectorを2*/ template <typename T> void splitIn(ll N, vector<T> &array) { T temp; int i = 0; if (N == 0) { return; } array.resize(N); while (cin >> temp) { array[i] = temp; i++; if (i >= N) { break; } } return; } int main() { ios::sync_with_stdio(false); cin.tie(0); //setprecision(15); ll n, k, m,l; ll ans = 0; ll sum = 0; string s; vector<ll> v; cin >> n >> k >> m; cout << k/m - max(0,(n-1))/m << "\n"; }
a.cc: In function 'int main()': a.cc:210:22: error: no matching function for call to 'max(int, ll)' 210 | cout << k/m - max(0,(n-1))/m << "\n"; | ~~~^~~~~~~~~ In file included from /usr/include/c++/14/bits/specfun.h:43, from /usr/include/c++/14/cmath:3906, from a.cc:4: /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:210:22: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'}) 210 | cout << k/m - max(0,(n-1))/m << "\n"; | ~~~^~~~~~~~~ /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, from a.cc:9: /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:210:22: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 210 | cout << k/m - max(0,(n-1))/m << "\n"; | ~~~^~~~~~~~~
s616423211
p03861
C++
#include <bits/stdc++.h> #define rep(i, n) for(int i = 0; i < (int)(n); i++) using namespace std; typedef long long int ll; typedef pair<int, int> P; 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; } long long a, b, x; int main(){ cin >> a >> b >> x; long long res = b / x; res -= max(a - 1, 0) / x; cout << res << endl; }
a.cc: In function 'int main()': a.cc:15:13: error: no matching function for call to 'max(long long int, int)' 15 | res -= max(a - 1, 0) / 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:15:13: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 15 | res -= max(a - 1, 0) / 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:15:13: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 15 | res -= max(a - 1, 0) / x; | ~~~^~~~~~~~~~
s553254924
p03861
C++
//失敗するからこそそこから立ち向かって行く強さがあってそんな強さが本当の強さだと私は思うから // ぜったいあきらめない #include<bits/stdc++.h> using namespace std; #if !defined(ONLINE_JUDGE) #include "/home/ichigo/debug.hpp" #define deb(x...) cerr << "[" << #x << "] = ["; _print(x) #else #define deb(x...) #endif #define FIO {ios::sync_with_stdio(0);cin.tie(nullptr);cout.tie(nullptr);} int main(){ FIO long long a, b, x;cin >> a >> b >> x; if(a == 0){ cout << b / x + 1; } else{ long long left = (a - 1) / x; long long right = b / x; cout << right - left; } return 0; }
a.cc:7:10: fatal error: /home/ichigo/debug.hpp: No such file or directory 7 | #include "/home/ichigo/debug.hpp" | ^~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
s899736736
p03861
C
#include<stdio.h> int main() { long long int a,b,x; long long int con; scanf("%lld %lld %lld",&a,&b,&x); con=b/x-(a-1)/x; if() con++; printf("%lld",con); return 0; }
main.c: In function 'main': main.c:10:6: error: expected expression before ')' token 10 | if() con++; | ^
s260416240
p03861
C++
#include <iostream> #include<vector> #include<algorithm> #include<string> #include<cmath> using namespace std; int f(int n,int x); int main(){ long a,b,x; cin >> a >> b >> x; long count; count = f(b,x)-f(a-1,x); cout << count << endl; } long f(long n,long x){ if(n==-1){ return 0; }else{ return n/x+1; } }
/usr/bin/ld: /tmp/ccF9NNrl.o: in function `main': a.cc:(.text+0x52): undefined reference to `f(int, int)' /usr/bin/ld: a.cc:(.text+0x6a): undefined reference to `f(int, int)' collect2: error: ld returned 1 exit status
s341240314
p03861
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for(ll i = 0; i < (ll)(n); i++) #define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++) #define memi cout << endl #define kono(n) cout << fixed << setprecision(n) #define all(c) (c).begin(), (c).end() #define pb push_back #define hina cout << ' ' #define in(n) cin >> n #define in2(n, m) cin >> n >> m #define in3(n, m, l) cin >> n >> m >> l #define out(n) cout << n const ll mei = (ll)1e9 + 7; int main(){ ll a, b, c; in3(a, b, c); out(b / c - max(0, a - 1) / c); memi; }
a.cc: In function 'int main()': a.cc:20:18: error: no matching function for call to 'max(int, ll)' 20 | out(b / c - max(0, a - 1) / c); | ~~~^~~~~~~~~~ a.cc:14:24: note: in definition of macro 'out' 14 | #define out(n) cout << n | ^ 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:20:18: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'}) 20 | out(b / c - max(0, a - 1) / c); | ~~~^~~~~~~~~~ a.cc:14:24: note: in definition of macro 'out' 14 | #define out(n) cout << n | ^ /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:20:18: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 20 | out(b / c - max(0, a - 1) / c); | ~~~^~~~~~~~~~ a.cc:14:24: note: in definition of macro 'out' 14 | #define out(n) cout << n | ^
s800304307
p03861
C++
import sys # import math # import decimal # import queue # import bisect # import heapq # import time # import itertools # from fractions import Fraction mod = int(1e9+7) INF = 1<<29 def main(): a,b,x = map(int,input().split()) l = (a + x - 1) // x r = (b + x - 1) // x ans = r - l if b%x==0: ans += 1 print(ans) return if __name__=='__main__': main()
a.cc:2:3: warning: #import is a deprecated GCC extension [-Wdeprecated] 2 | # import math | ^~~~~~ a.cc:2:10: error: #import expects "FILENAME" or <FILENAME> 2 | # import math | ^~~~ a.cc:3:3: warning: #import is a deprecated GCC extension [-Wdeprecated] 3 | # import decimal | ^~~~~~ a.cc:3:10: error: #import expects "FILENAME" or <FILENAME> 3 | # import decimal | ^~~~~~~ a.cc:4:3: warning: #import is a deprecated GCC extension [-Wdeprecated] 4 | # import queue | ^~~~~~ a.cc:4:10: error: #import expects "FILENAME" or <FILENAME> 4 | # import queue | ^~~~~ a.cc:5:3: warning: #import is a deprecated GCC extension [-Wdeprecated] 5 | # import bisect | ^~~~~~ a.cc:5:10: error: #import expects "FILENAME" or <FILENAME> 5 | # import bisect | ^~~~~~ a.cc:6:3: warning: #import is a deprecated GCC extension [-Wdeprecated] 6 | # import heapq | ^~~~~~ a.cc:6:10: error: #import expects "FILENAME" or <FILENAME> 6 | # import heapq | ^~~~~ a.cc:7:3: warning: #import is a deprecated GCC extension [-Wdeprecated] 7 | # import time | ^~~~~~ a.cc:7:10: error: #import expects "FILENAME" or <FILENAME> 7 | # import time | ^~~~ a.cc:8:3: warning: #import is a deprecated GCC extension [-Wdeprecated] 8 | # import itertools | ^~~~~~ a.cc:8:10: error: #import expects "FILENAME" or <FILENAME> 8 | # import itertools | ^~~~~~~~~ a.cc:9:3: error: invalid preprocessing directive #from 9 | # from fractions import Fraction | ^~~~ a.cc:24:14: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes 24 | if __name__=='__main__': | ^~~~~~~~~~ a.cc:1:1: error: 'import' does not name a type 1 | import sys | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s972702065
p03861
C++
#include <iostream> #include <string> using namespace std; int main() { unsigned long long a, b, x; cin >> a >> b >> x; unsigned long long answer = (b - a) / x; if (a % x == 0 || b % x == 0) answer++; cout << answer; return 0
a.cc: In function 'int main()': a.cc:18:13: error: expected ';' at end of input 18 | return 0 | ^ | ; a.cc:18:13: error: expected '}' at end of input a.cc:7:1: note: to match this '{' 7 | { | ^