submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s478970810
p03730
C++
#include <cstdio> int main() { int a,b,c,num; scanf("%d%d%d",&a,&b,&c); for(i=0;i<=1000;i++) { ans=a*i; if(ans%b==c) { printf("YES\n"); return 0; } } printf("NO\n"); return 0; }
a.cc: In function 'int main()': a.cc:6:9: error: 'i' was not declared in this scope 6 | for(i=0;i<=1000;i++) | ^ a.cc:8:9: error: 'ans' was not declared in this scope 8 | ans=a*i; | ^~~
s020400095
p03730
C++
#include<bits/stdc++.h> using namespace std; int a, b, c; int count = 0; int main(){ cin >> a >> b >> c; for(int i = 1; i < 1000; i++){ count += i*a; } if(count % b == c) cout << "Yes" << endl; else cout << "No" << endl; }
a.cc: In function 'int main()': a.cc:8:5: error: reference to 'count' is ambiguous 8 | count += i*a; | ^~~~~ In file included from /usr/include/c++/14/algorithm:86, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)' 101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value); | ^~~~~ In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:4025:5: note: 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)' 4025 | count(_InputIterator __first, _InputIterator __last, const _Tp& __value) | ^~~~~ a.cc:4:5: note: 'int count' 4 | int count = 0; | ^~~~~ a.cc:10:6: error: reference to 'count' is ambiguous 10 | if(count % b == c) cout << "Yes" << endl; | ^~~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)' 101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value); | ^~~~~ /usr/include/c++/14/bits/stl_algo.h:4025:5: note: 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)' 4025 | count(_InputIterator __first, _InputIterator __last, const _Tp& __value) | ^~~~~ a.cc:4:5: note: 'int count' 4 | int count = 0; | ^~~~~
s756688591
p03730
C++
#include<bits/stdc++.h> using namespace std; int a, b, c; int count = 0; int main(){ cin >> a >> b >> c; for(int i = 1; i < 1000; i++){ count += i*a } if(count % b == c) cout << "Yes" << endl; else cout << "No" << endl; }
a.cc: In function 'int main()': a.cc:8:5: error: reference to 'count' is ambiguous 8 | count += i*a | ^~~~~ In file included from /usr/include/c++/14/algorithm:86, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)' 101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value); | ^~~~~ In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:4025:5: note: 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)' 4025 | count(_InputIterator __first, _InputIterator __last, const _Tp& __value) | ^~~~~ a.cc:4:5: note: 'int count' 4 | int count = 0; | ^~~~~ a.cc:10:6: error: reference to 'count' is ambiguous 10 | if(count % b == c) cout << "Yes" << endl; | ^~~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)' 101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value); | ^~~~~ /usr/include/c++/14/bits/stl_algo.h:4025:5: note: 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)' 4025 | count(_InputIterator __first, _InputIterator __last, const _Tp& __value) | ^~~~~ a.cc:4:5: note: 'int count' 4 | int count = 0; | ^~~~~
s674099300
p03730
C++
#include<iostream> using namespace std; int main(){ long long a,b,c,i; cin>>a>>b>>c; for(i=1;i<=1000;++i){ if((a*i)%b==c){ cout<<"YES"<<endl; goto endapp: } } cout<<"NO"<<endl; endapp: return 0; }
a.cc: In function 'int main()': a.cc:9:24: error: expected ';' before ':' token 9 | goto endapp: | ^ | ; a.cc:9:24: error: expected primary-expression before ':' token
s783632491
p03730
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a,b,c; cin >> a >> b >> c; for(int i=a; i <= b * a; i *= a){ if(i % b == c){ cout << "YES" << endl; } cout << "NO" << endl; }
a.cc: In function 'int main()': a.cc:10:2: error: expected '}' at end of input 10 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s606674779
p03730
C++
#include <iostream> #include <cstdio> #include <cstdlib> #include <cstring> #include <cctype> #include <algorithm> #include <string> #include <sstream> #include <complex> #include <vector> #include <list> #include <queue> #include <deque> #include <stack> #include <map> #include <set> #include "bits/stdc++.h" using namespace std; typedef long long unsigned int ll; #define EPS (1e-7) #define INF (1e9) #define PI (acos(-1)) #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define REP(i,n) FOR(i,0,n) #define ALL(a) (a).begin(),(a).end() int main(){ cin>>a>>b>>c; for(int s=a;s<=100000;s+=a) { if(s%b==c) { cout<<"YES\n"; return 0; } } cout<<"NO\n"; }
a.cc: In function 'int main()': a.cc:30:10: error: 'a' was not declared in this scope 30 | cin>>a>>b>>c; | ^ a.cc:30:13: error: 'b' was not declared in this scope 30 | cin>>a>>b>>c; | ^ a.cc:30:16: error: 'c' was not declared in this scope 30 | cin>>a>>b>>c; | ^
s288327099
p03730
C++
#include<bits/stdc++.h> using namespace std; int main() { long long n,m,y; cin>>n>>m>>y; for(int i=1;i<=1000;i++) { if((a*s)%b==c) { cout<<"YES"<<endl; return 0; } } cout<<"NO"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:13: error: 'a' was not declared in this scope 9 | if((a*s)%b==c) | ^ a.cc:9:15: error: 's' was not declared in this scope 9 | if((a*s)%b==c) | ^ a.cc:9:18: error: 'b' was not declared in this scope 9 | if((a*s)%b==c) | ^ a.cc:9:21: error: 'c' was not declared in this scope 9 | if((a*s)%b==c) | ^
s066291847
p03730
C++
int main() { int A, B, C; scanf("%d %d %d", &A, &B, &C); while(A != 0 && B != 0) { int a = A, b = B; if(a > b) { A = a % b; } else { B = b % a; } } printf("%s", (A != 0 && C % A == 0 || B != 0 && C % B == 0) ? "YES" : "NO"); return 0; }
a.cc: In function 'int main()': a.cc:4:5: error: 'scanf' was not declared in this scope 4 | scanf("%d %d %d", &A, &B, &C); | ^~~~~ a.cc:15:5: error: 'printf' was not declared in this scope 15 | printf("%s", (A != 0 && C % A == 0 || B != 0 && C % B == 0) ? "YES" : "NO"); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | int main()
s202777274
p03730
C
#include<stdio.h> int main() { int a,b,c,f=0; // 整数の入力 // スペース区切りの整数の入力 scanf("%d %d %d",&a,&b,&c); // 出力 for(int i=1;i<=b;i++){ if((a*i-c)%b==0){ printf("YES"); f=1; break; } }
main.c: In function 'main': main.c:15:3: error: expected declaration or statement at end of input 15 | } | ^
s361403004
p03730
C++
#include <bits/stdc++.h> #define REP(i,n) for(int i=0;i<(n);i++) const int MOD=(int)1e9+7; using namespace std; int main(){ int a,b,c; cin>>a>>b>>C; REP(i,b){ if(i*a%b==c){ cout<<"YES"<<endl; return 0; } } cout<<"NO"<<endl; }
a.cc: In function 'int main()': a.cc:7:16: error: 'C' was not declared in this scope 7 | cin>>a>>b>>C; | ^
s059591359
p03730
C
#include<stdio.h> int main() { int a,b,c; // 整数の入力 // スペース区切りの整数の入力 scanf("%d %d %d",&a,&b,&c); // 出力 for(int i=1;i<=b;i++){ if((a*i-c)%b==0){ printf("YES"); } printf("NO"); return 0; }
main.c: In function 'main': main.c:15:1: error: expected declaration or statement at end of input 15 | } | ^
s519016593
p03730
C
#include<stdio.h> int main() { int a,b,c; // 整数の入力 // スペース区切りの整数の入力 scanf("%d,%d %d",&a,&b,&c); // 出力 for(int i=0;i<b;i++){ if((a*i-c)%b==0){ printf("YES"); }else printf(“NO”); } return 0; }
main.c: In function 'main': main.c:12:20: error: stray '\342' in program 12 | }else printf(<U+201C>NO<U+201D>); | ^~~~~~~~ main.c:12:23: error: stray '\342' in program 12 | }else printf(<U+201C>NO<U+201D>); | ^~~~~~~~ main.c:12:21: error: 'NO' undeclared (first use in this function) 12 | }else printf(“NO”); | ^~ main.c:12:21: note: each undeclared identifier is reported only once for each function it appears in
s329344023
p03730
C
#include<stdio.h> int main() { int a,b,c; // 整数の入力 // スペース区切りの整数の入力 scanf("%d,%d %d",&a,&b,&c); // 出力 for(int i=0;i<b;i++){ if((a*n-c)%b==0){ printf("YES"); }else printf(“NO”); } return 0; }
main.c: In function 'main': main.c:10:11: error: 'n' undeclared (first use in this function) 10 | if((a*n-c)%b==0){ | ^ main.c:10:11: note: each undeclared identifier is reported only once for each function it appears in main.c:12:20: error: stray '\342' in program 12 | }else printf(<U+201C>NO<U+201D>); | ^~~~~~~~ main.c:12:23: error: stray '\342' in program 12 | }else printf(<U+201C>NO<U+201D>); | ^~~~~~~~ main.c:12:21: error: 'NO' undeclared (first use in this function) 12 | }else printf(“NO”); | ^~
s764390386
p03730
C
#include<stdio.h> int main() { int a,b,c; // 整数の入力 // スペース区切りの整数の入力 scanf("%d,%d %d",&a,&b,&c); // 出力 for(int i=0;i<b;i++){ if((a*n-c)%b==0){ printf("YES"); }else printf(“NO”); } return 0; }
main.c: In function 'main': main.c:10:11: error: 'n' undeclared (first use in this function) 10 | if((a*n-c)%b==0){ | ^ main.c:10:11: note: each undeclared identifier is reported only once for each function it appears in main.c:12:20: error: stray '\342' in program 12 | }else printf(<U+201C>NO<U+201D>); | ^~~~~~~~ main.c:12:23: error: stray '\342' in program 12 | }else printf(<U+201C>NO<U+201D>); | ^~~~~~~~ main.c:12:21: error: 'NO' undeclared (first use in this function) 12 | }else printf(“NO”); | ^~
s190805369
p03730
C
#include<stdio.h> int main() { int a,b,c; // 整数の入力 // スペース区切りの整数の入力 scanf("%d,%d %d",&a,&b,&c); // 出力 for(int i=0;i<b;i++){ if((a*n-c)%b==0){ printf("YES"); }else printf(“NO”); } return 0; }
main.c: In function 'main': main.c:10:11: error: 'n' undeclared (first use in this function) 10 | if((a*n-c)%b==0){ | ^ main.c:10:11: note: each undeclared identifier is reported only once for each function it appears in main.c:12:20: error: stray '\342' in program 12 | }else printf(<U+201C>NO<U+201D>); | ^~~~~~~~ main.c:12:23: error: stray '\342' in program 12 | }else printf(<U+201C>NO<U+201D>); | ^~~~~~~~ main.c:12:21: error: 'NO' undeclared (first use in this function) 12 | }else printf(“NO”); | ^~
s626789896
p03730
C++
#include <iostream> using namespace std; bool check(int A, int B, int C){ for(int i=0; i<B; i++){ if((A*i))%B == C) return true; } return false; } int main(){ cin.tie(0); ios::sync_with_stdio(false);//高速化、endlは使わない int A, B, C; cin >> A >> B >> C; if (check(A,B,C)) cout << "Yes" << "\n"; else cout << "No" << "\n"; }
a.cc: In function 'bool check(int, int, int)': a.cc:7:14: error: expected primary-expression before '%' token 7 | if((A*i))%B == C) return true; | ^
s425384552
p03730
C++
77 42 36
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 77 42 36 | ^~
s395470164
p03730
C++
a, b, c = map(int, input().split()) def judhe(a, b, c): for i in range(b+1): if (a*i) % b == c: return 1 return 0 print("YES" if judhe(a, b, c) else "NO")
a.cc:1:1: error: 'a' does not name a type 1 | a, b, c = map(int, input().split()) | ^
s142103228
p03730
C++
#include<bits/stdc++.h> #define LL long long using namespace std; int main(){ int a,b,c; cin>>a>>b>>c; if(a==1) cout<<"YES"<<endl if(a%2 && b%2) cout<<"YES"<<endl; //else if(a%2 && !(b%2) && c%2) cout<<"YES"<<endl; else if(!(a%2) && !(b%2) && !(c%2)) cout<<"YES"<<endl; else cout<<"NO"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:6:29: error: expected ';' before 'if' 6 | if(a==1) cout<<"YES"<<endl | ^ | ; 7 | if(a%2 && b%2) cout<<"YES"<<endl; | ~~
s785102108
p03730
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a,b,c; cin>>a>>b>>c; if(!(a%2) && !(b%2) && c%2) cout<<"NO"<<endl; else if(a%2 && !(b%2) && !(c%2)) cout<<"NO"<<endl; else if(a%s && b%2 && !(c%2)) cout<<"NO"<<endl; else cout<<"YES"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:8:13: error: 's' was not declared in this scope 8 | else if(a%s && b%2 && !(c%2)) cout<<"NO"<<endl; | ^
s555809947
p03730
C++
#include<iostream> #include<algorithm> #include<vector> #include<string> using namespace std; typedef long long lng; #define FOR(i,a,b) for(int i=(a); i<=(b); ++i) #define FORD(i,b,a) for(int i=(b); i>=(a); --i) #define REP(i,n) FOR(i,0,n-1) #define ALL(a) (a).begin(), (a).end() #define UNIQUE(a) a.erase(unique(ALL(a)), a.end()) //ATTENTION: <a> must be sorted in advance lng power(lng b, lng n) {lng sol=1; while(n>0) {if(n&1) {sol=sol*b;} n>>=1; b*= b;} return sol;} //calculate b^n const int MOD = 1000000007; //10^9+7 /*********** variables ************/ string A, B, C; /**********************************/ int main() { cin.tie(0); ios::sync_with_stdio(false); cin >> A >> B >> C; FOR(i, 1, 200) { int a = i*A; if(a%B == C) { cout << "YES" << endl; return 0; } } cout << "NO" << endl; }
a.cc: In function 'int main()': a.cc:28:18: error: no match for 'operator*' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 28 | int a = i*A; | ~^~ | | | | | std::string {aka std::__cxx11::basic_string<char>} | int a.cc:29:13: error: no match for 'operator%' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 29 | if(a%B == C) { | ~^~ | | | | | std::string {aka std::__cxx11::basic_string<char>} | int
s722631903
p03730
Java
\import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int A,B,C,num2=0; A=sc.nextInt(); B=sc.nextInt(); C=sc.nextInt(); for(int a=A;a<=B*A;a++){ int num = a%B; if(num == C) num2 = 1; } if(B<=C) System.out.println("NO"); if(num2!=0) System.out.println("YES"); else System.out.println("NO"); } }
Main.java:1: error: illegal character: '\' \import java.util.*; ^ Main.java:1: error: class, interface, enum, or record expected \import java.util.*; ^ 2 errors
s972907006
p03730
C++
#include <iostream> #include <string> #include <algorithm> using namespace std; int main(){ int a,b,c; cin>>a>>b>>c; int p[100]; for(int i=1;i<=b;i++)p[i-1]=a*i%b; for(int i=0;i<n;i++){ if(p[i]==c){ cout<<"YES"<<endl; return 0; } } cout<<"NO"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:10:23: error: 'n' was not declared in this scope 10 | for(int i=0;i<n;i++){ | ^
s394692516
p03730
C++
#include <iostream> using namespace std; int main(){ int a, b, c; cin >> a >> b >> c; for(int i = 1; i <= b; i**){ if((a*i)%b == c){ cout << "YES" << endl; return 0; } } cout << "NO" << endl; }
a.cc: In function 'int main()': a.cc:6:29: error: expected primary-expression before ')' token 6 | for(int i = 1; i <= b; i**){ | ^
s480913647
p03730
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); boolean b = false; for(int i = 0;i < a*b;i += a){ if(i%b == c){ b = true; break; } } if(b)System.out.println("YES"); else System.out.println("NO"); }}
Main.java:8: error: variable b is already defined in method main(String[]) boolean b = false; ^ Main.java:9: error: bad operand types for binary operator '*' for(int i = 0;i < a*b;i += a){ ^ first type: int second type: boolean Main.java:10: error: bad operand types for binary operator '%' if(i%b == c){ ^ first type: int second type: boolean 3 errors
s989377724
p03730
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); boolean b = false; for(int i = 0;i < a*b;i += a){ if(i%b == c){ b = true; break } } if(b)System.out.println("YES"); else System.out.println("NO"); }}
Main.java:12: error: ';' expected break ^ 1 error
s193031028
p03730
Java
import java.util.Scanner; public class Main{ public static void main(String args[]){ Scanner sc = new Scanner(); int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); int d = a % b; int k = d; while(true){ if(c==k){ System.out.println("YES"); return; } k += d; if(k > d){ k -= d; } if(k == d){ System.out.println("NO"); return; } } } }
Main.java:5: error: no suitable constructor found for Scanner(no arguments) Scanner sc = new Scanner(); ^ constructor Scanner.Scanner(Readable,Pattern) is not applicable (actual and formal argument lists differ in length) constructor Scanner.Scanner(Readable) is not applicable (actual and formal argument lists differ in length) constructor Scanner.Scanner(InputStream) is not applicable (actual and formal argument lists differ in length) constructor Scanner.Scanner(InputStream,String) is not applicable (actual and formal argument lists differ in length) constructor Scanner.Scanner(InputStream,Charset) is not applicable (actual and formal argument lists differ in length) constructor Scanner.Scanner(File) is not applicable (actual and formal argument lists differ in length) constructor Scanner.Scanner(File,String) is not applicable (actual and formal argument lists differ in length) constructor Scanner.Scanner(File,Charset) is not applicable (actual and formal argument lists differ in length) constructor Scanner.Scanner(File,CharsetDecoder) is not applicable (actual and formal argument lists differ in length) constructor Scanner.Scanner(Path) is not applicable (actual and formal argument lists differ in length) constructor Scanner.Scanner(Path,String) is not applicable (actual and formal argument lists differ in length) constructor Scanner.Scanner(Path,Charset) is not applicable (actual and formal argument lists differ in length) constructor Scanner.Scanner(String) is not applicable (actual and formal argument lists differ in length) constructor Scanner.Scanner(ReadableByteChannel) is not applicable (actual and formal argument lists differ in length) constructor Scanner.Scanner(ReadableByteChannel,String) is not applicable (actual and formal argument lists differ in length) constructor Scanner.Scanner(ReadableByteChannel,Charset) is not applicable (actual and formal argument lists differ in length) 1 error
s379453535
p03730
C++
#include <iostream> using namespace std; int main(){ int A, B, C, j=0; cin >> A >> B >> C; for(int i=1; i<=B; i++){ if(A*i%B==C){ j++; break; } if(j!=0) cout << "YES"; else cout << "NO"; }
a.cc: In function 'int main()': a.cc:15:2: error: expected '}' at end of input 15 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s391496473
p03730
C++
#include <iostream> #include <cmath> #include <algorithm> using namespace std; int main(void){ int a, b, c; cin >> a >> b >> c; if (c % gcd(a, b) == 0) cout << "YES" << endl; else cout << "NO" << endl; }
a.cc: In function 'int main()': a.cc:12:17: error: 'gcd' was not declared in this scope 12 | if (c % gcd(a, b) == 0) | ^~~
s995237374
p03730
C++
#include <iostream> #include <cmath> using namespace std; int main(void){ int a, b, c; cin >> a >> b >> c; if (c % gcd(a, b) == 0) cout << "YES" << endl; else cout << "NO" << endl; }
a.cc: In function 'int main()': a.cc:11:17: error: 'gcd' was not declared in this scope 11 | if (c % gcd(a, b) == 0) | ^~~
s356330148
p03730
C++
#include <iostream> #include <gcd> using namespace std; int main(void){ int a, b, c; cin >> a >> b >> c; if (c % gcd(a, b) == 0) cout << "YES" << endl; else cout << "NO" << endl; }
a.cc:2:10: fatal error: gcd: No such file or directory 2 | #include <gcd> | ^~~~~ compilation terminated.
s425290204
p03730
C++
#include <cstdio> #include <cstdlib> #include <cmath> #include <cstring> #include <iostream> #include <algorithm> using namespace std; int a, b, c, flag; int main(){ wihle(cin>>a>>b>>c){ int q == c % b; flag = 0; for(int i = 1; i <= 100; i++){ if((a * i) % b == q){ cout<<"YES"<<endl; flag = 1; break; } } if(flag == 0) cout<<"NO"<<endl; } }
a.cc: In function 'int main()': a.cc:10:9: error: 'wihle' was not declared in this scope 10 | wihle(cin>>a>>b>>c){ | ^~~~~
s023761239
p03730
C++
#include<iostream> #include<algorithm> #include<cstdio> #include<cmath> #include<cstring> using namespace std; int main() { int a,b,c,i; scanf("%d%d%d",&a,&b,&c); n=c%b; for(i=0;i<=1000;i++){ if((n+b*i)%a==0) { printf("YES\n"); break; } } printf("NO\n"); }
a.cc: In function 'int main()': a.cc:11:9: error: 'n' was not declared in this scope 11 | n=c%b; | ^
s334906108
p03730
Java
#include <bits/stdc++.h> typedef long long LL; const int MAX = 1000; using namespace std; int tu[MAX+5][MAX+5],m,n; int main(){ int a,b,c; while(cin>>a>>b>>c){ int m = c%b; int flag=0,sum=1; for(int i=1; i<=100; ++i){ sum=a*i; if(sum==m){ flag=1; break; } } if(flag)cout<<"YES"<<endl; else cout<<"NO"<<endl; } return 0; }
Main.java:1: error: illegal character: '#' #include <bits/stdc++.h> ^ Main.java:1: error: class, interface, enum, or record expected #include <bits/stdc++.h> ^ Main.java:3: error: class, interface, enum, or record expected const int MAX = 1000; ^ Main.java:4: error: class, interface, enum, or record expected using namespace std; ^ Main.java:6: error: class, interface, enum, or record expected int tu[MAX+5][MAX+5],m,n; ^ Main.java:19: error: not a statement if(flag)cout<<"YES"<<endl; ^ Main.java:20: error: not a statement else cout<<"NO"<<endl; ^ Main.java:7: error: unnamed classes are a preview feature and are disabled by default. int main(){ ^ (use --enable-preview to enable unnamed classes) 8 errors
s634004718
p03730
C++
#include <iostream> using namespace std; int main(void){ // Your code here! int A, B, C,; cin >> A; cin >> B; cin >> C; for (int a = 0; ; a++) { if (A % B == 0) { cout << "NO" << endl; return 0; } if (A * a % B == C) { cout << "YES" << endl; return 0; } } }
a.cc: In function 'int main()': a.cc:5:17: error: expected unqualified-id before ';' token 5 | int A, B, C,; | ^
s438759929
p03730
C++
#include <iostream> using namespace std; int main(void){ // Your code here! int A, B, C,; cin >> A; cin >> B; cin >> C; for (int a = 0; ; a++) { if (A % B == 0) { cout << "NO" << endl; return 0; } if (A * a % B == C) { cout << "YES" << endl; return 0; } }
a.cc: In function 'int main()': a.cc:5:17: error: expected unqualified-id before ';' token 5 | int A, B, C,; | ^ a.cc:22:2: error: expected '}' at end of input 22 | } | ^ a.cc:3:15: note: to match this '{' 3 | int main(void){ | ^
s994228651
p03730
C++
#include <iostream> #include <string> #include <cmath> using namespace std; #define PrintLn(X) cout << X << endl int main(void) { int A, B, C; cin >> A >> B >> C; int n = 1; while(1){ if((A * n) % B == C){ PrintLn("YES"); return 0; }else if((A * n) % B == A % B){ PrintLn("NO"); return 0; } n++ } }
a.cc: In function 'int main()': a.cc:21:20: error: expected ';' before '}' token 21 | n++ | ^ | ; 22 | } | ~
s951021706
p03730
C++
#include <bits/stdc++.h> #include<iostream> #include<cstdio> #include<vector> #include<queue> #include<map> #include<cstring> #include<string> #include <math.h> #include<algorithm> // #include <boost/multiprecision/cpp_int.hpp> #include<functional> #define int long long #define inf 1000000007 #define pa pair<int,int> #define ll long long #define pal pair<double,pa> #define ppa pair<int,int> #define ppap pair<int,pa> #define ssa pair<string,int> #define mp make_pair #define pb push_back #define EPS (1e-10) #define equals(a,b) (fabs((a)-(b))<EPS) using namespace std; class Point{ public: double x,y; Point(double x=0,double y=0):x(x),y(y) {} Point operator + (Point p) {return Point(x+p.x,y+p.y);} Point operator - (Point p) {return Point(x-p.x,y-p.y);} Point operator * (double a) {return Point(x*a,y*a);} Point operator / (double a) {return Point(x/a,y/a);} double absv() {return sqrt(norm());} double norm() {return x*x+y*y;} bool operator < (const Point &p) const{ return x != p.x ? x<p.x: y<p.y; } bool operator == (const Point &p) const{ return fabs(x-p.x)<EPS && fabs(y-p.y)<EPS; } }; typedef Point Vector; struct Segment{ Point p1,p2; }; double dot(Vector a,Vector b){ return a.x*b.x+a.y*b.y; } double cross(Vector a,Vector b){ return a.x*b.y-a.y*b.x; } bool parareru(Point a,Point b,Point c,Point d){ // if(abs(cross(a-b,d-c))<EPS)cout<<"dd "<<cross(a-b,d-c)<<endl; return abs(cross(a-b,d-c))<EPS; } double distance_ls_p(Point a, Point b, Point c) { if ( dot(b-a, c-a) < EPS ) return (c-a).absv(); if ( dot(a-b, c-b) < EPS ) return (c-b).absv(); return abs(cross(b-a, c-a)) / (b-a).absv(); } bool is_intersected_ls(Segment a,Segment b) { if(a.p1==b.p1||a.p2==b.p1||a.p1==b.p2||a.p2==b.p2) return false; if(parareru((a.p2),(a.p1),(a.p1),(b.p2))&&parareru((a.p2),(a.p1),(a.p1),(b.p1))){ // cout<<"sss"<<endl; if(dot(a.p1-b.p1,a.p1-b.p2)<EPS) return true; if(dot(a.p2-b.p1,a.p2-b.p2)<EPS) return true; if(dot(a.p1-b.p1,a.p2-b.p1)<EPS) return true; if(dot(a.p1-b.p2,a.p2-b.p2)<EPS) return true; return false; } else return ( cross(a.p2-a.p1, b.p1-a.p1) * cross(a.p2-a.p1, b.p2-a.p1) < EPS ) && ( cross(b.p2-b.p1, a.p1-b.p1) * cross(b.p2-b.p1, a.p2-b.p1) < EPS ); } double segment_dis(Segment a,Segment b){ if(is_intersected_ls(a,b))return 0; double r=distance_ls_p(a.p1, a.p2, b.p1); r=min(r,distance_ls_p(a.p1, a.p2, b.p2)); r=min(r,distance_ls_p(b.p1, b.p2, a.p2)); r=min(r,distance_ls_p(b.p1, b.p2, a.p1)); return r; } Point intersection_ls(Segment a, Segment b) { Point ba = b.p2-b.p1; double d1 = abs(cross(ba, a.p1-b.p1)); double d2 = abs(cross(ba, a.p2-b.p1)); double t = d1 / (d1 + d2); return a.p1 + (a.p2-a.p1) * t; } string itos( int i ) { ostringstream s ; s << i ; return s.str() ; } int gcd(int v,int b){ if(v>b) return gcd(b,v); if(v==b) return b; if(b%v==0) return v; return gcd(v,b%v); } double distans(double x1,double y1,double x2,double y2){ double rr=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2); return sqrt(rr); } /* int pr[100010]; //int inv[100010]; */ int beki(int wa,int rr,int warukazu){ if(rr==0) return 1ll; if(rr==1) return wa%warukazu; if(rr%2==1) return (beki(wa,rr-1,warukazu)*wa)%warukazu; int zx=beki(wa,rr/2,warukazu); return (zx*zx)%warukazu; } /* void gya(){ pr[0]=1; for(int i=1;i<100010;i++){ pr[i]=(pr[i-1]*i)%inf; } for(int i=0;i<100010;i++) inv[i]=beki(pr[i],inf-2); } */ //----------------kokomade tenpure------------ //vector<double> ans(100000000),ans2(100000000); int len(int u){ int r=u; int d=0; while(r>=1){ r/=10; d++; } //cout<<u<<" "<<d<<endl; return d; } signed main(){ int a,b,c; cin>>a>>b>>c; int d=gcd(a,b); if(c%d==0)cout<<"YES"<<endl; else cout<"NO"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:157:23: error: invalid operands of types 'const char [3]' and '<unresolved overloaded function type>' to binary 'operator<<' 157 | else cout<"NO"<<endl; | ~~~~^~~~~~
s451947322
p03730
C++
#include <iostream> #include <string> using namespace std; int main () { int a,b,c,i; string ans = "NO"; cin >> a >> b >> c; for(i=1;i<b;i++){ if(i*a%b == c){ ans = "YES"; } } cout << ans << endl; return 0;
a.cc: In function 'int main()': a.cc:19:14: error: expected '}' at end of input 19 | return 0; | ^ a.cc:5:13: note: to match this '{' 5 | int main () { | ^
s896866653
p03730
C++
#include<iostream> using namespace std; int A[1000]; int main(){ int a,b,c; cin>>a>>b>>c; int baisu=a; while(!A[baisu]){ A[baisu]=1 baisu+=a; int amari=baisu%b; baisu=amari; if(amari==c){ cout<<"YES"<<endl; return 0; } } cout<<"NO"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:11:19: error: expected ';' before 'baisu' 11 | A[baisu]=1 | ^ | ; 12 | baisu+=a; | ~~~~~
s518150189
p03730
C++
#include <iostream> #include <vector> #include <queue> #include <sstream> #include <algorithm> #include <bitset> #include <limits> #include <map> #include <set> #include <iomanip> #include <cmath> using namespace std; typedef long long int ll; typedef std::numeric_limits<double> dbl; const long long int LL_INF=1LL<<60; vector<string> split(const string& input, char delimiter) { stringstream stream(input); string field; vector<string> result; while (getline(stream, field, delimiter)) { result.push_back(field); } return result; } //#define DEBUG ll A, B, M, N, D, K, Q, W, H, T, X, Y; int main() { cin >> A >> B >> C; for (int i = A; i <= B*A; ++i) { if (A % B == C) { cout << "YES" << endl; } } cout << "NO" << endl; return 0; }
a.cc: In function 'int main()': a.cc:37:22: error: 'C' was not declared in this scope 37 | cin >> A >> B >> C; | ^
s123993487
p03730
C++
#include <iostream> #include<sstream> #include<vector> #include<iterator> using namespace std; int main(void) { int A, B, C; cin >> A >> B >> C; vector<int> table; table.push_back(A%B); do { int a = table.back() + A; a %= B; table.push_back(a); }while(table.front() !=table.back()); string ret; if(find(table.begin(), table.end(), C) != table.end()) ret = "YES"; else ret = "NO"; cout << ret << endl; return 0; }
a.cc: In function 'int main()': a.cc:22:16: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)' 22 | if(find(table.begin(), table.end(), C) != table.end()) | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/bits/locale_facets.h:48, from /usr/include/c++/14/bits/basic_ios.h:37, from /usr/include/c++/14/ios:46, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)' 435 | find(istreambuf_iterator<_CharT> __first, | ^~~~ /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed: a.cc:22:16: note: '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>' 22 | if(find(table.begin(), table.end(), C) != table.end()) | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s431342348
p03730
C++
#include <iostream> using namespace std; typedef unsigned long long ll; #define rep(i,a,n) for(ll i = (a);i < (n);i++) #define lp(i,a,n) for(ll i = (a);i <= (n);i++) #define MAX 50000000000000ull int main(){ ll a,b,c; cin >> a >> b >> c; if(a == b && c != 0){ cout << "NO" << endl; return 0; }else if(a == i){ cout << c << endl; return 0; } rep(i,1,MAX){ if(a * i % b == c){ cout << "YES" << endl; return 0; } } cout << "NO" << endl; return 0; }
a.cc: In function 'int main()': a.cc:14:17: error: 'i' was not declared in this scope 14 | }else if(a == i){ | ^
s128254464
p03730
C++
#include<stdio.h> int main() { int a,b,c; scanf("%d %d %d",&a,&b,&c); int x; for(x=1;x<INT_MAX;x++) { if((b*x+c)%a==0) printf("YES"); else printf("NO"); } return 0; }
a.cc: In function 'int main()': a.cc:7:11: error: 'INT_MAX' was not declared in this scope 7 | for(x=1;x<INT_MAX;x++) | ^~~~~~~ a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 1 | #include<stdio.h> +++ |+#include <climits> 2 | int main()
s625337921
p03730
C++
#include <iostream> #include <vector> #include <algorithm> #include <set> #include <map> using namespace std; int main() { std::ios::sync_with_stdio(false); std::cin.tie(0); int A,B,C; cin >> A >> B >> C; for(int i = 1; i <= 10; i++){ if(A * i % B == C){ cout << "YES" << endl; return; } } cout << "NO" << endl; }
a.cc: In function 'int main()': a.cc:18:9: error: return-statement with no value, in function returning 'int' [-fpermissive] 18 | return; | ^~~~~~
s450723872
p03730
Java
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); for(int i = 1; i ++) { if(a % b ==c) { System.out.println("YES"); break; } else { a *= a * i; } } }
Main.java:11: error: ';' expected for(int i = 1; i ++) { ^ Main.java:19: error: reached end of file while parsing } ^ 2 errors
s842030256
p03730
Java
object Main { val s = new java.util.Scanner(System.in) def main(args: Array[String]) { val a, b, c = s.nextInt() for (i <- 1 to b) if (a * i % b == c) { println("YES") return } println("NO") } }
Main.java:1: error: class, interface, enum, or record expected object Main { ^ 1 error
s901101177
p03730
C++
#include <iostream> int main() { cin.tie(0); ios::sync_with_stdio(false); int A,B,C; std::cin >> A; std::cin >> B; std::cin >> C; for(int i=1; i<B; i++) { int modAB = (A*i) % B; bool result = modAB==C; if(result){ std::cout << "YES" << std::endl; return 0; } } std::cout << "NO" << std::endl; return 0; }
a.cc: In function 'int main()': a.cc:4:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 4 | cin.tie(0); | ^~~ | 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:5:9: error: 'ios' has not been declared 5 | ios::sync_with_stdio(false); | ^~~
s708262566
p03730
Java
public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); if((b-c) % a == 0) { System.out.println("YES"); } else { System.out.println("NO"); } } }
Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s054177979
p03730
Java
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); int a = scan.nextInt(); int b = scan.nextInt(); int c = scan.nextInt(); a = a % b; wihle(true){ if(c == 0){ System.out.println("NO"); break; } a = a - c; if(a == 0){ System.out.println("YES"); break; } else if(a < 0){ System.out.println("NO"); break; } } } }
Main.java:13: error: ';' expected wihle(true){ ^ 1 error
s656867000
p03730
C++
#include <iostream> #include <cmath> using namespace std; int main() { int A, B, C; cin >> A >> B >> C; int n = 0; bool found = false; int c_digits = 0; int tmp_c = C; while(tmp_c != 0){ tmp_c >>= 1; c_digits++; } while(n <= pow(10, c_digits) && !found){ if((n * A) % B == C){ found = true; } n++; } if(found) cout << "YES" << endl; else cout << "NO" << endl; return 0;
a.cc: In function 'int main()': a.cc:26:18: error: expected '}' at end of input 26 | return 0; | ^ a.cc:6:1: note: to match this '{' 6 | { | ^
s726622429
p03730
C++
#include<iostream> #include<string> using namespace std; int main(){ long long A,B,C,sum; int key=0; cin>>A>>B>>C; for(int i=1;i<=B;i++){ sum =A*i%B; if(sum==C)key=1 } if(key==1)cout<<"YES"<<endl; else cout<<"NO"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:11:20: error: expected ';' before '}' token 11 | if(sum==C)key=1 | ^ | ; 12 | } | ~
s845318081
p03730
C
#include<stdio.h> #include<string.h> char a[]="0123456789"; int main(){ int a,b,c; int x=0; int i; int c=0; scanf("%d%d%d",&a,&b,&c); for(i=0;i<1000;i++){ x+=i*a; if(x%b==c){ c++; } } if(c>0){ printf("YES\n"); }else{ printf("NO\n"); } return 0; }
main.c: In function 'main': main.c:9:5: error: redeclaration of 'c' with no linkage 9 | int c=0; | ^ main.c:6:9: note: previous declaration of 'c' with type 'int' 6 | int a,b,c; | ^
s096878697
p03730
C++
#include <iostream> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; int x = c % b; bool f = 0; for (int i = 1; i <= 100; i++) { if (i * a % b == x) { f = 1; break; } } if (f) cout << "YES" else cout << "NO"; return 0; }
a.cc: In function 'int main()': a.cc:17:14: error: expected ';' before 'else' 17 | cout << "YES" | ^ | ; 18 | else | ~~~~
s779686655
p03730
C++
//------------入力------------ int A = 0, B = 0, C = 0; cin >> A >> B >> C; //------------出力------------ int j = 0; for (int i = 1; i <= B; ++i) { if (i*A % B == C) { cout << "YES" << endl; j = 1; break; } } if (j == 0) cout << "NO" << endl;
a.cc:3:17: error: 'cin' does not name a type 3 | cin >> A >> B >> C; | ^~~ a.cc:7:17: error: expected unqualified-id before 'for' 7 | for (int i = 1; i <= B; ++i) { | ^~~ a.cc:7:33: error: 'i' does not name a type 7 | for (int i = 1; i <= B; ++i) { | ^ a.cc:7:41: error: expected unqualified-id before '++' token 7 | for (int i = 1; i <= B; ++i) { | ^~ a.cc:15:17: error: expected unqualified-id before 'if' 15 | if (j == 0) cout << "NO" << endl; | ^~
s998436398
p03730
C++
#include <iostream>   using namespace std;   int main() { //------------入力------------ int A = 0, B = 0, C = 0; cin >> A >> B >> C;   //------------出力------------ for (int i = 0;; ++i) { if ((i*A % 2 == 0 && (i*A / B) % 2 == 1 && B % 2 == 1 && C % 2 == 0) || (i*A % 2 == 0 && B % 2 == 0 && C % 2 == 1)) { cout << "NO" << endl; break; } else { cout << "YES" << endl; break; } } return 0; }
a.cc:2:1: error: extended character   is not valid in an identifier 2 |   | ^ a.cc:4:1: error: extended character   is not valid in an identifier 4 |   | ^ a.cc:9:1: error: extended character   is not valid in an identifier 9 |   | ^ a.cc:2:1: error: '\U000000a0' does not name a type 2 |   | ^ a.cc:4:1: error: '\U000000a0' does not name a type 4 |   | ^
s485175997
p03730
C++
#include <iostream>   using namespace std;   int main() { //------------入力------------ int A = 0, B = 0, C = 0; cin >> A >> B >> C;   //------------出力------------ for (int i = 1;; ++i) { if ((i*A % 2 == 0 && (i*A / B) % 2 == 1 && B % 2 == 1 && C % 2 == 0) || (i*A % 2 == 0 && B % 2 == 0 && C % 2 == 1)) { cout << "NO" << endl; break; } else { cout << "YES" << endl; break; } } int W;/*-----存在しないを書けない→分からない-----*/ cin >> W;   return 0; }
a.cc:2:1: error: extended character   is not valid in an identifier 2 |   | ^ a.cc:4:1: error: extended character   is not valid in an identifier 4 |   | ^ a.cc:9:1: error: extended character   is not valid in an identifier 9 |   | ^ a.cc:23:1: error: extended character   is not valid in an identifier 23 |   | ^ a.cc:2:1: error: '\U000000a0' does not name a type 2 |   | ^ a.cc:4:1: error: '\U000000a0' does not name a type 4 |   | ^
s200075758
p03730
C++
include <stdio.h> int main(void){ int a,b,c,n; scanf("%d %d %d",&a,&b,&c); while((a*n)%b!=c){ n++; if(n==9999999){ printf("NO\n"); } } printf("YES\n"); return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include <stdio.h> | ^~~~~~~
s991392625
p03730
C++
#include <bits/stdc++.h> using namespace std; int main() { int a,b,c; cin>>a>>b>>c; for(int i = 0 ; i < 100 ; i++) { if ((b*i + c)%a == 0)) { cout<<"YES"; return 0; } } cout<<"NO"; return 0; }
a.cc: In function 'int main()': a.cc:10:22: error: expected primary-expression before ')' token 10 | if ((b*i + c)%a == 0)) | ^
s226686461
p03730
C++
#include<cstdio> #include<vector> #include<iostream> using namespace std; int gcd(int a,int b){if(a<b){swap(a,b)};if(b==0){return a;}return gcd(a%b,b);} int main(void){ int a,b,c; cin>>a>>b>>c; if(c%gcd(a,b)==0){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;} return 0; }
a.cc: In function 'int gcd(int, int)': a.cc:5:39: error: expected ';' before '}' token 5 | int gcd(int a,int b){if(a<b){swap(a,b)};if(b==0){return a;}return gcd(a%b,b);} | ^ | ;
s613752763
p03730
C++
#include<cstdio> #include<vector> #include<iostream> using namespace std; int gcd(int a,int b){if(a<b){swap(a,b)};if(b==0){return a;}return gcd(a%b,b);} int main(void){ int a,b,c; cin>>a>>b>>c; if(c%gcd(a,b)==0){cout<<"YES"<endl;}else{cout<<"NO"<<endl;} return 0; }
a.cc: In function 'int gcd(int, int)': a.cc:5:39: error: expected ';' before '}' token 5 | int gcd(int a,int b){if(a<b){swap(a,b)};if(b==0){return a;}return gcd(a%b,b);} | ^ | ; a.cc: In function 'int main()': a.cc:9:38: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 9 | if(c%gcd(a,b)==0){cout<<"YES"<endl;}else{cout<<"NO"<<endl;} | ~~~~~~~~~~~^~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/vector:62, from a.cc:2: /usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed: a.cc:9:39: note: 'std::basic_ostream<char>' is not derived from 'const std::pair<_T1, _T2>' 9 | if(c%gcd(a,b)==0){cout<<"YES"<endl;}else{cout<<"NO"<<endl;} | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 448 | operator<(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed: a.cc:9:39: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 9 | if(c%gcd(a,b)==0){cout<<"YES"<endl;}else{cout<<"NO"<<endl;} | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 493 | operator<(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed: a.cc:9:39: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 9 | if(c%gcd(a,b)==0){cout<<"YES"<endl;}else{cout<<"NO"<<endl;} | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1694 | operator<(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed: a.cc:9:39: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>' 9 | if(c%gcd(a,b)==0){cout<<"YES"<endl;}else{cout<<"NO"<<endl;} | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1760 | operator<(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed: a.cc:9:39: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>' 9 | if(c%gcd(a,b)==0){cout<<"YES"<endl;}else{cout<<"NO"<<endl;} | ^~~~ In file included from /usr/include/c++/14/vector:66: /usr/include/c++/14/bits/stl_vector.h:2089:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator<(const vector<_Tp, _Alloc>&, const vector<_Tp, _Alloc>&)' 2089 | operator<(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:2089:5: note: template argument deduction/substitution failed: a.cc:9:39: note: 'std::basic_ostream<char>' is not derived from 'const std::vector<_Tp, _Alloc>' 9 | if(c%gcd(a,b)==0){cout<<"YES"<endl;}else{cout<<"NO"<<endl;} | ^~~~ In file included from /usr/include/c++/14/bits/memory_resource.h:47, from /usr/include/c++/14/vector:87: /usr/include/c++/14/tuple:2600:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator<(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)' 2600 | operator<(const tuple<_TElements...>& __t, | ^~~~~~~~ /usr/include/c++/14/tuple:2600:5: note: template argument deduction/substitution failed: a.cc:9:39: note: 'std::basic_ostream<char>' is not derived from 'const std::tuple<_UTypes ...>' 9 | if(c%gcd(a,b)==0){cout<<"YES"<endl;}else{cout<<"NO"<<endl;} | ^~~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:3: /usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 673 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed: a.cc:9:39: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 9 | if(c%gcd(a,b)==0){cout<<"YES"<endl;}else{cout<<"NO"<<endl;} | ^~~~ /usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 680 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed: a.cc:9:39: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 9 | if(c%gcd(a,b)==0){cout<<"YES"<endl;}else{cout<<"NO"<<endl;} | ^~~~ /usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed: a.cc:9:39: note: couldn't deduce template parameter '_CharT' 9 | if(c%gcd(a,b)==0){cout<<"YES"<endl;}else{cout<<"NO"<<endl;} | ^~~~ /usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed: a.cc:9:39: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 9 | if(c%gcd(a,b)==0){cout<<"YES"<endl;}else{cout<<"NO"<<endl;} | ^~~~ /usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3888 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3888:5: note: template argument deduction/substitution failed: a.cc:9:39: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 9 | if(c%gcd(a,b)==0){cout<<"YES"<endl;}else{cout<<"NO"<<endl;} | ^~~~ /usr/include/c++/14/bits/basic_string.h:3901:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3901 | operator<(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3901:5: note: template argument deduction/substitution failed: a.cc:9:39: note: mismatched types 'const _CharT*' and 'std::basic_ostream<char>' 9 | if(c%gcd(a,b)==0){cout<<"YES"<endl;}else{cout<<"NO"<<endl;} | ^~~~ In file included from /usr/include/c++/14/bits/ios_base.h:46: /usr/include/c++/14/system_error:324:3: note: candidate: 'bool std::operator<(const error_code&, const error_code&)' 324 | operator<(const error_code& __lhs, const error_code& __rhs) noexcept | ^~~~~~~~ /usr/include/c++/14/system_error:324:31: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'const std::error_code&' 324 | operator<(const error_code& __lhs, const error_code& __rhs) noexcept | ~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/14/system_error:507:3: note: candidate: 'bool std::operator<(const error_condition&, const error_condition&)' 507 | operator<(const error_condition& __lhs, | ^~~~~~~~ /usr/inclu
s537158405
p03730
C++
#include<cstdio> #include<vector> #include<iostream> using namespace std; int gcd(int a,int b){if(a<b){swap(a,b);if(b==0){return a;}return gcd(a%b,b);} int main(void){ int a,b,c; cin>>a>>b>>c; if(c%gcd(a,b)==0){cout<<"YES"<endl;}else{cout<<"NO"<<endl;} return 0; }
a.cc: In function 'int gcd(int, int)': a.cc:6:15: error: a function-definition is not allowed here before '{' token 6 | int main(void){ | ^ a.cc:11:2: error: expected '}' at end of input 11 | } | ^ a.cc:5:21: note: to match this '{' 5 | int gcd(int a,int b){if(a<b){swap(a,b);if(b==0){return a;}return gcd(a%b,b);} | ^ a.cc:11:2: warning: control reaches end of non-void function [-Wreturn-type] 11 | } | ^
s944546452
p03730
Java
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner scanner = new Scanner(System.in); int a=scanner.nextInt(); int b=scanner.nextInt(); int c=scanner.nextInt(); for(int i=1;i<=100;i++){ if((a*i)%b==c){ break; } } if((a*i)%b==c){ System.out.println("YES"); }else{ System.out.println("NO"); } } }
Main.java:13: error: cannot find symbol if((a*i)%b==c){ ^ symbol: variable i location: class Main 1 error
s262344216
p03730
Java
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner scanner = new Scanner(System.in); int a=scanner.nextInt(); int b=scanner.nextInt(); int c=scanner.nextInt(); for(i=1;i<=100;i++){ if((a*i)%b==c){ break; } } if(sum%b==c){ System.out.println("YES"); }else{ System.out.println("NO"); } } }
Main.java:8: error: cannot find symbol for(i=1;i<=100;i++){ ^ symbol: variable i location: class Main Main.java:8: error: cannot find symbol for(i=1;i<=100;i++){ ^ symbol: variable i location: class Main Main.java:8: error: cannot find symbol for(i=1;i<=100;i++){ ^ symbol: variable i location: class Main Main.java:9: error: cannot find symbol if((a*i)%b==c){ ^ symbol: variable i location: class Main Main.java:13: error: cannot find symbol if(sum%b==c){ ^ symbol: variable sum location: class Main 5 errors
s143644563
p03730
C++
A, B, C = gets.split.map(&:to_i) i = 1 h = {} flag = false while 1 y = A * i % B break if h.has_key?(y) h[y] = 1 if y == C flag = true break end i += 1 end puts flag ? "YES" : "NO"
a.cc:1:1: error: 'A' does not name a type 1 | A, B, C = gets.split.map(&:to_i) | ^ a.cc:5:1: error: 'flag' does not name a type 5 | flag = false | ^~~~
s160228010
p03730
C++
#include<iostream> using namespace std; int main(void) { int A; int B; int C; int i; cin >> A; cin >> B; cin >> C; for (i = 0; i <= B; i++) { if (i*A%B == C) { cout << "YES" << endl; } else { cout << "NO" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:26:10: error: expected '}' at end of input 26 | } | ^ a.cc:4:9: note: to match this '{' 4 | { | ^
s117634036
p03730
C++
#include<iostream> using namespace std; int main() { int A,B,C; cin >> A >> B >> C; for (int i = 0; i <= B; i++) { if ((A*i) % B == C) { cout << "YES" << endl; return 0; } } cout << "NO" << endl;
a.cc: In function 'int main()': a.cc:16:30: error: expected '}' at end of input 16 | cout << "NO" << endl; | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s271405741
p03730
C++
int main() { int a, b, c; cin >> a >> b >> c; for (int i = 1; i <= b; i++) { if ((i*a)%b==c) { cout << "YES"; } } cout << "NO"; return 0; }
a.cc: In function 'int main()': a.cc:4:9: error: 'cin' was not declared in this scope 4 | cin >> a >> b >> c; | ^~~ a.cc:9:25: error: 'cout' was not declared in this scope 9 | cout << "YES"; | ^~~~ a.cc:12:9: error: 'cout' was not declared in this scope 12 | cout << "NO"; | ^~~~
s333525539
p03730
C++
#include<bits/stdc++.h> using namespace std; #define int long long signed main(){ int a,b,c; cin>>a>>b>>c; bool f=0; for(int i=1;i<1000;i++) f|=((a*i)%b==c) cout<<(f?"YES":"NO")<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:20: error: expected ';' before 'cout' 9 | f|=((a*i)%b==c) | ^ | ; 10 | cout<<(f?"YES":"NO")<<endl; | ~~~~
s649268506
p03730
C++
#include <iostream> #include <algorithm> using namespace std; int n,A,B,C,a; int main() { cin>>A>>B>>C; int a%A==0; if (a%B==C)cout<<"YES"<<endl; else cout<<"NO"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:14: error: expected initializer before '%' token 9 | int a%A==0; | ^
s007008838
p03731
Java
import java.util.*; import java.io.*; public class A{ public static void main(String[] args) throws IOException,NumberFormatException{ try { FastScanner sc=new FastScanner(); int n=sc.nextInt(),t=sc.nextInt(); int a[]=sc.readArray(n); PrintWriter out=new PrintWriter(System.out); long total=0; for(int i=0;i<n;i++) { if(a[i]<=t) { total=(a[i]+t); } else { total+=t; } } out.println(total); out.close(); } catch(Exception e) { return ; } } static final Random random=new Random(); static void ruffleSort(int[] a) { int n=a.length; for(int i=0;i<n;i++) { int oi=random.nextInt(n),temp=a[oi]; a[oi]=a[i]; a[i]=temp; } Arrays.sort(a); } public static class FastScanner { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st=new StringTokenizer(""); String next() { while (!st.hasMoreTokens()) try { st=new StringTokenizer(br.readLine()); } catch (IOException e) {} return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } int[] readArray(int n) { int[] a=new int[n]; for (int i=0; i<n; i++) a[i]=nextInt(); return a; } long[] readLongArray(int n) { long[] a=new long[n]; for(int i=0; i<n ; i++) a[i]=nextLong(); return a; } String nextLine() { String str = ""; try { str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } } }
Main.java:4: error: class A is public, should be declared in a file named A.java public class A{ ^ 1 error
s214764386
p03731
C++
#include <bits/stdc++.h> #define rep(i, n) for(int i = 0; i < n; i++) using ll = long long; using ld = long double; using namespace std; int main() {  int N, T, X = 4; cin >> N >> T; vector<int>t(N), u(N - 1); rep(i, N) {cin >> t.at(i);} rep(i, N - 1) {u.at(i) = t.at(i + 1) - t.at(i);} rep(i, N - 1) { if (u.at(i) < T) {X += u.at(i);} else {X += T;} } cout << X << endl; }
a.cc:7:1: error: extended character   is not valid in an identifier 7 |  int N, T, X = 4; | ^ a.cc: In function 'int main()': a.cc:7:1: error: '\U00003000int' was not declared in this scope 7 |  int N, T, X = 4; | ^~~~~ a.cc:8:10: error: 'N' was not declared in this scope 8 | cin >> N >> T; | ^ a.cc:8:15: error: 'T' was not declared in this scope 8 | cin >> N >> T; | ^ a.cc:13:23: error: 'X' was not declared in this scope 13 | if (u.at(i) < T) {X += u.at(i);} | ^ a.cc:14:11: error: 'X' was not declared in this scope 14 | else {X += T;} | ^ a.cc:16:11: error: 'X' was not declared in this scope 16 | cout << X << endl; | ^
s262007501
p03731
C++
#include<bits/stdc++.h> using namespace std; #define debug(n) cerr << #n << ':' << n << endl; #define dline cerr << __LINE__ << endl; using ll = long long; using ull = unsigned long long; template<class T, class U> using P = pair<T,U>; template<class T> using Heap = priority_queue<T>; template<class T> using heaP = priority_queue<T,vector<T>,greater<T>>; template<class T,class U> using umap = unordered_map<T,U>; template<class T> using uset = unordered_set<T>; template<class T> bool ChangeMax(T&a,const T&b){ if(a >= b) return false; a = b; return true; } template<class T> bool ChangeMin(T&a,const T&b){ if(a <= b) return false; a = b; return true; } template<class T, size_t N, class U> void Fill(T (&a)[N], const U&v){ fill((U*)a,(U*)(a+N),v); } template<class T> istream& operator >> (istream&is, vector<T>&v){ for(auto&e:v)is >> e; return is; } int main(){ int n,t; cin >> n >> t; vector<int> st,en; int nen = -1; for(int i = 0; i < n; ++i){ int x; cin >> x; if(x <= nen){ nen = x + t; } else { if(nen != -1)en.push_back(nen); st.push_back(x); nen = x + t; } } int ans = 0; for(int i = 0; i < (int)st.size(); ++i){ ans += en[i] - st[i]; } cout << asn << endl; }
a.cc: In function 'int main()': a.cc:57:11: error: 'asn' was not declared in this scope; did you mean 'ans'? 57 | cout << asn << endl; | ^~~ | ans
s743345134
p03731
C++
#include<bits/stdc++.h> using namespace std; int main(void){ int n,t,vec[200000],sum; cin>>n>>t; for(int i=0;i<n;i++){ cin>>vec[i]; } for(int i=0;i<n-1;i++){ sum+=min(t,a[i+1]-a[i]); } cout<<sum+t<<endl; return 0; }
a.cc: In function 'int main()': a.cc:10:16: error: 'a' was not declared in this scope 10 | sum+=min(t,a[i+1]-a[i]); | ^
s208583129
p03731
C++
#include<bits/tdc++.h> using namespace std; int main(void){ int n,t,vec[200000],sum; cin>>n>>t; for(int i=0;i<n;i++){ cin>>vec[i]; } for(int i=0;i<n-1;i++){ sum+=min(t,a[i+1]-a[i]); } cout<<sum+t<<endl; return 0; }
a.cc:1:9: fatal error: bits/tdc++.h: No such file or directory 1 | #include<bits/tdc++.h> | ^~~~~~~~~~~~~~ compilation terminated.
s843726329
p03731
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ll n, t; cin >> n >> t; ll a[n]; for(int i=0; i<n; i++){ cin >> a[i]; } ll ans = t; for(int i=1; i<n; i++){ ans += min(t, a[i]-a[i-1]; } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:15:30: error: expected ')' before ';' token 15 | ans += min(t, a[i]-a[i-1]; | ~ ^ | )
s086276720
p03731
C++
#include "pch.h" #include <bits/stdc++.h> using namespace std; int main() { long long n, tt; cin >> n >> tt; long long ans = 0; long long t,tim; cin >> t; ans = tt; tim = tt; for (long long i = 2; i <= n; i++) { cin >> t; if (tim > t) { ans += tt - (tim - t); tim = t + tt; } else { ans += tt; tim = t + tt; } } cout << ans << endl; }
a.cc:1:10: fatal error: pch.h: No such file or directory 1 | #include "pch.h" | ^~~~~~~ compilation terminated.
s034557456
p03731
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; int main() { ll n,t,a[200005],sum=0;z cin>>n>>t; for(ll i=0;i<n;i++) { cin>>a[i]; if(i) { if(a[i-1]+t<a[i])sum+=t; else sum+=a[i]-a[i-1]; } } cout<<sum+t<<endl; return 0; }
a.cc: In function 'int main()': a.cc:10:32: error: 'z' was not declared in this scope 10 | ll n,t,a[200005],sum=0;z | ^
s428634254
p03731
C++
#include <iostream> #include <string> #include <algorithm> #include <vector> #include <cmath> #include <map> #include <iomanip> typedef long long ll; #define rep(i,a,b) for(int i=a;i<b;++i) #define rrep(i,a,b) for(int i=a;i>=b;--i) using namespace std; using vi = vector<int>; using vll = vector<ll>; ll mod = 1e9 + 7; using namespace std; using Graph = vector<vector<int>>; Graph G; int cnt_digit(ll N) { int digit = 0; while (N > 0) { N /= 10; digit++; } return digit; } int n; vll a; ll solve(bool isp) { ll sum = 0ll; ll ret = 0ll; for (int i = 0; i < n; i++) { sum += a[i]; if (isp and sum <= 0) { ret += -sum + 1; sum = 1ll; } if (not isp and sum >= 0) { ret += sum + 1; sum = -1ll; } isp ^= 1; } return ret; }
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s629645487
p03731
C++
#include<bits/stdc++.h> #define rep(i,n)for(int i=0;i<n;++i) #include<string> #include<vector> using namespace std; typedef long long ll; typedef pair<int, int>P; 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; } //max=({}); //条件式が真ならwhileの中身を回し続ける //printf("%d\n", ans); //pairの入力 //vector<pair<ll, ll>>work(n); //rep(i, n) { // ll a, b; // cin >> a >> b; // work[i] = make_pair(a, b); //for(auto p:mp)(mapの探索) //printf("%.10f\n",なんちゃら) int g[15][15]; const int INF = 1001001001; const int dx[4] = { -1,0,1,0 }; const int dy[4] = { 0,-1,0,1 }; //最大公約数 ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; } ll lcm(ll x, ll y) { if (x == 0 || y == 0)return 0; return (x / gcd(x, y) * y); } //素因数分解 vector<pair<ll, int>>factorize(ll n) { vector<pair<ll, int>>res; for (ll i = 2;i * i <= n;++i) { if (n % i)continue; res.emplace_back(i, 0); while (n % i == 0) { n /= i; res.back().second++; } } if (n != 1)res.emplace_back(n, 1); return res; } int bingo[3][3]; bool flag[3][3]; int cnt[2][105]; int h, w; int choco[1010][1010]; int s[11][11]; int main() { ll n, T; cin >> n >> T; vector<ll>t(n); ll ans = T; rep(i, n) { cin >> t[i]; } for (int i = 1;i < n;++i) { ans += T - max(0, t[i - 1] + T - t[i]); } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:69:31: error: no matching function for call to 'max(int, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type)' 69 | ans += T - max(0, t[i - 1] + T - t[i]); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~ 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:69:31: note: deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'}) 69 | ans += T - max(0, t[i - 1] + T - t[i]); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~ /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:69:31: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 69 | ans += T - max(0, t[i - 1] + T - t[i]); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~
s358518232
p03731
C++
n, T = map(int, input().split()) t = list(map(int, input().split())) ans = 0 for i in range(1, n): ans += min(t[i]-t[i-1], T) print(ans+T)
a.cc:1:1: error: 'n' does not name a type 1 | n, T = map(int, input().split()) | ^
s800510343
p03731
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <utility> #include <cmath> #include <cstdlib> #include <climits> using namespace std; int main(){ long int n , t; long int total = 0; cin >> n >> t; for(int i = 1; i <= n; ++i){ int s; cin >> s; total += s - r < t ? s - r : t; int r = s; } cout << total + t << endl; return 0; }
a.cc: In function 'int main()': a.cc:21:18: error: 'r' was not declared in this scope 21 | total += s - r < t ? s - r : t; | ^
s216480695
p03731
C
#include <stdio.h> int main (){ int i,a[200002],t,n; scanf ("%d%d",&n,&t); for (i=0;i<n;i++){ scanf ("%d",&a[i]); } for (i=0;i<n-1;i++){ if (a[i+1]-a[i]>t){ sum=sum+t; } else{ sum=sum+a[i+1]-a[i]; } } printf ("%d",sum+a[n-1]); return 0; }
main.c: In function 'main': main.c:10:3: error: 'sum' undeclared (first use in this function) 10 | sum=sum+t; | ^~~ main.c:10:3: note: each undeclared identifier is reported only once for each function it appears in
s138636917
p03731
C
#include <stdio.h> int main (){ int i,a[200002],t,n; scanf ("%d%d",&n,&t); for (i=0;i<n;i++){ scanf ("%d",&a[i]); } a[n+1]=110000000; for (i=0;i<n-1;i++){ if (a[i+1]-a[i]>t){ sum=sum+t; } else{ sum=sum+a[i+1]-a[i]; } } printf ("%d",sum); return 0; }
main.c: In function 'main': main.c:11:3: error: 'sum' undeclared (first use in this function) 11 | sum=sum+t; | ^~~ main.c:11:3: note: each undeclared identifier is reported only once for each function it appears in
s732727979
p03731
C
#include<stdio.h> int main (){ int i,a[200002],t,n; scanf ("%d%d",&n,&t); for (i=0;i<n;i++){ scanf ("%d",&a[i]); } a[n+1]=110000000; for (i=0;i<n-1;i++){ if (a[i+1]-a[i]>t){ sum=sum+t; } else{ sum=sum+a[i+1]-a[i]; } } return 0; }
main.c: In function 'main': main.c:11:3: error: 'sum' undeclared (first use in this function) 11 | sum=sum+t; | ^~~ main.c:11:3: note: each undeclared identifier is reported only once for each function it appears in
s146008844
p03731
C++
n, t = gets.split.map(&:to_i) a = gets.split.map(&:to_i) ans, tmp= 0, 0 a.each do |i| ans += [t, i+t-tmp].min tmp = i + t end p ans
a.cc:1:1: error: 'n' does not name a type 1 | n, t = gets.split.map(&:to_i) | ^
s322672786
p03731
C++
#include <iostream> #include <iomanip> #include <vector> #include <cmath> #include <algorithm> #include <iomanip> #include <cstring> #define rep(i, N) for (int i = 0; i < (int)N; i++) using namespace std; typedef long long ll; const ll LLINF = 9223372036854775807; const int MOD = 1000000007; int main() { int N, T; cin >> N >> T; ll t[N]; rep(i, N) cin >> t[i]; ll result = T; for(int i=N-2; i>=0; i++) result += min(t[i+1]-t[i], T); cout << result << endl; return 0; }
a.cc: In function 'int main()': a.cc:19:42: error: no matching function for call to 'min(ll, int&)' 19 | for(int i=N-2; i>=0; i++) result += min(t[i+1]-t[i], T); | ~~~^~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:19:42: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 19 | for(int i=N-2; i>=0; i++) result += min(t[i+1]-t[i], T); | ~~~^~~~~~~~~~~~~~~~ /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, from a.cc:5: /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:19:42: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 19 | for(int i=N-2; i>=0; i++) result += min(t[i+1]-t[i], T); | ~~~^~~~~~~~~~~~~~~~
s011738754
p03731
C++
#include <iostream> #include <iomanip> #include <vector> #include <cmath> #include <algorithm> #include <iomanip> #include <cstring> #define rep(i, N) for (int i = 0; i < (int)N; i++) using namespace std; typedef long long ll; const ll LLINF = 9223372036854775807; const int MOD = 1000000007; int main() { int N, T; cin >> N >> T; ll t[N]; rep(i, N) cin >> t[i]; ll result = T; for(int i=N-2; i>=0; i++) result += min(t[i+1]-t[i], T) cout << result << endl; return 0; }
a.cc: In function 'int main()': a.cc:19:42: error: no matching function for call to 'min(ll, int&)' 19 | for(int i=N-2; i>=0; i++) result += min(t[i+1]-t[i], T) | ~~~^~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:19:42: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 19 | for(int i=N-2; i>=0; i++) result += min(t[i+1]-t[i], T) | ~~~^~~~~~~~~~~~~~~~ /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, from a.cc:5: /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:19:42: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 19 | for(int i=N-2; i>=0; i++) result += min(t[i+1]-t[i], T) | ~~~^~~~~~~~~~~~~~~~
s640723429
p03731
C++
def main(): n,t=map(int,input().split(' ')) human = list(map(int,input().split(' '))) ans = t for i in range(n-1): if human[i+1]-human[i] >= t: ans += t else: ans += human[i+1] - human[i] print(ans) if __name__ == '__main__': main()
a.cc:11:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes 11 | if __name__ == '__main__': | ^~~~~~~~~~ a.cc:1:1: error: 'def' does not name a type 1 | def main(): | ^~~
s095387856
p03731
C++
#include <iostream> #include <vector> using namespace std; int main(){ int N; cin >> N; long long int T; cin >> T; vector <long long int> A(N); for(int i = 0; i < N; i++){ cin >> A[i]; } long long int maxT = A[N-1] + T; //maxTから空白期間を引いていく。 for(int i = 0; i < N; i++){ maxT -= min(A[i] - T,0); } cout << maxT; }
a.cc: In function 'int main()': a.cc:20:14: error: no matching function for call to 'min(__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type, int)' 20 | maxT -= min(A[i] - T,0); | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:20:14: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 20 | maxT -= min(A[i] - T,0); | ~~~^~~~~~~~~~~~ /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
s935800112
p03731
C++
int main() { int N = 0; int T = 0; long long SUM = 0; cin >> N >> T; int previous = 0; int now = 0; int load = T; for (int i = 0; i < N; i++) { cin >> now; if (load - now < 0) { SUM += T; load = now + T; } else { SUM += now - previous; } previous = now; } SUM += T; cout << SUM << endl; }
a.cc: In function 'int main()': a.cc:5:9: error: 'cin' was not declared in this scope 5 | cin >> N >> T; | ^~~ a.cc:21:9: error: 'cout' was not declared in this scope 21 | cout << SUM << endl; | ^~~~ a.cc:21:24: error: 'endl' was not declared in this scope 21 | cout << SUM << endl; | ^~~~
s174561260
p03731
C
#inculde <stdio.h> int main(){ int n,t,i,ans=0,time=0; scanf("%d %d",&n,&t); int str[n]; scanf("%d",str[0]); time=str[0]; for(i=1;i<n-1;i++){ scanf("%d",&str[i]); if(time + t >str[i] ){ ans=ans+(time + t - str[i]); time=str[i]; }else{ time=str[i]; ans+=t; } ans+=t; printf("%d\n",ans); } return 0; }
main.c:1:2: error: invalid preprocessing directive #inculde; did you mean #include? 1 | #inculde <stdio.h> | ^~~~~~~ | include main.c: In function 'main': main.c:4:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 4 | scanf("%d %d",&n,&t); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | #inculde <stdio.h> main.c:4:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 4 | scanf("%d %d",&n,&t); | ^~~~~ main.c:4:3: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:18:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 18 | printf("%d\n",ans); | ^~~~~~ main.c:18:5: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:18:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:18:5: note: include '<stdio.h>' or provide a declaration of 'printf'
s772451888
p03731
C++
#include <iostream> using namespace std; using i64 = long long; int main() { i64 n, k; cin >> n >> k; i64 ans = 0; i64 bfr; cin >> bfr; for(int i = 1;i < N;i++) { i64 a; cin >> a; ans += min(a - bfr, k); bfr = a; } cout << ans + k << endl; }
a.cc: In function 'int main()': a.cc:10:21: error: 'N' was not declared in this scope 10 | for(int i = 1;i < N;i++) { | ^
s963379545
p03731
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N, T; cin >> N >> T ; vector<int> t(N); for(int i=0; i<N; i++){ cin >> t.at(i); } int ans=T; for(int i=0; i<N-1; i++) if(t.at(i+1)-t.at(i)>T) ans+=T; else ans+=t.at(i+1)-t.at(i); } cout << ans << endl; }
a.cc:17:3: error: 'cout' does not name a type 17 | cout << ans << endl; | ^~~~ a.cc:18:1: error: expected declaration before '}' token 18 | } | ^
s428879427
p03731
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; long long T,t[n],ans=T; cin>>T; t[0]=0; for(int i=1;i<n;i++){ cin>>t[i]; ans+=min(T,t[i]-t[i-1]); cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:12:2: error: expected '}' at end of input 12 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s421754973
p03731
C++
#include<bits/stdc++.h> #define all(x) (x).begin(),(x).end() typedef long long ll; #define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i) #define REP(i,num,n) for(ll i=num, i##_len=(n); i<i##_len; ++i) #define repprev(i,a,b) for(ll i=b-1;i>=a;i--) #define reprev(i,n) repprev(i,0,n) using namespace std; #define sz(x) ((int)(x).size()) #define ZERO(a) memset(a,0,sizeof(a)) #define MINUS(a) memset(a,0xff,sizeof(a)) #define MEMSET(v, h) memset((v), h, sizeof(v)) template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; } template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; } template<class T> int former(const vector<T> &v, T x){ return upper_bound(v.begin(),v.end(),x) - v.begin() - 1; } template<class T> int latter(const vector<T> &v, T x){ return lower_bound(v.begin(),v.end(),x) - v.begin(); } #define pb push_back #define mp make_pair #define y0 y3487465 #define y1 y8687969 #define j0 j1347829 #define j1 j234892 #define BIT_FLAG_0 (1<<0) // 0000 0000 0000 0001 #define BIT_FLAG_1 (1<<1) // 0000 0000 0000 0010 #define BIT_FLAG_2 (1<<2) // 0000 0000 0000 0100 #define BIT_FLAG_3 (1<<3) // 0000 0000 0000 1000 #define BIT_FLAG_4 (1<<4) // 0000 0000 0001 0000 #define BIT_FLAG_5 (1<<5) // 0000 0000 0010 0000 #define BIT_FLAG_6 (1<<6) // 0000 0000 0100 0000 #define BIT_FLAG_7 (1<<7) // 0000 0000 1000 0000 ll gcd(ll a,ll b){return b?gcd(b,a%b):a;} const ll LLINF = 1LL<<60; const int INTINF = 1<<30; const int MAX = 510000; const int MOD = 1000000007; long long fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++){ fac[i] = fac[i - 1] * i % MOD; inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD; finv[i] = finv[i - 1] * inv[i] % MOD; } } // 二項係数計算 long long COM(int n, int k){ if (n < k) return 0; if (n < 0 || k < 0) return 0; return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD; } struct UnionFind { vector<ll> par; // par[i]:iの親の番号 (例) par[3] = 2 : 3の親が2 UnionFind(ll n) : par(n, -1) { } void init(ll n) { par.assign(n, -1); } ll root(ll x) { if (par[x] < 0) return x; else return par[x] = root(par[x]); } bool issame(ll x, ll y) { return root(x) == root(y); } bool merge(ll x, ll y) { x = root(x); y = root(y); if (x == y) return false; if (par[x] > par[y]) swap(x, y); // merge technique par[x] += par[y]; par[y] = x; return true; } ll size(ll x) { return -par[root(x)]; } }; template <typename T> vector<T> dijkstra(int s,vector<vector<pair<int, T> > > & G){ const T INF = numeric_limits<T>::max(); using P = pair<T, int>; int n=G.size(); vector<T> d(n,INF); vector<int> b(n,-1); priority_queue<P,vector<P>,greater<P> > q; d[s]=0; q.emplace(d[s],s); while(!q.empty()){ P p=q.top();q.pop(); int v=p.second; if(d[v]<p.first) continue; for(auto& e:G[v]){ int u=e.first; T c=e.second; if(d[u]>d[v]+c){ d[u]=d[v]+c; b[u]=v; q.emplace(d[u],u); } } } return d; } vector<vector<int> > bfs(vector<string> &s,int sy,int sx,char wall,int dir){ int h=s.size(),w=s.front().size(); vector<vector<int> > dp(h,vector<int>(w,-1)); using P = pair<int, int>; queue<P> q; dp[sy][sx]=0; q.emplace(sy,sx); int dy[]={1,-1,0,0,1,1,-1,-1}; int dx[]={0,0,1,-1,1,-1,1,-1}; auto in=[&](int y,int x){return 0<=y&&y<h&&0<=x&&x<w;}; while(!q.empty()){ int y,x; tie(y,x)=q.front();q.pop(); for(int k=0;k<dir;k++){ int ny=y+dy[k],nx=x+dx[k]; if(!in(ny,nx)||s[ny][nx]==wall) continue; if(~dp[ny][nx]) continue; dp[ny][nx]=dp[y][x]+1; q.emplace(ny,nx); } } return dp; } int64_t power(int64_t x, int64_t n, int64_t mod) { int64_t ret = 1; while(n > 0) { if(n & 1) (ret *= x) %= mod; (x *= x) %= mod; n >>= 1; } return ret; } vector<int> sieve_of_eratosthenes(int n) { vector<int> primes(n); for (int i = 2; i < n; ++i) primes[i] = i; for (int i = 2; i*i < n; ++i) if (primes[i]) for (int j = i*i; j < n; j+=i) primes[j] = 0; return primes; } std::vector<ll> divisor(ll n)//nの約数を列挙 { std::vector<ll> ret; for(ll i=1 ; i*i<=n ; ++i) { if(n%i == 0) { ret.push_back(i); if(i!=1 && i*i!=n) { ret.push_back(n/i); } } } return ret; } const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}; const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1}; int N, T, t[201010]; int main() { cin >> N >> T; rep(i, 0, N) scanf("%d", &t[i]); ll ans = 0; REP(i, 1, N) ans += min(T, t[i] - t[i - 1]); ans += T; cout << ans << endl; }
a.cc:192:16: error: macro "rep" passed 3 arguments, but takes just 2 192 | rep(i, 0, N) scanf("%d", &t[i]); | ^ a.cc:4:9: note: macro "rep" defined here 4 | #define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i) | ^~~ a.cc: In function 'int main()': a.cc:192:5: error: 'rep' was not declared in this scope 192 | rep(i, 0, N) scanf("%d", &t[i]); | ^~~
s863125029
p03731
C++
int main(){ int N,T; cin>>N>>T; int t=0,a=0; ll ans=0; cin>>t; for(int i=1;i<N;i++){ if(t-a>T){ ans+=T; }else{ ans+=t-a; } a=t; } cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:3:3: error: 'cin' was not declared in this scope 3 | cin>>N>>T; | ^~~ a.cc:5:3: error: 'll' was not declared in this scope 5 | ll ans=0; | ^~ a.cc:9:7: error: 'ans' was not declared in this scope 9 | ans+=T; | ^~~ a.cc:11:7: error: 'ans' was not declared in this scope 11 | ans+=t-a; | ^~~ a.cc:15:3: error: 'cout' was not declared in this scope 15 | cout<<ans<<endl; | ^~~~ a.cc:15:9: error: 'ans' was not declared in this scope 15 | cout<<ans<<endl; | ^~~ a.cc:15:14: error: 'endl' was not declared in this scope 15 | cout<<ans<<endl; | ^~~~
s938691555
p03731
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N,T; int t[N]; cin >> N >> T; for(int i=0; i<N; i++){ cin >> t[i]; } long long ans = 0; for(int i=0; i<N-1; i++){ if(t[i+1] - t[i] < T){ ans += (long long)([i+1] - t[i]); }else{ ans += T; } } cout << ans + T << endl; return 0; }
a.cc: In function 'int main()': a.cc:13:28: error: expected ',' before '+' token 13 | ans += (long long)([i+1] - t[i]); | ^ | , a.cc:13:28: error: expected identifier before '+' token a.cc: In lambda function: a.cc:13:32: error: expected '{' before '-' token 13 | ans += (long long)([i+1] - t[i]); | ^ a.cc: In function 'int main()': a.cc:13:32: error: no match for 'operator-' (operand types are 'main()::<lambda()>' and 'int') 13 | ans += (long long)([i+1] - t[i]); | ~~~~~ ^ ~~~~ | | | | | int | main()::<lambda()> In file included from /usr/include/c++/14/bits/stl_algobase.h:67, 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_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 618 | operator-(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:618:5: note: template argument deduction/substitution failed: a.cc:13:37: note: 'main()::<lambda()>' is not derived from 'const std::reverse_iterator<_Iterator>' 13 | ans += (long long)([i+1] - t[i]); | ^ /usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1790 | operator-(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1790:5: note: template argument deduction/substitution failed: a.cc:13:37: note: 'main()::<lambda()>' is not derived from 'const std::move_iterator<_IteratorL>' 13 | ans += (long long)([i+1] - t[i]); | ^ In file included from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/complex:370:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const complex<_Tp>&, const complex<_Tp>&)' 370 | operator-(const complex<_Tp>& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:370:5: note: template argument deduction/substitution failed: a.cc:13:37: note: 'main()::<lambda()>' is not derived from 'const std::complex<_Tp>' 13 | ans += (long long)([i+1] - t[i]); | ^ /usr/include/c++/14/complex:379:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const complex<_Tp>&, const _Tp&)' 379 | operator-(const complex<_Tp>& __x, const _Tp& __y) | ^~~~~~~~ /usr/include/c++/14/complex:379:5: note: template argument deduction/substitution failed: a.cc:13:37: note: 'main()::<lambda()>' is not derived from 'const std::complex<_Tp>' 13 | ans += (long long)([i+1] - t[i]); | ^ /usr/include/c++/14/complex:388:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const _Tp&, const complex<_Tp>&)' 388 | operator-(const _Tp& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:388:5: note: template argument deduction/substitution failed: a.cc:13:37: note: mismatched types 'const std::complex<_Tp>' and 'int' 13 | ans += (long long)([i+1] - t[i]); | ^ /usr/include/c++/14/complex:465:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const complex<_Tp>&)' 465 | operator-(const complex<_Tp>& __x) | ^~~~~~~~ /usr/include/c++/14/complex:465:5: note: candidate expects 1 argument, 2 provided In file included from /usr/include/c++/14/valarray:605, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166: /usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)' 406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed: a.cc:13:37: note: 'main()::<lambda()>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 13 | ans += (long long)([i+1] - t[i]); | ^ /usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)' 406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed: a.cc:13:37: note: 'main()::<lambda()>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 13 | ans += (long long)([i+1] - t[i]); | ^ /usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed: a.cc:13:37: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 13 | ans += (long long)([i+1] - t[i]); | ^ /usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)' 406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed: a.cc:13:37: note: 'main()::<lambda()>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 13 | ans += (long long)([i+1] - t[i]); | ^ /usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed: a.cc:13:37: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 13 | ans += (long long)([i+1] - t[i]); | ^ /usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const valarray<_Tp>&, const valarray<_Tp>&)' 1197 | _DEFINE_BINARY_OPERATOR(-, __minus) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed: a.cc:13:37: note: 'main()::<lambda()>' is not derived from 'const std::valarray<_Tp>' 13 | ans += (long long)([i+1] - t[i]); | ^ /usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)' 1197 | _DEFINE_BINARY_OPERATOR(-, __minus) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed: a.cc:13:37: note: 'main()::<lambda()>' is not derived from 'const std::valarray<_Tp>' 13 | ans += (long long)([i+1] - t[i]); | ^ /usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)' 1197 | _DEFINE_BINARY_OPERATOR(-, __minus) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed: a.cc:13:37: note: mismatched types 'const std::valarray<_Tp>' and 'int' 13 | ans += (long long)([i+1] - t[i]); | ^
s469416719
p03731
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N,T; int t[N]; cin >> N >> T; for(int i=0; i<N; i++){ cin >> t[i]; } long long ans = LL0; for(int i=0; i<N-1; i++){ if(t[i+1] - t[i] < T){ ans += t[i+1] - t[i]; }else{ ans += T; } } cout << ans + T << endl; return 0; }
a.cc: In function 'int main()': a.cc:10:19: error: 'LL0' was not declared in this scope 10 | long long ans = LL0; | ^~~
s397522930
p03731
C++
#include <iostream> #include <map> #include <vector> #include <algorithm> int main(){ int n, shower; std::cin >> n >> shower; int ans = 0; std::vector<int> t(n); std::cin >> t.at(0); for(int i = 1; i < n; ++i){ std::cin >> t.at(i); if(t.at(i) - t.at(i - 1) < shower){ ans += t.at(i) - t.at(i - 1) < shower; }else{ ans += t; } } std::cout << ans << std::endl; return 0; }
a.cc: In function 'int main()': a.cc:18:17: error: no match for 'operator+=' (operand types are 'int' and 'std::vector<int>') 18 | ans += t; | ~~~~^~~~